mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'DaforLynx/poise-sfx' into 'master'
Poise (stun) SFX and fix for town music See merge request veloren/veloren!2212
This commit is contained in:
commit
5a48158b7f
@ -2,7 +2,7 @@
|
|||||||
tracks: [
|
tracks: [
|
||||||
(
|
(
|
||||||
path: "voxygen.audio.ambient.wind",
|
path: "voxygen.audio.ambient.wind",
|
||||||
length: 14.203,
|
length: 14.2,
|
||||||
tag: Wind,
|
tag: Wind,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
BIN
assets/voxygen/audio/ambient/wind.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/ambient/wind.ogg
(Stored with Git LFS)
Binary file not shown.
@ -792,5 +792,37 @@
|
|||||||
],
|
],
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
),
|
),
|
||||||
|
PoiseChange(Interrupted): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.character.interrupted_1",
|
||||||
|
"voxygen.audio.sfx.character.interrupted_2",
|
||||||
|
"voxygen.audio.sfx.character.interrupted_3",
|
||||||
|
"voxygen.audio.sfx.character.interrupted_4",
|
||||||
|
],
|
||||||
|
threshold: 0.25,
|
||||||
|
),
|
||||||
|
PoiseChange(Stunned): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.character.stunned_1",
|
||||||
|
"voxygen.audio.sfx.character.stunned_2",
|
||||||
|
"voxygen.audio.sfx.character.stunned_3",
|
||||||
|
],
|
||||||
|
threshold: 0.6,
|
||||||
|
),
|
||||||
|
PoiseChange(Dazed): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.character.dazed_1",
|
||||||
|
"voxygen.audio.sfx.character.dazed_2",
|
||||||
|
"voxygen.audio.sfx.character.dazed_3",
|
||||||
|
],
|
||||||
|
threshold: 0.85,
|
||||||
|
),
|
||||||
|
PoiseChange(KnockedDown): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.character.knockeddown_1",
|
||||||
|
"voxygen.audio.sfx.character.knockeddown_2",
|
||||||
|
],
|
||||||
|
threshold: 1.25,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
BIN
assets/voxygen/audio/sfx/character/dazed_1.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/dazed_1.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/dazed_2.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/dazed_2.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/dazed_3.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/dazed_3.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/interrupted_1.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/interrupted_1.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/interrupted_2.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/interrupted_2.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/interrupted_3.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/interrupted_3.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/interrupted_4.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/interrupted_4.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/knockeddown_1.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/knockeddown_1.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/knockeddown_2.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/knockeddown_2.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/stunned_1.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/stunned_1.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/stunned_2.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/stunned_2.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/audio/sfx/character/stunned_3.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/character/stunned_3.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -17,16 +17,6 @@
|
|||||||
music_state: Activity(Explore),
|
music_state: Activity(Explore),
|
||||||
artist: "badbbad",
|
artist: "badbbad",
|
||||||
)),
|
)),
|
||||||
Individual((
|
|
||||||
title: "Library Theme",
|
|
||||||
path: "voxygen.audio.soundtrack.town.library_theme",
|
|
||||||
length: 65.0,
|
|
||||||
timing: Some(Day),
|
|
||||||
biomes: [],
|
|
||||||
site: Some(Settlement),
|
|
||||||
music_state: Activity(Explore),
|
|
||||||
artist: "Aeronic",
|
|
||||||
)),
|
|
||||||
Individual((
|
Individual((
|
||||||
title: "Onwards!",
|
title: "Onwards!",
|
||||||
path: "voxygen.audio.soundtrack.town.onwards",
|
path: "voxygen.audio.soundtrack.town.onwards",
|
||||||
|
BIN
assets/voxygen/audio/soundtrack/Town/library_theme.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/soundtrack/Town/library_theme.ogg
(Stored with Git LFS)
Binary file not shown.
@ -90,7 +90,7 @@ impl Default for Poise {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// States to define effects of a poise change
|
/// States to define effects of a poise change
|
||||||
#[derive(Clone, Copy, PartialEq, Debug, Serialize, Deserialize)]
|
#[derive(Clone, Copy, PartialEq, Debug, Serialize, Deserialize, Eq, Hash)]
|
||||||
pub enum PoiseState {
|
pub enum PoiseState {
|
||||||
/// No effect applied
|
/// No effect applied
|
||||||
Normal,
|
Normal,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use crate::{comp, uid::Uid};
|
use crate::{comp, uid::Uid};
|
||||||
use comp::{beam, item::Reagent};
|
use comp::{beam, item::Reagent, poise::PoiseState};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
@ -64,6 +64,10 @@ pub enum Outcome {
|
|||||||
parry: bool,
|
parry: bool,
|
||||||
uid: Uid,
|
uid: Uid,
|
||||||
},
|
},
|
||||||
|
PoiseChange {
|
||||||
|
pos: Vec3<f32>,
|
||||||
|
state: PoiseState,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Outcome {
|
impl Outcome {
|
||||||
@ -76,7 +80,8 @@ impl Outcome {
|
|||||||
| Outcome::SkillPointGain { pos, .. }
|
| Outcome::SkillPointGain { pos, .. }
|
||||||
| Outcome::SummonedCreature { pos, .. }
|
| Outcome::SummonedCreature { pos, .. }
|
||||||
| Outcome::Damage { pos, .. }
|
| Outcome::Damage { pos, .. }
|
||||||
| Outcome::Block { pos, .. } => Some(*pos),
|
| Outcome::Block { pos, .. }
|
||||||
|
| Outcome::PoiseChange { pos, .. } => Some(*pos),
|
||||||
Outcome::BreakBlock { pos, .. } => Some(pos.map(|e| e as f32 + 0.5)),
|
Outcome::BreakBlock { pos, .. } => Some(pos.map(|e| e as f32 + 0.5)),
|
||||||
Outcome::ExpChange { .. } | Outcome::ComboChange { .. } => None,
|
Outcome::ExpChange { .. } | Outcome::ComboChange { .. } => None,
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
use specs::{
|
use specs::{
|
||||||
shred::ResourceId, Entities, Join, LazyUpdate, Read, ReadStorage, SystemData, World,
|
shred::ResourceId, Entities, Join, LazyUpdate, Read, ReadStorage, SystemData, World, Write,
|
||||||
WriteStorage,
|
WriteStorage,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -15,6 +15,7 @@ use common::{
|
|||||||
Vel,
|
Vel,
|
||||||
},
|
},
|
||||||
event::{EventBus, LocalEvent, ServerEvent},
|
event::{EventBus, LocalEvent, ServerEvent},
|
||||||
|
outcome::Outcome,
|
||||||
resources::DeltaTime,
|
resources::DeltaTime,
|
||||||
states::{
|
states::{
|
||||||
self,
|
self,
|
||||||
@ -101,6 +102,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
WriteStorage<'a, Inventory>,
|
WriteStorage<'a, Inventory>,
|
||||||
WriteStorage<'a, Controller>,
|
WriteStorage<'a, Controller>,
|
||||||
WriteStorage<'a, Poise>,
|
WriteStorage<'a, Poise>,
|
||||||
|
Write<'a, Vec<Outcome>>,
|
||||||
);
|
);
|
||||||
|
|
||||||
const NAME: &'static str = "character_behavior";
|
const NAME: &'static str = "character_behavior";
|
||||||
@ -121,6 +123,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
mut inventories,
|
mut inventories,
|
||||||
mut controllers,
|
mut controllers,
|
||||||
mut poises,
|
mut poises,
|
||||||
|
mut outcomes,
|
||||||
): Self::SystemData,
|
): Self::SystemData,
|
||||||
) {
|
) {
|
||||||
let mut server_emitter = read_data.server_bus.emitter();
|
let mut server_emitter = read_data.server_bus.emitter();
|
||||||
@ -173,6 +176,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
if let Some(mut poise) = poises.get_mut(entity) {
|
if let Some(mut poise) = poises.get_mut(entity) {
|
||||||
let was_wielded = char_state.get_unchecked().is_wield();
|
let was_wielded = char_state.get_unchecked().is_wield();
|
||||||
let poise_state = poise.poise_state();
|
let poise_state = poise.poise_state();
|
||||||
|
let pos = pos.0;
|
||||||
match poise_state {
|
match poise_state {
|
||||||
PoiseState::Normal => {},
|
PoiseState::Normal => {},
|
||||||
PoiseState::Interrupted => {
|
PoiseState::Interrupted => {
|
||||||
@ -189,6 +193,10 @@ impl<'a> System<'a> for Sys {
|
|||||||
stage_section: common::states::utils::StageSection::Buildup,
|
stage_section: common::states::utils::StageSection::Buildup,
|
||||||
was_wielded,
|
was_wielded,
|
||||||
});
|
});
|
||||||
|
outcomes.push(Outcome::PoiseChange {
|
||||||
|
pos,
|
||||||
|
state: PoiseState::Interrupted,
|
||||||
|
});
|
||||||
},
|
},
|
||||||
PoiseState::Stunned => {
|
PoiseState::Stunned => {
|
||||||
poise.reset();
|
poise.reset();
|
||||||
@ -204,6 +212,10 @@ impl<'a> System<'a> for Sys {
|
|||||||
stage_section: common::states::utils::StageSection::Buildup,
|
stage_section: common::states::utils::StageSection::Buildup,
|
||||||
was_wielded,
|
was_wielded,
|
||||||
});
|
});
|
||||||
|
outcomes.push(Outcome::PoiseChange {
|
||||||
|
pos,
|
||||||
|
state: PoiseState::Stunned,
|
||||||
|
});
|
||||||
server_emitter.emit(ServerEvent::Knockback {
|
server_emitter.emit(ServerEvent::Knockback {
|
||||||
entity,
|
entity,
|
||||||
impulse: 5.0 * poise.knockback(),
|
impulse: 5.0 * poise.knockback(),
|
||||||
@ -223,6 +235,10 @@ impl<'a> System<'a> for Sys {
|
|||||||
stage_section: common::states::utils::StageSection::Buildup,
|
stage_section: common::states::utils::StageSection::Buildup,
|
||||||
was_wielded,
|
was_wielded,
|
||||||
});
|
});
|
||||||
|
outcomes.push(Outcome::PoiseChange {
|
||||||
|
pos,
|
||||||
|
state: PoiseState::Dazed,
|
||||||
|
});
|
||||||
server_emitter.emit(ServerEvent::Knockback {
|
server_emitter.emit(ServerEvent::Knockback {
|
||||||
entity,
|
entity,
|
||||||
impulse: 10.0 * poise.knockback(),
|
impulse: 10.0 * poise.knockback(),
|
||||||
@ -242,6 +258,10 @@ impl<'a> System<'a> for Sys {
|
|||||||
stage_section: common::states::utils::StageSection::Buildup,
|
stage_section: common::states::utils::StageSection::Buildup,
|
||||||
was_wielded,
|
was_wielded,
|
||||||
});
|
});
|
||||||
|
outcomes.push(Outcome::PoiseChange {
|
||||||
|
pos,
|
||||||
|
state: PoiseState::KnockedDown,
|
||||||
|
});
|
||||||
server_emitter.emit(ServerEvent::Knockback {
|
server_emitter.emit(ServerEvent::Knockback {
|
||||||
entity,
|
entity,
|
||||||
impulse: 10.0 * poise.knockback(),
|
impulse: 10.0 * poise.knockback(),
|
||||||
|
@ -139,7 +139,7 @@ impl assets::Asset for AmbientCollection {
|
|||||||
|
|
||||||
fn default_value(_: &str, error: assets::Error) -> Result<Self, assets::Error> {
|
fn default_value(_: &str, error: assets::Error) -> Result<Self, assets::Error> {
|
||||||
warn!(
|
warn!(
|
||||||
"Error reading music config file, music will not be available: {:#?}",
|
"Error reading ambience config file, ambience will not be available: {:#?}",
|
||||||
error
|
error
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -93,7 +93,9 @@ use common::{
|
|||||||
comp::{
|
comp::{
|
||||||
beam,
|
beam,
|
||||||
item::{ItemKind, ToolKind},
|
item::{ItemKind, ToolKind},
|
||||||
object, Body, CharacterAbilityType, InventoryUpdateEvent,
|
object,
|
||||||
|
poise::PoiseState,
|
||||||
|
Body, CharacterAbilityType, InventoryUpdateEvent,
|
||||||
},
|
},
|
||||||
outcome::Outcome,
|
outcome::Outcome,
|
||||||
terrain::{BlockKind, TerrainChunk},
|
terrain::{BlockKind, TerrainChunk},
|
||||||
@ -178,7 +180,7 @@ pub enum SfxEvent {
|
|||||||
ArrowShot,
|
ArrowShot,
|
||||||
FireShot,
|
FireShot,
|
||||||
FlameThrower,
|
FlameThrower,
|
||||||
// Poise(StunState),
|
PoiseChange(PoiseState),
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Deserialize, Hash, Eq)]
|
#[derive(Clone, Debug, PartialEq, Deserialize, Hash, Eq)]
|
||||||
@ -418,6 +420,29 @@ impl SfxMgr {
|
|||||||
audio.emit_sfx(sfx_trigger_item, *pos, Some(2.0), false);
|
audio.emit_sfx(sfx_trigger_item, *pos, Some(2.0), false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Outcome::PoiseChange { pos, state, .. } => match state {
|
||||||
|
PoiseState::Normal => {},
|
||||||
|
PoiseState::Interrupted => {
|
||||||
|
let sfx_trigger_item =
|
||||||
|
triggers.get_key_value(&SfxEvent::PoiseChange(PoiseState::Interrupted));
|
||||||
|
audio.emit_sfx(sfx_trigger_item, *pos, None, false);
|
||||||
|
},
|
||||||
|
PoiseState::Stunned => {
|
||||||
|
let sfx_trigger_item =
|
||||||
|
triggers.get_key_value(&SfxEvent::PoiseChange(PoiseState::Stunned));
|
||||||
|
audio.emit_sfx(sfx_trigger_item, *pos, None, false);
|
||||||
|
},
|
||||||
|
PoiseState::Dazed => {
|
||||||
|
let sfx_trigger_item =
|
||||||
|
triggers.get_key_value(&SfxEvent::PoiseChange(PoiseState::Dazed));
|
||||||
|
audio.emit_sfx(sfx_trigger_item, *pos, None, false);
|
||||||
|
},
|
||||||
|
PoiseState::KnockedDown => {
|
||||||
|
let sfx_trigger_item =
|
||||||
|
triggers.get_key_value(&SfxEvent::PoiseChange(PoiseState::KnockedDown));
|
||||||
|
audio.emit_sfx(sfx_trigger_item, *pos, None, false);
|
||||||
|
},
|
||||||
|
},
|
||||||
Outcome::ExpChange { .. }
|
Outcome::ExpChange { .. }
|
||||||
| Outcome::ComboChange { .. }
|
| Outcome::ComboChange { .. }
|
||||||
| Outcome::SummonedCreature { .. } => {},
|
| Outcome::SummonedCreature { .. } => {},
|
||||||
|
@ -219,8 +219,9 @@ impl ParticleMgr {
|
|||||||
| Outcome::Beam { .. }
|
| Outcome::Beam { .. }
|
||||||
| Outcome::ExpChange { .. }
|
| Outcome::ExpChange { .. }
|
||||||
| Outcome::SkillPointGain { .. }
|
| Outcome::SkillPointGain { .. }
|
||||||
| Outcome::ComboChange { .. } => {},
|
| Outcome::ComboChange { .. }
|
||||||
Outcome::Damage { .. } => {},
|
| Outcome::Damage { .. }
|
||||||
|
| Outcome::PoiseChange { .. } => {},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user