diff --git a/assets/common/abilities/axe/leap.ron b/assets/common/abilities/axe/leap.ron index 98685cb174..942813aa4b 100644 --- a/assets/common/abilities/axe/leap.ron +++ b/assets/common/abilities/axe/leap.ron @@ -13,6 +13,7 @@ LeapMelee( ), range: 4.5, angle: 30.0, + multi_target: true, ), forward_leap_strength: 20.0, vertical_leap_strength: 8.0, diff --git a/assets/common/abilities/axe/spin.ron b/assets/common/abilities/axe/spin.ron index a48020290f..e77e0de272 100644 --- a/assets/common/abilities/axe/spin.ron +++ b/assets/common/abilities/axe/spin.ron @@ -11,6 +11,7 @@ SpinMelee( ), range: 3.5, angle: 360.0, + multi_target: true, ), energy_cost: 10.0, is_infinite: true, diff --git a/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron b/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron index 13f0bbcada..a7d3a31516 100644 --- a/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron +++ b/assets/common/abilities/custom/arthropods/hornbeetle/leap.ron @@ -13,6 +13,7 @@ LeapMelee( ), range: 4.5, angle: 180.0, + multi_target: true, ), forward_leap_strength: 40.0, vertical_leap_strength: 7.5, diff --git a/assets/common/abilities/custom/claygolem/strike.ron b/assets/common/abilities/custom/claygolem/strike.ron index 3656a04d84..b7abaa9f72 100644 --- a/assets/common/abilities/custom/claygolem/strike.ron +++ b/assets/common/abilities/custom/claygolem/strike.ron @@ -12,6 +12,7 @@ BasicMelee( ), range: 4.0, angle: 45.0, + multi_target: true, ), ori_modifier: 1.0, ) diff --git a/assets/common/abilities/custom/harvester/scythe.ron b/assets/common/abilities/custom/harvester/scythe.ron index 18d22ccfc9..cffb276a44 100644 --- a/assets/common/abilities/custom/harvester/scythe.ron +++ b/assets/common/abilities/custom/harvester/scythe.ron @@ -12,6 +12,7 @@ BasicMelee( ), range: 4.0, angle: 60.0, + multi_target: true, ), ori_modifier: 1.0, ) diff --git a/assets/common/abilities/custom/mindflayer/necroticvortex.ron b/assets/common/abilities/custom/mindflayer/necroticvortex.ron index ab8458e42a..9819991ec7 100644 --- a/assets/common/abilities/custom/mindflayer/necroticvortex.ron +++ b/assets/common/abilities/custom/mindflayer/necroticvortex.ron @@ -10,6 +10,7 @@ SpinMelee( ), range: 16.0, angle: 360.0, + multi_target: true, ), energy_cost: 0.0, is_infinite: true, diff --git a/assets/common/abilities/custom/minotaur/charge.ron b/assets/common/abilities/custom/minotaur/charge.ron index 69169c86dc..c85aea8a58 100644 --- a/assets/common/abilities/custom/minotaur/charge.ron +++ b/assets/common/abilities/custom/minotaur/charge.ron @@ -21,6 +21,7 @@ DashMelee( strength: DamageFraction(0.3), chance: 0.25, ))), + multi_target: true, ), energy_drain: 0, forward_speed: 5.0, diff --git a/assets/common/abilities/custom/minotaur/cleave.ron b/assets/common/abilities/custom/minotaur/cleave.ron index e7705d0bed..69489b315f 100644 --- a/assets/common/abilities/custom/minotaur/cleave.ron +++ b/assets/common/abilities/custom/minotaur/cleave.ron @@ -16,6 +16,7 @@ ChargedMelee( )), range: 5.0, angle: 45.0, + multi_target: true, ), charge_duration: 4.5, swing_duration: 0.1, diff --git a/assets/common/abilities/custom/minotaur/cripplingstrike.ron b/assets/common/abilities/custom/minotaur/cripplingstrike.ron index 7023af4d94..f21aa3a3b2 100644 --- a/assets/common/abilities/custom/minotaur/cripplingstrike.ron +++ b/assets/common/abilities/custom/minotaur/cripplingstrike.ron @@ -18,6 +18,7 @@ BasicMelee( strength: Value(0.5), chance: 1.0, ))), + multi_target: true, ), ori_modifier: 1.0, ) diff --git a/assets/common/abilities/custom/quadlowtail/charged.ron b/assets/common/abilities/custom/quadlowtail/charged.ron index 921492fd75..8506e952b8 100644 --- a/assets/common/abilities/custom/quadlowtail/charged.ron +++ b/assets/common/abilities/custom/quadlowtail/charged.ron @@ -16,6 +16,7 @@ ChargedMelee( )), range: 6.0, angle: 90.0, + multi_target: true, ), charge_duration: 3.2, swing_duration: 0.7, diff --git a/assets/common/abilities/custom/quadmedjump/leap.ron b/assets/common/abilities/custom/quadmedjump/leap.ron index fdae6ece52..633cd72e9c 100644 --- a/assets/common/abilities/custom/quadmedjump/leap.ron +++ b/assets/common/abilities/custom/quadmedjump/leap.ron @@ -13,6 +13,7 @@ LeapMelee( ), range: 6.75, angle: 180.0, + multi_target: true, ), forward_leap_strength: 45.0, vertical_leap_strength: 10.0, diff --git a/assets/common/abilities/custom/quadmedjump/quickleap.ron b/assets/common/abilities/custom/quadmedjump/quickleap.ron index 2c6757aaec..2501c2ae84 100644 --- a/assets/common/abilities/custom/quadmedjump/quickleap.ron +++ b/assets/common/abilities/custom/quadmedjump/quickleap.ron @@ -13,6 +13,7 @@ LeapMelee( ), range: 4.5, angle: 180.0, + multi_target: true, ), forward_leap_strength: 20.0, vertical_leap_strength: 5.0, diff --git a/assets/common/abilities/custom/stonegolemfist/spin.ron b/assets/common/abilities/custom/stonegolemfist/spin.ron index 5880f210e1..9dded605ba 100644 --- a/assets/common/abilities/custom/stonegolemfist/spin.ron +++ b/assets/common/abilities/custom/stonegolemfist/spin.ron @@ -11,6 +11,7 @@ SpinMelee( ), range: 7.5, angle: 360.0, + multi_target: true, ), energy_cost: 0, is_infinite: false, diff --git a/assets/common/abilities/custom/tidalwarrior/pincer.ron b/assets/common/abilities/custom/tidalwarrior/pincer.ron index 2fc9d1d32f..36d3486c6b 100644 --- a/assets/common/abilities/custom/tidalwarrior/pincer.ron +++ b/assets/common/abilities/custom/tidalwarrior/pincer.ron @@ -12,6 +12,7 @@ BasicMelee( ), range: 5.0, angle: 60.0, + multi_target: true, ), ori_modifier: 1.0, ) diff --git a/assets/common/abilities/custom/tidalwarrior/scuttle.ron b/assets/common/abilities/custom/tidalwarrior/scuttle.ron index 662abe2d75..809f6e5136 100644 --- a/assets/common/abilities/custom/tidalwarrior/scuttle.ron +++ b/assets/common/abilities/custom/tidalwarrior/scuttle.ron @@ -15,6 +15,7 @@ DashMelee( )), range: 5.0, angle: 90.0, + multi_target: true, ), energy_drain: 0, forward_speed: 10.0, diff --git a/assets/common/abilities/custom/tornado/spin.ron b/assets/common/abilities/custom/tornado/spin.ron index fe87bdedf9..a58c87add6 100644 --- a/assets/common/abilities/custom/tornado/spin.ron +++ b/assets/common/abilities/custom/tornado/spin.ron @@ -11,6 +11,7 @@ SpinMelee( ), range: 3.5, angle: 360.0, + multi_target: true, ), energy_cost: 0, is_infinite: true, diff --git a/assets/common/abilities/custom/yeti/strike.ron b/assets/common/abilities/custom/yeti/strike.ron index cf3aa1c6c2..122989651f 100644 --- a/assets/common/abilities/custom/yeti/strike.ron +++ b/assets/common/abilities/custom/yeti/strike.ron @@ -12,6 +12,7 @@ BasicMelee( ), range: 4.0, angle: 20.0, + multi_target: true, ), ori_modifier: 1.0, ) diff --git a/assets/common/abilities/hammer/charged.ron b/assets/common/abilities/hammer/charged.ron index 0388906a16..9dc2b45368 100644 --- a/assets/common/abilities/hammer/charged.ron +++ b/assets/common/abilities/hammer/charged.ron @@ -16,6 +16,7 @@ ChargedMelee( )), range: 3.5, angle: 30.0, + multi_target: true, ), charge_duration: 1.0, swing_duration: 0.12, diff --git a/assets/common/abilities/hammer/leap.ron b/assets/common/abilities/hammer/leap.ron index e9df3820ca..1803bf57fd 100644 --- a/assets/common/abilities/hammer/leap.ron +++ b/assets/common/abilities/hammer/leap.ron @@ -13,6 +13,7 @@ LeapMelee( ), range: 4.5, angle: 360.0, + multi_target: true, ), forward_leap_strength: 20.0, vertical_leap_strength: 8.0, diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 037da0458e..9a853f6dcc 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -660,6 +660,7 @@ impl Default for CharacterAbility { scaled: None, range: 3.5, angle: 15.0, + multi_target: false, damage_effect: None, }, ori_modifier: 1.0, diff --git a/common/src/comp/melee.rs b/common/src/comp/melee.rs index 65fde94961..f3220c5d45 100644 --- a/common/src/comp/melee.rs +++ b/common/src/comp/melee.rs @@ -20,6 +20,7 @@ pub struct Melee { pub max_angle: f32, pub applied: bool, pub hit_count: u32, + pub multi_target: bool, pub break_block: Option<(Vec3, Option)>, } @@ -45,6 +46,8 @@ pub struct MeleeConstructor { pub scaled: Option, pub range: f32, pub angle: f32, + #[serde(default)] + pub multi_target: bool, pub damage_effect: Option, } @@ -282,6 +285,7 @@ impl MeleeConstructor { max_angle: self.angle.to_radians(), applied: false, hit_count: 0, + multi_target: self.multi_target, break_block: None, } } diff --git a/common/src/states/combo_melee.rs b/common/src/states/combo_melee.rs index c13baebf7e..560ff3d7bb 100644 --- a/common/src/states/combo_melee.rs +++ b/common/src/states/combo_melee.rs @@ -287,6 +287,9 @@ impl CharacterBehavior for Data { max_angle: self.static_data.stage_data[stage_index].angle.to_radians(), applied: false, hit_count: 0, + // TODO: Evaluate if we want to leave this true. State will be removed at + // some point anyways and this does preserve behavior + multi_target: true, break_block: data .inputs .break_block_pos diff --git a/common/systems/src/melee.rs b/common/systems/src/melee.rs index dfa461657b..f2d21d9402 100644 --- a/common/systems/src/melee.rs +++ b/common/systems/src/melee.rs @@ -112,6 +112,12 @@ impl<'a> System<'a> for Sys { ) .join() { + // Unless the melee attack can hit multiple targets, stop the attack if it has + // already hit 1 target + if !melee_attack.multi_target && melee_attack.hit_count > 0 { + break; + } + let look_dir = *ori.look_dir(); // 2D versions