diff --git a/assets/common/abilities/axe/defiance.ron b/assets/common/abilities/axe/defiance.ron index b4732b4a2f..151dda965b 100644 --- a/assets/common/abilities/axe/defiance.ron +++ b/assets/common/abilities/axe/defiance.ron @@ -1,22 +1,9 @@ -ComboMelee2( - strikes: [ - ( - melee_constructor: ( - kind: Slash( - damage: 4, - poise: 5, - knockback: 0, - energy_regen: 5, - ), - range: 3.0, - angle: 45.0, - ), - buildup_duration: 0.15, - swing_duration: 0.05, - hit_timing: 0.5, - recover_duration: 0.1, - ori_modifier: 0.6, - ), - ], - energy_cost_per_strike: 0, -) \ No newline at end of file +SelfBuff( + buildup_duration: 0.1, + cast_duration: 0.4, + recover_duration: 0.2, + buff_kind: Defiance, + buff_strength: 0.4, + buff_duration: Some(20.0), + energy_cost: /*20*/0, +) diff --git a/assets/voxygen/i18n/en/buff.ftl b/assets/voxygen/i18n/en/buff.ftl index 3bc582b445..dbec12b346 100644 --- a/assets/voxygen/i18n/en/buff.ftl +++ b/assets/voxygen/i18n/en/buff.ftl @@ -100,6 +100,9 @@ buff-desc-fury = With your fury, you attack more swiftly. ## Sunderer buff-title-sunderer = Sunderer buff-desc-sunderer = Your attacks can break through your foes' defences and are more staggering. +## Sunderer +buff-title-defiance = Defiance +buff-desc-defiance = You can withstand mightier and more staggering blows ## Util buff-text-over_seconds = over { $dur_secs } seconds buff-text-for_seconds = for { $dur_secs } seconds diff --git a/common/src/cmd.rs b/common/src/cmd.rs index 83d7f3524a..f4551fd4c5 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -175,6 +175,7 @@ lazy_static! { BuffKind::ImminentCritical => "imminent_critical", BuffKind::Fury => "fury", BuffKind::Sunderer => "sunderer", + BuffKind::Defiance => "defiance", }; let mut buff_parser = HashMap::new(); for kind in BuffKind::iter() { diff --git a/common/src/comp/buff.rs b/common/src/comp/buff.rs index dc9e45e3c8..a4fecae7b5 100644 --- a/common/src/comp/buff.rs +++ b/common/src/comp/buff.rs @@ -91,6 +91,12 @@ pub enum BuffKind { /// increase. DR penetration is non-linear, 0.5 is 50% penetration and 1.0 /// is a 67% penetration. Sunderer, + /// Increases damage resistance and poise resistance. Damage resistance is + /// increased by half of poise resistance. Poise resistance increases + /// non-linearly with strength, 0.5 is 50% and 1.0 is 67%. + /// Damage resistance increases non-linearly with strength, 0.5 is 25% and + /// 1.0 is 33%. + Defiance, // Debuffs /// Does damage to a creature over time. /// Strength should be the DPS of the debuff. @@ -156,7 +162,8 @@ impl BuffKind { //| BuffKind::SalamanderAspect | BuffKind::ImminentCritical | BuffKind::Fury - | BuffKind::Sunderer => true, + | BuffKind::Sunderer + | BuffKind::Defiance => true, BuffKind::Bleeding | BuffKind::Cursed | BuffKind::Burning @@ -354,6 +361,10 @@ impl BuffKind { BuffEffect::AttackPoise(data.strength), BuffEffect::MitigationsPenetration(nn_scaling(data.strength)), ], + BuffKind::Defiance => vec![ + BuffEffect::DamageReduction(nn_scaling(data.strength) / 2.0), + BuffEffect::PoiseReduction(nn_scaling(data.strength)), + ], } } diff --git a/common/systems/src/buff.rs b/common/systems/src/buff.rs index b63c998fa4..1be604131b 100644 --- a/common/systems/src/buff.rs +++ b/common/systems/src/buff.rs @@ -589,9 +589,8 @@ fn execute_effect( stat.max_energy_modifiers.mult_mod *= *value; }, }, - #[allow(clippy::manual_clamp)] BuffEffect::DamageReduction(dr) => { - stat.damage_reduction = stat.damage_reduction.max(*dr).min(1.0); + stat.damage_reduction = 1.0 - ((1.0 - stat.damage_reduction) * (1.0 - *dr)); }, BuffEffect::MaxHealthChangeOverTime { rate, diff --git a/voxygen/anim/src/character/selfbuff.rs b/voxygen/anim/src/character/selfbuff.rs index cb09f92183..9dff36c1c0 100644 --- a/voxygen/anim/src/character/selfbuff.rs +++ b/voxygen/anim/src/character/selfbuff.rs @@ -360,6 +360,38 @@ impl Animation for SelfBuffAnimation { next.second.position += Vec3::new(0.0, move2 * -10.0, 0.0); next.control.position += Vec3::new(0.0, 0.0, move2 * -5.0); }, + Some("common.abilities.axe.defiance") => { + let (move1, tension, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time, 0.0, 0.0), + Some(StageSection::Action) => (1.0, (anim_time * 20.0).sin(), 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; + + next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2); + next.hand_l.orientation = + Quaternion::rotation_x(s_a.ahl.3) * Quaternion::rotation_y(s_a.ahl.4); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = + Quaternion::rotation_x(s_a.ahr.3) * Quaternion::rotation_z(s_a.ahr.5); + + next.control.position = Vec3::new(s_a.ac.0, s_a.ac.1, s_a.ac.2); + next.control.orientation = Quaternion::rotation_x(s_a.ac.3) + * Quaternion::rotation_y(s_a.ac.4) + * Quaternion::rotation_z(s_a.ac.5); + + next.control.orientation.rotate_z(move1 * -1.6); + next.control.orientation.rotate_x(move1 * 1.7); + next.control.position += Vec3::new(move1 * 12.0, move1 * -10.0, move1 * 18.0); + next.head.orientation.rotate_x(move1 * 0.6); + next.head.position += Vec3::new(0.0, 0.0, move1 * -3.0); + next.control.orientation.rotate_z(move1 * 0.4); + + next.head.orientation.rotate_x(tension * 0.3); + next.control.position += Vec3::new(0.0, 0.0, tension * 2.0); + }, _ => {}, } diff --git a/voxygen/i18n-helpers/src/lib.rs b/voxygen/i18n-helpers/src/lib.rs index 7f32fe6a13..8a2fff9570 100644 --- a/voxygen/i18n-helpers/src/lib.rs +++ b/voxygen/i18n-helpers/src/lib.rs @@ -123,7 +123,8 @@ pub fn localize_chat_message( // | BuffKind::SalamanderAspect | BuffKind::ImminentCritical | BuffKind::Fury - | BuffKind::Sunderer => { + | BuffKind::Sunderer + | BuffKind::Defiance => { tracing::error!("Player was killed by a positive buff!"); "hud-outcome-mysterious" }, diff --git a/voxygen/src/hud/mod.rs b/voxygen/src/hud/mod.rs index f288e588f4..f06ced9d6c 100644 --- a/voxygen/src/hud/mod.rs +++ b/voxygen/src/hud/mod.rs @@ -5118,6 +5118,8 @@ pub fn get_buff_image(buff: BuffKind, imgs: &Imgs) -> conrod_core::image::Id { BuffKind::Fury => imgs.buff_reckless, // TODO: Get buff image BuffKind::Sunderer => imgs.debuff_crippled_0, + // TODO: Get buff image + BuffKind::Defiance => imgs.buff_fortitude_0, // Debuffs BuffKind::Bleeding => imgs.debuff_bleed_0, BuffKind::Cursed => imgs.debuff_skull_0, @@ -5157,6 +5159,7 @@ pub fn get_buff_title(buff: BuffKind, localized_strings: &Localization) -> Cow localized_strings.get_msg("buff-title-imminentcritical"), BuffKind::Fury => localized_strings.get_msg("buff-title-fury"), BuffKind::Sunderer => localized_strings.get_msg("buff-title-sunderer"), + BuffKind::Defiance => localized_strings.get_msg("buff-title-defiance"), // Debuffs BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-title-bleed"), BuffKind::Cursed { .. } => localized_strings.get_msg("buff-title-cursed"), @@ -5203,6 +5206,7 @@ pub fn get_buff_desc(buff: BuffKind, data: BuffData, localized_strings: &Localiz BuffKind::ImminentCritical => localized_strings.get_msg("buff-desc-imminentcritical"), BuffKind::Fury => localized_strings.get_msg("buff-desc-fury"), BuffKind::Sunderer => localized_strings.get_msg("buff-desc-sunderer"), + BuffKind::Defiance => localized_strings.get_msg("buff-desc-defiance"), // Debuffs BuffKind::Bleeding { .. } => localized_strings.get_msg("buff-desc-bleed"), BuffKind::Cursed { .. } => localized_strings.get_msg("buff-desc-cursed"), diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index 96af5faf6e..e04df52a9f 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -212,7 +212,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { // | BuffKind::SalamanderAspect | BuffKind::ImminentCritical | BuffKind::Fury - | BuffKind::Sunderer => Cow::Borrowed(""), + | BuffKind::Sunderer + | BuffKind::Defiance => Cow::Borrowed(""), }; write!(&mut description, "{}", buff_desc).unwrap(); @@ -257,7 +258,8 @@ pub fn consumable_desc(effects: &Effects, i18n: &Localization) -> Vec { // | BuffKind::SalamanderAspect | BuffKind::ImminentCritical | BuffKind::Fury - | BuffKind::Sunderer => Cow::Borrowed(""), + | BuffKind::Sunderer + | BuffKind::Defiance => Cow::Borrowed(""), } } else if let BuffKind::Saturation | BuffKind::Regeneration