Started implementing SFX

Fixed Shield animation jumps and secondary attack
Fixed demon wall stone behavior
Made overworld ambient sounds unpausable
This commit is contained in:
2025-11-25 03:04:07 -08:00
parent 3e8c11d55d
commit db7a1df1f7
122 changed files with 2313 additions and 1687 deletions
@@ -3,12 +3,12 @@
importer="wav"
type="AudioStreamWAV"
uid="uid://ddii3pi8x75xc"
path="res://.godot/imported/amb_beach.wav-e64adf8f733e6a108ae15edd5f0499ab.sample"
path="res://.godot/imported/amb_beach.wav-046e4f838e50e43a1aba1a754b92aad6.sample"
[deps]
source_file="res://src/audio/amb/amb_beach.wav"
dest_files=["res://.godot/imported/amb_beach.wav-e64adf8f733e6a108ae15edd5f0499ab.sample"]
source_file="res://src/audio/AMB/amb_beach.wav"
dest_files=["res://.godot/imported/amb_beach.wav-046e4f838e50e43a1aba1a754b92aad6.sample"]
[params]
@@ -3,12 +3,12 @@
importer="wav"
type="AudioStreamWAV"
uid="uid://ym4ur8a2qxhp"
path="res://.godot/imported/amb_perlin.wav-dea63667b2a56d37d48ba209f56f8900.sample"
path="res://.godot/imported/amb_perlin.wav-ba6da0d5591f392e4aca7d2f85c4dfc2.sample"
[deps]
source_file="res://src/audio/amb/amb_perlin.wav"
dest_files=["res://.godot/imported/amb_perlin.wav-dea63667b2a56d37d48ba209f56f8900.sample"]
source_file="res://src/audio/AMB/amb_perlin.wav"
dest_files=["res://.godot/imported/amb_perlin.wav-ba6da0d5591f392e4aca7d2f85c4dfc2.sample"]
[params]
@@ -3,12 +3,12 @@
importer="wav"
type="AudioStreamWAV"
uid="uid://b7wxddjx3qw5o"
path="res://.godot/imported/amb_white_noise.wav-c98b45aa94120bc0c660bf2d6af1c696.sample"
path="res://.godot/imported/amb_white_noise.wav-d316dd05afe429f6bcdda594285ad718.sample"
[deps]
source_file="res://src/audio/amb/amb_white_noise.wav"
dest_files=["res://.godot/imported/amb_white_noise.wav-c98b45aa94120bc0c660bf2d6af1c696.sample"]
source_file="res://src/audio/AMB/amb_white_noise.wav"
dest_files=["res://.godot/imported/amb_white_noise.wav-d316dd05afe429f6bcdda594285ad718.sample"]
[params]
@@ -3,12 +3,12 @@
importer="wav"
type="AudioStreamWAV"
uid="uid://bmiitw4fcs68e"
path="res://.godot/imported/amb_wind_loop_altar.wav-b9d60e3c3c10ec00833903539a7f3796.sample"
path="res://.godot/imported/amb_wind_loop_altar.wav-e766e3db29faa01ad6dbaa8cb18d7de6.sample"
[deps]
source_file="res://src/audio/amb/amb_wind_loop_altar.wav"
dest_files=["res://.godot/imported/amb_wind_loop_altar.wav-b9d60e3c3c10ec00833903539a7f3796.sample"]
source_file="res://src/audio/AMB/amb_wind_loop_altar.wav"
dest_files=["res://.godot/imported/amb_wind_loop_altar.wav-e766e3db29faa01ad6dbaa8cb18d7de6.sample"]
[params]
+10 -32
View File
@@ -1,43 +1,21 @@
using Godot;
using System;
using System.Collections.Generic;
namespace Zennysoft.Game.Ma;
public partial class AudioManager : Node
{
private static string sfxPath = $"res://src/audio/sfx/";
private AudioStreamPlayer _audioPlayer;
private IDictionary<SoundEffect, AudioStream> _sfxDictionary;
private static AudioStreamPlayer _audioPlayer;
private static AudioManager _instance;
public static AudioManager Instance => _instance;
public override void _Ready()
{
_audioPlayer = new AudioStreamPlayer();
AddChild(_audioPlayer);
_sfxDictionary = new Dictionary<SoundEffect, AudioStream>();
var soundEffects = Enum.GetValues(typeof(SoundEffect));
foreach (var effect in soundEffects)
_sfxDictionary.Add((SoundEffect)effect, GD.Load<AudioStream>(sfxPath + effect + ".ogg"));
if (_instance != null)
QueueFree();
_instance = this;
_audioPlayer = new AudioStreamPlayer();
AddChild(_audioPlayer);
_audioPlayer.Bus = "SFX";
}
public void Play(SoundEffect soundEffect)
{
_sfxDictionary.TryGetValue(soundEffect, out var stream);
_audioPlayer.Stream = stream;
_audioPlayer.Play();
}
}
public enum SoundEffect
{
Cancel,
Equip,
Heal,
MenuBack,
MoveThroughOptions,
PlayerAttack,
PlayerHitWall,
Select,
Sort,
Unequip
}
}
@@ -0,0 +1,150 @@
[gd_scene load_steps=25 format=3 uid="uid://brgi35xj3b4ud"]
[ext_resource type="Script" uid="uid://cw100tox0ufsy" path="res://src/audio/SfxDatabase.cs" id="1_ojkqd"]
[ext_resource type="AudioStream" uid="uid://cye8wlqbx66h4" path="res://src/audio/sfx/player_heal.ogg" id="2_158j8"]
[ext_resource type="AudioStream" uid="uid://1nuk6xpkwujl" path="res://src/audio/sfx/player_gain_VT.ogg" id="3_kac56"]
[ext_resource type="AudioStream" uid="uid://bfrp34y2m8b1l" path="res://src/audio/sfx/item_number_increase.ogg" id="4_fa8i8"]
[ext_resource type="AudioStream" uid="uid://xjdv23q5cqhm" path="res://src/audio/sfx/UI_PAUSE.ogg" id="5_p5cio"]
[ext_resource type="AudioStream" uid="uid://clhdcrs4dxt6h" path="res://src/audio/sfx/UI_MOVE.ogg" id="6_r16t0"]
[ext_resource type="AudioStream" uid="uid://c817txm4tmup7" path="res://src/audio/sfx/PLAYER_EQUIP.ogg" id="7_sew62"]
[ext_resource type="AudioStream" uid="uid://qxi7qto7hhgk" path="res://src/audio/sfx/PLAYER_UNEQUIP.ogg" id="8_rf1la"]
[ext_resource type="AudioStream" uid="uid://doeefxilh0luj" path="res://src/audio/sfx/ITEM_SORT.ogg" id="9_l6w22"]
[ext_resource type="AudioStream" uid="uid://4mk4hlse81if" path="res://src/audio/sfx/player_losehealth.ogg" id="10_kac56"]
[ext_resource type="AudioStream" uid="uid://dwp3ep3jddvrr" path="res://src/audio/sfx/UI_SELECT.ogg" id="10_nerso"]
[ext_resource type="AudioStream" uid="uid://oslvh60ec5gc" path="res://src/audio/sfx/UI_CANCEL_BACK.ogg" id="11_rloay"]
[ext_resource type="AudioStream" uid="uid://bo2u1ceci6k1i" path="res://src/audio/sfx/PLAYER_quicker_slash.ogg" id="13_fa8i8"]
[ext_resource type="AudioStream" uid="uid://na0lxb1lib11" path="res://src/audio/sfx/player_crit.ogg" id="14_p5cio"]
[ext_resource type="AudioStream" uid="uid://bsc83jkt7uisg" path="res://src/audio/sfx/PLAYER_GET_ITEM.ogg" id="15_r16t0"]
[ext_resource type="AudioStream" uid="uid://ckf3md1ujxhvm" path="res://src/audio/sfx/player_levelup.ogg" id="16_sew62"]
[ext_resource type="AudioStream" uid="uid://coeynqnn61c43" path="res://src/audio/sfx/ITEM_TRANSFER.ogg" id="18_l6w22"]
[ext_resource type="AudioStream" uid="uid://bfrmm07vthpwt" path="res://src/audio/sfx/item_divine_recall.ogg" id="19_nerso"]
[ext_resource type="AudioStream" uid="uid://bu8akh5uh3ioo" path="res://src/audio/sfx/item_devic_balance_element1.ogg" id="20_rloay"]
[ext_resource type="AudioStream" uid="uid://bjkn6s2xjxuji" path="res://src/audio/sfx/item_gospel_dimension.ogg" id="21_6hsck"]
[ext_resource type="AudioStream" uid="uid://c3ur4bgvmsidi" path="res://src/audio/sfx/item_gospel_escape.ogg" id="22_3wq6u"]
[ext_resource type="AudioStream" uid="uid://bc2pe0l5nr5ro" path="res://src/audio/sfx/ITEM_kyuu_hit.ogg" id="23_aaerj"]
[ext_resource type="AudioStream" uid="uid://ck0nc757t0jq5" path="res://src/audio/sfx/ITEM_PERSPECTIVE.ogg" id="23_jdwj3"]
[ext_resource type="AudioStream" uid="uid://dblijlgm8njjv" path="res://src/audio/sfx/item_sine_morphization.ogg" id="24_jdwj3"]
[node name="SfxDatabase" type="Node"]
script = ExtResource("1_ojkqd")
[node name="UI" type="Node" parent="."]
[node name="OpenInventorySound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true
stream = ExtResource("5_p5cio")
bus = &"SFX"
[node name="MoveSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true
stream = ExtResource("6_r16t0")
bus = &"SFX"
[node name="SelectSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true
stream = ExtResource("10_nerso")
bus = &"SFX"
[node name="CancelSound" type="AudioStreamPlayer" parent="UI"]
unique_name_in_owner = true
stream = ExtResource("11_rloay")
bus = &"SFX"
[node name="Player" type="Node" parent="."]
[node name="HealHPSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("2_158j8")
bus = &"SFX"
[node name="TakeDamageSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("10_kac56")
bus = &"SFX"
[node name="HealVTSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("3_kac56")
bus = &"SFX"
[node name="WeaponSwingSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("13_fa8i8")
bus = &"SFX"
[node name="CritSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("14_p5cio")
bus = &"SFX"
[node name="PickupItemSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("15_r16t0")
bus = &"SFX"
[node name="LevelUpSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("16_sew62")
bus = &"SFX"
[node name="EquipSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("7_sew62")
bus = &"SFX"
[node name="UnequipSound" type="AudioStreamPlayer" parent="Player"]
unique_name_in_owner = true
stream = ExtResource("8_rf1la")
bus = &"SFX"
[node name="Item" type="Node" parent="."]
[node name="TransferItemSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("18_l6w22")
bus = &"SFX"
[node name="IncreaseStatSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("4_fa8i8")
bus = &"SFX"
[node name="SortSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("9_l6w22")
bus = &"SFX"
[node name="RecallEnemiesSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("19_nerso")
bus = &"SFX"
[node name="KillHalfEnemiesSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("20_rloay")
bus = &"SFX"
[node name="TeleportToRandomRoomSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("21_6hsck")
bus = &"SFX"
[node name="TeleportToExitSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("22_3wq6u")
bus = &"SFX"
[node name="AbsorbHPFromAllEnemiesSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("23_aaerj")
bus = &"SFX"
[node name="SwapHPAndVTSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("23_jdwj3")
bus = &"SFX"
[node name="TurnAllEnemiesIntoHealingItemsSound" type="AudioStreamPlayer" parent="Item"]
unique_name_in_owner = true
stream = ExtResource("24_jdwj3")
bus = &"SFX"
+108
View File
@@ -0,0 +1,108 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using System.Collections.Generic;
[Meta(typeof(IAutoNode)), Id("sfx_database")]
public partial class SfxDatabase : Node
{
public override void _Notification(int what) => this.Notify(what);
private static SfxDatabase _instance;
public static SfxDatabase Instance => _instance;
public void OnReady()
{
if (_instance != null)
QueueFree();
_instance = this;
_sfxMap = new Dictionary<SoundEffect, AudioStreamPlayer>
{
{SoundEffect.HealHP, HealHPSound },
{SoundEffect.TakeDamage, TakeDamageSound },
{SoundEffect.HealVT, HealVTSound },
{SoundEffect.IncreaseStat, IncreaseStatSound },
{SoundEffect.WeaponSwing, WeaponSwingSound },
{SoundEffect.Crit, CritSound },
{SoundEffect.PickupItem, PickupItemSound },
{SoundEffect.OpenInventory, OpenInventorySound },
{SoundEffect.MoveUI, MoveSound },
{SoundEffect.Equip, EquipSound },
{SoundEffect.Unequip, UnequipSound },
{SoundEffect.SortInventory, SortSound },
{SoundEffect.SelectUI, SelectSound },
{SoundEffect.CancelUI, CancelSound },
{SoundEffect.LevelUp, LevelUpSound },
{SoundEffect.Transfer, TransferItemSound },
{SoundEffect.RecallEnemies, RecallEnemiesSound},
{SoundEffect.KillHalfEnemies, KillHalfEnemiesSound},
{SoundEffect.TeleportToRandomRoom, TeleportToRandomRoomSound},
{SoundEffect.TeleportToExit, TeleportToExitSound},
{SoundEffect.AbsorbHPFromAllEnemies, AbsorbHPFromAllEnemiesSound},
{SoundEffect.TurnAllEnemiesIntoHealingItems, TurnAllEnemiesIntoHealingItemsSound},
};
}
[Node] private AudioStreamPlayer HealHPSound { get; set; } = default!;
[Node] private AudioStreamPlayer TakeDamageSound { get; set; } = default!;
[Node] private AudioStreamPlayer HealVTSound { get; set; } = default!;
[Node] private AudioStreamPlayer IncreaseStatSound { get; set; } = default!;
[Node] private AudioStreamPlayer WeaponSwingSound { get; set; } = default!;
[Node] private AudioStreamPlayer CritSound { get; set; } = default!;
[Node] private AudioStreamPlayer PickupItemSound { get; set; } = default!;
[Node] private AudioStreamPlayer OpenInventorySound { get; set; }
[Node] private AudioStreamPlayer MoveSound { get; set; }
[Node] private AudioStreamPlayer EquipSound { get; set; }
[Node] private AudioStreamPlayer UnequipSound { get; set; }
[Node] private AudioStreamPlayer SortSound { get; set; }
[Node] private AudioStreamPlayer SelectSound { get; set; }
[Node] private AudioStreamPlayer CancelSound { get; set; }
[Node] private AudioStreamPlayer LevelUpSound { get; set; }
[Node] private AudioStreamPlayer TransferItemSound { get; set; }
[Node] private AudioStreamPlayer RecallEnemiesSound { get; set; }
[Node] private AudioStreamPlayer KillHalfEnemiesSound { get; set; }
[Node] private AudioStreamPlayer TeleportToRandomRoomSound { get; set; }
[Node] private AudioStreamPlayer TeleportToExitSound { get; set; }
[Node] private AudioStreamPlayer AbsorbHPFromAllEnemiesSound { get; set; }
[Node] private AudioStreamPlayer SwapHPAndVTSound { get; set; }
[Node] private AudioStreamPlayer TurnAllEnemiesIntoHealingItemsSound { get; set; }
private Dictionary<SoundEffect, AudioStreamPlayer> _sfxMap;
public void Play(SoundEffect soundEffect)
{
_sfxMap.TryGetValue(soundEffect, out var audio);
if (audio != null)
audio.Play();
}
}
public enum SoundEffect
{
HealHP,
TakeDamage,
HealVT,
IncreaseStat,
WeaponSwing,
Crit,
PickupItem,
OpenInventory,
MoveUI,
Equip,
Unequip,
SortInventory,
SelectUI,
CancelUI,
LevelUp,
Transfer,
RecallEnemies,
KillHalfEnemies,
TeleportToRandomRoom,
TeleportToExit,
AbsorbHPFromAllEnemies,
SwapHPAndVT,
TurnAllEnemiesIntoHealingItems,
}
@@ -0,0 +1 @@
uid://cw100tox0ufsy
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://dci08kmwsu6k1"
path="res://.godot/imported/Cancel.ogg-90240069a266fcef76dd638dfd79efd5.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/Cancel.ogg"
dest_files=["res://.godot/imported/Cancel.ogg-90240069a266fcef76dd638dfd79efd5.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://nebh8kbv638p"
path="res://.godot/imported/Equip.ogg-217f5d9ca98d54921c4ec31e13fb9ba4.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/Equip.ogg"
dest_files=["res://.godot/imported/Equip.ogg-217f5d9ca98d54921c4ec31e13fb9ba4.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://myx4s8lmarc2"
path="res://.godot/imported/Heal.ogg-05b7ed0ad880ef31e2dd13ac2428a53c.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/Heal.ogg"
dest_files=["res://.godot/imported/Heal.ogg-05b7ed0ad880ef31e2dd13ac2428a53c.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://r1tryiit38i8"
path="res://.godot/imported/MenuBack.ogg-4d59ead9ffd1dde11bf2c91a5ade19a4.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/MenuBack.ogg"
dest_files=["res://.godot/imported/MenuBack.ogg-4d59ead9ffd1dde11bf2c91a5ade19a4.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://dor0in0x2fg48"
path="res://.godot/imported/MoveThroughOptions.ogg-d2ab68a21096bd510cf966df8d088ca2.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/MoveThroughOptions.ogg"
dest_files=["res://.godot/imported/MoveThroughOptions.ogg-d2ab68a21096bd510cf966df8d088ca2.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://dl300ljxjccju"
path="res://.godot/imported/PlayerAttack.ogg-b72a90c320c3a6f764de2be3f71a8058.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/PlayerAttack.ogg"
dest_files=["res://.godot/imported/PlayerAttack.ogg-b72a90c320c3a6f764de2be3f71a8058.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://dvv6wd7rtbc7b"
path="res://.godot/imported/PlayerHitWall.ogg-429bd11f2f509307596bb8d8ac73a08d.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/PlayerHitWall.ogg"
dest_files=["res://.godot/imported/PlayerHitWall.ogg-429bd11f2f509307596bb8d8ac73a08d.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://bb5lchnrvacf8"
path="res://.godot/imported/Select.ogg-d9dd04507bb827ea76d34cbcda6e7708.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/Select.ogg"
dest_files=["res://.godot/imported/Select.ogg-d9dd04507bb827ea76d34cbcda6e7708.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://d3sn7c614uj2n"
path="res://.godot/imported/Sort.ogg-c7758aed01332fd8ea77a27c6593a8bb.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/Sort.ogg"
dest_files=["res://.godot/imported/Sort.ogg-c7758aed01332fd8ea77a27c6593a8bb.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4
Binary file not shown.
@@ -1,19 +0,0 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://bb1j3m60jns54"
path="res://.godot/imported/Unequip.ogg-b3c6ba8a77b0e6d2ec671cb12640c764.oggvorbisstr"
[deps]
source_file="res://src/audio/sfx/Unequip.ogg"
dest_files=["res://.godot/imported/Unequip.ogg-b3c6ba8a77b0e6d2ec671cb12640c764.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4