This commit is contained in:
Sam 2024-02-24 13:05:18 -05:00
parent 7ed66f29bf
commit 90f3b671c3
14 changed files with 72 additions and 3 deletions

View File

@ -201,7 +201,7 @@
Simple(Hammer(VigorousBash), "common.abilities.hammer.vigorous_bash"),
Simple(Hammer(Retaliate), "common.abilities.hammer.retaliate"),
Simple(Hammer(SpineCracker), "common.abilities.hammer.spine_cracker"),
// Simple(Hammer(Breach), "common.abilities.hammer.breach"),
Simple(Hammer(Breach), "common.abilities.hammer.breach"),
// Contextualized(
// pseudo_id: "common.abilities.hammer.iron_tempest",
// abilities: [

View File

@ -0,0 +1,21 @@
BasicMelee(
energy_cost: 20,
buildup_duration: 0.4,
swing_duration: 0.1,
hit_timing: 0.5,
recover_duration: 0.2,
melee_constructor: (
kind: Bash(
damage: 15,
poise: 20,
knockback: 0,
energy_regen: 0,
),
range: 3.0,
angle: 15.0,
attack_effect: Some((Poise(40), TargetBlocking)),
precision_flank_multiplier: 1.5,
precision_flank_invert: true,
),
ori_modifier: 0.6,
)

BIN
assets/voxygen/element/skills/hammer/breach.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -410,4 +410,7 @@ common-abilities-hammer-retaliate = Retaliate
common-abilities-hammer-spine_cracker = Spine Cracker
.desc =
When you foe turns their back to you, strike them hard in the back, targeting the weak part of their spine.
common-abilities-hammer-breach = Breach
.desc =
Breach through your enemy's attempt at defense with a heavy strike from your hammer.

View File

@ -663,6 +663,9 @@ impl Attack {
false
}
},
CombatRequirement::TargetBlocking => target.char_state.map_or(false, |cs| {
cs.is_block(attack_source) || cs.is_parry(attack_source)
}),
});
if requirements_met {
is_applied = true;
@ -1023,6 +1026,7 @@ pub enum CombatRequirement {
TargetHasBuff(BuffKind),
TargetPoised,
BehindTarget,
TargetBlocking,
}
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]
@ -1643,8 +1647,15 @@ pub fn precision_mult_from_flank(
attack_dir: Vec3<f32>,
target_ori: Option<&Ori>,
precision_flank_multiplier: f32,
precision_flank_invert: bool,
) -> Option<f32> {
let angle = target_ori.map(|t_ori| t_ori.look_dir().angle_between(attack_dir));
let angle = target_ori.map(|t_ori| {
t_ori.look_dir().angle_between(if precision_flank_invert {
-attack_dir
} else {
attack_dir
})
});
match angle {
Some(angle) if angle < FULL_FLANK_ANGLE => {
Some(MAX_BACK_FLANK_PRECISION * precision_flank_multiplier)

View File

@ -1114,6 +1114,7 @@ impl Default for CharacterAbility {
simultaneous_hits: 1,
custom_combo: None,
precision_flank_multiplier: 1.0,
precision_flank_invert: false,
},
ori_modifier: 1.0,
frontend_specifier: None,

View File

@ -24,6 +24,7 @@ pub struct Melee {
pub break_block: Option<(Vec3<i32>, Option<ToolKind>)>,
pub simultaneous_hits: u32,
pub precision_flank_multiplier: f32,
pub precision_flank_invert: bool,
}
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
@ -81,6 +82,8 @@ pub struct MeleeConstructor {
pub custom_combo: Option<CustomCombo>,
#[serde(default = "default_precision_flank_multiplier")]
pub precision_flank_multiplier: f32,
#[serde(default)]
pub precision_flank_invert: bool,
}
#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)]
@ -391,6 +394,7 @@ impl MeleeConstructor {
break_block: None,
simultaneous_hits: self.simultaneous_hits,
precision_flank_multiplier: self.precision_flank_multiplier,
precision_flank_invert: self.precision_flank_invert,
}
}

View File

@ -264,6 +264,7 @@ impl<'a> System<'a> for Sys {
beam.bezier.ctrl - beam.bezier.start,
target_info.ori,
1.0,
false,
);
let precision_from_time = {

View File

@ -249,6 +249,7 @@ impl<'a> System<'a> for Sys {
.unwrap_or(ori.look_vec()),
target_ori,
melee_attack.precision_flank_multiplier,
melee_attack.precision_flank_invert,
);
let precision_from_poise = {

View File

@ -390,7 +390,7 @@ fn dispatch_hit(
.map_or(false, |i| i.projectiles);
let precision_from_flank =
combat::precision_mult_from_flank(*projectile_dir, target_info.ori, 1.0);
combat::precision_mult_from_flank(*projectile_dir, target_info.ori, 1.0, false);
let precision_from_head = {
// This performs a cylinder and line segment intersection check. The cylinder is

View File

@ -133,6 +133,27 @@ impl Animation for AlphaAnimation {
next.control_l.orientation.rotate_z(move2 * -2.3);
next.control_r.orientation.rotate_z(move2 * -2.3);
},
Some("common.abilities.hammer.breach") => {
hammer_start(&mut next, s_a);
let (move1, move2, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time, 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;
let move2 = move2 * pullback;
next.control.orientation.rotate_x(move1 * 2.5);
next.control.orientation.rotate_z(move1 * -4.8);
next.control.position += Vec3::new(-12.0, 0.0, 22.0) * move1;
twist_back(&mut next, move1, 0.6, 0.2, 0.0, 0.3);
twist_forward(&mut next, move2, 1.6, 0.4, 0.2, 0.7);
next.control.orientation.rotate_x(move2 * -4.5);
next.control.position += Vec3::new(0.0, 0.0, -20.0) * move2;
},
_ => {
let (move1, move2, _move3, move2h) = match stage_section {
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0, 0.0),

View File

@ -91,6 +91,7 @@ fn maps_basic_melee() {
simultaneous_hits: 1,
custom_combo: None,
precision_flank_multiplier: 1.0,
precision_flank_invert: false,
},
ori_modifier: 1.0,
ability_info: empty_ability_info(),

View File

@ -324,6 +324,7 @@ image_ids! {
hammer_intercept: "voxygen.element.skills.hammer.intercept",
hammer_retaliate: "voxygen.element.skills.hammer.retaliate",
hammer_spine_cracker: "voxygen.element.skills.hammer.spine_cracker",
hammer_breach: "voxygen.element.skills.hammer.breach",
// Skilltree Icons
health_plus_skill: "voxygen.element.skills.skilltree.health_plus",
energy_plus_skill: "voxygen.element.skills.skilltree.energy_plus",

View File

@ -633,6 +633,7 @@ pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id {
"common.abilities.hammer.dual_intercept" => imgs.hammer_intercept,
"common.abilities.hammer.retaliate" => imgs.hammer_retaliate,
"common.abilities.hammer.spine_cracker" => imgs.hammer_spine_cracker,
"common.abilities.hammer.breach" => imgs.hammer_breach,
// Bow
"common.abilities.bow.charged" => imgs.bow_m1,
"common.abilities.bow.repeater" => imgs.bow_m2,