mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Vigorous bash
This commit is contained in:
parent
89048e9530
commit
909363d33c
@ -198,7 +198,7 @@
|
||||
abilities: [
|
||||
Simple(Hammer(ScornfulSwipe), "common.abilities.hammer.scornful_swipe"),
|
||||
Simple(Hammer(Tremor), "common.abilities.hammer.tremor"),
|
||||
// Simple(Hammer(VigorousBash), "common.abilities.hammer.vigorous_bash"),
|
||||
Simple(Hammer(VigorousBash), "common.abilities.hammer.vigorous_bash"),
|
||||
// Simple(Hammer(Retaliate), "common.abilities.hammer.retaliate"),
|
||||
// Simple(Hammer(SpineCracker), "common.abilities.hammer.spine_cracker"),
|
||||
// Simple(Hammer(Breach), "common.abilities.hammer.breach"),
|
||||
|
@ -22,5 +22,5 @@ ChargedMelee(
|
||||
swing_duration: 0.1,
|
||||
hit_timing: 0.2,
|
||||
recover_duration: 0.2,
|
||||
additional_combo: 4,
|
||||
custom_combo: Some((additional: 4)),
|
||||
)
|
||||
|
@ -20,7 +20,7 @@ ComboMelee2(
|
||||
swing: Some(Forward(0.7)),
|
||||
),
|
||||
ori_modifier: 0.6,
|
||||
additional_combo: 4,
|
||||
custom_combo: Some((additional: 4)),
|
||||
),
|
||||
],
|
||||
energy_cost_per_strike: 10,
|
||||
|
@ -16,7 +16,7 @@ ComboMelee2(
|
||||
hit_timing: 0.5,
|
||||
recover_duration: 0.3,
|
||||
ori_modifier: 0.6,
|
||||
additional_combo: 4,
|
||||
custom_combo: Some((additional: 4)),
|
||||
),
|
||||
],
|
||||
energy_cost_per_strike: 10,
|
||||
|
@ -1,5 +1,5 @@
|
||||
Shockwave(
|
||||
energy_cost: 0,
|
||||
energy_cost: 20,
|
||||
buildup_duration: 0.4,
|
||||
swing_duration: 0.3,
|
||||
recover_duration: 0.3,
|
||||
|
27
assets/common/abilities/hammer/vigorous_bash.ron
Normal file
27
assets/common/abilities/hammer/vigorous_bash.ron
Normal file
@ -0,0 +1,27 @@
|
||||
ComboMelee2(
|
||||
strikes: [
|
||||
(
|
||||
melee_constructor: (
|
||||
kind: Bash(
|
||||
damage: 15,
|
||||
poise: 15,
|
||||
knockback: 5,
|
||||
energy_regen: 0,
|
||||
),
|
||||
range: 4.0,
|
||||
angle: 15.0,
|
||||
),
|
||||
buildup_duration: 0.2,
|
||||
swing_duration: 0.2,
|
||||
hit_timing: 0.2,
|
||||
recover_duration: 0.1,
|
||||
movement: (
|
||||
buildup: Some(Forward(0.2)),
|
||||
swing: Some(Forward(0.3)),
|
||||
),
|
||||
ori_modifier: 0.6,
|
||||
custom_combo: Some((additional: 9, requirement: Some(TargetPoised))),
|
||||
),
|
||||
],
|
||||
energy_cost_per_strike: 0,
|
||||
)
|
BIN
assets/voxygen/element/skills/hammer/vigorous_bash.png
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/element/skills/hammer/vigorous_bash.png
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -389,3 +389,6 @@ common-abilities-hammer-scornful_swipe = Scornful Swipe
|
||||
common-abilities-hammer-tremor = Tremor
|
||||
.desc =
|
||||
Strike the earth with enough force that the ground beneath your foes trembles.
|
||||
common-abilities-hammer-vigorous_bash = Vigorous Bash
|
||||
.desc =
|
||||
Use the head of your hammer to quickly strike your foes.
|
||||
|
@ -136,13 +136,17 @@ impl Attack {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_combo(self, combo: i32) -> Self {
|
||||
pub fn with_combo_requirement(self, combo: i32, requirement: CombatRequirement) -> Self {
|
||||
self.with_effect(
|
||||
AttackEffect::new(None, CombatEffect::Combo(combo))
|
||||
.with_requirement(CombatRequirement::AnyDamage),
|
||||
AttackEffect::new(None, CombatEffect::Combo(combo)).with_requirement(requirement),
|
||||
)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_combo(self, combo: i32) -> Self {
|
||||
self.with_combo_requirement(combo, CombatRequirement::AnyDamage)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_combo_increment(self) -> Self { self.with_combo(1) }
|
||||
|
||||
@ -648,6 +652,9 @@ impl Attack {
|
||||
CombatRequirement::TargetHasBuff(buff) => {
|
||||
target.buffs.map_or(false, |buffs| buffs.contains(*buff))
|
||||
},
|
||||
CombatRequirement::TargetPoised => {
|
||||
target.char_state.map_or(false, |cs| cs.is_stunned())
|
||||
},
|
||||
});
|
||||
if requirements_met {
|
||||
is_applied = true;
|
||||
@ -1000,12 +1007,13 @@ impl CombatEffect {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
pub enum CombatRequirement {
|
||||
AnyDamage,
|
||||
Energy(f32),
|
||||
Combo(u32),
|
||||
TargetHasBuff(BuffKind),
|
||||
TargetPoised,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
|
||||
|
@ -14,7 +14,7 @@ use crate::{
|
||||
slot::EquipSlot,
|
||||
Inventory,
|
||||
},
|
||||
melee::{MeleeConstructor, MeleeConstructorKind},
|
||||
melee::{CustomCombo, MeleeConstructor, MeleeConstructorKind},
|
||||
projectile::ProjectileConstructor,
|
||||
skillset::{
|
||||
skills::{self, Skill, SKILL_MODIFIERS},
|
||||
@ -889,8 +889,7 @@ pub enum CharacterAbility {
|
||||
melee_constructor: MeleeConstructor,
|
||||
specifier: Option<charged_melee::FrontendSpecifier>,
|
||||
damage_effect: Option<CombatEffect>,
|
||||
#[serde(default)]
|
||||
additional_combo: i32,
|
||||
custom_combo: Option<CustomCombo>,
|
||||
#[serde(default)]
|
||||
meta: AbilityMeta,
|
||||
},
|
||||
@ -1112,7 +1111,7 @@ impl Default for CharacterAbility {
|
||||
multi_target: None,
|
||||
damage_effect: None,
|
||||
simultaneous_hits: 1,
|
||||
combo_gain: 1,
|
||||
custom_combo: None,
|
||||
},
|
||||
ori_modifier: 1.0,
|
||||
frontend_specifier: None,
|
||||
@ -1466,7 +1465,7 @@ impl CharacterAbility {
|
||||
specifier: _,
|
||||
ref mut damage_effect,
|
||||
meta: _,
|
||||
additional_combo: _,
|
||||
custom_combo: _,
|
||||
} => {
|
||||
*swing_duration /= stats.speed;
|
||||
*buildup_strike = buildup_strike
|
||||
@ -2450,7 +2449,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
||||
melee_constructor,
|
||||
specifier,
|
||||
damage_effect,
|
||||
additional_combo,
|
||||
custom_combo,
|
||||
meta: _,
|
||||
} => CharacterState::ChargedMelee(charged_melee::Data {
|
||||
static_data: charged_melee::StaticData {
|
||||
@ -2466,7 +2465,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
|
||||
ability_info,
|
||||
specifier: *specifier,
|
||||
damage_effect: *damage_effect,
|
||||
additional_combo: *additional_combo,
|
||||
custom_combo: *custom_combo,
|
||||
},
|
||||
stage_section: if buildup_strike.is_some() {
|
||||
StageSection::Buildup
|
||||
|
@ -51,7 +51,6 @@ impl Component for Melee {
|
||||
}
|
||||
|
||||
fn default_simultaneous_hits() -> u32 { 1 }
|
||||
fn default_combo_gain() -> i32 { 1 }
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct Scaled {
|
||||
@ -76,8 +75,13 @@ pub struct MeleeConstructor {
|
||||
pub damage_effect: Option<CombatEffect>,
|
||||
#[serde(default = "default_simultaneous_hits")]
|
||||
pub simultaneous_hits: u32,
|
||||
#[serde(default = "default_combo_gain")]
|
||||
pub combo_gain: i32,
|
||||
pub custom_combo: Option<CustomCombo>,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
pub struct CustomCombo {
|
||||
pub additional: i32,
|
||||
pub requirement: Option<CombatRequirement>,
|
||||
}
|
||||
|
||||
impl MeleeConstructor {
|
||||
@ -140,7 +144,6 @@ impl MeleeConstructor {
|
||||
.with_effect(energy)
|
||||
.with_effect(poise)
|
||||
.with_effect(knockback)
|
||||
.with_combo(self.combo_gain)
|
||||
},
|
||||
Stab {
|
||||
damage,
|
||||
@ -191,7 +194,6 @@ impl MeleeConstructor {
|
||||
.with_effect(energy)
|
||||
.with_effect(poise)
|
||||
.with_effect(knockback)
|
||||
.with_combo(self.combo_gain)
|
||||
},
|
||||
Bash {
|
||||
damage,
|
||||
@ -234,7 +236,6 @@ impl MeleeConstructor {
|
||||
.with_effect(energy)
|
||||
.with_effect(poise)
|
||||
.with_effect(knockback)
|
||||
.with_combo(self.combo_gain)
|
||||
},
|
||||
Hook {
|
||||
damage,
|
||||
@ -281,7 +282,6 @@ impl MeleeConstructor {
|
||||
.with_precision(precision_mult)
|
||||
.with_effect(poise)
|
||||
.with_effect(knockback)
|
||||
.with_combo(self.combo_gain)
|
||||
},
|
||||
NecroticVortex {
|
||||
damage,
|
||||
@ -319,7 +319,6 @@ impl MeleeConstructor {
|
||||
.with_damage(damage)
|
||||
.with_precision(precision_mult)
|
||||
.with_effect(knockback)
|
||||
.with_combo(self.combo_gain)
|
||||
},
|
||||
SonicWave {
|
||||
damage,
|
||||
@ -358,10 +357,23 @@ impl MeleeConstructor {
|
||||
.with_precision(precision_mult)
|
||||
.with_effect(poise)
|
||||
.with_effect(knockback)
|
||||
.with_combo(self.combo_gain)
|
||||
},
|
||||
};
|
||||
|
||||
let attack = match self.custom_combo {
|
||||
None => attack.with_combo_increment(),
|
||||
Some(CustomCombo {
|
||||
additional,
|
||||
requirement: None,
|
||||
}) => attack.with_combo(1 + additional),
|
||||
Some(CustomCombo {
|
||||
additional,
|
||||
requirement: Some(req),
|
||||
}) => attack
|
||||
.with_combo_increment()
|
||||
.with_combo_requirement(additional, req),
|
||||
};
|
||||
|
||||
Melee {
|
||||
attack,
|
||||
range: self.range,
|
||||
@ -517,8 +529,8 @@ impl MeleeConstructor {
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn with_combo(mut self, combo: i32) -> Self {
|
||||
self.combo_gain = combo;
|
||||
pub fn custom_combo(mut self, custom: Option<CustomCombo>) -> Self {
|
||||
self.custom_combo = custom;
|
||||
self
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
use crate::{
|
||||
combat::{self, CombatEffect},
|
||||
comp::{character_state::OutputEvents, CharacterState, MeleeConstructor, StateUpdate},
|
||||
comp::{
|
||||
character_state::OutputEvents, melee::CustomCombo, CharacterState, MeleeConstructor,
|
||||
StateUpdate,
|
||||
},
|
||||
event::LocalEvent,
|
||||
outcome::Outcome,
|
||||
states::{
|
||||
@ -38,7 +41,7 @@ pub struct StaticData {
|
||||
/// Adds an effect onto the main damage of the attack
|
||||
pub damage_effect: Option<CombatEffect>,
|
||||
/// The actual additional combo is modified by duration of charge
|
||||
pub additional_combo: i32,
|
||||
pub custom_combo: Option<CustomCombo>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
@ -156,15 +159,21 @@ impl CharacterBehavior for Data {
|
||||
|
||||
let precision_mult = combat::compute_precision_mult(data.inventory, data.msm);
|
||||
let tool_stats = get_tool_stats(data, self.static_data.ability_info);
|
||||
let additional_combo =
|
||||
(self.charge_amount * self.static_data.additional_combo as f32 + 0.5)
|
||||
.floor() as i32;
|
||||
let custom_combo = self.static_data.custom_combo.map(|c| {
|
||||
let additional =
|
||||
(self.charge_amount * c.additional as f32 + 0.5).floor() as i32;
|
||||
|
||||
CustomCombo {
|
||||
additional,
|
||||
requirement: c.requirement,
|
||||
}
|
||||
});
|
||||
|
||||
data.updater.insert(
|
||||
data.entity,
|
||||
self.static_data
|
||||
.melee_constructor
|
||||
.with_combo(1 + additional_combo)
|
||||
.custom_combo(custom_combo)
|
||||
.handle_scaling(self.charge_amount)
|
||||
.create_melee(precision_mult, tool_stats),
|
||||
);
|
||||
|
@ -2,8 +2,8 @@ use crate::{
|
||||
combat,
|
||||
combat::{Attack, AttackDamage, Damage, DamageKind::Crushing, DamageSource, GroupTarget},
|
||||
comp::{
|
||||
character_state::OutputEvents, item::Reagent, tool::Stats, CharacterState,
|
||||
MeleeConstructor, StateUpdate,
|
||||
character_state::OutputEvents, item::Reagent, melee::CustomCombo, tool::Stats,
|
||||
CharacterState, MeleeConstructor, StateUpdate,
|
||||
},
|
||||
event::{ExplosionEvent, LocalEvent},
|
||||
outcome::Outcome,
|
||||
@ -38,7 +38,7 @@ pub struct Strike<T> {
|
||||
/// Adjusts turning rate during the attack
|
||||
pub ori_modifier: f32,
|
||||
#[serde(default)]
|
||||
pub additional_combo: i32,
|
||||
pub custom_combo: Option<CustomCombo>,
|
||||
}
|
||||
|
||||
impl Strike<f32> {
|
||||
@ -51,7 +51,7 @@ impl Strike<f32> {
|
||||
recover_duration: Duration::from_secs_f32(self.recover_duration),
|
||||
movement: self.movement,
|
||||
ori_modifier: self.ori_modifier,
|
||||
additional_combo: self.additional_combo,
|
||||
custom_combo: self.custom_combo,
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ impl Strike<f32> {
|
||||
recover_duration: self.recover_duration / stats.speed,
|
||||
movement: self.movement,
|
||||
ori_modifier: self.ori_modifier,
|
||||
additional_combo: self.additional_combo,
|
||||
custom_combo: self.custom_combo,
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -179,7 +179,7 @@ impl CharacterBehavior for Data {
|
||||
data.entity,
|
||||
strike_data
|
||||
.melee_constructor
|
||||
.with_combo(1 + strike_data.additional_combo)
|
||||
.custom_combo(strike_data.custom_combo)
|
||||
.create_melee(precision_mult, tool_stats),
|
||||
);
|
||||
} else if self.timer < strike_data.swing_duration {
|
||||
|
@ -278,7 +278,7 @@ fn create_test_melee(static_data: StaticData) -> Melee {
|
||||
multi_target: None,
|
||||
damage_effect: None,
|
||||
simultaneous_hits: 1,
|
||||
combo_gain: 0,
|
||||
custom_combo: None,
|
||||
};
|
||||
melee.create_melee(0.0, tool::Stats::one())
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
use super::{
|
||||
super::{vek::*, Animation},
|
||||
CharacterSkeleton, SkeletonAttr,
|
||||
hammer_start, twist_back, twist_forward, CharacterSkeleton, SkeletonAttr,
|
||||
};
|
||||
use common::states::utils::{AbilityInfo, HandInfo, StageSection};
|
||||
use core::f32::consts::{PI, TAU};
|
||||
@ -1208,6 +1208,28 @@ impl Animation for ComboAnimation {
|
||||
}
|
||||
}
|
||||
},
|
||||
Some("common.abilities.hammer.vigorous_bash") => {
|
||||
hammer_start(&mut next, s_a);
|
||||
let (move1, move2, move3) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
|
||||
Some(StageSection::Action) => (1.0, anim_time, 0.0),
|
||||
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - move3;
|
||||
let move1 = move1 * pullback;
|
||||
let move2 = move2 * pullback;
|
||||
|
||||
twist_forward(&mut next, move1, 1.4, 0.7, 0.5, 0.9);
|
||||
next.control.orientation.rotate_y(move1 * 0.3);
|
||||
next.control.orientation.rotate_z(move1 * -0.3);
|
||||
next.control.position += Vec3::new(12.0, -3.0, 3.0) * move1;
|
||||
|
||||
twist_back(&mut next, move2, 1.8, 0.9, 0.6, 1.1);
|
||||
next.control.orientation.rotate_z(move2 * -2.1);
|
||||
next.control.orientation.rotate_x(move2 * 0.6);
|
||||
next.control.position += Vec3::new(-20.0, 8.0, 0.0) * move2;
|
||||
},
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
|
@ -319,6 +319,7 @@ image_ids! {
|
||||
hammer_wide_wallop: "voxygen.element.skills.hammer.wide_wallop",
|
||||
hammer_scornful_swipe: "voxygen.element.skills.hammer.scornful_swipe",
|
||||
hammer_tremor: "voxygen.element.skills.hammer.tremor",
|
||||
hammer_vigorous_bash: "voxygen.element.skills.hammer.vigorous_bash",
|
||||
// Skilltree Icons
|
||||
health_plus_skill: "voxygen.element.skills.skilltree.health_plus",
|
||||
energy_plus_skill: "voxygen.element.skills.skilltree.energy_plus",
|
||||
|
@ -626,6 +626,7 @@ pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id {
|
||||
"common.abilities.hammer.wide_wallop" => imgs.hammer_wide_wallop,
|
||||
"common.abilities.hammer.scornful_swipe" => imgs.hammer_scornful_swipe,
|
||||
"common.abilities.hammer.tremor" => imgs.hammer_tremor,
|
||||
"common.abilities.hammer.vigorous_bash" => imgs.hammer_vigorous_bash,
|
||||
// Bow
|
||||
"common.abilities.bow.charged" => imgs.bow_m1,
|
||||
"common.abilities.bow.repeater" => imgs.bow_m2,
|
||||
|
Loading…
Reference in New Issue
Block a user