mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
More voice kinds, more opportunities for sounds
This commit is contained in:
parent
fb51fd3230
commit
e3c44ba7fe
@ -844,11 +844,17 @@
|
|||||||
],
|
],
|
||||||
threshold: 4.0,
|
threshold: 4.0,
|
||||||
),
|
),
|
||||||
Utterance(Angry, Saurok): (
|
Utterance(Angry, Reptile): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.utterance.saurok_angry",
|
"voxygen.audio.sfx.utterance.saurok_angry",
|
||||||
],
|
],
|
||||||
threshold: 4.0,
|
threshold: 4.0,
|
||||||
),
|
),
|
||||||
|
Utterance(Angry, Bird): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.utterance.bird_angry",
|
||||||
|
],
|
||||||
|
threshold: 4.0,
|
||||||
|
),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
BIN
assets/voxygen/audio/sfx/utterance/bird_angry.ogg
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/audio/sfx/utterance/bird_angry.ogg
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -102,6 +102,7 @@ pub enum UtteranceKind {
|
|||||||
Angry,
|
Angry,
|
||||||
Surprised,
|
Surprised,
|
||||||
Hurt,
|
Hurt,
|
||||||
|
Greeting,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
|
@ -945,6 +945,10 @@ impl<'a> AgentData<'a> {
|
|||||||
controller.actions.push(ControlAction::Unwield);
|
controller.actions.push(ControlAction::Unwield);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if thread_rng().gen_bool(0.001) {
|
||||||
|
controller.push_event(ControlEvent::Utterance(UtteranceKind::Calm));
|
||||||
|
}
|
||||||
|
|
||||||
// Sit
|
// Sit
|
||||||
if thread_rng().gen::<f32>() < 0.0035 {
|
if thread_rng().gen::<f32>() < 0.0035 {
|
||||||
controller.actions.push(ControlAction::Sit);
|
controller.actions.push(ControlAction::Sit);
|
||||||
@ -990,6 +994,8 @@ impl<'a> AgentData<'a> {
|
|||||||
if self.look_toward(controller, read_data, &target) {
|
if self.look_toward(controller, read_data, &target) {
|
||||||
controller.actions.push(ControlAction::Stand);
|
controller.actions.push(ControlAction::Stand);
|
||||||
controller.actions.push(ControlAction::Talk);
|
controller.actions.push(ControlAction::Talk);
|
||||||
|
controller.push_event(ControlEvent::Utterance(UtteranceKind::Greeting));
|
||||||
|
|
||||||
match subject {
|
match subject {
|
||||||
Subject::Regular => {
|
Subject::Regular => {
|
||||||
if let (
|
if let (
|
||||||
|
@ -209,7 +209,7 @@ impl AudioFrontend {
|
|||||||
// TODO: Should this take `underwater` into consideration?
|
// TODO: Should this take `underwater` into consideration?
|
||||||
match self.play_sfx(sfx_file, self.listener.pos, None, false) {
|
match self.play_sfx(sfx_file, self.listener.pos, None, false) {
|
||||||
Ok(_) => {},
|
Ok(_) => {},
|
||||||
Err(e) => warn!("Failed to play sfx. {}", e),
|
Err(e) => warn!("Failed to play sfx '{:?}'. {}", sfx_file, e),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
debug!("Missing sfx trigger config for external sfx event.",);
|
debug!("Missing sfx trigger config for external sfx event.",);
|
||||||
@ -244,7 +244,7 @@ impl AudioFrontend {
|
|||||||
|
|
||||||
match self.play_sfx(sfx_file, position, volume, underwater) {
|
match self.play_sfx(sfx_file, position, volume, underwater) {
|
||||||
Ok(_) => {},
|
Ok(_) => {},
|
||||||
Err(e) => warn!("Failed to play sfx. {}", e),
|
Err(e) => warn!("Failed to play sfx '{:?}'. {}", sfx_file, e),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
debug!(
|
debug!(
|
||||||
|
@ -95,7 +95,8 @@ use common::{
|
|||||||
item::{ItemKind, ToolKind},
|
item::{ItemKind, ToolKind},
|
||||||
object,
|
object,
|
||||||
poise::PoiseState,
|
poise::PoiseState,
|
||||||
Body, CharacterAbilityType, InventoryUpdateEvent, UtteranceKind,
|
quadruped_medium, quadruped_small, Body, CharacterAbilityType, InventoryUpdateEvent,
|
||||||
|
UtteranceKind,
|
||||||
},
|
},
|
||||||
outcome::Outcome,
|
outcome::Outcome,
|
||||||
terrain::{BlockKind, TerrainChunk},
|
terrain::{BlockKind, TerrainChunk},
|
||||||
@ -191,18 +192,53 @@ pub enum VoiceKind {
|
|||||||
Human,
|
Human,
|
||||||
BipedLarge,
|
BipedLarge,
|
||||||
Wendigo,
|
Wendigo,
|
||||||
Saurok,
|
Reptile,
|
||||||
|
Bird,
|
||||||
|
Critter,
|
||||||
|
Sheep,
|
||||||
|
Pig,
|
||||||
|
Cow,
|
||||||
|
Canine,
|
||||||
|
BigCat,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn body_to_voice(body: &Body) -> VoiceKind {
|
fn body_to_voice(body: &Body) -> VoiceKind {
|
||||||
match body {
|
match body {
|
||||||
|
Body::Humanoid(_) => VoiceKind::Human,
|
||||||
|
Body::QuadrupedSmall(body) => match body.species {
|
||||||
|
quadruped_small::Species::Sheep => VoiceKind::Sheep,
|
||||||
|
quadruped_small::Species::Pig | quadruped_small::Species::Boar => VoiceKind::Pig,
|
||||||
|
_ => VoiceKind::Critter,
|
||||||
|
},
|
||||||
|
Body::QuadrupedMedium(body) => match body.species {
|
||||||
|
quadruped_medium::Species::Saber
|
||||||
|
| quadruped_medium::Species::Tiger
|
||||||
|
| quadruped_medium::Species::Lion
|
||||||
|
| quadruped_medium::Species::Frostfang
|
||||||
|
| quadruped_medium::Species::Snowleopard => VoiceKind::BigCat,
|
||||||
|
quadruped_medium::Species::Wolf
|
||||||
|
| quadruped_medium::Species::Roshwalr
|
||||||
|
| quadruped_medium::Species::Tarasque
|
||||||
|
| quadruped_medium::Species::Darkhound
|
||||||
|
| quadruped_medium::Species::Bonerattler
|
||||||
|
| quadruped_medium::Species::Grolgar => VoiceKind::Canine,
|
||||||
|
quadruped_medium::Species::Cattle
|
||||||
|
| quadruped_medium::Species::Catoblepas
|
||||||
|
| quadruped_medium::Species::Highland
|
||||||
|
| quadruped_medium::Species::Yak
|
||||||
|
| quadruped_medium::Species::Moose
|
||||||
|
| quadruped_medium::Species::Dreadhorn => VoiceKind::Cow,
|
||||||
|
_ => VoiceKind::Mute,
|
||||||
|
},
|
||||||
|
Body::BirdMedium(_) | Body::BirdLarge(_) => VoiceKind::Bird,
|
||||||
Body::BipedLarge(body) => match body.species {
|
Body::BipedLarge(body) => match body.species {
|
||||||
biped_large::Species::Wendigo => VoiceKind::Wendigo,
|
biped_large::Species::Wendigo => VoiceKind::Wendigo,
|
||||||
biped_large::Species::Occultsaurok
|
biped_large::Species::Occultsaurok
|
||||||
| biped_large::Species::Mightysaurok
|
| biped_large::Species::Mightysaurok
|
||||||
| biped_large::Species::Slysaurok => VoiceKind::Saurok,
|
| biped_large::Species::Slysaurok => VoiceKind::Reptile,
|
||||||
_ => VoiceKind::BipedLarge,
|
_ => VoiceKind::BipedLarge,
|
||||||
},
|
},
|
||||||
|
Body::Theropod(_) | Body::Dragon(_) => VoiceKind::Reptile,
|
||||||
_ => VoiceKind::Mute,
|
_ => VoiceKind::Mute,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user