adlet elder tweaks

This commit is contained in:
flo666 2023-04-20 01:56:10 +02:00 committed by Sam
parent b7c5c22070
commit 9a6ab28c3d
23 changed files with 163 additions and 6 deletions

View File

@ -781,7 +781,8 @@
primary: Simple(None, "common.abilities.adlet.elder.triplestrike"),
secondary: Simple(None, "common.abilities.adlet.elder.dash"),
abilities: [
Simple(None, "common.abilities.adlet.elder.trap")
Simple(None, "common.abilities.adlet.elder.trap"),
Simple(None, "common.abilities.adlet.elder.leap"),
],
),
})

View File

@ -0,0 +1,27 @@
LeapMelee(
energy_cost: 0.0,
buildup_duration: 0.5,
movement_duration: 0.8,
swing_duration: 0.15,
recover_duration: 0.2,
melee_constructor: (
kind: Bash(
damage: 25.0,
poise: 40.0,
knockback: 25.0,
energy_regen: 0.0,
),
range: 4.5,
angle: 360.0,
multi_target: Some(Normal),
damage_effect: Some(Buff((
kind: Frozen,
dur_secs: 2.0,
strength: DamageFraction(0.1),
chance: 1.0,
))),
),
forward_leap_strength: 30.0,
vertical_leap_strength: 25.0,
specifier: Some(ElderLeap),
)

View File

@ -1,7 +1,7 @@
BasicMelee(
energy_cost: 0,
buildup_duration: 0.3,
swing_duration: 0.55,
buildup_duration: 0.4,
swing_duration: 0.2,
recover_duration: 0.4,
melee_constructor: (
kind: Stab(

View File

@ -16,4 +16,5 @@ LeapMelee(
),
forward_leap_strength: 24,
vertical_leap_strength: 16,
specifier: None,
)

View File

@ -1,7 +1,7 @@
BasicMelee(
energy_cost: 0,
buildup_duration: 0.4,
swing_duration: 0.2,
swing_duration: 0.25,
recover_duration: 0.45,
melee_constructor: (
kind: Stab(

View File

@ -11,6 +11,6 @@ BasicRanged(
projectile_light: None,
projectile_speed: 10.0,
num_projectiles: 1,
projectile_spread: 0.0,
projectile_spread: 0.2,
move_efficiency: 0.3,
)

View File

@ -17,4 +17,5 @@ LeapMelee(
),
forward_leap_strength: 20.0,
vertical_leap_strength: 8.0,
specifier: None,
)

View File

@ -17,4 +17,5 @@ LeapMelee(
),
forward_leap_strength: 40.0,
vertical_leap_strength: 7.5,
specifier: None,
)

View File

@ -16,4 +16,5 @@ LeapMelee(
),
forward_leap_strength: 25.0,
vertical_leap_strength: 10.0,
specifier: None,
)

View File

@ -23,4 +23,5 @@ LeapMelee(
),
forward_leap_strength: 20.0,
vertical_leap_strength: 8.0,
specifier: None,
)

View File

@ -17,4 +17,5 @@ LeapMelee(
),
forward_leap_strength: 45.0,
vertical_leap_strength: 10.0,
specifier: None,
)

View File

@ -17,4 +17,5 @@ LeapMelee(
),
forward_leap_strength: 20.0,
vertical_leap_strength: 5.0,
specifier: None,
)

View File

@ -17,4 +17,5 @@ LeapMelee(
),
forward_leap_strength: 20.0,
vertical_leap_strength: 10.0,
specifier: None,
)

View File

@ -17,4 +17,5 @@ LeapMelee(
),
forward_leap_strength: 20.0,
vertical_leap_strength: 8.0,
specifier: None,
)

View File

