shovel sfx & particles

This commit is contained in:
flo666 2023-08-03 21:52:55 +02:00
parent b06960ce1c
commit 607af6f227
8 changed files with 46 additions and 0 deletions

View File

@ -1491,6 +1491,13 @@
threshold: 0.9,
subtitle: "subtitle-attack-steam",
),
GroundDig: (
files: [
"voxygen.audio.sfx.abilities.shovel",
],
threshold: 0.8,
subtitle: "subtitle-attack-shovel",
),
// Utterances (NPCs)

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

Binary file not shown.

View File

@ -108,6 +108,7 @@ subtitle-attack-flash_freeze = Flash freeze
subtitle-attack-icy_spikes = Icy spikes
subtitle-attack-ice_crack = Ice crack
subtitle-attack-steam = Steam
subtitle-attack-shovel = Shovel digging
subtitle-consume_potion = Drinking potion
subtitle-consume_apple = Eating apple

View File

@ -137,6 +137,9 @@ pub enum Outcome {
FireShockwave {
pos: Vec3<f32>,
},
GroundDig {
pos: Vec3<f32>,
},
}
impl Outcome {
@ -166,6 +169,7 @@ impl Outcome {
| Outcome::CyclopsCharge { pos }
| Outcome::FlamethrowerCharge { pos }
| Outcome::LaserBeam { pos }
| Outcome::GroundDig { pos }
| Outcome::Glider { pos, .. } => Some(*pos),
Outcome::BreakBlock { pos, .. }
| Outcome::SpriteUnlocked { pos }

View File

@ -3,6 +3,8 @@ use crate::{
character_state::OutputEvents, tool::ToolKind, CharacterState, MeleeConstructor,
StateUpdate,
},
event::LocalEvent,
outcome::Outcome,
states::{
behavior::{CharacterBehavior, JoinData},
utils::*,
@ -96,6 +98,12 @@ impl CharacterBehavior for Data {
}),
),
);
// Send local event used for frontend shenanigans
if self.static_data.ability_info.tool == Some(ToolKind::Shovel) {
output_events.emit_local(LocalEvent::CreateOutcome(Outcome::GroundDig {
pos: data.pos.0 + *data.ori.look_dir() * (data.body.max_radius()),
}));
}
} else if self.timer < self.static_data.swing_duration {
// Swings
update.character = CharacterState::BasicMelee(Data {

View File

@ -6,6 +6,8 @@ use crate::{
tool::{Stats, ToolKind},
CharacterState, Melee, StateUpdate,
},
event::LocalEvent,
outcome::Outcome,
states::{
behavior::{CharacterBehavior, JoinData},
utils::*,
@ -319,6 +321,12 @@ impl CharacterBehavior for Data {
..*self
});
}
// Send local event used for frontend shenanigans
if self.static_data.ability_info.tool == Some(ToolKind::Shovel) {
output_events.emit_local(LocalEvent::CreateOutcome(Outcome::GroundDig {
pos: data.pos.0 + *data.ori.look_dir() * (data.body.max_radius()),
}));
}
},
StageSection::Recover => {
if self.timer < self.static_data.stage_data[stage_index].base_recover_duration {

View File

@ -182,6 +182,7 @@ pub enum SfxEvent {
DeepLaugh,
Whoosh,
Swoosh,
GroundDig,
}
#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)]
@ -488,6 +489,10 @@ impl SfxMgr {
},
}
},
Outcome::GroundDig { pos, .. } => {
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::GroundDig);
audio.emit_sfx(sfx_trigger_item, *pos, Some(2.0), underwater);
},
Outcome::IceSpikes { pos, .. } => {
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::IceSpikes);
audio.emit_sfx(sfx_trigger_item, *pos, Some(2.0), underwater);

View File

@ -386,6 +386,16 @@ impl ParticleMgr {
)
});
},
Outcome::GroundDig { pos, .. } => {
self.particles.resize_with(self.particles.len() + 12, || {
Particle::new(
Duration::from_millis(200),
time,
ParticleMode::BigShrapnel,
*pos,
)
});
},
Outcome::ProjectileShot { .. }
| Outcome::Beam { .. }
| Outcome::ExpChange { .. }