added sfx (thanks to @flo666)

This commit is contained in:
Maxicarlos08 2023-08-17 21:53:28 +02:00
parent e5e26149ed
commit dc1756b2df
No known key found for this signature in database
8 changed files with 28 additions and 0 deletions

View File

@ -1498,6 +1498,13 @@
threshold: 0.8,
subtitle: "subtitle-attack-shovel",
),
PortalActivated: (
files: [
"voxygen.audio.sfx.ambient.portal_2",
],
threshold: 0.8,
subtitle: "subtitle-portal-activated",
),
// Utterances (NPCs)

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

Binary file not shown.

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

Binary file not shown.

View File

@ -4,6 +4,7 @@ subtitle-bees = Bees buzzing
subtitle-owl = Owl hooting
subtitle-running_water = Water bubbling
subtitle-lightning = Thunder
subtitle-portal-activated = Portal Activated
subtitle-footsteps_grass = Walking on grass
subtitle-footsteps_earth = Walking on dirt

View File

@ -140,6 +140,9 @@ pub enum Outcome {
GroundDig {
pos: Vec3<f32>,
},
PortalActivated {
pos: Vec3<f32>,
},
}
impl Outcome {
@ -170,6 +173,7 @@ impl Outcome {
| Outcome::FlamethrowerCharge { pos }
| Outcome::LaserBeam { pos }
| Outcome::GroundDig { pos }
| Outcome::PortalActivated { pos }
| Outcome::Glider { pos, .. } => Some(*pos),
Outcome::BreakBlock { pos, .. }
| Outcome::SpriteUnlocked { pos }

View File

@ -3,6 +3,7 @@ use common::{
consts::TELEPORTER_RADIUS,
effect::Effect,
event::{EventBus, ServerEvent},
outcome::Outcome,
resources::{DeltaTime, Time},
CachedSpatialGrid, Damage, DamageKind, DamageSource, Explosion, RadiusEffect,
};
@ -19,6 +20,7 @@ impl<'a> System<'a> for Sys {
Read<'a, DeltaTime>,
Read<'a, Time>,
Read<'a, EventBus<ServerEvent>>,
Read<'a, EventBus<Outcome>>,
Read<'a, CachedSpatialGrid>,
ReadStorage<'a, Pos>,
ReadStorage<'a, Vel>,
@ -39,6 +41,7 @@ impl<'a> System<'a> for Sys {
_dt,
time,
server_bus,
outcome_bus,
spatial_grid,
positions,
velocities,
@ -204,6 +207,7 @@ impl<'a> System<'a> for Sys {
server_bus.emit_now(ServerEvent::ChangeBody {
entity,
new_body: Body::Object(if is_active {
outcome_bus.emit_now(Outcome::PortalActivated { pos: pos.0 });
object::Body::PortalActive
} else {
object::Body::Portal

View File

@ -183,6 +183,7 @@ pub enum SfxEvent {
Whoosh,
Swoosh,
GroundDig,
PortalActivated,
}
#[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)]
@ -493,6 +494,10 @@ impl SfxMgr {
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::GroundDig);
audio.emit_sfx(sfx_trigger_item, *pos, Some(2.0), underwater);
},
Outcome::PortalActivated { pos, .. } => {
let sfx_trigger_item = triggers.get_key_value(&SfxEvent::PortalActivated);
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

@ -411,6 +411,7 @@ impl ParticleMgr {
| Outcome::Swoosh { .. }
| Outcome::Steam { .. }
| Outcome::FireShockwave { .. }
| Outcome::PortalActivated { .. }
| Outcome::LaserBeam { .. } => {},
}
}