Add stackable items

This commit is contained in:
2025-03-11 16:00:46 -07:00
parent 192f2eb316
commit f060229b5e
17 changed files with 151 additions and 57 deletions

View File

@@ -57,86 +57,86 @@ public partial class InGameAudio : Node
public void Setup()
{
InGameAudioLogic = new InGameAudioLogic();
InGameAudioLogic = new InGameAudioLogic();
}
public void OnResolved()
{
InGameAudioLogic.Set(AppRepo);
InGameAudioLogic.Set(GameEventDepot);
InGameAudioLogic.Set(Player);
InGameAudioLogic.Set(GameRepo);
InGameAudioLogic.Set(AppRepo);
InGameAudioLogic.Set(GameEventDepot);
InGameAudioLogic.Set(Player);
InGameAudioLogic.Set(GameRepo);
InGameAudioBinding = InGameAudioLogic.Bind();
InGameAudioBinding = InGameAudioLogic.Bind();
InGameAudioBinding
.Handle((in InGameAudioLogic.Output.PlayOverworldMusic _) => StartOverworldMusic())
.Handle((in InGameAudioLogic.Output.PlayDungeonThemeAMusic _) => StartDungeonThemeA())
.Handle((in InGameAudioLogic.Output.PlayMenuScrollSound _) => PlayMenuScrollSound())
.Handle((in InGameAudioLogic.Output.PlayEquipSound _) => PlayEquipSound())
.Handle((in InGameAudioLogic.Output.PlayMenuBackSound _) => PlayMenuBackSound())
.Handle((in InGameAudioLogic.Output.PlayInventorySortedSound _) => PlayInventorySortedSound())
.Handle((in InGameAudioLogic.Output.PlayHealingItemSound _) => PlayHealingItemSound())
.Handle((in InGameAudioLogic.Output.PlayTeleportSound _) => PlayTeleportSound())
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackSound _) => { PlayerAttackSFX.Stop(); PlayerAttackSFX.Play(); })
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackWallSound _) => { PlayerAttackWallSFX.Stop(); PlayerAttackWallSFX.Play(); })
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackEnemySound _) => { PlayerAttackEnemySFX.Stop(); PlayerAttackEnemySFX.Play(); });
InGameAudioBinding
.Handle((in InGameAudioLogic.Output.PlayOverworldMusic _) => StartOverworldMusic())
.Handle((in InGameAudioLogic.Output.PlayDungeonThemeAMusic _) => StartDungeonThemeA())
.Handle((in InGameAudioLogic.Output.PlayMenuScrollSound _) => PlayMenuScrollSound())
.Handle((in InGameAudioLogic.Output.PlayEquipSound _) => PlayEquipSound())
.Handle((in InGameAudioLogic.Output.PlayMenuBackSound _) => PlayMenuBackSound())
.Handle((in InGameAudioLogic.Output.PlayInventorySortedSound _) => PlayInventorySortedSound())
.Handle((in InGameAudioLogic.Output.PlayHealingItemSound _) => PlayHealingItemSound())
.Handle((in InGameAudioLogic.Output.PlayTeleportSound _) => PlayTeleportSound())
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackSound _) => { PlayerAttackSFX.Stop(); PlayerAttackSFX.Play(); })
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackWallSound _) => { PlayerAttackWallSFX.Stop(); PlayerAttackWallSFX.Play(); })
.Handle((in InGameAudioLogic.Output.PlayPlayerAttackEnemySound _) => { PlayerAttackEnemySFX.Stop(); PlayerAttackEnemySFX.Play(); });
InGameAudioLogic.Start();
InGameAudioLogic.Start();
}
public void OnExitTree()
{
InGameAudioLogic.Stop();
InGameAudioBinding.Dispose();
InGameAudioLogic.Stop();
InGameAudioBinding.Dispose();
}
private void StartOverworldMusic()
{
OverworldBgm.Stop();
OverworldBgm.FadeIn();
OverworldBgm.Stop();
OverworldBgm.FadeIn();
}
private void StartDungeonThemeA()
{
OverworldBgm.FadeOut();
DungeonThemeABgm.Stop();
DungeonThemeABgm.FadeIn();
OverworldBgm.FadeOut();
DungeonThemeABgm.Stop();
DungeonThemeABgm.FadeIn();
}
private void PlayMenuScrollSound()
{
MenuScrollSFX.Stop();
MenuScrollSFX.Play();
MenuScrollSFX.Stop();
MenuScrollSFX.Play();
}
private void PlayEquipSound()
{
EquipSFX.Stop();
EquipSFX.Play();
EquipSFX.Stop();
EquipSFX.Play();
}
private void PlayMenuBackSound()
{
MenuBackSFX.Stop();
MenuBackSFX.Play();
MenuBackSFX.Stop();
MenuBackSFX.Play();
}
private void PlayInventorySortedSound()
{
InventorySortedSFX.Stop();
InventorySortedSFX.Play();
InventorySortedSFX.Stop();
InventorySortedSFX.Play();
}
private void PlayHealingItemSound()
{
HealingItemSFX.Stop();
HealingItemSFX.Play();
HealingItemSFX.Stop();
HealingItemSFX.Play();
}
private void PlayTeleportSound()
{
TeleportSFX.Stop();
TeleportSFX.Play();
TeleportSFX.Stop();
TeleportSFX.Play();
}
}

