mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Sfx fixes and new test
This commit is contained in:
parent
0151e5aeed
commit
a757bf3dbd
@ -584,37 +584,19 @@
|
|||||||
//
|
//
|
||||||
// Consumables
|
// Consumables
|
||||||
//
|
//
|
||||||
Inventory(Consumed("Potion")): (
|
Inventory(Consumed("Minor Potion")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.liquid",
|
"voxygen.audio.sfx.inventory.consumable.liquid",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("PotionMinor")): (
|
Inventory(Consumed("Medium Potion")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.liquid",
|
"voxygen.audio.sfx.inventory.consumable.liquid",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("PotionMed")): (
|
Inventory(Consumed("Large Potion")): (
|
||||||
files: [
|
|
||||||
"voxygen.audio.sfx.inventory.consumable.liquid",
|
|
||||||
],
|
|
||||||
threshold: 0.3,
|
|
||||||
),
|
|
||||||
Inventory(Consumed("PotionLarge")): (
|
|
||||||
files: [
|
|
||||||
"voxygen.audio.sfx.inventory.consumable.liquid",
|
|
||||||
],
|
|
||||||
threshold: 0.3,
|
|
||||||
),
|
|
||||||
Inventory(Consumed("PotionExp")): (
|
|
||||||
files: [
|
|
||||||
"voxygen.audio.sfx.inventory.consumable.liquid",
|
|
||||||
],
|
|
||||||
threshold: 0.3,
|
|
||||||
),
|
|
||||||
Inventory(Consumed("SunflowerTea")): (
|
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.liquid",
|
"voxygen.audio.sfx.inventory.consumable.liquid",
|
||||||
],
|
],
|
||||||
@ -632,19 +614,25 @@
|
|||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("Cheese")): (
|
Inventory(Consumed("Dwarven Cheese")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("AppleShroomCurry")): (
|
Inventory(Consumed("Sunflower Ice Tea")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.liquid",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("AppleStick")): (
|
Inventory(Consumed("Mushroom Curry")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.liquid",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Apple Stick")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
],
|
],
|
||||||
@ -656,7 +644,7 @@
|
|||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("MushroomStick")): (
|
Inventory(Consumed("Mushroom Stick")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
],
|
],
|
||||||
@ -668,12 +656,6 @@
|
|||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("Fish")): (
|
|
||||||
files: [
|
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
|
||||||
],
|
|
||||||
threshold: 0.3,
|
|
||||||
),
|
|
||||||
Inventory(Consumed("Carrot")): (
|
Inventory(Consumed("Carrot")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
@ -686,30 +668,100 @@
|
|||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("PlainSalad")): (
|
Inventory(Consumed("Plain Salad")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("TomatoSalad")): (
|
Inventory(Consumed("Tomato Salad")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("Velorite")): (
|
Inventory(Consumed("Cactus Colada")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.liquid",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Raw Bird Meat")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
Inventory(Consumed("VeloriteFrag")): (
|
Inventory(Consumed("Cooked Bird Meat")): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.inventory.consumable.food",
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
],
|
],
|
||||||
threshold: 0.3,
|
threshold: 0.3,
|
||||||
),
|
),
|
||||||
|
Inventory(Consumed("Raw Fish")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Cooked Fish")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Raw Meat Slab")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Cooked Meat Slab")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Raw Meat Sliver")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Cooked Meat Sliver")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Raw Tough Meat")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Cooked Tough Meat")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Huge Raw Drumstick")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
Inventory(Consumed("Huge Cooked Drumstick")): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.inventory.consumable.food",
|
||||||
|
],
|
||||||
|
threshold: 0.3,
|
||||||
|
),
|
||||||
|
|
||||||
|
//
|
||||||
|
//Combat
|
||||||
|
//
|
||||||
Explosion: (
|
Explosion: (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.abilities.explosion",
|
"voxygen.audio.sfx.abilities.explosion",
|
||||||
@ -947,7 +999,7 @@
|
|||||||
),
|
),
|
||||||
Utterance(Hurt, Antelope): (
|
Utterance(Hurt, Antelope): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.utterance.antelope",
|
"voxygen.audio.sfx.utterance.antelope_hurt1",
|
||||||
],
|
],
|
||||||
threshold: 1.0,
|
threshold: 1.0,
|
||||||
),
|
),
|
||||||
@ -969,9 +1021,9 @@
|
|||||||
],
|
],
|
||||||
threshold: 1.0,
|
threshold: 1.0,
|
||||||
),
|
),
|
||||||
Utterance(Hurt, Marlin): (
|
Utterance(Hurt, Mandragora): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.utterance.marlin_hurt1",
|
"voxygen.audio.sfx.utterance.mandragora_hurt1",
|
||||||
],
|
],
|
||||||
threshold: 1.0,
|
threshold: 1.0,
|
||||||
),
|
),
|
||||||
@ -981,6 +1033,12 @@
|
|||||||
],
|
],
|
||||||
threshold: 1.0,
|
threshold: 1.0,
|
||||||
),
|
),
|
||||||
|
Utterance(Hurt, Marlin): (
|
||||||
|
files: [
|
||||||
|
"voxygen.audio.sfx.utterance.marlin_hurt1",
|
||||||
|
],
|
||||||
|
threshold: 1.0,
|
||||||
|
),
|
||||||
Utterance(Hurt, Mindflayer): (
|
Utterance(Hurt, Mindflayer): (
|
||||||
files: [
|
files: [
|
||||||
"voxygen.audio.sfx.utterance.mindflayer_hurt1",
|
"voxygen.audio.sfx.utterance.mindflayer_hurt1",
|
||||||
|
BIN
assets/voxygen/audio/sfx/inventory/consumable/apple.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/inventory/consumable/apple.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/inventory/consumable/food.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/inventory/consumable/food.ogg
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/audio/sfx/inventory/consumable/liquid.ogg
(Stored with Git LFS)
BIN
assets/voxygen/audio/sfx/inventory/consumable/liquid.ogg
(Stored with Git LFS)
Binary file not shown.
@ -9,10 +9,7 @@ use vek::Vec3;
|
|||||||
use crate::{
|
use crate::{
|
||||||
comp::{
|
comp::{
|
||||||
inventory::{
|
inventory::{
|
||||||
item::{
|
item::{tool::AbilityMap, ItemDef, ItemKind, MaterialStatManifest, TagExampleInfo},
|
||||||
tool::AbilityMap, ConsumableKind, ItemDef, ItemKind, MaterialStatManifest,
|
|
||||||
TagExampleInfo,
|
|
||||||
},
|
|
||||||
loadout::Loadout,
|
loadout::Loadout,
|
||||||
slot::{EquipSlot, Slot, SlotError},
|
slot::{EquipSlot, Slot, SlotError},
|
||||||
},
|
},
|
||||||
@ -806,7 +803,7 @@ impl Component for Inventory {
|
|||||||
pub enum InventoryUpdateEvent {
|
pub enum InventoryUpdateEvent {
|
||||||
Init,
|
Init,
|
||||||
Used,
|
Used,
|
||||||
Consumed(ConsumableKind),
|
Consumed(String),
|
||||||
Gave,
|
Gave,
|
||||||
Given,
|
Given,
|
||||||
Swapped,
|
Swapped,
|
||||||
|
@ -285,9 +285,9 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
|
|||||||
&state.ecs().read_resource::<item::MaterialStatManifest>(),
|
&state.ecs().read_resource::<item::MaterialStatManifest>(),
|
||||||
) {
|
) {
|
||||||
match item.kind() {
|
match item.kind() {
|
||||||
ItemKind::Consumable { kind, effect, .. } => {
|
ItemKind::Consumable { effect, .. } => {
|
||||||
maybe_effect = Some(effect.clone());
|
maybe_effect = Some(effect.clone());
|
||||||
Some(comp::InventoryUpdateEvent::Consumed(*kind))
|
Some(comp::InventoryUpdateEvent::Consumed(item.name().to_owned()))
|
||||||
},
|
},
|
||||||
ItemKind::Throwable { kind, .. } => {
|
ItemKind::Throwable { kind, .. } => {
|
||||||
if let Some(pos) =
|
if let Some(pos) =
|
||||||
|
@ -92,7 +92,7 @@ use common::{
|
|||||||
assets::{self, AssetExt, AssetHandle},
|
assets::{self, AssetExt, AssetHandle},
|
||||||
comp::{
|
comp::{
|
||||||
beam, biped_large, biped_small, humanoid,
|
beam, biped_large, biped_small, humanoid,
|
||||||
item::{ConsumableKind, ItemKind, ToolKind},
|
item::{ItemKind, ToolKind},
|
||||||
object,
|
object,
|
||||||
poise::PoiseState,
|
poise::PoiseState,
|
||||||
quadruped_low, quadruped_medium, quadruped_small, Body, CharacterAbilityType,
|
quadruped_low, quadruped_medium, quadruped_small, Body, CharacterAbilityType,
|
||||||
@ -210,6 +210,7 @@ pub enum VoiceKind {
|
|||||||
Saurok,
|
Saurok,
|
||||||
Cat,
|
Cat,
|
||||||
Goat,
|
Goat,
|
||||||
|
Mandragora,
|
||||||
}
|
}
|
||||||
|
|
||||||
fn body_to_voice(body: &Body) -> Option<VoiceKind> {
|
fn body_to_voice(body: &Body) -> Option<VoiceKind> {
|
||||||
@ -254,6 +255,7 @@ fn body_to_voice(body: &Body) -> Option<VoiceKind> {
|
|||||||
Body::BirdMedium(_) | Body::BirdLarge(_) => VoiceKind::Bird,
|
Body::BirdMedium(_) | Body::BirdLarge(_) => VoiceKind::Bird,
|
||||||
Body::BipedSmall(body) => match body.species {
|
Body::BipedSmall(body) => match body.species {
|
||||||
biped_small::Species::Adlet => VoiceKind::Adlet,
|
biped_small::Species::Adlet => VoiceKind::Adlet,
|
||||||
|
biped_small::Species::Mandragora => VoiceKind::Mandragora,
|
||||||
_ => return None,
|
_ => return None,
|
||||||
},
|
},
|
||||||
Body::BipedLarge(body) => match body.species {
|
Body::BipedLarge(body) => match body.species {
|
||||||
@ -276,7 +278,7 @@ pub enum SfxInventoryEvent {
|
|||||||
CollectedTool(ToolKind),
|
CollectedTool(ToolKind),
|
||||||
CollectedItem(String),
|
CollectedItem(String),
|
||||||
CollectFailed,
|
CollectFailed,
|
||||||
Consumed(ConsumableKind),
|
Consumed(String),
|
||||||
Debug,
|
Debug,
|
||||||
Dropped,
|
Dropped,
|
||||||
Given,
|
Given,
|
||||||
@ -308,7 +310,7 @@ impl From<&InventoryUpdateEvent> for SfxEvent {
|
|||||||
SfxEvent::Inventory(SfxInventoryEvent::CollectFailed)
|
SfxEvent::Inventory(SfxInventoryEvent::CollectFailed)
|
||||||
},
|
},
|
||||||
InventoryUpdateEvent::Consumed(consumable) => {
|
InventoryUpdateEvent::Consumed(consumable) => {
|
||||||
SfxEvent::Inventory(SfxInventoryEvent::Consumed(*consumable))
|
SfxEvent::Inventory(SfxInventoryEvent::Consumed(consumable.clone()))
|
||||||
},
|
},
|
||||||
InventoryUpdateEvent::Debug => SfxEvent::Inventory(SfxInventoryEvent::Debug),
|
InventoryUpdateEvent::Debug => SfxEvent::Inventory(SfxInventoryEvent::Debug),
|
||||||
InventoryUpdateEvent::Dropped => SfxEvent::Inventory(SfxInventoryEvent::Dropped),
|
InventoryUpdateEvent::Dropped => SfxEvent::Inventory(SfxInventoryEvent::Dropped),
|
||||||
@ -579,3 +581,11 @@ impl assets::Asset for SfxTriggers {
|
|||||||
|
|
||||||
const EXTENSION: &'static str = "ron";
|
const EXTENSION: &'static str = "ron";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_load_sfx_triggers() { let _ = SfxTriggers::load_expect("voxygen.audio.sfx"); }
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user