From 904623a003c8dda681d6db2b72b08713af7cd38e Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 16 Apr 2024 18:46:16 -0400 Subject: [PATCH] Changed scornful swipe to only give buff on successful hits. Nerfed knockback on most hammer abilities. --- .../abilities/hammer/dual_heavy_whorl.ron | 2 +- .../abilities/hammer/dual_intercept.ron | 4 +- .../common/abilities/hammer/dual_upheaval.ron | 2 +- assets/common/abilities/hammer/intercept.ron | 4 +- assets/common/abilities/hammer/judgement.ron | 2 +- .../common/abilities/hammer/lung_pummel.ron | 2 +- assets/common/abilities/hammer/retaliate.ron | 2 +- .../abilities/hammer/scornful_swipe.ron | 9 ++- .../common/abilities/hammer/seismic_shock.ron | 2 +- assets/common/abilities/hammer/tremor.ron | 2 +- assets/common/abilities/hammer/upheaval.ron | 2 +- .../common/abilities/hammer/vigorous_bash.ron | 2 +- .../common/abilities/hammer/wide_wallop.ron | 2 +- common/src/combat.rs | 73 +++++++++++++++++++ 14 files changed, 93 insertions(+), 17 deletions(-) diff --git a/assets/common/abilities/hammer/dual_heavy_whorl.ron b/assets/common/abilities/hammer/dual_heavy_whorl.ron index 94199a8af3..f038445e4a 100644 --- a/assets/common/abilities/hammer/dual_heavy_whorl.ron +++ b/assets/common/abilities/hammer/dual_heavy_whorl.ron @@ -8,7 +8,7 @@ BasicMelee( kind: Bash( damage: 15, poise: 15, - knockback: 10, + knockback: 5, energy_regen: 0, ), range: 3, diff --git a/assets/common/abilities/hammer/dual_intercept.ron b/assets/common/abilities/hammer/dual_intercept.ron index 0ceb572415..45e088770e 100644 --- a/assets/common/abilities/hammer/dual_intercept.ron +++ b/assets/common/abilities/hammer/dual_intercept.ron @@ -10,14 +10,14 @@ DashMelee( kind: Bash( damage: 6, poise: 10, - knockback: 6, + knockback: 0, energy_regen: 0, ), scaled: Some(( kind: Bash( damage: 9, poise: 15, - knockback: 9, + knockback: 5, energy_regen: 0, ))), range: 4.0, diff --git a/assets/common/abilities/hammer/dual_upheaval.ron b/assets/common/abilities/hammer/dual_upheaval.ron index d6145fe4de..16283c8003 100644 --- a/assets/common/abilities/hammer/dual_upheaval.ron +++ b/assets/common/abilities/hammer/dual_upheaval.ron @@ -23,7 +23,7 @@ BasicMelee( attack_effect: Some(( Knockback(( direction: Up, - strength: 20, + strength: 10, )), AnyDamage, )), diff --git a/assets/common/abilities/hammer/intercept.ron b/assets/common/abilities/hammer/intercept.ron index 1cd275e17e..fd8e5eb222 100644 --- a/assets/common/abilities/hammer/intercept.ron +++ b/assets/common/abilities/hammer/intercept.ron @@ -10,14 +10,14 @@ DashMelee( kind: Bash( damage: 8, poise: 12, - knockback: 8, + knockback: 0, energy_regen: 0, ), scaled: Some(( kind: Bash( damage: 12, poise: 18, - knockback: 12, + knockback: 7.5, energy_regen: 0, ))), range: 4.0, diff --git a/assets/common/abilities/hammer/judgement.ron b/assets/common/abilities/hammer/judgement.ron index 850727b3ee..45234312bc 100644 --- a/assets/common/abilities/hammer/judgement.ron +++ b/assets/common/abilities/hammer/judgement.ron @@ -7,7 +7,7 @@ FinisherMelee( kind: Bash( damage: 25, poise: 30, - knockback: 10, + knockback: 5, energy_regen: 0, ), range: 4.0, diff --git a/assets/common/abilities/hammer/lung_pummel.ron b/assets/common/abilities/hammer/lung_pummel.ron index 4ac16ad9dc..fd69e2f6c0 100644 --- a/assets/common/abilities/hammer/lung_pummel.ron +++ b/assets/common/abilities/hammer/lung_pummel.ron @@ -7,7 +7,7 @@ FinisherMelee( kind: Bash( damage: 20, poise: 20, - knockback: 12, + knockback: 6, energy_regen: 0, ), range: 4.0, diff --git a/assets/common/abilities/hammer/retaliate.ron b/assets/common/abilities/hammer/retaliate.ron index 3fc39c410b..d6f5d99c77 100644 --- a/assets/common/abilities/hammer/retaliate.ron +++ b/assets/common/abilities/hammer/retaliate.ron @@ -8,7 +8,7 @@ RiposteMelee( kind: Bash( damage: 20, poise: 30, - knockback: 10, + knockback: 5, energy_regen: 0, ), range: 4.0, diff --git a/assets/common/abilities/hammer/scornful_swipe.ron b/assets/common/abilities/hammer/scornful_swipe.ron index 13c4a441e1..b90d24934b 100644 --- a/assets/common/abilities/hammer/scornful_swipe.ron +++ b/assets/common/abilities/hammer/scornful_swipe.ron @@ -13,9 +13,12 @@ BasicMelee( ), range: 3.0, angle: 15.0, + damage_effect: SelfBuff(( + kind: ScornfulTaunt, + dur_secs: 20.0, + strength: Value(0.5), + chance: 1.0, + )), ), ori_modifier: 0.6, - meta: ( - init_event: Some(GainBuff(kind: ScornfulTaunt, strength: 0.5, duration: Some(20.0))), - ), ) diff --git a/assets/common/abilities/hammer/seismic_shock.ron b/assets/common/abilities/hammer/seismic_shock.ron index d453a46cb6..f9810329f1 100644 --- a/assets/common/abilities/hammer/seismic_shock.ron +++ b/assets/common/abilities/hammer/seismic_shock.ron @@ -5,7 +5,7 @@ Shockwave( recover_duration: 0.6, damage: 60, poise_damage: 80, - knockback: (strength: 25.0, direction: Up), + knockback: (strength: 10.0, direction: Up), shockwave_angle: 360.0, shockwave_vertical_angle: 45.0, shockwave_speed: 8.0, diff --git a/assets/common/abilities/hammer/tremor.ron b/assets/common/abilities/hammer/tremor.ron index d989b9a2c6..8061069a35 100644 --- a/assets/common/abilities/hammer/tremor.ron +++ b/assets/common/abilities/hammer/tremor.ron @@ -5,7 +5,7 @@ Shockwave( recover_duration: 0.3, damage: 30, poise_damage: 40, - knockback: (strength: 15.0, direction: Up), + knockback: (strength: 5.0, direction: Up), shockwave_angle: 60.0, shockwave_vertical_angle: 45.0, shockwave_speed: 10.0, diff --git a/assets/common/abilities/hammer/upheaval.ron b/assets/common/abilities/hammer/upheaval.ron index 54d2034af9..e16b69b0ee 100644 --- a/assets/common/abilities/hammer/upheaval.ron +++ b/assets/common/abilities/hammer/upheaval.ron @@ -22,7 +22,7 @@ BasicMelee( attack_effect: Some(( Knockback(( direction: Up, - strength: 30, + strength: 15, )), AnyDamage, )), diff --git a/assets/common/abilities/hammer/vigorous_bash.ron b/assets/common/abilities/hammer/vigorous_bash.ron index ff2de47a0d..4480190618 100644 --- a/assets/common/abilities/hammer/vigorous_bash.ron +++ b/assets/common/abilities/hammer/vigorous_bash.ron @@ -5,7 +5,7 @@ ComboMelee2( kind: Bash( damage: 15, poise: 15, - knockback: 5, + knockback: 3, energy_regen: 0, ), range: 4.0, diff --git a/assets/common/abilities/hammer/wide_wallop.ron b/assets/common/abilities/hammer/wide_wallop.ron index d415fdb6bb..fe3a2587a2 100644 --- a/assets/common/abilities/hammer/wide_wallop.ron +++ b/assets/common/abilities/hammer/wide_wallop.ron @@ -12,7 +12,7 @@ ChargedMelee( kind: Bash( damage: 40, poise: 100, - knockback: 20, + knockback: 2, energy_regen: 30, ))), range: 4.5, diff --git a/common/src/combat.rs b/common/src/combat.rs index 19e32b93bc..759db36914 100644 --- a/common/src/combat.rs +++ b/common/src/combat.rs @@ -594,6 +594,21 @@ impl Attack { }); } }, + CombatEffect::SelfBuff(b) => { + if let Some(attacker) = attacker { + if rng.gen::() < b.chance { + emitters.emit(BuffEvent { + entity: attacker.entity, + buff_change: BuffChange::Add(b.to_self_buff( + time, + attacker, + applied_damage, + strength_modifier, + )), + }); + } + } + }, } } } @@ -788,7 +803,23 @@ impl Attack { }, // Only has an effect when attached to a damage CombatEffect::BuffsVulnerable(_, _) => {}, + // Only has an effect when attached to a damage CombatEffect::StunnedVulnerable(_) => {}, + CombatEffect::SelfBuff(b) => { + if let Some(attacker) = attacker { + if rng.gen::() < b.chance { + emitters.emit(BuffEvent { + entity: target.entity, + buff_change: BuffChange::Add(b.to_self_buff( + time, + attacker, + accumulated_damage, + strength_modifier, + )), + }); + } + } + }, } } } @@ -978,6 +1009,8 @@ pub enum CombatEffect { // TODO: Maybe try to make it do something if tied to attack, not sure if it should double // count in that instance? StunnedVulnerable(f32), + /// Applies buff to yourself after attack is applied + SelfBuff(CombatBuff), } impl CombatEffect { @@ -1016,6 +1049,17 @@ impl CombatEffect { CombatEffect::StunnedVulnerable(v) => { CombatEffect::StunnedVulnerable(v * stats.effect_power) }, + CombatEffect::SelfBuff(CombatBuff { + kind, + dur_secs, + strength, + chance, + }) => CombatEffect::SelfBuff(CombatBuff { + kind, + dur_secs, + strength: strength * stats.buff_strength, + chance, + }), } } } @@ -1358,6 +1402,35 @@ impl CombatBuff { attacker_info.and_then(|a| a.mass), ) } + + fn to_self_buff( + self, + time: Time, + attacker_info: AttackerInfo, + damage: f32, + strength_modifier: f32, + ) -> Buff { + // TODO: Generate BufCategoryId vec (probably requires damage overhaul?) + let source = BuffSource::Character { + by: attacker_info.uid, + }; + let dest_info = DestInfo { + stats: attacker_info.stats, + mass: attacker_info.mass, + }; + Buff::new( + self.kind, + BuffData::new( + self.strength.to_strength(damage, strength_modifier), + Some(Secs(self.dur_secs as f64)), + ), + Vec::new(), + source, + time, + dest_info, + attacker_info.mass, + ) + } } pub fn get_weapon_kinds(inv: &Inventory) -> (Option, Option) {