diff --git a/assets/common/abilities/sword/agile_crescent_slash.ron b/assets/common/abilities/sword/agile_crescent_slash.ron index dba2420527..d256fb447e 100644 --- a/assets/common/abilities/sword/agile_crescent_slash.ron +++ b/assets/common/abilities/sword/agile_crescent_slash.ron @@ -3,37 +3,20 @@ ComboMelee2( ( melee_constructor: ( kind: Slash( - damage: 5, - poise: 0, + damage: 12, + poise: 5, knockback: 0, - energy_regen: 5, + energy_regen: 0, ), range: 3.0, - angle: 45.0, + angle: 60.0, ), - buildup_duration: 0.15, - swing_duration: 0.05, + buildup_duration: 0.05, + swing_duration: 0.1, hit_timing: 0.5, recover_duration: 0.1, ori_modifier: 0.6, ), - ( - melee_constructor: ( - kind: Slash( - damage: 10, - poise: 0, - knockback: 0, - energy_regen: 7.5, - ), - range: 3.0, - angle: 45.0, - ), - buildup_duration: 0.1, - swing_duration: 0.1, - hit_timing: 0.5, - recover_duration: 0.2, - ori_modifier: 0.6, - ), ], - energy_cost_per_strike: 0, + energy_cost_per_strike: 10, ) \ No newline at end of file diff --git a/assets/common/abilities/sword/basic_crescent_slash.ron b/assets/common/abilities/sword/basic_crescent_slash.ron index dba2420527..500f0e56fc 100644 --- a/assets/common/abilities/sword/basic_crescent_slash.ron +++ b/assets/common/abilities/sword/basic_crescent_slash.ron @@ -3,30 +3,13 @@ ComboMelee2( ( melee_constructor: ( kind: Slash( - damage: 5, - poise: 0, + damage: 18, + poise: 5, knockback: 0, - energy_regen: 5, + energy_regen: 0, ), 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, - ), - ( - melee_constructor: ( - kind: Slash( - damage: 10, - poise: 0, - knockback: 0, - energy_regen: 7.5, - ), - range: 3.0, - angle: 45.0, + angle: 60.0, ), buildup_duration: 0.1, swing_duration: 0.1, @@ -35,5 +18,5 @@ ComboMelee2( ori_modifier: 0.6, ), ], - energy_cost_per_strike: 0, + energy_cost_per_strike: 10, ) \ No newline at end of file diff --git a/assets/common/abilities/sword/cleaving_crescent_slash.ron b/assets/common/abilities/sword/cleaving_crescent_slash.ron index dba2420527..6af054c286 100644 --- a/assets/common/abilities/sword/cleaving_crescent_slash.ron +++ b/assets/common/abilities/sword/cleaving_crescent_slash.ron @@ -3,30 +3,14 @@ ComboMelee2( ( melee_constructor: ( kind: Slash( - damage: 5, - poise: 0, + damage: 15, + poise: 5, knockback: 0, - energy_regen: 5, + energy_regen: 0, ), 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, - ), - ( - melee_constructor: ( - kind: Slash( - damage: 10, - poise: 0, - knockback: 0, - energy_regen: 7.5, - ), - range: 3.0, - angle: 45.0, + angle: 75.0, + multi_target: Some(Normal), ), buildup_duration: 0.1, swing_duration: 0.1, @@ -35,5 +19,5 @@ ComboMelee2( ori_modifier: 0.6, ), ], - energy_cost_per_strike: 0, + energy_cost_per_strike: 10, ) \ No newline at end of file diff --git a/assets/common/abilities/sword/crippling_crescent_slash.ron b/assets/common/abilities/sword/crippling_crescent_slash.ron index dba2420527..531109a28c 100644 --- a/assets/common/abilities/sword/crippling_crescent_slash.ron +++ b/assets/common/abilities/sword/crippling_crescent_slash.ron @@ -3,30 +3,19 @@ ComboMelee2( ( melee_constructor: ( kind: Slash( - damage: 5, - poise: 0, + damage: 14, + poise: 5, knockback: 0, - energy_regen: 5, + energy_regen: 0, ), 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, - ), - ( - melee_constructor: ( - kind: Slash( - damage: 10, - poise: 0, - knockback: 0, - energy_regen: 7.5, - ), - range: 3.0, - angle: 45.0, + angle: 60.0, + damage_effect: Some(Buff(( + kind: Bleeding, + dur_secs: 8.0, + strength: DamageFraction(0.25), + chance: 0.25, + ))), ), buildup_duration: 0.1, swing_duration: 0.1, @@ -35,5 +24,5 @@ ComboMelee2( ori_modifier: 0.6, ), ], - energy_cost_per_strike: 0, + energy_cost_per_strike: 10, ) \ No newline at end of file diff --git a/assets/common/abilities/sword/defensive_crescent_slash.ron b/assets/common/abilities/sword/defensive_crescent_slash.ron index dba2420527..213fb924b8 100644 --- a/assets/common/abilities/sword/defensive_crescent_slash.ron +++ b/assets/common/abilities/sword/defensive_crescent_slash.ron @@ -3,30 +3,13 @@ ComboMelee2( ( melee_constructor: ( kind: Slash( - damage: 5, - poise: 0, + damage: 15, + poise: 5, knockback: 0, - energy_regen: 5, + energy_regen: 0, ), 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, - ), - ( - melee_constructor: ( - kind: Slash( - damage: 10, - poise: 0, - knockback: 0, - energy_regen: 7.5, - ), - range: 3.0, - angle: 45.0, + angle: 60.0, ), buildup_duration: 0.1, swing_duration: 0.1, @@ -35,5 +18,11 @@ ComboMelee2( ori_modifier: 0.6, ), ], - energy_cost_per_strike: 0, + energy_cost_per_strike: 10, + meta: ( + capabilities: ( + // When in buildup, attack can get cancelled into parry + bits: 0b00100000, + ), + ), ) \ No newline at end of file diff --git a/assets/common/abilities/sword/defensive_double_slash.ron b/assets/common/abilities/sword/defensive_double_slash.ron index dcbb3a7178..34a2b954d6 100644 --- a/assets/common/abilities/sword/defensive_double_slash.ron +++ b/assets/common/abilities/sword/defensive_double_slash.ron @@ -38,7 +38,7 @@ ComboMelee2( energy_cost_per_strike: 0, meta: ( capabilities: ( - // Buildup blocks melee attacks at 50% strength + // Blocks melee attacks at 50% strength bits: 0b00000100, ), ), diff --git a/assets/common/abilities/sword/heavy_crescent_slash.ron b/assets/common/abilities/sword/heavy_crescent_slash.ron index dba2420527..bd02b868f7 100644 --- a/assets/common/abilities/sword/heavy_crescent_slash.ron +++ b/assets/common/abilities/sword/heavy_crescent_slash.ron @@ -3,37 +3,20 @@ ComboMelee2( ( melee_constructor: ( kind: Slash( - damage: 5, - poise: 0, + damage: 25, + poise: 15, knockback: 0, - energy_regen: 5, + energy_regen: 0, ), range: 3.0, - angle: 45.0, + angle: 60.0, ), - buildup_duration: 0.15, - swing_duration: 0.05, - hit_timing: 0.5, - recover_duration: 0.1, - ori_modifier: 0.6, - ), - ( - melee_constructor: ( - kind: Slash( - damage: 10, - poise: 0, - knockback: 0, - energy_regen: 7.5, - ), - range: 3.0, - angle: 45.0, - ), - buildup_duration: 0.1, + buildup_duration: 0.3, swing_duration: 0.1, hit_timing: 0.5, recover_duration: 0.2, ori_modifier: 0.6, ), ], - energy_cost_per_strike: 0, + energy_cost_per_strike: 10, ) \ No newline at end of file diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index ce22c41fce..7b705180d6 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -2848,6 +2848,8 @@ bitflags::bitflags! { const POISE_RESISTANT = 0b00001000; // WHen in the ability, an entity only receives half as much knockback const KNOCKBACK_RESISTANT = 0b00010000; + // The ability will interrupt itself into a parry if hit with melee + const BUILDUP_PARRIES = 0b00100000; } } diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 5a62f9540c..5b9609afef 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -303,11 +303,19 @@ impl CharacterState { } pub fn is_parry(&self) -> bool { - match self { + let from_capability = self + .ability_info() + .map(|a| a.ability_meta.capabilities) + .map_or(false, |c| { + c.contains(Capability::BUILDUP_PARRIES) + && matches!(self.stage_section(), Some(StageSection::Buildup)) + }); + let from_state = match self { CharacterState::BasicBlock(c) => c.is_parry(), CharacterState::RiposteMelee(c) => matches!(c.stage_section, StageSection::Buildup), _ => false, - } + }; + from_capability || from_state } /// In radians diff --git a/server/src/events/entity_manipulation.rs b/server/src/events/entity_manipulation.rs index 4a9b23d337..3f78aa330c 100644 --- a/server/src/events/entity_manipulation.rs +++ b/server/src/events/entity_manipulation.rs @@ -1272,7 +1272,11 @@ pub fn handle_parry_hook(server: &Server, defender: EcsEntity, attacker: Option< }); true }, - _ => false, + char_state => char_state.ability_info().map_or(false, |info| { + info.ability_meta + .capabilities + .contains(comp::ability::Capability::BUILDUP_PARRIES) + }), }; if return_to_wield { *char_state = diff --git a/voxygen/anim/src/character/combomelee.rs b/voxygen/anim/src/character/combomelee.rs index c2eee3abec..879897f3c3 100644 --- a/voxygen/anim/src/character/combomelee.rs +++ b/voxygen/anim/src/character/combomelee.rs @@ -493,6 +493,52 @@ impl Animation for ComboAnimation { _ => {}, } }, + Some( + "common.abilities.sword.basic_crescent_slash" + | "common.abilities.sword.heavy_crescent_slash" + | "common.abilities.sword.agile_crescent_slash" + | "common.abilities.sword.defensive_crescent_slash" + | "common.abilities.sword.crippling_crescent_slash" + | "common.abilities.sword.cleaving_crescent_slash", + ) => { + let (move1, move2) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0), + Some(StageSection::Action) => (1.0, anim_time.powi(2)), + Some(StageSection::Recover) => (1.0, 1.0), + _ => (0.0, 0.0), + }; + let move1 = move1 * multi_strike_pullback; + let move2 = move2 * multi_strike_pullback; + + next.hand_l.position = Vec3::new(s_a.shl.0, s_a.shl.1, s_a.shl.2); + next.hand_l.orientation = + Quaternion::rotation_x(s_a.shl.3) * Quaternion::rotation_y(s_a.shl.4); + next.hand_r.position = Vec3::new( + -s_a.sc.0 + 6.0 + move1 * -12.0, + -4.0 + move1 * 3.0, + -2.0 + move1.min(0.5) * 2.0 * 10.0 + (move1.max(0.5) - 0.5) * 2.0 * -10.0, + ); + next.hand_r.orientation = Quaternion::rotation_x(0.9 + move1 * 0.5); + next.control.position = Vec3::new(s_a.sc.0, s_a.sc.1, s_a.sc.2); + next.control.orientation = Quaternion::rotation_x(s_a.sc.3); + + next.chest.orientation = Quaternion::rotation_z(move1 * 1.2); + next.head.orientation = Quaternion::rotation_z(move1 * -0.7); + next.shorts.orientation = Quaternion::rotation_z(move1 * -0.6); + next.belt.orientation = Quaternion::rotation_z(move1 * -0.2); + next.control + .orientation + .rotate_y(move1 * -1.5 + move2 * -0.7); + + next.chest.orientation.rotate_z(move2 * -1.4); + next.head.orientation.rotate_z(move2 * 0.9); + next.shorts.orientation.rotate_z(move2 * 0.8); + next.belt.orientation.rotate_z(move2 * 0.3); + next.control.orientation.rotate_x(move2 * 0.6); + next.control.orientation.rotate_z(move2 * -1.7); + next.control.position += Vec3::new(move2 * 12.0, move2 * 4.0, move2 * 7.0); + next.control.orientation.rotate_x(move2 * 0.7); + }, Some("common.abilities.sword.cleaving_combo") => { let (move1, move2) = if strike == current_strike { match stage_section {