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

View File

@@ -64,9 +64,11 @@ public class EffectService
var currentEnemies = currentRoom.EnemiesInRoom;
foreach (var enemy in currentEnemies)
{
enemy.Die();
enemy.OnMorph();
DropHealingItem(enemy.GlobalPosition);
}
if (!currentEnemies.IsEmpty)
SfxDatabase.Instance.Play(SoundEffect.TurnAllEnemiesIntoHealingItems);
}
public void DropHealingItem(Vector3 vector)
@@ -109,6 +111,7 @@ public class EffectService
var absorbAmount = enemy.HealthComponent.MaximumHP.Value * 0.05;
enemy.HealthComponent.Damage((int)absorbAmount);
hpToAbsorb += absorbAmount;
enemy.OnAbsorb();
}
_player.HealthComponent.Heal((int)hpToAbsorb);
GD.Print("HP to absorb: " + hpToAbsorb);
@@ -136,6 +139,7 @@ public class EffectService
_player.HealthComponent.SetCurrentHealth(oldVt);
_player.VTComponent.SetVT(oldHp);
SfxDatabase.Instance.Play(SoundEffect.SwapHPAndVT);
}
public void RandomEffect(EffectItem item)
@@ -155,6 +159,7 @@ public class EffectService
var currentWeapon = (Weapon)_player.EquipmentComponent.EquippedWeapon.Value;
currentWeapon.IncreaseWeaponAttack(1);
SfxDatabase.Instance.Play(SoundEffect.IncreaseStat);
}
public void RaiseCurrentArmorDefense()
@@ -164,6 +169,7 @@ public class EffectService
var currentArmor = (Armor)_player.EquipmentComponent.EquippedArmor.Value;
currentArmor.IncreaseArmorDefense(1);
SfxDatabase.Instance.Play(SoundEffect.IncreaseStat);
}
public void RaiseLevel() => _player.LevelUp();
@@ -204,6 +210,7 @@ public class EffectService
var randomRoom = roomsGodotCollection.PickRandom();
var spawnPoint = randomRoom.PlayerSpawn;
player.TeleportPlayer(spawnPoint.Transform);
SfxDatabase.Instance.Play(SoundEffect.TeleportToRandomRoom);
}
public void ChangeAffinity(ThrowableItem throwableItem)
@@ -224,6 +231,9 @@ public class EffectService
{
var exitRoom = _game.CurrentFloor.Rooms.OfType<ExitRoom>().Single();
if (exitRoom.PlayerDiscoveredRoom)
{
SfxDatabase.Instance.Play(SoundEffect.TeleportToExit);
player.TeleportPlayer(exitRoom.PlayerSpawn.Transform);
}
}
}