@ -1416,6 +1416,12 @@
threshold: 1.25,
subtitle: "subtitle-attack-laser_beam",
),
Woosh: (
files: [
"voxygen.audio.sfx.abilities.woosh",
],
threshold: 0.4,
),
CyclopsCharge: (
files: [
"voxygen.audio.sfx.abilities.cyclops_charge",

BIN
assets/voxygen/audio/sfx/abilities/woosh.ogg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -595,6 +595,7 @@ pub enum CharacterAbility {
forward_leap_strength: f32,
vertical_leap_strength: f32,
damage_effect: Option<CombatEffect>,
specifier: Option<leap_melee::FrontendSpecifier>,
#[serde(default)]
meta: AbilityMeta,
},
@ -1149,6 +1150,7 @@ impl CharacterAbility {
forward_leap_strength: _,
vertical_leap_strength: _,
ref mut damage_effect,
specifier: _,
meta: _,
} => {
*buildup_duration /= stats.speed;
@ -2342,6 +2344,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
forward_leap_strength,
vertical_leap_strength,
damage_effect,
specifier,
meta: _,
} => CharacterState::LeapMelee(leap_melee::Data {
static_data: leap_melee::StaticData {
@ -2354,6 +2357,7 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState {
vertical_leap_strength: *vertical_leap_strength,
ability_info,
damage_effect: *damage_effect,
specifier: *specifier,
},
timer: Duration::default(),
stage_section: StageSection::Buildup,

View File

@ -122,6 +122,9 @@ pub enum Outcome {
FailedSpriteUnlock {
pos: Vec3<i32>,
},
Woosh {
pos: Vec3<f32>,
},
}
impl Outcome {
@ -140,6 +143,7 @@ impl Outcome {
| Outcome::PoiseChange { pos, .. }
| Outcome::GroundSlam { pos }
| Outcome::FlashFreeze { pos }
| Outcome::Woosh { pos }
| Outcome::IceSpikes { pos }
| Outcome::IceCrack { pos }
| Outcome::Utterance { pos, .. }

View File

@ -1,6 +1,8 @@
use crate::{
combat::CombatEffect,
comp::{character_state::OutputEvents, CharacterState, MeleeConstructor, StateUpdate},
event::LocalEvent,
outcome::Outcome,
states::{
behavior::{CharacterBehavior, JoinData},
utils::{StageSection, *},
@ -22,6 +24,8 @@ pub struct StaticData {
pub recover_duration: Duration,
/// Used to construct the Melee attack
pub melee_constructor: MeleeConstructor,
/// Used to specify the sfx to the frontend
pub specifier: Option<FrontendSpecifier>,
/// Affects how far forward the player leaps
pub forward_leap_strength: f32,
/// Affects how high the player leaps
@ -69,6 +73,12 @@ impl CharacterBehavior for Data {
stage_section: StageSection::Movement,
..*self
});
if let Some(FrontendSpecifier::ElderLeap) = self.static_data.specifier {
// Send local event used for frontend shenanigans
output_events.emit_local(LocalEvent::CreateOutcome(Outcome::Woosh {
pos: data.pos.0 + *data.ori.look_dir() * (data.body.max_radius()),
}));
}
}
},
StageSection::Movement => {
@ -157,3 +167,8 @@ impl CharacterBehavior for Data {
update
}
}
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
pub enum FrontendSpecifier {
ElderLeap,
}

View File

@ -136,6 +136,49 @@ impl Animation for LeapAnimation {
},
_ => {},
},
Some(ToolKind::Sword) => match ability_id {
Some("common.abilities.adlet.elder.leap") => {
next.hand_l.position = Vec3::new(s_a.hhl.0 * 1.5, -s_a.hhl.1, 5.0);
next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3);
next.hand_r.position = Vec3::new(s_a.hhr.0 / 2.0, 12.0, 5.0);
next.hand_r.orientation = Quaternion::rotation_x(s_a.hhr.3);
next.main.position = Vec3::new(-6.0, 18.0, 4.0);
next.main.orientation =
Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0);
next.second.position = Vec3::new(-2.0, 20.0, 4.0);
next.second.orientation =
Quaternion::rotation_y(0.0) * Quaternion::rotation_z(0.0);
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
next.control.orientation =
Quaternion::rotation_x(movement2 * PI / 2.5 + movement3 * -2.3);
next.upper_torso.orientation = Quaternion::rotation_x(
movement1 * 0.3 + movement2 * 0.3 + movement3 * -0.9 + movement4 * 0.3,
) * Quaternion::rotation_z(
movement1 * 0.5 + movement2 * 0.2 + movement3 * -0.7,
);
next.head.orientation = Quaternion::rotation_x(movement3 * 0.2)
* Quaternion::rotation_y(0.0 + movement2 * -0.1)
* Quaternion::rotation_z(
movement1 * -0.4 + movement2 * -0.2 + movement3 * 0.6,
);
next.foot_l.position = Vec3::new(
-s_a.foot.0,
s_a.foot.1 + movement3 * 13.0,
s_a.foot.2 + movement3 * -2.0,
);
next.foot_l.orientation = Quaternion::rotation_x(-0.8 + movement3 * 1.7);
next.foot_r.position = Vec3::new(
s_a.foot.0,
s_a.foot.1 + 8.0 + movement3 * -13.0,
s_a.foot.2 + 5.0 + movement3 * -5.0,
);
next.foot_r.orientation = Quaternion::rotation_x(0.9 + movement3 * -1.7);
},
_ => {},
},
_ => {},
}

View File

@ -118,7 +118,7 @@ impl Animation for ShootAnimation {
next.foot_l.orientation = Quaternion::rotation_y(move1 * 0.3 + move2 * -0.3);
next.foot_r.orientation = Quaternion::rotation_y(move1 * 0.3 + move2 * -0.3);
},
Some("common.abilities.adlet.elder.trap") => {
Some("common.abilities.adlet.elder.air_blade") => {
let (move1base, move2base, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0),
@ -152,6 +152,40 @@ impl Animation for ShootAnimation {
next.head.orientation =
Quaternion::rotation_x(move1abs * 0.4 + move2abs * -0.2);
},
Some("common.abilities.adlet.elder.trap") => {
let (move1base, move2base, move3) = match stage_section {
Some(StageSection::Buildup) => (anim_time, 0.0, 0.0),
Some(StageSection::Action) => (1.0, anim_time.powf(0.25), 0.0),
Some(StageSection::Recover) => (1.0, 1.0, anim_time),
_ => (0.0, 0.0, 0.0),
};
let pullback = 1.0 - move3;
let move1abs = move1base * pullback;
let move2abs = move2base * pullback;
// next.main.position = Vec3::new(-10.0, -8.0, 12.0);
// next.main.orientation = Quaternion::rotation_y(2.5) *
// Quaternion::rotation_z(PI / 2.0);
next.hand_l.position =
Vec3::new(-s_a.hand.0, s_a.hand.1 + 1.0, s_a.hand.2 + 5.0);
next.hand_r.position =
Vec3::new(s_a.hand.0, s_a.hand.1 + 1.0, s_a.hand.2 + 5.0);
next.hand_r.orientation =
Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7)
* Quaternion::rotation_y(0.0 + move1abs * -0.7);
next.hand_l.orientation =
Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7);
next.hand_r.orientation =
Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7);
next.shoulder_l.orientation =
Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7);
next.shoulder_r.orientation =
Quaternion::rotation_x(move1abs * 4.0 + move2abs * -0.7);
next.head.orientation =
Quaternion::rotation_x(move1abs * 0.4 + move2abs * -0.2);
},
_ => {},
},
Some(ToolKind::Hammer) => match ability_id {

View File

@ -177,6 +177,7 @@ pub enum SfxEvent {
Yeet,
Klonk,
SmashKlonk,
Woosh,
}
#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)]
@ -696,6 +697,15 @@ impl SfxMgr {
_ => {},
};
},
Outcome::Woosh { pos, .. } => {
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::Woosh);
audio.emit_sfx(
sfx_trigger_item,
pos.map(|e| e + 0.5),
Some(3.0),
underwater,
);
},
Outcome::ExpChange { .. } | Outcome::ComboChange { .. } => {},
}
}

View File

@ -391,6 +391,7 @@ impl ParticleMgr {
| Outcome::IceSpikes { .. }
| Outcome::IceCrack { .. }
| Outcome::Glider { .. }
| Outcome::Woosh { .. }
| Outcome::LaserBeam { .. } => {},
}
}