From 93399710329d1f2ee15264bb4104ee993801d7b8 Mon Sep 17 00:00:00 2001 From: flo Date: Sun, 28 Aug 2022 18:48:18 +0000 Subject: [PATCH] Music Instruments --- .../common/abilities/ability_set_manifest.ron | 40 +++ assets/common/abilities/music/bass.ron | 6 + assets/common/abilities/music/flute.ron | 6 + assets/common/abilities/music/harp.ron | 6 + assets/common/abilities/music/kalimba.ron | 6 + assets/common/abilities/music/lute.ron | 6 + assets/common/abilities/music/melodica.ron | 6 + assets/common/abilities/music/perc.ron | 6 + assets/common/abilities/music/sitar.ron | 6 + assets/common/items/tool/instruments/bass.ron | 21 ++ .../common/items/tool/instruments/flute.ron | 21 ++ assets/common/items/tool/instruments/harp.ron | 21 ++ .../common/items/tool/instruments/kalimba.ron | 21 ++ assets/common/items/tool/instruments/lute.ron | 21 ++ .../items/tool/instruments/melodica.ron | 21 ++ assets/common/items/tool/instruments/perc.ron | 21 ++ .../common/items/tool/instruments/sitar.ron | 21 ++ assets/voxygen/audio/sfx.ron | 113 ++++++++ .../audio/sfx/instrument/bass/bass_a.ogg | 3 + .../audio/sfx/instrument/bass/bass_c.ogg | 3 + .../audio/sfx/instrument/bass/bass_c1.ogg | 3 + .../audio/sfx/instrument/bass/bass_d.ogg | 3 + .../audio/sfx/instrument/bass/bass_e.ogg | 3 + .../audio/sfx/instrument/bass/bass_g.ogg | 3 + .../audio/sfx/instrument/flute/flute_a.ogg | 3 + .../audio/sfx/instrument/flute/flute_c.ogg | 3 + .../audio/sfx/instrument/flute/flute_c1.ogg | 3 + .../audio/sfx/instrument/flute/flute_d.ogg | 3 + .../audio/sfx/instrument/flute/flute_e.ogg | 3 + .../audio/sfx/instrument/flute/flute_g.ogg | 3 + .../audio/sfx/instrument/harp/harp_a.ogg | 3 + .../audio/sfx/instrument/harp/harp_c.ogg | 3 + .../audio/sfx/instrument/harp/harp_c1.ogg | 3 + .../audio/sfx/instrument/harp/harp_d.ogg | 3 + .../audio/sfx/instrument/harp/harp_e.ogg | 3 + .../audio/sfx/instrument/harp/harp_g.ogg | 3 + .../sfx/instrument/kalimba/kalimba_a.ogg | 3 + .../sfx/instrument/kalimba/kalimba_c.ogg | 3 + .../sfx/instrument/kalimba/kalimba_c1.ogg | 3 + .../sfx/instrument/kalimba/kalimba_d.ogg | 3 + .../sfx/instrument/kalimba/kalimba_e.ogg | 3 + .../sfx/instrument/kalimba/kalimba_g.ogg | 3 + .../audio/sfx/instrument/lute/lute_a.ogg | 3 + .../audio/sfx/instrument/lute/lute_c.ogg | 3 + .../audio/sfx/instrument/lute/lute_c1.ogg | 3 + .../audio/sfx/instrument/lute/lute_d.ogg | 3 + .../audio/sfx/instrument/lute/lute_e.ogg | 3 + .../audio/sfx/instrument/lute/lute_g.ogg | 3 + .../sfx/instrument/melodica/melodica_a.ogg | 3 + .../sfx/instrument/melodica/melodica_c.ogg | 3 + .../sfx/instrument/melodica/melodica_c1.ogg | 3 + .../sfx/instrument/melodica/melodica_d.ogg | 3 + .../sfx/instrument/melodica/melodica_e.ogg | 3 + .../sfx/instrument/melodica/melodica_g.ogg | 3 + .../audio/sfx/instrument/perc/perc_a.ogg | 3 + .../audio/sfx/instrument/perc/perc_c.ogg | 3 + .../audio/sfx/instrument/perc/perc_d.ogg | 3 + .../audio/sfx/instrument/perc/perc_e.ogg | 3 + .../audio/sfx/instrument/perc/perc_g.ogg | 3 + .../audio/sfx/instrument/sitar/sitar_a.ogg | 3 + .../audio/sfx/instrument/sitar/sitar_c.ogg | 3 + .../audio/sfx/instrument/sitar/sitar_c1.ogg | 3 + .../audio/sfx/instrument/sitar/sitar_d.ogg | 3 + .../audio/sfx/instrument/sitar/sitar_e.ogg | 3 + .../audio/sfx/instrument/sitar/sitar_g.ogg | 3 + assets/voxygen/element/skills/music.png | 3 + assets/voxygen/i18n/en/common.ftl | 1 + assets/voxygen/item_image_manifest.ron | 32 +++ .../voxygen/voxel/biped_weapon_manifest.ron | 32 +++ assets/voxygen/voxel/item_drop_manifest.ron | 9 + assets/voxygen/voxel/weapon/tool/bass.vox | 3 + assets/voxygen/voxel/weapon/tool/flute.vox | 3 + assets/voxygen/voxel/weapon/tool/harp.vox | 3 + assets/voxygen/voxel/weapon/tool/kalimba.vox | 3 + assets/voxygen/voxel/weapon/tool/lute.vox | 3 + assets/voxygen/voxel/weapon/tool/melodica.vox | 3 + assets/voxygen/voxel/weapon/tool/perc.vox | 3 + assets/voxygen/voxel/weapon/tool/sitar.vox | 3 + common/src/bin/csv_export/main.rs | 1 + common/src/comp/ability.rs | 37 +++ common/src/comp/character_state.rs | 8 + common/src/comp/inventory/item/tool.rs | 4 + common/src/states/mod.rs | 1 + common/src/states/music.rs | 133 +++++++++ common/src/states/utils.rs | 3 + common/systems/src/stats.rs | 1 + server/src/persistence/json_models.rs | 2 + voxygen/anim/src/character/alpha.rs | 256 +++++++++++++++++- voxygen/anim/src/character/equip.rs | 3 + voxygen/anim/src/character/roll.rs | 2 +- voxygen/anim/src/character/sneakequip.rs | 3 + voxygen/anim/src/character/sneakwield.rs | 32 ++- voxygen/anim/src/character/staggered.rs | 6 + voxygen/anim/src/character/stunned.rs | 7 +- voxygen/anim/src/character/wield.rs | 198 +++++++++++++- .../src/audio/sfx/event_mapper/combat/mod.rs | 7 + voxygen/src/audio/sfx/mod.rs | 3 +- voxygen/src/hud/diary.rs | 1 + voxygen/src/hud/img_ids.rs | 1 + voxygen/src/hud/util.rs | 10 + voxygen/src/scene/figure/mod.rs | 37 ++- 101 files changed, 1344 insertions(+), 23 deletions(-) create mode 100644 assets/common/abilities/music/bass.ron create mode 100644 assets/common/abilities/music/flute.ron create mode 100644 assets/common/abilities/music/harp.ron create mode 100644 assets/common/abilities/music/kalimba.ron create mode 100644 assets/common/abilities/music/lute.ron create mode 100644 assets/common/abilities/music/melodica.ron create mode 100644 assets/common/abilities/music/perc.ron create mode 100644 assets/common/abilities/music/sitar.ron create mode 100644 assets/common/items/tool/instruments/bass.ron create mode 100644 assets/common/items/tool/instruments/flute.ron create mode 100644 assets/common/items/tool/instruments/harp.ron create mode 100644 assets/common/items/tool/instruments/kalimba.ron create mode 100644 assets/common/items/tool/instruments/lute.ron create mode 100644 assets/common/items/tool/instruments/melodica.ron create mode 100644 assets/common/items/tool/instruments/perc.ron create mode 100644 assets/common/items/tool/instruments/sitar.ron create mode 100644 assets/voxygen/audio/sfx/instrument/bass/bass_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/bass/bass_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/bass/bass_c1.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/bass/bass_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/bass/bass_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/bass/bass_g.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/flute/flute_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/flute/flute_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/flute/flute_c1.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/flute/flute_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/flute/flute_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/flute/flute_g.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/harp/harp_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/harp/harp_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/harp/harp_c1.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/harp/harp_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/harp/harp_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/harp/harp_g.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/kalimba/kalimba_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c1.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/kalimba/kalimba_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/kalimba/kalimba_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/kalimba/kalimba_g.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/lute/lute_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/lute/lute_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/lute/lute_c1.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/lute/lute_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/lute/lute_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/lute/lute_g.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/melodica/melodica_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/melodica/melodica_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/melodica/melodica_c1.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/melodica/melodica_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/melodica/melodica_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/melodica/melodica_g.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/perc/perc_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/perc/perc_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/perc/perc_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/perc/perc_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/perc/perc_g.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/sitar/sitar_a.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/sitar/sitar_c.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/sitar/sitar_c1.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/sitar/sitar_d.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/sitar/sitar_e.ogg create mode 100644 assets/voxygen/audio/sfx/instrument/sitar/sitar_g.ogg create mode 100644 assets/voxygen/element/skills/music.png create mode 100644 assets/voxygen/voxel/weapon/tool/bass.vox create mode 100644 assets/voxygen/voxel/weapon/tool/flute.vox create mode 100644 assets/voxygen/voxel/weapon/tool/harp.vox create mode 100644 assets/voxygen/voxel/weapon/tool/kalimba.vox create mode 100644 assets/voxygen/voxel/weapon/tool/lute.vox create mode 100644 assets/voxygen/voxel/weapon/tool/melodica.vox create mode 100644 assets/voxygen/voxel/weapon/tool/perc.vox create mode 100644 assets/voxygen/voxel/weapon/tool/sitar.vox create mode 100644 common/src/states/music.rs diff --git a/assets/common/abilities/ability_set_manifest.ron b/assets/common/abilities/ability_set_manifest.ron index 016ace5fba..badbc909e2 100644 --- a/assets/common/abilities/ability_set_manifest.ron +++ b/assets/common/abilities/ability_set_manifest.ron @@ -422,6 +422,46 @@ secondary: "common.abilities.tool.golf_club.charged", abilities: [], ), + Custom("Bass"): ( + primary: "common.abilities.music.bass", + secondary: "common.abilities.music.bass", + abilities: [], + ), + Custom("Flute"): ( + primary: "common.abilities.music.flute", + secondary: "common.abilities.music.flute", + abilities: [], + ), + Custom("Harp"): ( + primary: "common.abilities.music.harp", + secondary: "common.abilities.music.harp", + abilities: [], + ), + Custom("Perc"): ( + primary: "common.abilities.music.perc", + secondary: "common.abilities.music.perc", + abilities: [], + ), + Custom("Kalimba"): ( + primary: "common.abilities.music.kalimba", + secondary: "common.abilities.music.kalimba", + abilities: [], + ), + Custom("Melodica"): ( + primary: "common.abilities.music.melodica", + secondary: "common.abilities.music.melodica", + abilities: [], + ), + Custom("Lute"): ( + primary: "common.abilities.music.lute", + secondary: "common.abilities.music.lute", + abilities: [], + ), + Custom("Sitar"): ( + primary: "common.abilities.music.sitar", + secondary: "common.abilities.music.sitar", + abilities: [], + ), Tool(Debug): ( primary: "common.abilities.debug.forwardboost", secondary: "common.abilities.debug.upboost", diff --git a/assets/common/abilities/music/bass.ron b/assets/common/abilities/music/bass.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/bass.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/abilities/music/flute.ron b/assets/common/abilities/music/flute.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/flute.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/abilities/music/harp.ron b/assets/common/abilities/music/harp.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/harp.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/abilities/music/kalimba.ron b/assets/common/abilities/music/kalimba.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/kalimba.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/abilities/music/lute.ron b/assets/common/abilities/music/lute.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/lute.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/abilities/music/melodica.ron b/assets/common/abilities/music/melodica.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/melodica.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/abilities/music/perc.ron b/assets/common/abilities/music/perc.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/perc.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/abilities/music/sitar.ron b/assets/common/abilities/music/sitar.ron new file mode 100644 index 0000000000..5e9fe39169 --- /dev/null +++ b/assets/common/abilities/music/sitar.ron @@ -0,0 +1,6 @@ +Music( + buildup_duration: 0.1, + play_duration: 0.1, + recover_duration: 0.1, + ori_modifier: 1.0, +) \ No newline at end of file diff --git a/assets/common/items/tool/instruments/bass.ron b/assets/common/items/tool/instruments/bass.ron new file mode 100644 index 0000000000..18559a8bd7 --- /dev/null +++ b/assets/common/items/tool/instruments/bass.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Bass", + description: "Common Bass.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Bass")), +) diff --git a/assets/common/items/tool/instruments/flute.ron b/assets/common/items/tool/instruments/flute.ron new file mode 100644 index 0000000000..477986ede5 --- /dev/null +++ b/assets/common/items/tool/instruments/flute.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Flute", + description: "Common Flute.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Flute")), +) diff --git a/assets/common/items/tool/instruments/harp.ron b/assets/common/items/tool/instruments/harp.ron new file mode 100644 index 0000000000..89e51ea5f6 --- /dev/null +++ b/assets/common/items/tool/instruments/harp.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Harp", + description: "Common Harp.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Harp")), +) diff --git a/assets/common/items/tool/instruments/kalimba.ron b/assets/common/items/tool/instruments/kalimba.ron new file mode 100644 index 0000000000..505a74a904 --- /dev/null +++ b/assets/common/items/tool/instruments/kalimba.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Kalimba", + description: "Common Kalimba.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Kalimba")), +) diff --git a/assets/common/items/tool/instruments/lute.ron b/assets/common/items/tool/instruments/lute.ron new file mode 100644 index 0000000000..24b0937794 --- /dev/null +++ b/assets/common/items/tool/instruments/lute.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Lute", + description: "Common Lute.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Lute")), +) diff --git a/assets/common/items/tool/instruments/melodica.ron b/assets/common/items/tool/instruments/melodica.ron new file mode 100644 index 0000000000..f41e2ae350 --- /dev/null +++ b/assets/common/items/tool/instruments/melodica.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Melodica", + description: "Common Melodica.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Melodica")), +) diff --git a/assets/common/items/tool/instruments/perc.ron b/assets/common/items/tool/instruments/perc.ron new file mode 100644 index 0000000000..79b3048cf9 --- /dev/null +++ b/assets/common/items/tool/instruments/perc.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Waschbrett", + description: "Waschbrett.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Perc")), +) diff --git a/assets/common/items/tool/instruments/sitar.ron b/assets/common/items/tool/instruments/sitar.ron new file mode 100644 index 0000000000..339cbfdf2f --- /dev/null +++ b/assets/common/items/tool/instruments/sitar.ron @@ -0,0 +1,21 @@ +ItemDef( + name: "Sitar", + description: "Common Sitar.", + kind: Tool(( + kind: Instrument, + hands: Two, + stats: ( + equip_time_secs: 0.4, + power: 0.0, + effect_power: 1.0, + speed: 1.0, + crit_chance: 0.0, + range: 0.0, + energy_efficiency: 1.0, + buff_strength: 1.0, + ), + )), + quality: Common, + tags: [], + ability_spec: Some(Custom("Sitar")), +) diff --git a/assets/voxygen/audio/sfx.ron b/assets/voxygen/audio/sfx.ron index d786aa3e08..4bdafca0e3 100644 --- a/assets/voxygen/audio/sfx.ron +++ b/assets/voxygen/audio/sfx.ron @@ -525,6 +525,119 @@ threshold: 0.3, ), + // + // Instruments + Wield(Instrument): ( + files: [ + "voxygen.audio.sfx.weapon.weapon_out", + ], + threshold: 0.5, + ), + Unwield(Instrument): ( + files: [ + "voxygen.audio.sfx.weapon.weapon_in", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Bass")): ( + files: [ + "voxygen.audio.sfx.instrument.bass.bass_c", + "voxygen.audio.sfx.instrument.bass.bass_g", + "voxygen.audio.sfx.instrument.bass.bass_d", + "voxygen.audio.sfx.instrument.bass.bass_a", + "voxygen.audio.sfx.instrument.bass.bass_e", + "voxygen.audio.sfx.instrument.bass.bass_c1", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Flute")): ( + files: [ + "voxygen.audio.sfx.instrument.flute.flute_c", + "voxygen.audio.sfx.instrument.flute.flute_g", + "voxygen.audio.sfx.instrument.flute.flute_d", + "voxygen.audio.sfx.instrument.flute.flute_a", + "voxygen.audio.sfx.instrument.flute.flute_e", + "voxygen.audio.sfx.instrument.flute.flute_c1", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Harp")): ( + files: [ + "voxygen.audio.sfx.instrument.harp.harp_c", + "voxygen.audio.sfx.instrument.harp.harp_g", + "voxygen.audio.sfx.instrument.harp.harp_d", + "voxygen.audio.sfx.instrument.harp.harp_a", + "voxygen.audio.sfx.instrument.harp.harp_e", + "voxygen.audio.sfx.instrument.harp.harp_c1", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Kalimba")): ( + files: [ + "voxygen.audio.sfx.instrument.kalimba.kalimba_c", + "voxygen.audio.sfx.instrument.kalimba.kalimba_g", + "voxygen.audio.sfx.instrument.kalimba.kalimba_d", + "voxygen.audio.sfx.instrument.kalimba.kalimba_a", + "voxygen.audio.sfx.instrument.kalimba.kalimba_e", + "voxygen.audio.sfx.instrument.kalimba.kalimba_c1", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Melodica")): ( + files: [ + "voxygen.audio.sfx.instrument.melodica.melodica_c", + "voxygen.audio.sfx.instrument.melodica.melodica_g", + "voxygen.audio.sfx.instrument.melodica.melodica_d", + "voxygen.audio.sfx.instrument.melodica.melodica_a", + "voxygen.audio.sfx.instrument.melodica.melodica_e", + "voxygen.audio.sfx.instrument.melodica.melodica_c1", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Lute")): ( + files: [ + "voxygen.audio.sfx.instrument.lute.lute_c", + "voxygen.audio.sfx.instrument.lute.lute_g", + "voxygen.audio.sfx.instrument.lute.lute_d", + "voxygen.audio.sfx.instrument.lute.lute_a", + "voxygen.audio.sfx.instrument.lute.lute_e", + "voxygen.audio.sfx.instrument.lute.lute_c1", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Sitar")): ( + files: [ + "voxygen.audio.sfx.instrument.sitar.sitar_c", + "voxygen.audio.sfx.instrument.sitar.sitar_g", + "voxygen.audio.sfx.instrument.sitar.sitar_d", + "voxygen.audio.sfx.instrument.sitar.sitar_a", + "voxygen.audio.sfx.instrument.sitar.sitar_e", + "voxygen.audio.sfx.instrument.sitar.sitar_c1", + ], + threshold: 0.5, + ), + Music(Instrument, Custom("Perc")): ( + files: [ + "voxygen.audio.sfx.instrument.perc.perc_c", + "voxygen.audio.sfx.instrument.perc.perc_g", + "voxygen.audio.sfx.instrument.perc.perc_d", + "voxygen.audio.sfx.instrument.perc.perc_d", + "voxygen.audio.sfx.instrument.perc.perc_d", + "voxygen.audio.sfx.instrument.perc.perc_d", + "voxygen.audio.sfx.instrument.perc.perc_d", + "voxygen.audio.sfx.instrument.perc.perc_d", + "voxygen.audio.sfx.instrument.perc.perc_d", + "voxygen.audio.sfx.instrument.perc.perc_a", + "voxygen.audio.sfx.instrument.perc.perc_e", + ], + threshold: 0.5, + ), + Inventory(CollectedTool(Instrument)): ( + files: [ + "voxygen.audio.sfx.inventory.add_item", + ], + threshold: 0.3, + ), // // Dagger // diff --git a/assets/voxygen/audio/sfx/instrument/bass/bass_a.ogg b/assets/voxygen/audio/sfx/instrument/bass/bass_a.ogg new file mode 100644 index 0000000000..1a00276cfc --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/bass/bass_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8870ca6d50eaa0dbd9f293c632c2a91fddbdac8c895a9baba8708789ef51d165 +size 22155 diff --git a/assets/voxygen/audio/sfx/instrument/bass/bass_c.ogg b/assets/voxygen/audio/sfx/instrument/bass/bass_c.ogg new file mode 100644 index 0000000000..036bd41150 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/bass/bass_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:154c78cd118081c54ef4175fae8f2b60314cfdab4c4ad486f1bcfe477a1dd1e6 +size 20740 diff --git a/assets/voxygen/audio/sfx/instrument/bass/bass_c1.ogg b/assets/voxygen/audio/sfx/instrument/bass/bass_c1.ogg new file mode 100644 index 0000000000..47c6ac79f4 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/bass/bass_c1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9e1c968dfd2dd3d99adef5dde4f0e39d5e0b3e0a92418cb927d0a46f38294c38 +size 22350 diff --git a/assets/voxygen/audio/sfx/instrument/bass/bass_d.ogg b/assets/voxygen/audio/sfx/instrument/bass/bass_d.ogg new file mode 100644 index 0000000000..fc8a3295c9 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/bass/bass_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:3de935a5d70e17b4b34726f84330e5e7f261cfefde7468a3b7c3dd12eaa98326 +size 21204 diff --git a/assets/voxygen/audio/sfx/instrument/bass/bass_e.ogg b/assets/voxygen/audio/sfx/instrument/bass/bass_e.ogg new file mode 100644 index 0000000000..ee93daf2a1 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/bass/bass_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5de09a3c16eacb17afe94f8fb2e1ec3ed8d4af3926ab6390b0433fb9d25b2846 +size 21330 diff --git a/assets/voxygen/audio/sfx/instrument/bass/bass_g.ogg b/assets/voxygen/audio/sfx/instrument/bass/bass_g.ogg new file mode 100644 index 0000000000..16ae2d6b5a --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/bass/bass_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d785aa14128a33809946cfc4284be0fd1902994ecfc7cf72291e1cce8acd9a39 +size 23063 diff --git a/assets/voxygen/audio/sfx/instrument/flute/flute_a.ogg b/assets/voxygen/audio/sfx/instrument/flute/flute_a.ogg new file mode 100644 index 0000000000..b0fc7465ff --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/flute/flute_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fcc226bddfaaf005d864d432e6f65a2be4c64da79dd0d145c43ff531339a45d5 +size 15767 diff --git a/assets/voxygen/audio/sfx/instrument/flute/flute_c.ogg b/assets/voxygen/audio/sfx/instrument/flute/flute_c.ogg new file mode 100644 index 0000000000..4b1ec1b287 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/flute/flute_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9d521f5858aba942fa8f1c9b1183cadf3735b216301cb67af923042da3bfce15 +size 15604 diff --git a/assets/voxygen/audio/sfx/instrument/flute/flute_c1.ogg b/assets/voxygen/audio/sfx/instrument/flute/flute_c1.ogg new file mode 100644 index 0000000000..d03c26d16f --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/flute/flute_c1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c9c429542f503ec3625834b15e8cac36c5de296fe5b65c2f669c755a189cb5fe +size 14930 diff --git a/assets/voxygen/audio/sfx/instrument/flute/flute_d.ogg b/assets/voxygen/audio/sfx/instrument/flute/flute_d.ogg new file mode 100644 index 0000000000..6564406c14 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/flute/flute_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6f4c04d676c06fab391e4b9a034f6ca1bc79b13ae3189cccca3966f90a5cf521 +size 15778 diff --git a/assets/voxygen/audio/sfx/instrument/flute/flute_e.ogg b/assets/voxygen/audio/sfx/instrument/flute/flute_e.ogg new file mode 100644 index 0000000000..603abd5292 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/flute/flute_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:5988ddb124a0f2b25fdb9674e00e4cce1a88cedc366043d42a8c392f022bddd6 +size 15772 diff --git a/assets/voxygen/audio/sfx/instrument/flute/flute_g.ogg b/assets/voxygen/audio/sfx/instrument/flute/flute_g.ogg new file mode 100644 index 0000000000..9b95118cb5 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/flute/flute_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:52f323b028e0a3ae5300845a868d5ce56a9148c33d966ddc5b8b3e324ee235c7 +size 15638 diff --git a/assets/voxygen/audio/sfx/instrument/harp/harp_a.ogg b/assets/voxygen/audio/sfx/instrument/harp/harp_a.ogg new file mode 100644 index 0000000000..5aa23a2c02 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/harp/harp_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a379f51a0d3ff17cf1adb56cbc5df6c98c28d08003205670b2244771f9f96807 +size 14873 diff --git a/assets/voxygen/audio/sfx/instrument/harp/harp_c.ogg b/assets/voxygen/audio/sfx/instrument/harp/harp_c.ogg new file mode 100644 index 0000000000..ab532f50b0 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/harp/harp_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ded2fbf20f677a6a61a09be04fd8d72f7b20471113049465f6f62a3e7f8a919a +size 15923 diff --git a/assets/voxygen/audio/sfx/instrument/harp/harp_c1.ogg b/assets/voxygen/audio/sfx/instrument/harp/harp_c1.ogg new file mode 100644 index 0000000000..013ce66c11 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/harp/harp_c1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bab3b95b3ec9d687cadeedba6ed066922db8ea9208a6fdd1a8518d64fab63d4a +size 15258 diff --git a/assets/voxygen/audio/sfx/instrument/harp/harp_d.ogg b/assets/voxygen/audio/sfx/instrument/harp/harp_d.ogg new file mode 100644 index 0000000000..2249f666f4 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/harp/harp_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:190438f20e4142c10ec1130f3012231ff651f492371db79e6537f6c2b8a4a8ed +size 15151 diff --git a/assets/voxygen/audio/sfx/instrument/harp/harp_e.ogg b/assets/voxygen/audio/sfx/instrument/harp/harp_e.ogg new file mode 100644 index 0000000000..9d86ca2526 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/harp/harp_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cbffd5497511fabfe427313aefbcd32c9630d75a33e42449877a460c4edeea57 +size 14997 diff --git a/assets/voxygen/audio/sfx/instrument/harp/harp_g.ogg b/assets/voxygen/audio/sfx/instrument/harp/harp_g.ogg new file mode 100644 index 0000000000..091cf1a349 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/harp/harp_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9c71b93a9a53c905bf2ff872b80b85adb3e41fa57c04c0ce89fc0b620104ee8a +size 15462 diff --git a/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_a.ogg b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_a.ogg new file mode 100644 index 0000000000..4cb871d9f8 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:92b6464999445ff3a2bca43e1ca40d5dfe2cba262b4ddb80a15d67e7e2aba55a +size 8549 diff --git a/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c.ogg b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c.ogg new file mode 100644 index 0000000000..273fc19eb5 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6cf241f3cc9ffca3cb4cf9643877a2e8688e117bf9971a3d8f76340c241945da +size 8446 diff --git a/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c1.ogg b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c1.ogg new file mode 100644 index 0000000000..34bbf94411 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_c1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:77f75452b1d8bcf173571e7037f73115192a7a83275200fdc4f5b93e2f60786e +size 8375 diff --git a/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_d.ogg b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_d.ogg new file mode 100644 index 0000000000..81cb93cdca --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:845c00cfdc23f788b500e834087394e476cbbfa1ffebfe2aa0e2d99c6c6c1a4f +size 8583 diff --git a/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_e.ogg b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_e.ogg new file mode 100644 index 0000000000..12d44b8b97 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:cb45c41ca6d2ddd88c4f2e5c3008d7f83a6d6a623b685946dce27d8cfff5fa5b +size 8595 diff --git a/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_g.ogg b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_g.ogg new file mode 100644 index 0000000000..ac950c7b7b --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/kalimba/kalimba_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:03f39ca33147ba58c70662f15b7c1a13f09eb7d385c1c25f963b15c836731ec8 +size 8315 diff --git a/assets/voxygen/audio/sfx/instrument/lute/lute_a.ogg b/assets/voxygen/audio/sfx/instrument/lute/lute_a.ogg new file mode 100644 index 0000000000..97f1b33df2 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/lute/lute_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:2d7fce0159af0ecc19b2230f55a0e789579f099ba1d84afcf682fe32beca22bf +size 13154 diff --git a/assets/voxygen/audio/sfx/instrument/lute/lute_c.ogg b/assets/voxygen/audio/sfx/instrument/lute/lute_c.ogg new file mode 100644 index 0000000000..29cb2d8cf0 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/lute/lute_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:61f47508d08c5ed7a212b6ad788086b7b915d3c4caeb2456c721f90c28b6b5ab +size 11972 diff --git a/assets/voxygen/audio/sfx/instrument/lute/lute_c1.ogg b/assets/voxygen/audio/sfx/instrument/lute/lute_c1.ogg new file mode 100644 index 0000000000..139cfd9b63 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/lute/lute_c1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a0049e761981358aaa577c0813805965dbf149bb2b583d33f2025584260f9a07 +size 12083 diff --git a/assets/voxygen/audio/sfx/instrument/lute/lute_d.ogg b/assets/voxygen/audio/sfx/instrument/lute/lute_d.ogg new file mode 100644 index 0000000000..fbfd80bc7c --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/lute/lute_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:767167900990ea13f1b5ef2bc4dadfc2b6f5ef6a0f06df620107b243b0ea8fb7 +size 11834 diff --git a/assets/voxygen/audio/sfx/instrument/lute/lute_e.ogg b/assets/voxygen/audio/sfx/instrument/lute/lute_e.ogg new file mode 100644 index 0000000000..e5c321dc1c --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/lute/lute_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a6ff7cbe618164eaadc598a748537a5afb566480806e7db643c24f291a1a475e +size 12218 diff --git a/assets/voxygen/audio/sfx/instrument/lute/lute_g.ogg b/assets/voxygen/audio/sfx/instrument/lute/lute_g.ogg new file mode 100644 index 0000000000..37bcf75dc1 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/lute/lute_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:85244f3670fe3fdb41adcb11777876c1ab0459b9f657898a3a6ce26bfbf21a96 +size 12220 diff --git a/assets/voxygen/audio/sfx/instrument/melodica/melodica_a.ogg b/assets/voxygen/audio/sfx/instrument/melodica/melodica_a.ogg new file mode 100644 index 0000000000..049a35e0d9 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/melodica/melodica_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1ad5204068be369e23f65554b8dffcf0b1a6bc8e7c8afc3985bd00c831170c2f +size 11183 diff --git a/assets/voxygen/audio/sfx/instrument/melodica/melodica_c.ogg b/assets/voxygen/audio/sfx/instrument/melodica/melodica_c.ogg new file mode 100644 index 0000000000..90ab2dc549 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/melodica/melodica_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b9468920628115a03eeae4179b4f041335bd68c3a194087294694ab9f7dc0213 +size 11185 diff --git a/assets/voxygen/audio/sfx/instrument/melodica/melodica_c1.ogg b/assets/voxygen/audio/sfx/instrument/melodica/melodica_c1.ogg new file mode 100644 index 0000000000..2aee575516 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/melodica/melodica_c1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a2c7f7c09beda4bad687357ae90f7de5024c1b3f6cf3c526683c97805cf0ad90 +size 8229 diff --git a/assets/voxygen/audio/sfx/instrument/melodica/melodica_d.ogg b/assets/voxygen/audio/sfx/instrument/melodica/melodica_d.ogg new file mode 100644 index 0000000000..afd724c83d --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/melodica/melodica_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:24cc96df160de9dd37e7518cad2203a4797e9ed2a1a17839f497437c3c7e55ab +size 8334 diff --git a/assets/voxygen/audio/sfx/instrument/melodica/melodica_e.ogg b/assets/voxygen/audio/sfx/instrument/melodica/melodica_e.ogg new file mode 100644 index 0000000000..8050934c56 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/melodica/melodica_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e3809d40e03eedc5bb5f6eaaea9d62b9e04ce9b3b3d0bfc8b81f501c2a09dc91 +size 8264 diff --git a/assets/voxygen/audio/sfx/instrument/melodica/melodica_g.ogg b/assets/voxygen/audio/sfx/instrument/melodica/melodica_g.ogg new file mode 100644 index 0000000000..df52e3db22 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/melodica/melodica_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e43749b07ce070a71efab8dcd5d6c7e3e90b2e60c96d8c8f3c50c96eccc3a0c5 +size 11186 diff --git a/assets/voxygen/audio/sfx/instrument/perc/perc_a.ogg b/assets/voxygen/audio/sfx/instrument/perc/perc_a.ogg new file mode 100644 index 0000000000..3af6ae2732 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/perc/perc_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:28fc6cf3b5f17bb02471f0cabcdeabfec196c6460b0cbfd07f961dac1cd15b78 +size 8752 diff --git a/assets/voxygen/audio/sfx/instrument/perc/perc_c.ogg b/assets/voxygen/audio/sfx/instrument/perc/perc_c.ogg new file mode 100644 index 0000000000..5fe3e724c0 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/perc/perc_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:273dfb2aed45c35734049b50eb2eb64d200cd7c8a061315d0c4a3b57d40a80be +size 11784 diff --git a/assets/voxygen/audio/sfx/instrument/perc/perc_d.ogg b/assets/voxygen/audio/sfx/instrument/perc/perc_d.ogg new file mode 100644 index 0000000000..fb1ffb1729 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/perc/perc_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c731c559a4de60715f217348cb2c1d1d5ff081cda330f4baac66b12922689c54 +size 7791 diff --git a/assets/voxygen/audio/sfx/instrument/perc/perc_e.ogg b/assets/voxygen/audio/sfx/instrument/perc/perc_e.ogg new file mode 100644 index 0000000000..7f8bd7014a --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/perc/perc_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c5d30bedafb8c82d3f239b44be09d63a6be0f060edc4a04d67c94aee56b699bd +size 8017 diff --git a/assets/voxygen/audio/sfx/instrument/perc/perc_g.ogg b/assets/voxygen/audio/sfx/instrument/perc/perc_g.ogg new file mode 100644 index 0000000000..58e1504406 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/perc/perc_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9a819881111ac16d059d876290612ad682ae944db79b62673bd93203affa5d50 +size 8147 diff --git a/assets/voxygen/audio/sfx/instrument/sitar/sitar_a.ogg b/assets/voxygen/audio/sfx/instrument/sitar/sitar_a.ogg new file mode 100644 index 0000000000..d8eeaf3d63 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/sitar/sitar_a.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:962eaeed674f3cbb0845a8cc453893bef7521adcfa978670a261e6bf568d093e +size 41171 diff --git a/assets/voxygen/audio/sfx/instrument/sitar/sitar_c.ogg b/assets/voxygen/audio/sfx/instrument/sitar/sitar_c.ogg new file mode 100644 index 0000000000..19cf91cae9 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/sitar/sitar_c.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:da6b89fbbfd0288b174708524b7a685e9a7661240fc6b8a85c76ec7675b8a2af +size 41460 diff --git a/assets/voxygen/audio/sfx/instrument/sitar/sitar_c1.ogg b/assets/voxygen/audio/sfx/instrument/sitar/sitar_c1.ogg new file mode 100644 index 0000000000..2f87646353 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/sitar/sitar_c1.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a8bd8508c386275eccf5302d16d13526b9e7f0f6fab346ae2650e1db5ec91ca6 +size 41230 diff --git a/assets/voxygen/audio/sfx/instrument/sitar/sitar_d.ogg b/assets/voxygen/audio/sfx/instrument/sitar/sitar_d.ogg new file mode 100644 index 0000000000..2a1303a86e --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/sitar/sitar_d.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9c17c27eec1f8f2ba2fd4a680936c6ea65a4202354621119212b804152fab5e +size 41189 diff --git a/assets/voxygen/audio/sfx/instrument/sitar/sitar_e.ogg b/assets/voxygen/audio/sfx/instrument/sitar/sitar_e.ogg new file mode 100644 index 0000000000..0b6e357214 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/sitar/sitar_e.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1f83fa537ef2dcc8bd573c9b1937c8136ea691fc900bbed44a2b6dd78613d73a +size 41112 diff --git a/assets/voxygen/audio/sfx/instrument/sitar/sitar_g.ogg b/assets/voxygen/audio/sfx/instrument/sitar/sitar_g.ogg new file mode 100644 index 0000000000..f32e428658 --- /dev/null +++ b/assets/voxygen/audio/sfx/instrument/sitar/sitar_g.ogg @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8a52c8a368686645f0a6340c8f5e89e5f0e6dc4e2ed7f0fe7cdb8dc55ccca0f4 +size 41054 diff --git a/assets/voxygen/element/skills/music.png b/assets/voxygen/element/skills/music.png new file mode 100644 index 0000000000..fb0b3ce63e --- /dev/null +++ b/assets/voxygen/element/skills/music.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87e0e08aca75fffa64f0a78b17f9109b247c97e843e07e27ab068e94b09e12c4 +size 8399 diff --git a/assets/voxygen/i18n/en/common.ftl b/assets/voxygen/i18n/en/common.ftl index e3151be8ae..5c21ee0927 100644 --- a/assets/voxygen/i18n/en/common.ftl +++ b/assets/voxygen/i18n/en/common.ftl @@ -75,6 +75,7 @@ common-tool-debug = Debug common-tool-farming = Farming Tool common-tool-pick = Pickaxe common-tool-mining = Mining +common-tool-instrument = Instrument common-kind-modular_component = Modular Component common-kind-modular_component_partial = Component common-kind-glider = Glider diff --git a/assets/voxygen/item_image_manifest.ron b/assets/voxygen/item_image_manifest.ron index 19c8d54197..7dd0e4a4c0 100644 --- a/assets/voxygen/item_image_manifest.ron +++ b/assets/voxygen/item_image_manifest.ron @@ -1618,6 +1618,38 @@ "voxel.weapon.tool.shovel_gold", (0.0, 0.0, 0.0), (-135.0, 90.0, 0.0), 1.2, ), + Simple("common.items.tool.instruments.harp"): VoxTrans( + "voxel.weapon.tool.harp", + (0.0, 0.0, 0.0), (-135.0, 90.0, 0.0), 1.0, + ), + Simple("common.items.tool.instruments.flute"): VoxTrans( + "voxel.weapon.tool.flute", + (0.0, 0.0, 0.0), (-135.0, 90.0, 0.0), 1.0, + ), + Simple("common.items.tool.instruments.bass"): VoxTrans( + "voxel.weapon.tool.bass", + (0.0, 0.0, 0.0), (45.0, 90.0, 0.0), 1.4, + ), + Simple("common.items.tool.instruments.perc"): VoxTrans( + "voxel.weapon.tool.perc", + (0.0, 0.0, 0.0), (-135.0, 90.0, 0.0), 0.8, + ), + Simple("common.items.tool.instruments.kalimba"): VoxTrans( + "voxel.weapon.tool.kalimba", + (0.0, 0.0, 0.0), (-135.0, 90.0, 0.0), 0.8, + ), + Simple("common.items.tool.instruments.melodica"): VoxTrans( + "voxel.weapon.tool.melodica", + (0.0, 0.0, 0.0), (45.0, 90.0, 0.0), 0.9, + ), + Simple("common.items.tool.instruments.lute"): VoxTrans( + "voxel.weapon.tool.lute", + (0.0, 0.0, 0.0), (45.0, 90.0, 0.0), 1.0, + ), + Simple("common.items.tool.instruments.sitar"): VoxTrans( + "voxel.weapon.tool.sitar", + (0.0, 0.0, 0.0), (45.0, 90.0, 0.0), 1.2, + ), // Picks Simple("common.items.tool.pickaxe_stone"): VoxTrans( "voxel.weapon.tool.pickaxe_green-0", diff --git a/assets/voxygen/voxel/biped_weapon_manifest.ron b/assets/voxygen/voxel/biped_weapon_manifest.ron index a06dc48981..3cea116ceb 100644 --- a/assets/voxygen/voxel/biped_weapon_manifest.ron +++ b/assets/voxygen/voxel/biped_weapon_manifest.ron @@ -1120,6 +1120,38 @@ vox_spec: ("weapon.tool.shovel_gold", (-1.0, -2.5, -4.0)), color: None ), + Tool("common.items.tool.instruments.harp"): ( + vox_spec: ("weapon.tool.harp", (-3.5, -7.0, 6.0)), + color: None + ), + Tool("common.items.tool.instruments.flute"): ( + vox_spec: ("weapon.tool.flute", (-4.5, -4.5, 8.0)), + color: None + ), + Tool("common.items.tool.instruments.bass"): ( + vox_spec: ("weapon.tool.bass", (-3.5, -6.0, 0.0)), + color: None + ), + Tool("common.items.tool.instruments.perc"): ( + vox_spec: ("weapon.tool.perc", (-3.0, -6.0, 9.0)), + color: None + ), + Tool("common.items.tool.instruments.kalimba"): ( + vox_spec: ("weapon.tool.kalimba", (-3.5, -7.0, 6.0)), + color: None + ), + Tool("common.items.tool.instruments.melodica"): ( + vox_spec: ("weapon.tool.melodica", (-3.5, -4.5, 8.0)), + color: None + ), + Tool("common.items.tool.instruments.lute"): ( + vox_spec: ("weapon.tool.lute", (-2.5, -6.0, 4.0)), + color: None + ), + Tool("common.items.tool.instruments.sitar"): ( + vox_spec: ("weapon.tool.sitar", (-4.0, -6.0, 5.0)), + color: None + ), // Staves Modular(("common.items.modular.weapon.primary.staff.brand", "common.items.log.wood", Two)): ( vox_spec: ("weapon.staff.brand.wood", (-1.0, -2.5, -4.0)), diff --git a/assets/voxygen/voxel/item_drop_manifest.ron b/assets/voxygen/voxel/item_drop_manifest.ron index ff916912ba..fae1eb514d 100644 --- a/assets/voxygen/voxel/item_drop_manifest.ron +++ b/assets/voxygen/voxel/item_drop_manifest.ron @@ -397,6 +397,15 @@ // Picks Simple("common.items.tool.pickaxe_stone"): "voxel.weapon.tool.pickaxe_green-0", Simple("common.items.tool.pickaxe_steel"): "voxel.weapon.tool.pickaxe_green-1", + // Instruments + Simple("common.items.tool.instruments.bass"): "voxel.weapon.tool.bass", + Simple("common.items.tool.instruments.flute"): "voxel.weapon.tool.flute", + Simple("common.items.tool.instruments.harp"): "voxel.weapon.tool.harp", + Simple("common.items.tool.instruments.perc"): "voxel.weapon.tool.perc", + Simple("common.items.tool.instruments.kalimba"): "voxel.weapon.tool.kalimba", + Simple("common.items.tool.instruments.melodica"): "voxel.weapon.tool.melodica", + Simple("common.items.tool.instruments.lute"): "voxel.weapon.tool.lute", + Simple("common.items.tool.instruments.sitar"): "voxel.weapon.tool.sitar", // Other Simple("common.items.utility.coins"): "voxel.object.v-coin", Simple("common.items.utility.collar"): "voxel.object.collar", diff --git a/assets/voxygen/voxel/weapon/tool/bass.vox b/assets/voxygen/voxel/weapon/tool/bass.vox new file mode 100644 index 0000000000..15ca2fba7f --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/bass.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a810ac89e4fc98481f310e9082a75d4b1c09ac2d91167b34c19dca10b5871068 +size 2432 diff --git a/assets/voxygen/voxel/weapon/tool/flute.vox b/assets/voxygen/voxel/weapon/tool/flute.vox new file mode 100644 index 0000000000..d2c38d5dd6 --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/flute.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:000d2af2baa0c4c126b7bd678afb9500d9cf87b19045b63805bd40923e41b1b6 +size 1296 diff --git a/assets/voxygen/voxel/weapon/tool/harp.vox b/assets/voxygen/voxel/weapon/tool/harp.vox new file mode 100644 index 0000000000..160d87a307 --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/harp.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f265ae693ac68c7055849c091763e359d6ee286957ffd46264ceb1094551a399 +size 1464 diff --git a/assets/voxygen/voxel/weapon/tool/kalimba.vox b/assets/voxygen/voxel/weapon/tool/kalimba.vox new file mode 100644 index 0000000000..2673dd9e66 --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/kalimba.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:bef938960cd1af6a5953f02b700eb404af5e45e1634aacb4116fce93d76d8ddc +size 2068 diff --git a/assets/voxygen/voxel/weapon/tool/lute.vox b/assets/voxygen/voxel/weapon/tool/lute.vox new file mode 100644 index 0000000000..373899aa21 --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/lute.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:19ad242a3cd402407d6f5f4588ec5e2f20ccafdab03a1c4fbe56f83af4ed1375 +size 1428 diff --git a/assets/voxygen/voxel/weapon/tool/melodica.vox b/assets/voxygen/voxel/weapon/tool/melodica.vox new file mode 100644 index 0000000000..2e19f5c863 --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/melodica.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f8157ee1dcc54068203bca210ab47da9ecef6e2569525ff7d4968056fbb19a1c +size 1444 diff --git a/assets/voxygen/voxel/weapon/tool/perc.vox b/assets/voxygen/voxel/weapon/tool/perc.vox new file mode 100644 index 0000000000..a478cdbc02 --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/perc.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f1b869109fb6714e9c6f7d8732cd7ad7c5318f4780ff97d8aabcf83998c8dcc2 +size 1364 diff --git a/assets/voxygen/voxel/weapon/tool/sitar.vox b/assets/voxygen/voxel/weapon/tool/sitar.vox new file mode 100644 index 0000000000..eaaf8cba84 --- /dev/null +++ b/assets/voxygen/voxel/weapon/tool/sitar.vox @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8d66f0188b78934f6785ce71cce5067443c7813521609fa50b8bbc68d8d1fdc0 +size 1700 diff --git a/common/src/bin/csv_export/main.rs b/common/src/bin/csv_export/main.rs index b67d00b93b..2626591486 100644 --- a/common/src/bin/csv_export/main.rs +++ b/common/src/bin/csv_export/main.rs @@ -174,6 +174,7 @@ fn get_tool_kind(kind: &ToolKind) -> String { ToolKind::Debug => "Debug".to_string(), ToolKind::Farming => "Farming".to_string(), ToolKind::Pick => "Pick".to_string(), + ToolKind::Instrument => "Instrument".to_string(), ToolKind::Natural => "Natural".to_string(), ToolKind::Organ => "Organ".to_string(), ToolKind::Empty => "Empty".to_string(), diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 2729790117..652c273a6a 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -359,6 +359,7 @@ pub enum CharacterAbilityType { ComboMelee(StageSection, u32), LeapMelee(StageSection), SpinMelee(StageSection), + Music(StageSection), Shockwave, BasicBeam, RepeaterRanged, @@ -385,6 +386,7 @@ impl From<&CharacterState> for CharacterAbilityType { CharacterState::RepeaterRanged(_) => Self::RepeaterRanged, CharacterState::BasicAura(_) => Self::BasicAura, CharacterState::SelfBuff(_) => Self::SelfBuff, + CharacterState::Music(data) => Self::Music(data.stage_section), CharacterState::Idle(_) | CharacterState::Climb(_) | CharacterState::Sit @@ -611,6 +613,12 @@ pub enum CharacterAbility { summon_distance: (f32, f32), sparseness: f64, }, + Music { + buildup_duration: f32, + play_duration: f32, + recover_duration: f32, + ori_modifier: f32, + }, } impl Default for CharacterAbility { @@ -684,6 +692,7 @@ impl CharacterAbility { | CharacterAbility::Boost { .. } | CharacterAbility::BasicBeam { .. } | CharacterAbility::Blink { .. } + | CharacterAbility::Music { .. } | CharacterAbility::BasicSummon { .. } | CharacterAbility::SpriteSummon { .. } => true, } @@ -1063,6 +1072,16 @@ impl CharacterAbility { *inner_dist *= stats.range; *outer_dist *= stats.range; }, + Music { + ref mut buildup_duration, + ref mut play_duration, + ref mut recover_duration, + ori_modifier: _, + } => { + *buildup_duration /= stats.speed; + *play_duration /= stats.speed; + *recover_duration /= stats.speed; + }, } self } @@ -1093,6 +1112,7 @@ impl CharacterAbility { Boost { .. } | ComboMelee { .. } | Blink { .. } + | Music { .. } | BasicSummon { .. } | SpriteSummon { .. } => 0.0, } @@ -2207,6 +2227,23 @@ impl From<(&CharacterAbility, AbilityInfo, &JoinData<'_>)> for CharacterState { stage_section: StageSection::Buildup, achieved_radius: summon_distance.0.floor() as i32 - 1, }), + CharacterAbility::Music { + buildup_duration, + play_duration, + recover_duration, + ori_modifier, + } => CharacterState::Music(music::Data { + static_data: music::StaticData { + buildup_duration: Duration::from_secs_f32(*buildup_duration), + play_duration: Duration::from_secs_f32(*play_duration), + recover_duration: Duration::from_secs_f32(*recover_duration), + ori_modifier: *ori_modifier, + ability_info, + }, + timer: Duration::default(), + stage_section: StageSection::Buildup, + exhausted: false, + }), } } } diff --git a/common/src/comp/character_state.rs b/common/src/comp/character_state.rs index 3d72938933..845af42ae2 100644 --- a/common/src/comp/character_state.rs +++ b/common/src/comp/character_state.rs @@ -125,6 +125,8 @@ pub enum CharacterState { Wallrun(wallrun::Data), /// Ice skating or skiing Skate(skate::Data), + /// Play music instrument + Music(music::Data), } impl CharacterState { @@ -147,6 +149,7 @@ impl CharacterState { | CharacterState::BasicAura(_) | CharacterState::SelfBuff(_) | CharacterState::Blink(_) + | CharacterState::Music(_) | CharacterState::BasicSummon(_) | CharacterState::SpriteSummon(_) | CharacterState::Roll(roll::Data { @@ -240,6 +243,8 @@ impl CharacterState { pub fn is_skate(&self) -> bool { matches!(self, CharacterState::Skate(_)) } + pub fn is_music(&self) -> bool { matches!(self, CharacterState::Music(_)) } + pub fn is_melee_dodge(&self) -> bool { matches!(self, CharacterState::Roll(d) if d.static_data.immune_melee) } @@ -278,6 +283,7 @@ impl CharacterState { | CharacterState::SpriteSummon(_) | CharacterState::UseItem(_) | CharacterState::SpriteInteract(_) + | CharacterState::Music(_) ) } @@ -339,6 +345,7 @@ impl CharacterState { CharacterState::UseItem(data) => data.behavior(j, output_events), CharacterState::SpriteInteract(data) => data.behavior(j, output_events), CharacterState::Skate(data) => data.behavior(j, output_events), + CharacterState::Music(data) => data.behavior(j, output_events), } } @@ -386,6 +393,7 @@ impl CharacterState { CharacterState::UseItem(data) => data.handle_event(j, output_events, action), CharacterState::SpriteInteract(data) => data.handle_event(j, output_events, action), CharacterState::Skate(data) => data.handle_event(j, output_events, action), + CharacterState::Music(data) => data.handle_event(j, output_events, action), } } diff --git a/common/src/comp/inventory/item/tool.rs b/common/src/comp/inventory/item/tool.rs index 43b7b54fbc..7f7414fb88 100644 --- a/common/src/comp/inventory/item/tool.rs +++ b/common/src/comp/inventory/item/tool.rs @@ -36,6 +36,9 @@ pub enum ToolKind { Natural, Organ, /// This is an placeholder item, it is used by non-humanoid npcs to attack + /// Music Instruments + Instrument, + /// This is an placeholder item, it is used by non-humanoid npcs to attack Empty, } @@ -57,6 +60,7 @@ impl ToolKind { ToolKind::Farming => "farming", ToolKind::Pick => "pickaxe", ToolKind::Organ => "organ", + ToolKind::Instrument => "instrument", ToolKind::Empty => "empty", } } diff --git a/common/src/states/mod.rs b/common/src/states/mod.rs index 50920d6b11..295f28ac97 100644 --- a/common/src/states/mod.rs +++ b/common/src/states/mod.rs @@ -18,6 +18,7 @@ pub mod glide; pub mod glide_wield; pub mod idle; pub mod leap_melee; +pub mod music; pub mod repeater_ranged; pub mod roll; pub mod self_buff; diff --git a/common/src/states/music.rs b/common/src/states/music.rs new file mode 100644 index 0000000000..691bca061b --- /dev/null +++ b/common/src/states/music.rs @@ -0,0 +1,133 @@ +use crate::{ + comp::{character_state::OutputEvents, CharacterState, Melee, StateUpdate}, + states::{ + behavior::{CharacterBehavior, JoinData}, + utils::*, + wielding, + }, +}; +use serde::{Deserialize, Serialize}; +use std::time::Duration; + +/// Separated out to condense update portions of character state +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct StaticData { + /// How long until state should make sound + pub buildup_duration: Duration, + /// How long the state is playing for + pub play_duration: Duration, + /// How long the state has until exiting + pub recover_duration: Duration, + /// Adjusts turning rate during the attack + pub ori_modifier: f32, + /// What key is used to press ability + pub ability_info: AbilityInfo, +} + +#[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize)] +pub struct Data { + /// Struct containing data that does not change over the course of the + /// character state + pub static_data: StaticData, + /// Timer for each stage + pub timer: Duration, + /// What section the character stage is in + pub stage_section: StageSection, + /// Whether the attack can deal more damage + pub exhausted: bool, +} + +impl CharacterBehavior for Data { + fn behavior(&self, data: &JoinData, output_events: &mut OutputEvents) -> StateUpdate { + let mut update = StateUpdate::from(data); + + handle_orientation(data, &mut update, self.static_data.ori_modifier, None); + handle_move(data, &mut update, 0.7); + handle_jump(data, output_events, &mut update, 1.0); + + match self.stage_section { + StageSection::Buildup => { + if self.timer < self.static_data.buildup_duration { + // Build up + update.character = CharacterState::Music(Data { + timer: tick_attack_or_default(data, self.timer, None), + ..*self + }); + } else { + // Transitions to play section of stage + update.character = CharacterState::Music(Data { + timer: Duration::default(), + stage_section: StageSection::Action, + ..*self + }); + } + }, + StageSection::Action => { + if !self.exhausted { + update.character = CharacterState::Music(Data { + timer: Duration::default(), + exhausted: true, + ..*self + }); + } else if self.timer < self.static_data.play_duration { + // Play + update.character = CharacterState::Music(Data { + timer: tick_attack_or_default(data, self.timer, None), + ..*self + }); + } else { + // Transitions to recover section of stage + update.character = CharacterState::Music(Data { + timer: Duration::default(), + stage_section: StageSection::Recover, + ..*self + }); + } + }, + StageSection::Recover => { + if self.timer < self.static_data.recover_duration { + // Recovery + update.character = CharacterState::Music(Data { + timer: tick_attack_or_default(data, self.timer, None), + ..*self + }); + } else { + // Done + if input_is_pressed(data, self.static_data.ability_info.input) { + reset_state(self, data, output_events, &mut update); + } else { + update.character = + CharacterState::Wielding(wielding::Data { is_sneaking: false }); + } + } + }, + _ => { + // If it somehow ends up in an incorrect stage section + update.character = CharacterState::Wielding(wielding::Data { is_sneaking: false }); + // Make sure attack component is removed + data.updater.remove::(data.entity); + }, + } + + // At end of state logic so an interrupt isn't overwritten + if !input_is_pressed(data, self.static_data.ability_info.input) { + handle_state_interrupt(data, &mut update, false); + } + + update + } +} + +fn reset_state( + data: &Data, + join: &JoinData, + output_events: &mut OutputEvents, + update: &mut StateUpdate, +) { + handle_input( + join, + output_events, + update, + data.static_data.ability_info.input, + ); +} diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 0d18f761ed..bae3791364 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -1050,6 +1050,9 @@ pub fn is_strafing(data: &JoinData<'_>, update: &StateUpdate) -> bool { // TODO: Don't always check `character.is_aimed()`, allow the frontend to // control whether the player strafes during an aimed `CharacterState`. (update.character.is_aimed() || update.should_strafe) && data.body.can_strafe() + // no strafe with music instruments equipped in ActiveMainhand + && !matches!(unwrap_tool_data(data, EquipSlot::ActiveMainhand), + Some((ToolKind::Instrument, _))) } /// Returns tool and components diff --git a/common/systems/src/stats.rs b/common/systems/src/stats.rs index 1fb6761f51..34c6da3148 100644 --- a/common/systems/src/stats.rs +++ b/common/systems/src/stats.rs @@ -185,6 +185,7 @@ impl<'a> System<'a> for Sys { | CharacterState::SpinMelee { .. } | CharacterState::ComboMelee { .. } | CharacterState::BasicRanged { .. } + | CharacterState::Music { .. } | CharacterState::ChargedMelee { .. } | CharacterState::ChargedRanged { .. } | CharacterState::RepeaterRanged { .. } diff --git a/server/src/persistence/json_models.rs b/server/src/persistence/json_models.rs index 2e5dfecb9b..1d5e1eedb9 100644 --- a/server/src/persistence/json_models.rs +++ b/server/src/persistence/json_models.rs @@ -84,6 +84,7 @@ pub fn skill_group_to_db_string(skill_group: comp::skillset::SkillGroupKind) -> | Weapon(ToolKind::Blowgun) | Weapon(ToolKind::Debug) | Weapon(ToolKind::Farming) + | Weapon(ToolKind::Instrument) | Weapon(ToolKind::Empty) | Weapon(ToolKind::Natural) | Weapon(ToolKind::Organ) => panic!( @@ -205,6 +206,7 @@ fn tool_kind_to_string(tool: Option) -> String { Some(Farming) => "Farming", Some(Debug) => "Debug", Some(Natural) => "Natural", + Some(Instrument) => "Instrument", Some(Organ) => "Organ", Some(Empty) => "Empty", None => "None", diff --git a/voxygen/anim/src/character/alpha.rs b/voxygen/anim/src/character/alpha.rs index 878b386048..bfaafcde68 100644 --- a/voxygen/anim/src/character/alpha.rs +++ b/voxygen/anim/src/character/alpha.rs @@ -3,20 +3,20 @@ use super::{ CharacterSkeleton, SkeletonAttr, }; use common::{ - comp::item::{Hands, ToolKind}, + comp::item::{AbilitySpec, Hands, ToolKind}, states::utils::{AbilityInfo, StageSection}, }; use core::f32::consts::PI; pub struct AlphaAnimation; -type AlphaAnimationDependency = ( +type AlphaAnimationDependency<'a> = ( (Option, Option), Option, - Option, + (Option, Option<&'a AbilitySpec>), ); impl Animation for AlphaAnimation { - type Dependency<'a> = AlphaAnimationDependency; + type Dependency<'a> = AlphaAnimationDependency<'a>; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -25,7 +25,7 @@ impl Animation for AlphaAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_alpha")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - (hands, stage_section, ability_info): Self::Dependency<'a>, + (hands, stage_section, (ability_info, active_tool_spec)): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -78,6 +78,53 @@ impl Animation for AlphaAnimation { * Quaternion::rotation_z(0.0 + move1 * 1.5 + move2 * -2.5); next.head.orientation = Quaternion::rotation_z(0.0 + move1 * -1.5 + move2 * 2.5); }, + // TODO: create Instrument SubToolKinds to distinguish instruments + Some(ToolKind::Instrument) => { + if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { + match spec.as_str() { + "Flute" => { + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.head.position = + Vec3::new(move2 * 0.1, s_a.head.0 + move2 * 0.2, s_a.head.1); + next.chest.orientation = Quaternion::rotation_x( + 0.0 + move1 * 0.2 + move2 * -0.2 + move3 * 0.1, + ) * Quaternion::rotation_y( + 0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0, + ) * Quaternion::rotation_z( + 0.0 + move1 * 0.1 + move2 * -0.1 + move3 * 0.1, + ); + next.head.orientation = Quaternion::rotation_z( + 0.0 + move1 * -0.1 + move2 * 0.1 + move3 * -0.2, + ); + }, + _ => { + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.head.position = + Vec3::new(move2 * 1.0, s_a.head.0 + move2 * 1.0, s_a.head.1); + next.chest.orientation = Quaternion::rotation_x( + 0.0 + move1 * 0.2 + move2 * -0.2 + move3 * 0.1, + ) * Quaternion::rotation_y( + 0.0 + move1 * 0.0 + move2 * 0.0 + move3 * 0.0, + ) * Quaternion::rotation_z( + 0.0 + move1 * 0.3 + move2 * -0.3 + move3 * 0.2, + ); + next.head.orientation = Quaternion::rotation_z( + 0.0 + move1 * -0.1 + move2 * 0.1 + move3 * -0.2, + ); + }, + } + } + }, Some(ToolKind::Hammer) | Some(ToolKind::Pick) => { let (move1, move2, move3) = match stage_section { @@ -156,6 +203,205 @@ impl Animation for AlphaAnimation { s_a.ac.5 + move1 * -2.0 + move2 * -1.0 + move3 * 2.5, ) }, + Some(ToolKind::Instrument) => { + if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { + match spec.as_str() { + "Bass" => { + next.hand_r.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2); + next.hand_l.orientation = Quaternion::rotation_x(2.0) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.40); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = Quaternion::rotation_x(1.0) + * Quaternion::rotation_y(0.75) + * Quaternion::rotation_z(-0.40); + next.main.position = Vec3::new(-4.0, 6.0, 14.0); + next.main.orientation = Quaternion::rotation_x(0.1) + * Quaternion::rotation_y(3.0) + * Quaternion::rotation_z(PI / -3.0); + + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.hand_r.position = Vec3::new( + s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0, + ); + next.hand_l.position = Vec3::new( + s_a.ahl.0 + move1 * -5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahl.1 + move1 * 6.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahl.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0, + ); + }, + "Lute" => { + next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2); + next.hand_l.orientation = Quaternion::rotation_x(2.0) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.40); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = Quaternion::rotation_x(1.0) + * Quaternion::rotation_y(0.75) + * Quaternion::rotation_z(-0.40); + next.main.position = Vec3::new(-14.0, 6.0, 4.0); + next.main.orientation = Quaternion::rotation_x(0.1) + * Quaternion::rotation_y(2.0) + * Quaternion::rotation_z(PI / -3.0); + + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.hand_r.position = Vec3::new( + s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0, + ); + next.hand_l.position = Vec3::new( + s_a.ahl.0 + move1 * -5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahl.1 + move1 * 6.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahl.2 + move1 * -6.0 + move2 * 0.0 + move3 * 0.0, + ); + }, + "Sitar" => { + next.hand_l.position = Vec3::new(s_a.ahl.0, s_a.ahl.1, s_a.ahl.2); + next.hand_l.orientation = Quaternion::rotation_x(2.0) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.40); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = Quaternion::rotation_x(1.0) + * Quaternion::rotation_y(0.75) + * Quaternion::rotation_z(-0.40); + next.main.position = Vec3::new(-14.0, 6.0, 4.0); + next.main.orientation = Quaternion::rotation_x(0.1) + * Quaternion::rotation_y(2.0) + * Quaternion::rotation_z(PI / -3.0); + + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.hand_r.position = Vec3::new( + s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0, + ); + next.hand_l.position = Vec3::new( + s_a.ahl.0 + move1 * -5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahl.1 + move1 * 6.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahl.2 + move1 * -6.0 + move2 * 0.0 + move3 * 0.0, + ); + }, + "Flute" => { + next.hand_l.position = Vec3::new(-4.0, 6.0, 4.5); + next.hand_l.orientation = Quaternion::rotation_x(2.0) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.40); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = Quaternion::rotation_x(1.0) + * Quaternion::rotation_y(0.75) + * Quaternion::rotation_z(-0.40); + next.main.position = Vec3::new(-2.5, 10.0, -12.0); + next.main.orientation = Quaternion::rotation_x(3.5) + * Quaternion::rotation_y(PI) + * Quaternion::rotation_z(0.05); + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.hand_r.position = Vec3::new( + s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0, + ); + }, + "Kalimba" => { + next.hand_l.position = Vec3::new(-4.0, 6.0, 2.0); + next.hand_l.orientation = Quaternion::rotation_x(1.00) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.20); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = Quaternion::rotation_x(1.75) + * Quaternion::rotation_y(0.75) + * Quaternion::rotation_z(-0.40); + next.main.position = Vec3::new(8.0, 12.0, -6.0); + next.main.orientation = Quaternion::rotation_x(0.2) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(PI - 0.2); + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.hand_r.position = Vec3::new( + s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.2 + move1 * 3.0 + move2 * 0.0 + move3 * 0.0, + ); + }, + "Melodica" => { + next.hand_l.position = Vec3::new(-3.0, 6.0, 3.5); + next.hand_l.orientation = Quaternion::rotation_x(2.0) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.40); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = Quaternion::rotation_x(1.0) + * Quaternion::rotation_y(0.75) + * Quaternion::rotation_z(-0.40); + next.main.position = Vec3::new(-1.0, 2.0, 15.0); + next.main.orientation = Quaternion::rotation_x(0.3) + * Quaternion::rotation_y(PI) + * Quaternion::rotation_z(PI / -2.0); + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.hand_r.position = Vec3::new( + s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.2 + move1 * 1.0 + move2 * 0.0 + move3 * 0.0, + ); + }, + _ => { + next.hand_l.position = Vec3::new(-4.0, 6.0, 2.0); + next.hand_l.orientation = Quaternion::rotation_x(1.00) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.20); + next.hand_r.position = Vec3::new(s_a.ahr.0, s_a.ahr.1, s_a.ahr.2); + next.hand_r.orientation = Quaternion::rotation_x(1.75) + * Quaternion::rotation_y(0.75) + * Quaternion::rotation_z(-0.40); + next.main.position = Vec3::new(8.0, 14.0, -6.0); + next.main.orientation = Quaternion::rotation_x(0.2) + * Quaternion::rotation_y(-0.75) + * Quaternion::rotation_z(0.20); + let (move1, move2, move3) = match stage_section { + Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), + Some(StageSection::Action) => (1.0, anim_time, 0.0), + Some(StageSection::Recover) => (1.0, 1.0, anim_time.powi(4)), + _ => (0.0, 0.0, 0.0), + }; + next.hand_r.position = Vec3::new( + s_a.ahr.0 + move1 * 5.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.1 + move1 * 8.0 + move2 * 0.0 + move3 * 0.0, + s_a.ahr.2 + move1 * 3.0 + move2 * 0.0 + move3 * 0.0, + ); + }, + } + } + }, Some(ToolKind::Hammer) | Some(ToolKind::Pick) => { let (move1, move2, move3) = match stage_section { Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, 0.0), diff --git a/voxygen/anim/src/character/equip.rs b/voxygen/anim/src/character/equip.rs index 509a0502f3..f89e3c6db0 100644 --- a/voxygen/anim/src/character/equip.rs +++ b/voxygen/anim/src/character/equip.rs @@ -51,6 +51,9 @@ impl Animation for EquipAnimation { next.hand_l.position = Vec3::new(-3.0, -5.0, 9.0); next.hand_r.position = Vec3::new(-1.75, -4.5, 7.0); }, + Some(ToolKind::Instrument) => { + next.hand_l.position = Vec3::new(-5.0, -5.0, 8.0); + }, _ => {}, } diff --git a/voxygen/anim/src/character/roll.rs b/voxygen/anim/src/character/roll.rs index ff0846a6f6..861da18c2c 100644 --- a/voxygen/anim/src/character/roll.rs +++ b/voxygen/anim/src/character/roll.rs @@ -103,7 +103,7 @@ impl Animation for RollAnimation { * Quaternion::rotation_y(s_a.ac.4) * Quaternion::rotation_z(s_a.ac.5); }, - Some(ToolKind::Hammer | ToolKind::Pick) => { + Some(ToolKind::Hammer | ToolKind::Pick | ToolKind::Instrument) => { next.hand_l.position = Vec3::new(s_a.hhl.0, s_a.hhl.1, s_a.hhl.2); next.hand_l.orientation = Quaternion::rotation_x(s_a.hhl.3) * Quaternion::rotation_y(s_a.hhl.4) diff --git a/voxygen/anim/src/character/sneakequip.rs b/voxygen/anim/src/character/sneakequip.rs index 83db768bb1..e5558e384c 100644 --- a/voxygen/anim/src/character/sneakequip.rs +++ b/voxygen/anim/src/character/sneakequip.rs @@ -191,6 +191,9 @@ impl Animation for SneakEquipAnimation { next.hand_l.position = Vec3::new(-3.0, -5.0, 9.0); next.hand_r.position = Vec3::new(-1.75, -4.5, 7.0); }, + Some(ToolKind::Instrument) => { + next.hand_l.position = Vec3::new(-3.0, -5.0, 10.0); + }, _ => {}, } next diff --git a/voxygen/anim/src/character/sneakwield.rs b/voxygen/anim/src/character/sneakwield.rs index 722ed2d1ba..1a07f7a93d 100644 --- a/voxygen/anim/src/character/sneakwield.rs +++ b/voxygen/anim/src/character/sneakwield.rs @@ -2,14 +2,14 @@ use super::{ super::{vek::*, Animation}, CharacterSkeleton, SkeletonAttr, }; -use common::comp::item::{Hands, ToolKind}; +use common::comp::item::{AbilitySpec, Hands, ToolKind}; use core::{f32::consts::PI, ops::Mul}; pub struct SneakWieldAnimation; impl Animation for SneakWieldAnimation { type Dependency<'a> = ( - Option, + (Option, Option<&'a AbilitySpec>), Option, (Option, Option), Vec3, @@ -25,9 +25,15 @@ impl Animation for SneakWieldAnimation { #[cfg_attr(feature = "be-dyn-lib", export_name = "character_sneakwield")] fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, - ( active_tool_kind, + ( + (active_tool_kind, active_tool_spec), second_tool_kind, - hands, velocity, orientation, last_ori, global_time): Self::Dependency<'a>, + hands, + velocity, + orientation, + last_ori, + global_time, + ): Self::Dependency<'a>, anim_time: f32, rate: &mut f32, s_a: &SkeletonAttr, @@ -283,6 +289,24 @@ impl Animation for SneakWieldAnimation { * Quaternion::rotation_y(s_a.bc.4) * Quaternion::rotation_z(s_a.bc.5); }, + Some(ToolKind::Instrument) => { + if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { + match spec.as_str() { + "Perc" => { + next.hand_l.position = Vec3::new(-7.0, 0.0, 3.0); + next.hand_l.orientation = Quaternion::rotation_x(1.27); + next.main.position = Vec3::new(-5.0, -4.5, -5.0); + next.main.orientation = Quaternion::rotation_x(5.5); + }, + _ => { + next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0); + next.hand_l.orientation = Quaternion::rotation_x(1.27); + next.main.position = Vec3::new(-5.0, 5.0, 23.0); + next.main.orientation = Quaternion::rotation_x(PI); + }, + } + } + }, Some(ToolKind::Debug) => { next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0); next.hand_l.orientation = Quaternion::rotation_x(1.27); diff --git a/voxygen/anim/src/character/staggered.rs b/voxygen/anim/src/character/staggered.rs index 3389e12f73..f4a4b7309f 100644 --- a/voxygen/anim/src/character/staggered.rs +++ b/voxygen/anim/src/character/staggered.rs @@ -162,6 +162,12 @@ impl Animation for StaggeredAnimation { next.control.position = Vec3::new(-11.0, 1.8, 4.0); }, + Some(ToolKind::Instrument) => { + next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0); + next.hand_l.orientation = Quaternion::rotation_x(1.27); + next.main.position = Vec3::new(-5.0, 5.0, 23.0); + next.main.orientation = Quaternion::rotation_x(PI); + }, _ => {}, } }, diff --git a/voxygen/anim/src/character/stunned.rs b/voxygen/anim/src/character/stunned.rs index 9edde52b15..4b11b8068f 100644 --- a/voxygen/anim/src/character/stunned.rs +++ b/voxygen/anim/src/character/stunned.rs @@ -155,9 +155,14 @@ impl Animation for StunnedAnimation { next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); next.main.position = Vec3::new(7.5, 7.5, 13.2); next.main.orientation = Quaternion::rotation_y(PI); - next.control.position = Vec3::new(-11.0, 1.8, 4.0); }, + Some(ToolKind::Instrument) => { + next.hand_l.position = Vec3::new(-7.0, 4.0, 3.0); + next.hand_l.orientation = Quaternion::rotation_x(1.27); + next.main.position = Vec3::new(-5.0, 5.0, 23.0); + next.main.orientation = Quaternion::rotation_x(PI); + }, _ => {}, }, (_, _) => {}, diff --git a/voxygen/anim/src/character/wield.rs b/voxygen/anim/src/character/wield.rs index 1bccde31b6..2e759ad6f3 100644 --- a/voxygen/anim/src/character/wield.rs +++ b/voxygen/anim/src/character/wield.rs @@ -3,15 +3,15 @@ use super::{ CharacterSkeleton, SkeletonAttr, }; use common::{ - comp::item::{Hands, ToolKind}, + comp::item::{AbilitySpec, Hands, ToolKind}, util::Dir, }; use core::{f32::consts::PI, ops::Mul}; pub struct WieldAnimation; -type WieldAnimationDependency = ( - Option, +type WieldAnimationDependency<'a> = ( + (Option, Option<&'a AbilitySpec>), Option, (Option, Option), Vec3, @@ -21,7 +21,7 @@ type WieldAnimationDependency = ( f32, ); impl Animation for WieldAnimation { - type Dependency<'a> = WieldAnimationDependency; + type Dependency<'a> = WieldAnimationDependency<'a>; type Skeleton = CharacterSkeleton; #[cfg(feature = "use-dyn-lib")] @@ -31,7 +31,7 @@ impl Animation for WieldAnimation { fn update_skeleton_inner<'a>( skeleton: &Self::Skeleton, ( - active_tool_kind, + (active_tool_kind, active_tool_spec), second_tool_kind, hands, orientation, @@ -281,6 +281,194 @@ impl Animation for WieldAnimation { * Quaternion::rotation_y(0.6 + u_slow * 0.1) * Quaternion::rotation_z(u_slowalt * 0.1); }, + Some(ToolKind::Instrument) => { + if let Some(AbilitySpec::Custom(spec)) = active_tool_spec { + match spec.as_str() { + "Harp" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(0.0, 2.0, -4.0); + next.hand_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.main.position = Vec3::new(-2.0, 10.0, 12.0); + next.main.orientation = Quaternion::rotation_y(PI); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + "Flute" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(-1.0, 2.0, -2.0); + next.hand_l.orientation = Quaternion::rotation_x(2.5) + * Quaternion::rotation_y(0.9) + * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.main.position = Vec3::new(12.0, 3.0, 4.0); + next.main.orientation = + Quaternion::rotation_x(PI) * Quaternion::rotation_y(-1.2); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + "Bass" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(-6.0, 5.0, -5.0); + next.hand_l.orientation = Quaternion::rotation_x((PI / 2.0) + 0.3) + * Quaternion::rotation_y(0.7) + * Quaternion::rotation_y(0.25) + * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-2.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.main.position = Vec3::new(-14.0, 4.0, -6.0); + next.main.orientation = Quaternion::rotation_x(-0.2) + * Quaternion::rotation_y(1.2) + * Quaternion::rotation_z(-1.2); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + "Perc" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(0.0, 2.0, -4.0); + next.hand_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.main.position = Vec3::new(-2.0, 10.0, 12.0); + next.main.orientation = Quaternion::rotation_y(PI); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + "Kalimba" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(-2.0, 2.0, -4.0); + next.hand_l.orientation = + Quaternion::rotation_x(PI / 2.0) * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.main.position = Vec3::new(-2.0, 7.0, 12.0); + next.main.orientation = + Quaternion::rotation_y(PI) * Quaternion::rotation_z(PI); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + "Lute" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(-2.0, 5.0, -5.0); + next.hand_l.orientation = Quaternion::rotation_x((PI / 2.0) + 0.3) + * Quaternion::rotation_y(0.7) + * Quaternion::rotation_y(0.25) + * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-5.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.main.position = Vec3::new(-2.0, 4.0, -12.0); + next.main.orientation = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(0.2) + * Quaternion::rotation_z(-1.3); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + "Melodica" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(-1.0, 3.0, -2.0); + next.hand_l.orientation = Quaternion::rotation_x(2.0) + * Quaternion::rotation_z(-0.5) + * Quaternion::rotation_y(0.4) + * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-4.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(1.2) + * Quaternion::rotation_y(-0.3) + * Quaternion::rotation_z(1.5); + next.main.position = Vec3::new(-14.0, 3.0, -6.0); + next.main.orientation = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(1.1) + * Quaternion::rotation_z(-1.5); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + "Sitar" => { + if speed < 0.5 { + next.head.orientation = Quaternion::rotation_z(head_look.x) + * Quaternion::rotation_x( + 0.0 + head_look.y.abs() + look_dir.z * 0.7, + ); + } + next.hand_l.position = Vec3::new(-1.0, 5.0, -2.5); + next.hand_l.orientation = Quaternion::rotation_x((PI / 2.0) + 0.3) + * Quaternion::rotation_y(0.2) + * Quaternion::rotation_y(0.25) + * Quaternion::rotation_z(PI); + next.hand_r.position = Vec3::new(-5.0, 2.0, 6.0); + next.hand_r.orientation = Quaternion::rotation_x(PI / 2.0); + next.main.position = Vec3::new(-2.0, 4.0, -12.0); + next.main.orientation = Quaternion::rotation_x(0.0) + * Quaternion::rotation_y(0.2) + * Quaternion::rotation_z(-1.3); + + next.control.position = Vec3::new(-2.0 + slow * 0.5, 0.5, 0.8); + next.control.orientation = Quaternion::rotation_x(u_slow * 0.1) + * Quaternion::rotation_y(2.0 + u_slow * 0.1) + * Quaternion::rotation_z(u_slowalt * 0.1); + }, + _ => {}, + } + } + }, _ => {}, }, ((_, _), _, _) => {}, diff --git a/voxygen/src/audio/sfx/event_mapper/combat/mod.rs b/voxygen/src/audio/sfx/event_mapper/combat/mod.rs index b758902c97..d04c1a7dd7 100644 --- a/voxygen/src/audio/sfx/event_mapper/combat/mod.rs +++ b/voxygen/src/audio/sfx/event_mapper/combat/mod.rs @@ -152,6 +152,13 @@ impl CombatEventMapper { CharacterAbilityType::from(character_state), data.kind, ); + } else if character_state.is_music() { + if let Some(ability_spec) = item + .ability_spec() + .map(|ability_spec| ability_spec.into_owned()) + { + return SfxEvent::Music(data.kind, ability_spec); + } } else if let Some(wield_event) = match ( previous_state.weapon_drawn, Self::weapon_drawn(character_state), diff --git a/voxygen/src/audio/sfx/mod.rs b/voxygen/src/audio/sfx/mod.rs index 723cc41c22..a712e7a2bb 100644 --- a/voxygen/src/audio/sfx/mod.rs +++ b/voxygen/src/audio/sfx/mod.rs @@ -94,7 +94,7 @@ use common::{ assets::{self, AssetExt, AssetHandle}, comp::{ beam, biped_large, biped_small, humanoid, - item::{ItemDefinitionId, ItemKind, ToolKind}, + item::{AbilitySpec, ItemDefinitionId, ItemKind, ToolKind}, object, poise::PoiseState, quadruped_low, quadruped_medium, quadruped_small, Body, CharacterAbilityType, Health, @@ -192,6 +192,7 @@ pub enum SfxEvent { GroundSlam, Utterance(UtteranceKind, VoiceKind), Lightning, + Music(ToolKind, AbilitySpec), } #[derive(Copy, Clone, Debug, PartialEq, Deserialize, Hash, Eq)] diff --git a/voxygen/src/hud/diary.rs b/voxygen/src/hud/diary.rs index f2a932f53c..7669f11ce2 100644 --- a/voxygen/src/hud/diary.rs +++ b/voxygen/src/hud/diary.rs @@ -2833,6 +2833,7 @@ fn unlock_skill_strings(group: SkillGroupKind) -> SkillStrings<'static> { | ToolKind::Blowgun | ToolKind::Debug | ToolKind::Farming + | ToolKind::Instrument | ToolKind::Pick | ToolKind::Natural | ToolKind::Organ diff --git a/voxygen/src/hud/img_ids.rs b/voxygen/src/hud/img_ids.rs index 56f6f042dd..19a36b0455 100644 --- a/voxygen/src/hud/img_ids.rs +++ b/voxygen/src/hud/img_ids.rs @@ -548,6 +548,7 @@ image_ids! { skill_axe_leap_slash: "voxygen.element.skills.skill_axe_leap_slash", skill_bow_jump_burst: "voxygen.element.skills.skill_bow_jump_burst", skill_sceptre_aura: "voxygen.element.skills.sceptre_protection", + instrument: "voxygen.element.skills.music", missing_icon: "voxygen.element.missing_icon_grey", // Buttons diff --git a/voxygen/src/hud/util.rs b/voxygen/src/hud/util.rs index c1dd3ebd99..bbe386c7fc 100644 --- a/voxygen/src/hud/util.rs +++ b/voxygen/src/hud/util.rs @@ -256,6 +256,7 @@ fn tool_kind<'a>(tool: &Tool, i18n: &'a Localization) -> Cow<'a, str> { ToolKind::Natural => i18n.get_msg("common-weapons-natural"), ToolKind::Debug => i18n.get_msg("common-tool-debug"), ToolKind::Farming => i18n.get_msg("common-tool-farming"), + ToolKind::Instrument => i18n.get_msg("common-tool-instrument"), ToolKind::Pick => i18n.get_msg("common-tool-pick"), ToolKind::Empty => i18n.get_msg("common-empty"), }; @@ -351,6 +352,15 @@ pub fn ability_image(imgs: &img_ids::Imgs, ability_id: &str) -> image::Id { "common.abilities.dagger.tempbasic" => imgs.onehdagger_m1, // Pickaxe "common.abilities.pick.swing" => imgs.mining, + // Instruments + "common.abilities.music.bass" => imgs.instrument, + "common.abilities.music.flute" => imgs.instrument, + "common.abilities.music.harp" => imgs.instrument, + "common.abilities.music.perc" => imgs.instrument, + "common.abilities.music.kalimba" => imgs.instrument, + "common.abilities.music.melodica" => imgs.instrument, + "common.abilities.music.lute" => imgs.instrument, + "common.abilities.music.sitar" => imgs.instrument, _ => imgs.not_found, } } diff --git a/voxygen/src/scene/figure/mod.rs b/voxygen/src/scene/figure/mod.rs index 4d1684dbc6..5d48961aed 100644 --- a/voxygen/src/scene/figure/mod.rs +++ b/voxygen/src/scene/figure/mod.rs @@ -912,7 +912,6 @@ impl FigureMgr { let (second_tool_kind, second_tool_hand, second_tool_spec) = tool_info(EquipSlot::ActiveOffhand); let second_tool_spec = second_tool_spec.as_deref(); - let hands = (active_tool_hand, second_tool_hand); // If a mount exists, get its animated mounting transform and its position @@ -1152,7 +1151,7 @@ impl FigureMgr { ( hands, Some(s.stage_section), - Some(s.static_data.ability_info), + (Some(s.static_data.ability_info), None), ), stage_progress, &mut state_animation_rate, @@ -1332,7 +1331,7 @@ impl FigureMgr { CharacterState::Boost(_) => { anim::character::AlphaAnimation::update_skeleton( &target_base, - (hands, None, None), + (hands, None, (None, None)), state.state_time, &mut state_animation_rate, skeleton_attr, @@ -1590,7 +1589,7 @@ impl FigureMgr { ( hands, Some(s.stage_section), - Some(s.static_data.ability_info), + (Some(s.static_data.ability_info), None), ), stage_progress, &mut state_animation_rate, @@ -1735,7 +1734,7 @@ impl FigureMgr { anim::character::SneakWieldAnimation::update_skeleton( &target_base, ( - active_tool_kind, + (active_tool_kind, active_tool_spec), second_tool_kind, hands, rel_vel, @@ -1752,7 +1751,7 @@ impl FigureMgr { anim::character::WieldAnimation::update_skeleton( &target_base, ( - active_tool_kind, + (active_tool_kind, active_tool_spec), second_tool_kind, hands, // TODO: Update to use the quaternion. @@ -1833,6 +1832,32 @@ impl FigureMgr { skeleton_attr, ) }, + CharacterState::Music(s) => { + let stage_time = s.timer.as_secs_f32(); + let stage_progress = match s.stage_section { + StageSection::Buildup => { + stage_time / s.static_data.buildup_duration.as_secs_f32() + }, + StageSection::Action => { + stage_time / s.static_data.play_duration.as_secs_f32() + }, + StageSection::Recover => { + stage_time / s.static_data.recover_duration.as_secs_f32() + }, + _ => 0.0, + }; + anim::character::AlphaAnimation::update_skeleton( + &target_base, + ( + hands, + Some(s.stage_section), + (Some(s.static_data.ability_info), active_tool_spec), + ), + stage_progress, + &mut state_animation_rate, + skeleton_attr, + ) + }, _ => target_base, };