From a38f336c9e354170a0f42d9469fa14b053bdff70 Mon Sep 17 00:00:00 2001 From: Sam Date: Sun, 23 Apr 2023 21:31:29 -0400 Subject: [PATCH] Added dual wielding sword contextual abilities. --- .../common/abilities/ability_set_manifest.ron | 25 ++++++++- .../abilities/sword/agile_dual_cross_cut.ron | 23 ++++++++ .../abilities/sword/agile_dual_flurry.ron | 22 ++++++++ .../abilities/sword/agile_dual_perforate.ron | 19 +++++++ .../abilities/sword/basic_dual_cross_cut.ron | 23 ++++++++ .../sword/cleaving_dual_bladestorm.ron | 22 ++++++++ .../sword/cleaving_dual_cross_cut.ron | 24 ++++++++ .../sword/cleaving_dual_spiral_slash.ron | 26 +++++++++ .../sword/cleaving_dual_whirlwind_slice.ron | 24 ++++++++ .../sword/crippling_dual_cross_cut.ron | 29 ++++++++++ .../sword/defensive_dual_cross_cut.ron | 30 ++++++++++ .../abilities/sword/heavy_dual_cross_cut.ron | 24 ++++++++ assets/voxygen/i18n/en/hud/ability.ftl | 28 ++++++++++ common/src/combat.rs | 4 +- common/src/comp/ability.rs | 1 + common/src/comp/inventory/item/tool.rs | 2 +- common/src/comp/melee.rs | 6 ++ common/src/states/combo_melee.rs | 1 + common/src/states/dash_melee.rs | 1 + common/systems/src/beam.rs | 2 +- common/systems/src/melee.rs | 29 +++++----- common/systems/src/projectile.rs | 2 +- common/systems/src/shockwave.rs | 2 +- server/src/events/entity_manipulation.rs | 2 +- voxygen/anim/src/character/chargeswing.rs | 5 +- voxygen/anim/src/character/combomelee.rs | 49 +++++++++++++++++ voxygen/anim/src/character/rapidmelee.rs | 55 ++++++++++++++++++- voxygen/src/hud/util.rs | 14 ++++- 28 files changed, 469 insertions(+), 25 deletions(-) create mode 100644 assets/common/abilities/sword/agile_dual_cross_cut.ron create mode 100644 assets/common/abilities/sword/agile_dual_flurry.ron create mode 100644 assets/common/abilities/sword/agile_dual_perforate.ron create mode 100644 assets/common/abilities/sword/basic_dual_cross_cut.ron create mode 100644 assets/common/abilities/sword/cleaving_dual_bladestorm.ron create mode 100644 assets/common/abilities/sword/cleaving_dual_cross_cut.ron create mode 100644 assets/common/abilities/sword/cleaving_dual_spiral_slash.ron create mode 100644 assets/common/abilities/sword/cleaving_dual_whirlwind_slice.ron create mode 100644 assets/common/abilities/sword/crippling_dual_cross_cut.ron create mode 100644 assets/common/abilities/sword/defensive_dual_cross_cut.ron create mode 100644 assets/common/abilities/sword/heavy_dual_cross_cut.ron diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index 22e15d3238..b3b32f0b4f 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -18,9 +18,11 @@ pseudo_id: "veloren.core.pseudo_abilities.sword.secondary_ability", abilities: [ ([Stance(Sword(Heavy))], (None, "common.abilities.sword.heavy_slam")), + ([Stance(Sword(Agile)), DualWieldingSameKind], (None, "common.abilities.sword.agile_dual_perforate")), ([Stance(Sword(Agile))], (None, "common.abilities.sword.agile_perforate")), ([Stance(Sword(Defensive))], (None, "common.abilities.sword.defensive_vital_jab")), ([Stance(Sword(Crippling))], (None, "common.abilities.sword.crippling_deep_rend")), + ([Stance(Sword(Cleaving)), DualWieldingSameKind], (None, "common.abilities.sword.cleaving_dual_spiral_slash")), ([Stance(Sword(Cleaving))], (None, "common.abilities.sword.cleaving_spiral_slash")), ([], (None, "common.abilities.sword.basic_thrust")), ], @@ -73,6 +75,12 @@ Contextualized( pseudo_id: "veloren.core.pseudo_abilities.sword.cross_cut", abilities: [ + ([Stance(Sword(Heavy)), DualWieldingSameKind], (Sword(CrossCut), "common.abilities.sword.heavy_dual_cross_cut")), + ([Stance(Sword(Agile)), DualWieldingSameKind], (Sword(CrossCut), "common.abilities.sword.agile_dual_cross_cut")), + ([Stance(Sword(Defensive)), DualWieldingSameKind], (Sword(CrossCut), "common.abilities.sword.defensive_dual_cross_cut")), + ([Stance(Sword(Crippling)), DualWieldingSameKind], (Sword(CrossCut), "common.abilities.sword.crippling_dual_cross_cut")), + ([Stance(Sword(Cleaving)), DualWieldingSameKind], (Sword(CrossCut), "common.abilities.sword.cleaving_dual_cross_cut")), + ([DualWieldingSameKind], (Sword(CrossCut), "common.abilities.sword.basic_dual_cross_cut")), ([Stance(Sword(Heavy))], (Sword(CrossCut), "common.abilities.sword.heavy_cross_cut")), ([Stance(Sword(Agile))], (Sword(CrossCut), "common.abilities.sword.agile_cross_cut")), ([Stance(Sword(Defensive))], (Sword(CrossCut), "common.abilities.sword.defensive_cross_cut")), @@ -88,6 +96,7 @@ ([Stance(Sword(Agile))], (Sword(Finisher), "common.abilities.sword.agile_hundred_cuts")), ([Stance(Sword(Defensive))], (Sword(Finisher), "common.abilities.sword.defensive_counter")), ([Stance(Sword(Crippling))], (Sword(Finisher), "common.abilities.sword.crippling_mutilate")), + ([Stance(Sword(Cleaving)), DualWieldingSameKind], (Sword(Finisher), "common.abilities.sword.cleaving_dual_bladestorm")), ([Stance(Sword(Cleaving))], (Sword(Finisher), "common.abilities.sword.cleaving_bladestorm")), ([], (Sword(Finisher), "common.abilities.sword.basic_mighty_strike")), ], @@ -100,12 +109,24 @@ Simple(Sword(DefensiveDisengage), "common.abilities.sword.defensive_disengage"), Simple(Sword(CripplingGouge), "common.abilities.sword.crippling_gouge"), Simple(Sword(CripplingHamstring), "common.abilities.sword.crippling_hamstring"), - Simple(Sword(CleavingWhirlwindSlice), "common.abilities.sword.cleaving_whirlwind_slice"), + Contextualized( + pseudo_id: "common.abilities.sword.cleaving_whirlwind_slice", + abilities: [ + ([DualWieldingSameKind], (Sword(CleavingWhirlwindSlice), "common.abilities.sword.cleaving_dual_whirlwind_slice")), + ([], (Sword(CleavingWhirlwindSlice), "common.abilities.sword.cleaving_whirlwind_slice")), + ], + ), Simple(Sword(CleavingEarthSplitter), "common.abilities.sword.cleaving_earth_splitter"), Simple(Sword(HeavyFortitude), "common.abilities.sword.heavy_fortitude"), Simple(Sword(HeavyPillarThrust), "common.abilities.sword.heavy_pillar_thrust"), Simple(Sword(AgileDancingEdge), "common.abilities.sword.agile_dancing_edge"), - Simple(Sword(AgileFlurry), "common.abilities.sword.agile_flurry"), + Contextualized( + pseudo_id: "common.abilities.sword.agile_flurry", + abilities: [ + ([Stance(Sword(Agile)), DualWieldingSameKind], (Sword(AgileFlurry), "common.abilities.sword.agile_dual_flurry")), + ([Stance(Sword(Agile))], (Sword(AgileFlurry), "common.abilities.sword.agile_flurry")), + ], + ), Simple(Sword(DefensiveStalwartSword), "common.abilities.sword.defensive_stalwart_sword"), Simple(Sword(DefensiveDeflect), "common.abilities.sword.defensive_deflect"), Simple(Sword(CripplingEviscerate), "common.abilities.sword.crippling_eviscerate"), diff --git a/assets/common/abilities/sword/agile_dual_cross_cut.ron b/assets/common/abilities/sword/agile_dual_cross_cut.ron new file mode 100644 index 0000000000..b36fad7f9e --- /dev/null +++ b/assets/common/abilities/sword/agile_dual_cross_cut.ron @@ -0,0 +1,23 @@ +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Slash( + damage: 5, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 3.5, + angle: 90.0, + simultaneous_hits: 2, + ), + buildup_duration: 0.1, + swing_duration: 0.05, + hit_timing: 0.5, + recover_duration: 0.1, + ori_modifier: 0.6, + ), + ], + energy_cost_per_strike: 5, +) \ No newline at end of file diff --git a/assets/common/abilities/sword/agile_dual_flurry.ron b/assets/common/abilities/sword/agile_dual_flurry.ron new file mode 100644 index 0000000000..8a4be2c2bd --- /dev/null +++ b/assets/common/abilities/sword/agile_dual_flurry.ron @@ -0,0 +1,22 @@ +RapidMelee( + buildup_duration: 0.1, + swing_duration: 0.07, + recover_duration: 0.1, + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 3, + knockback: 0, + energy_regen: 0, + ), + range: 6.0, + angle: 10.0, + ), + energy_cost: 2.5, + max_strikes: Some(6), + move_modifier: 0.35, + ori_modifier: 0.25, + meta: ( + requirements: (stance: Some(Sword(Agile))), + ), +) diff --git a/assets/common/abilities/sword/agile_dual_perforate.ron b/assets/common/abilities/sword/agile_dual_perforate.ron new file mode 100644 index 0000000000..3034c3081e --- /dev/null +++ b/assets/common/abilities/sword/agile_dual_perforate.ron @@ -0,0 +1,19 @@ +RapidMelee( + buildup_duration: 0.2, + swing_duration: 0.14, + recover_duration: 0.3, + melee_constructor: ( + kind: Slash( + damage: 2, + poise: 1, + knockback: 0, + energy_regen: 2, + ), + range: 4.0, + angle: 5.0, + ), + energy_cost: 0, + max_strikes: None, + move_modifier: 0.3, + ori_modifier: 0.2, +) \ No newline at end of file diff --git a/assets/common/abilities/sword/basic_dual_cross_cut.ron b/assets/common/abilities/sword/basic_dual_cross_cut.ron new file mode 100644 index 0000000000..d9450cc643 --- /dev/null +++ b/assets/common/abilities/sword/basic_dual_cross_cut.ron @@ -0,0 +1,23 @@ +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 3.5, + angle: 90.0, + simultaneous_hits: 2, + ), + buildup_duration: 0.15, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 0.2, + ori_modifier: 0.6, + ), + ], + energy_cost_per_strike: 5, +) \ No newline at end of file diff --git a/assets/common/abilities/sword/cleaving_dual_bladestorm.ron b/assets/common/abilities/sword/cleaving_dual_bladestorm.ron new file mode 100644 index 0000000000..7aa68e8624 --- /dev/null +++ b/assets/common/abilities/sword/cleaving_dual_bladestorm.ron @@ -0,0 +1,22 @@ +RapidMelee( + buildup_duration: 0.3, + swing_duration: 0.15, + recover_duration: 0.3, + melee_constructor: ( + kind: Slash( + damage: 6, + poise: 10, + knockback: 0, + energy_regen: 0, + ), + range: 4.0, + angle: 360.0, + multi_target: Some(Normal), + simultaneous_hits: 2, + ), + energy_cost: 3.33, + max_strikes: Some(6), + move_modifier: 0.8, + ori_modifier: 1.0, + minimum_combo: 10, +) diff --git a/assets/common/abilities/sword/cleaving_dual_cross_cut.ron b/assets/common/abilities/sword/cleaving_dual_cross_cut.ron new file mode 100644 index 0000000000..e4e3f75ce3 --- /dev/null +++ b/assets/common/abilities/sword/cleaving_dual_cross_cut.ron @@ -0,0 +1,24 @@ +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 3.5, + angle: 90.0, + multi_target: Some(Normal), + simultaneous_hits: 2, + ), + buildup_duration: 0.2, + swing_duration: 0.15, + hit_timing: 0.5, + recover_duration: 0.25, + ori_modifier: 0.6, + ), + ], + energy_cost_per_strike: 5, +) \ No newline at end of file diff --git a/assets/common/abilities/sword/cleaving_dual_spiral_slash.ron b/assets/common/abilities/sword/cleaving_dual_spiral_slash.ron new file mode 100644 index 0000000000..ba0850c410 --- /dev/null +++ b/assets/common/abilities/sword/cleaving_dual_spiral_slash.ron @@ -0,0 +1,26 @@ +ChargedMelee( + energy_cost: 0, + energy_drain: 0, + melee_constructor: ( + kind: Slash( + damage: 0, + poise: 0, + knockback: 0, + energy_regen: 0, + ), + scaled: Some(Slash( + damage: 7, + poise: 10, + knockback: 0, + energy_regen: 10, + )), + range: 3.0, + angle: 360.0, + multi_target: Some(Normal), + simultaneous_hits: 2, + ), + charge_duration: 0.5, + swing_duration: 0.2, + hit_timing: 0.2, + recover_duration: 0.3, +) \ No newline at end of file diff --git a/assets/common/abilities/sword/cleaving_dual_whirlwind_slice.ron b/assets/common/abilities/sword/cleaving_dual_whirlwind_slice.ron new file mode 100644 index 0000000000..3b408fbf10 --- /dev/null +++ b/assets/common/abilities/sword/cleaving_dual_whirlwind_slice.ron @@ -0,0 +1,24 @@ +RapidMelee( + buildup_duration: 0.2, + swing_duration: 0.2, + recover_duration: 0.4, + melee_constructor: ( + kind: Slash( + damage: 10, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 4.0, + angle: 360.0, + multi_target: Some(Normal), + simultaneous_hits: 2, + ), + energy_cost: 5, + max_strikes: Some(2), + ori_modifier: 1.0, + move_modifier: 1.0, + meta: ( + init_event: Some(EnterStance(Sword(Cleaving))), + ), +) diff --git a/assets/common/abilities/sword/crippling_dual_cross_cut.ron b/assets/common/abilities/sword/crippling_dual_cross_cut.ron new file mode 100644 index 0000000000..fac0cce391 --- /dev/null +++ b/assets/common/abilities/sword/crippling_dual_cross_cut.ron @@ -0,0 +1,29 @@ +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Slash( + damage: 7, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 3.5, + angle: 90.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 8.0, + strength: DamageFraction(0.25), + chance: 1.0, + ))), + simultaneous_hits: 2, + ), + buildup_duration: 0.15, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 0.2, + ori_modifier: 0.6, + ), + ], + energy_cost_per_strike: 5, +) \ No newline at end of file diff --git a/assets/common/abilities/sword/defensive_dual_cross_cut.ron b/assets/common/abilities/sword/defensive_dual_cross_cut.ron new file mode 100644 index 0000000000..041a376163 --- /dev/null +++ b/assets/common/abilities/sword/defensive_dual_cross_cut.ron @@ -0,0 +1,30 @@ +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Slash( + damage: 6, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 3.5, + angle: 90.0, + damage_effect: Some(BuffsVulnerable(0.5, Parried)), + simultaneous_hits: 2, + ), + buildup_duration: 0.15, + swing_duration: 0.1, + hit_timing: 0.5, + recover_duration: 0.2, + ori_modifier: 0.6, + ), + ], + energy_cost_per_strike: 5, + meta: ( + capabilities: ( + // The ability will parry melee attacks in the buildup portion + bits: 0b00100000, + ), + ), +) \ No newline at end of file diff --git a/assets/common/abilities/sword/heavy_dual_cross_cut.ron b/assets/common/abilities/sword/heavy_dual_cross_cut.ron new file mode 100644 index 0000000000..886b31ad63 --- /dev/null +++ b/assets/common/abilities/sword/heavy_dual_cross_cut.ron @@ -0,0 +1,24 @@ +ComboMelee2( + strikes: [ + ( + melee_constructor: ( + kind: Slash( + damage: 12, + poise: 5, + knockback: 0, + energy_regen: 0, + ), + range: 3.5, + angle: 90.0, + damage_effect: Some(StunnedVulnerable(0.5)), + simultaneous_hits: 2, + ), + buildup_duration: 0.2, + swing_duration: 0.15, + hit_timing: 0.5, + recover_duration: 0.25, + ori_modifier: 0.6, + ), + ], + energy_cost_per_strike: 5, +) \ No newline at end of file diff --git a/assets/voxygen/i18n/en/hud/ability.ftl b/assets/voxygen/i18n/en/hud/ability.ftl index 7578fa3a26..74540b944d 100644 --- a/assets/voxygen/i18n/en/hud/ability.ftl +++ b/assets/voxygen/i18n/en/hud/ability.ftl @@ -44,12 +44,16 @@ common-abilities-sword-heavy_slam = Heavy Slam .desc = A strong overhead slash that can be charged to be more staggering common-abilities-sword-agile_perforate = Perforate .desc = A rapid flurry of light attacks +common-abilities-sword-agile_dual_perforate = Perforate + .desc = A rapid flurry of light attacks with both swords common-abilities-sword-defensive_vital_jab = Defensive Vital Jab .desc = A quickly charged jab that does more damage against parried foes common-abilities-sword-crippling_deep_rend = Deep Rend .desc = A strike aimed at an already open wound, deals more damage to bleeding enemies common-abilities-sword-cleaving_spiral_slash = Spiral Slash .desc = Sweep your blade fully around you to hit anyone nearby +common-abilities-sword-cleaving_dual_spiral_slash = Spiral Slash + .desc = Sweep both of your blades fully around you to hit anyone nearby veloren-core-pseudo_abilities-sword-crescent_slash = Crescent Slash .desc = An upwards diagonal slash @@ -130,6 +134,18 @@ common-abilities-sword-crippling_cross_cut = Crippling Cross Cut .desc = A right and left slash that can bleed common-abilities-sword-cleaving_cross_cut = Cleaving Cross Cut .desc = A right and left slash which cleave through enemies +common-abilities-sword-basic_dual_cross_cut = Basic Cross Cut + .desc = A simultaneous basic right and left slash +common-abilities-sword-heavy_dual_cross_cut = Heavy Cross Cut + .desc = A simultaneous right and left slash that can each stagger +common-abilities-sword-agile_dual_cross_cut = Agile Cross Cut + .desc = A simultaneous quick right and left slash +common-abilities-sword-defensive_dual_cross_cut = Defensive Cross Cut + .desc = A simultaneous parrying right and left slash +common-abilities-sword-crippling_dual_cross_cut = Crippling Cross Cut + .desc = A simultaneous right and left slash that can bleed +common-abilities-sword-cleaving_dual_cross_cut = Cleaving Cross Cut + .desc = A simultaneous right and left slash which cleave through enemies veloren-core-pseudo_abilities-sword-finisher = Finisher .desc = An ability that consumes combo and is meant to end a fight @@ -158,6 +174,10 @@ common-abilities-sword-cleaving_bladestorm = Bladestorm .desc = Decimate your enemies with multiple cyclic swings of your sword Requires a moderate amount of combo to use +common-abilities-sword-cleaving_dual_bladestorm = Bladestorm + .desc = + Decimate your enemies with multiple cyclic swings of both of your swords + Requires a moderate amount of combo to use common-abilities-sword-heavy_sweep = Heavy Sweep .desc = A heavy, wide, sweeping strike that deals more damage to a staggered enemy @@ -194,6 +214,10 @@ common-abilities-sword-cleaving_whirlwind_slice = Whirlwind Slice .desc = Strike all surrounding enemies with circular attacks Enters cleaving stance +common-abilities-sword-cleaving_dual_whirlwind_slice = Whirlwind Slice + .desc = + Strike all surrounding enemies with circular attacks using both of your swords + Enters cleaving stance common-abilities-sword-cleaving_earth_splitter = Earth Splitter .desc = Split the earth, if used while falling will have a much stronger impact @@ -214,6 +238,10 @@ common-abilities-sword-agile_flurry = Flurry .desc = Multiple rapid stabs Requires agile stance +common-abilities-sword-agile_dual_flurry = Flurry + .desc = + Multiple rapid stabs with both swords + Requires agile stance common-abilities-sword-defensive_stalwart_sword = Stalwart Sword .desc = Shrug off the brunt of attacks, incoming damage is reduced diff --git a/common/src/combat.rs b/common/src/combat.rs index 376a5a9917..7685423741 100644 --- a/common/src/combat.rs +++ b/common/src/combat.rs @@ -188,7 +188,7 @@ impl Attack { pub fn apply_attack( &self, attacker: Option, - target: TargetInfo, + target: &TargetInfo, dir: Dir, options: AttackOptions, // Currently strength_modifier just modifies damage, @@ -241,7 +241,7 @@ impl Attack { is_applied = true; let damage_reduction = Attack::compute_damage_reduction( attacker.as_ref(), - &target, + target, attack_source, dir, damage.damage, diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 575dfe433e..3ff759d6d4 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -834,6 +834,7 @@ impl Default for CharacterAbility { angle: 15.0, multi_target: None, damage_effect: None, + simultaneous_hits: 1, }, ori_modifier: 1.0, meta: Default::default(), diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index be676d8dde..bf36c9a104 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -334,7 +334,7 @@ impl AbilityKind { } => AbilityKind::::Contextualized { pseudo_id: pseudo_id.clone(), abilities: abilities - .into_iter() + .iter() .map(|(c, (s, x))| (c.clone(), (*s, f(x)))) .collect(), }, diff --git a/common/src/comp/melee.rs b/common/src/comp/melee.rs index 6152e9e122..aa53c7f487 100644 --- a/common/src/comp/melee.rs +++ b/common/src/comp/melee.rs @@ -22,6 +22,7 @@ pub struct Melee { pub hit_count: u32, pub multi_target: Option, pub break_block: Option<(Vec3, Option)>, + pub simultaneous_hits: u32, } #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] @@ -49,6 +50,8 @@ impl Component for Melee { type Storage = VecStorage; } +fn default_simultaneous_hits() -> u32 { 1 } + #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(deny_unknown_fields)] pub struct MeleeConstructor { @@ -61,6 +64,8 @@ pub struct MeleeConstructor { pub angle: f32, pub multi_target: Option, pub damage_effect: Option, + #[serde(default = "default_simultaneous_hits")] + pub simultaneous_hits: u32, } impl MeleeConstructor { @@ -306,6 +311,7 @@ impl MeleeConstructor { hit_count: 0, multi_target: self.multi_target, break_block: None, + simultaneous_hits: self.simultaneous_hits, } } diff --git a/common/src/states/combo_melee.rs b/common/src/states/combo_melee.rs index 653b69294d..f8c55d0103 100644 --- a/common/src/states/combo_melee.rs +++ b/common/src/states/combo_melee.rs @@ -272,6 +272,7 @@ impl CharacterBehavior for Data { // TODO: Evaluate if we want to leave this true. State will be removed at // some point anyways and this does preserve behavior multi_target: Some(MultiTarget::Normal), + simultaneous_hits: 1, break_block: data .inputs .break_block_pos diff --git a/common/src/states/dash_melee.rs b/common/src/states/dash_melee.rs index 4547b0e28c..6676f8987e 100644 --- a/common/src/states/dash_melee.rs +++ b/common/src/states/dash_melee.rs @@ -276,6 +276,7 @@ fn create_test_melee(static_data: StaticData) -> Melee { angle: static_data.melee_constructor.angle, multi_target: None, damage_effect: None, + simultaneous_hits: 1, }; melee.create_melee((0.0, 0.0), tool::Stats::one()) } diff --git a/common/systems/src/beam.rs b/common/systems/src/beam.rs index e4d8f1ae8b..f14d43ccd8 100644 --- a/common/systems/src/beam.rs +++ b/common/systems/src/beam.rs @@ -255,7 +255,7 @@ impl<'a> System<'a> for Sys { beam_segment.properties.attack.apply_attack( attacker_info, - target_info, + &target_info, ori.look_dir(), attack_options, 1.0, diff --git a/common/systems/src/melee.rs b/common/systems/src/melee.rs index bbe32ddaf9..d0a561573c 100644 --- a/common/systems/src/melee.rs +++ b/common/systems/src/melee.rs @@ -231,21 +231,24 @@ impl<'a> System<'a> for Sys { 1.0 }; - let is_applied = melee_attack.attack.apply_attack( - attacker_info, - target_info, - dir, - attack_options, - strength, - AttackSource::Melee, - *read_data.time, - |e| server_emitter.emit(e), - |o| outcomes_emitter.emit(o), - &mut rng, - ); + let mut is_applied = false; + for _ in 0..melee_attack.simultaneous_hits { + is_applied = melee_attack.attack.apply_attack( + attacker_info, + &target_info, + dir, + attack_options, + strength, + AttackSource::Melee, + *read_data.time, + |e| server_emitter.emit(e), + |o| outcomes_emitter.emit(o), + &mut rng, + ) || is_applied; + } if is_applied { - melee_attack.hit_count += 1; + melee_attack.hit_count += melee_attack.simultaneous_hits; } } } diff --git a/common/systems/src/projectile.rs b/common/systems/src/projectile.rs index 69b5cd5447..cb1e3ec0c3 100644 --- a/common/systems/src/projectile.rs +++ b/common/systems/src/projectile.rs @@ -352,7 +352,7 @@ fn dispatch_hit( attack.apply_attack( attacker_info, - target_info, + &target_info, projectile_dir, attack_options, 1.0, diff --git a/common/systems/src/shockwave.rs b/common/systems/src/shockwave.rs index 408ed881bc..ea16a6e892 100644 --- a/common/systems/src/shockwave.rs +++ b/common/systems/src/shockwave.rs @@ -241,7 +241,7 @@ impl<'a> System<'a> for Sys { shockwave.properties.attack.apply_attack( attacker_info, - target_info, + &target_info, dir, attack_options, 1.0, diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 72b961b315..90ce607d0d 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -1008,7 +1008,7 @@ pub fn handle_explosion(server: &Server, pos: Vec3, explosion: Explosion, o let time = server.state.ecs().read_resource::