Merge branch 'DaforLynx/aeh' into 'master'

Sfx fixes and new test

See merge request veloren/veloren!2529
This commit is contained in:
Joshua Barretto 2021-06-30 11:43:01 +00:00
commit 269c6171e4
7 changed files with 120 additions and 55 deletions

View File

@ -584,37 +584,19 @@
//
// Consumables
//
Inventory(Consumed("Potion")): (
Inventory(Consumed("Minor Potion")): (
files: [
"voxygen.audio.sfx.inventory.consumable.liquid",
],
threshold: 0.3,
),
Inventory(Consumed("PotionMinor")): (
Inventory(Consumed("Medium Potion")): (
files: [
"voxygen.audio.sfx.inventory.consumable.liquid",
],
threshold: 0.3,
),
Inventory(Consumed("PotionMed")): (
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")): (
Inventory(Consumed("Large Potion")): (
files: [
"voxygen.audio.sfx.inventory.consumable.liquid",
],
@ -632,19 +614,25 @@
],
threshold: 0.3,
),
Inventory(Consumed("Cheese")): (
Inventory(Consumed("Dwarven Cheese")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
],
threshold: 0.3,
),
Inventory(Consumed("AppleShroomCurry")): (
Inventory(Consumed("Sunflower Ice Tea")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
"voxygen.audio.sfx.inventory.consumable.liquid",
],
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: [
"voxygen.audio.sfx.inventory.consumable.food",
],
@ -656,7 +644,7 @@
],
threshold: 0.3,
),
Inventory(Consumed("MushroomStick")): (
Inventory(Consumed("Mushroom Stick")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
],
@ -668,12 +656,6 @@
],
threshold: 0.3,
),
Inventory(Consumed("Fish")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
],
threshold: 0.3,
),
Inventory(Consumed("Carrot")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
@ -686,30 +668,100 @@
],
threshold: 0.3,
),
Inventory(Consumed("PlainSalad")): (
Inventory(Consumed("Plain Salad")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
],
threshold: 0.3,
),
Inventory(Consumed("TomatoSalad")): (
Inventory(Consumed("Tomato Salad")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
],
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: [
"voxygen.audio.sfx.inventory.consumable.food",
],
threshold: 0.3,
),
Inventory(Consumed("VeloriteFrag")): (
Inventory(Consumed("Cooked Bird Meat")): (
files: [
"voxygen.audio.sfx.inventory.consumable.food",
],
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: (
files: [
"voxygen.audio.sfx.abilities.explosion",
@ -947,7 +999,7 @@
),
Utterance(Hurt, Antelope): (
files: [
"voxygen.audio.sfx.utterance.antelope",
"voxygen.audio.sfx.utterance.antelope_hurt1",
],
threshold: 1.0,
),
@ -969,9 +1021,9 @@
],
threshold: 1.0,
),
Utterance(Hurt, Marlin): (
Utterance(Hurt, Mandragora): (
files: [
"voxygen.audio.sfx.utterance.marlin_hurt1",
"voxygen.audio.sfx.utterance.mandragora_hurt1",
],
threshold: 1.0,
),
@ -981,6 +1033,12 @@
],
threshold: 1.0,
),
Utterance(Hurt, Marlin): (
files: [
"voxygen.audio.sfx.utterance.marlin_hurt1",
],
threshold: 1.0,
),
Utterance(Hurt, Mindflayer): (
files: [
"voxygen.audio.sfx.utterance.mindflayer_hurt1",

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -9,10 +9,7 @@ use vek::Vec3;
use crate::{
comp::{
inventory::{
item::{
tool::AbilityMap, ConsumableKind, ItemDef, ItemKind, MaterialStatManifest,
TagExampleInfo,
},
item::{tool::AbilityMap, ItemDef, ItemKind, MaterialStatManifest, TagExampleInfo},
loadout::Loadout,
slot::{EquipSlot, Slot, SlotError},
},
@ -806,7 +803,7 @@ impl Component for Inventory {
pub enum InventoryUpdateEvent {
Init,
Used,
Consumed(ConsumableKind),
Consumed(String),
Gave,
Given,
Swapped,

View File

@ -285,9 +285,9 @@ pub fn handle_inventory(server: &mut Server, entity: EcsEntity, manip: comp::Inv
&state.ecs().read_resource::<item::MaterialStatManifest>(),
) {
match item.kind() {
ItemKind::Consumable { kind, effect, .. } => {
ItemKind::Consumable { effect, .. } => {
maybe_effect = Some(effect.clone());
Some(comp::InventoryUpdateEvent::Consumed(*kind))
Some(comp::InventoryUpdateEvent::Consumed(item.name().to_owned()))
},
ItemKind::Throwable { kind, .. } => {
if let Some(pos) =

View File

@ -92,7 +92,7 @@ use common::{
assets::{self, AssetExt, AssetHandle},
comp::{
beam, biped_large, biped_small, humanoid,
item::{ConsumableKind, ItemKind, ToolKind},
item::{ItemKind, ToolKind},
object,
poise::PoiseState,
quadruped_low, quadruped_medium, quadruped_small, Body, CharacterAbilityType,
@ -210,6 +210,7 @@ pub enum VoiceKind {
Saurok,
Cat,
Goat,
Mandragora,
}
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::BipedSmall(body) => match body.species {
biped_small::Species::Adlet => VoiceKind::Adlet,
biped_small::Species::Mandragora => VoiceKind::Mandragora,
_ => return None,
},
Body::BipedLarge(body) => match body.species {
@ -276,7 +278,7 @@ pub enum SfxInventoryEvent {
CollectedTool(ToolKind),
CollectedItem(String),
CollectFailed,
Consumed(ConsumableKind),
Consumed(String),
Debug,
Dropped,
Given,
@ -308,7 +310,7 @@ impl From<&InventoryUpdateEvent> for SfxEvent {
SfxEvent::Inventory(SfxInventoryEvent::CollectFailed)
},
InventoryUpdateEvent::Consumed(consumable) => {
SfxEvent::Inventory(SfxInventoryEvent::Consumed(*consumable))
SfxEvent::Inventory(SfxInventoryEvent::Consumed(consumable.clone()))
},
InventoryUpdateEvent::Debug => SfxEvent::Inventory(SfxInventoryEvent::Debug),
InventoryUpdateEvent::Dropped => SfxEvent::Inventory(SfxInventoryEvent::Dropped),
@ -579,3 +581,11 @@ impl assets::Asset for SfxTriggers {
const EXTENSION: &'static str = "ron";
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_load_sfx_triggers() { let _ = SfxTriggers::load_expect("voxygen.audio.sfx"); }
}