View File

@@ -1,4 +1,4 @@
[gd_scene load_steps=15 format=3 uid="uid://b16ejcwanod72"]
[gd_scene load_steps=16 format=3 uid="uid://b16ejcwanod72"]
[ext_resource type="Script" uid="uid://2mnouyn1jcqs" path="res://src/audio/InGameAudio.cs" id="1_gpmcr"]
[ext_resource type="AudioStream" uid="uid://dfu0fksb6slhx" path="res://src/audio/music/droney.mp3" id="2_8hfyr"]
@@ -11,6 +11,7 @@
[ext_resource type="AudioStream" uid="uid://d1mlduwauechv" path="res://src/audio/sfx/PlayerAttackSFX.wav" id="7_wtvpb"]
[ext_resource type="AudioStream" uid="uid://r1tryiit38i8" path="res://src/audio/sfx/MenuBackSFX.ogg" id="8_1xcgo"]
[ext_resource type="AudioStream" uid="uid://bjj61s8q2gwb8" path="res://src/audio/sfx/EquipSFX.ogg" id="8_kwybb"]
[ext_resource type="AudioStream" uid="uid://4u8f1tpgs08b" path="res://src/audio/sfx/PlayerHitEnemySFX.wav" id="9_hertr"]
[ext_resource type="AudioStream" uid="uid://myx4s8lmarc2" path="res://src/audio/sfx/HealSFX.ogg" id="10_3lcw5"]
[ext_resource type="AudioStream" uid="uid://dci08kmwsu6k1" path="res://src/audio/sfx/ExitSFX.ogg" id="11_offhc"]
[ext_resource type="AudioStream" uid="uid://d3sn7c614uj2n" path="res://src/audio/sfx/SortSFX.ogg" id="12_wprjr"]
@@ -70,6 +71,11 @@ unique_name_in_owner = true
stream = ExtResource("7_8vh2f")
volume_db = -5.0
[node name="PlayerAttackEnemySFX" type="AudioStreamPlayer" parent="SFX"]
unique_name_in_owner = true
stream = ExtResource("9_hertr")
volume_db = -5.0
[node name="MenuScrollSFX" type="AudioStreamPlayer" parent="SFX"]
unique_name_in_owner = true
stream = ExtResource("7_777nl")

Binary file not shown.

View File

@@ -0,0 +1,24 @@
[remap]
importer="wav"
type="AudioStreamWAV"
uid="uid://4u8f1tpgs08b"
path="res://.godot/imported/PlayerHitEnemySFX.wav-7235df5e0b579a1c2793d138bb462425.sample"
[deps]
source_file="res://src/audio/sfx/PlayerHitEnemySFX.wav"
dest_files=["res://.godot/imported/PlayerHitEnemySFX.wav-7235df5e0b579a1c2793d138bb462425.sample"]
[params]
force/8_bit=false
force/mono=false
force/max_rate=false
force/max_rate_hz=44100
edit/trim=false
edit/normalize=false
edit/loop_mode=0
edit/loop_begin=0
edit/loop_end=-1
compress/mode=2