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

@@ -6,7 +6,6 @@ using System.Collections.Immutable;
using System.Linq;
using Zennysoft.Ma.Adapter;
using Zennysoft.Ma.Adapter.Entity;
using static Zennysoft.Ma.Adapter.AppLogic;
namespace Zennysoft.Game.Ma;
@@ -46,6 +45,10 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
[Export] public int ExpGiven { get; set; } = 10;
[Node] private AudioStreamPlayer3D _absorbSFX { get; set; } = default!;
[Node] private AudioStreamPlayer3D _hitSFX { get; set; } = default!;
[Node] private AudioStreamPlayer3D _morphSFX { get; set; } = default!;
protected bool _activated = false;
private Vector3 _previousPosition = Vector3.Zero;
@@ -130,6 +133,7 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
{
_enemyLogic.Input(new EnemyLogic.Input.Alert());
EnemyModelView.PlayHitAnimation();
_hitSFX.Play();
}
public virtual void Die()
@@ -143,6 +147,19 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
tweener.TweenCallback(Callable.From(QueueFree));
}
public void OnAbsorb()
{
_absorbSFX.Play();
}
public void OnMorph()
{
_morphSFX.Play();
SetPhysicsProcess(false);
_enemyLogic.Input(new EnemyLogic.Input.Defeated());
Callable.From(QueueFree);
}
public IDungeonRoom GetCurrentRoom(ImmutableList<IDungeonRoom> roomList)
{
foreach (var room in roomList)
@@ -178,8 +195,8 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
_enemyLogic.Input(new EnemyLogic.Input.Reset());
}
throw new NotImplementedException($"Only {nameof(MonsterRoom)} types are currently supported.");
else
throw new NotImplementedException($"Only {nameof(MonsterRoom)} types are currently supported.");
}
protected void LookAtTarget(Vector3 targetPosition)
@@ -199,7 +216,7 @@ public abstract partial class Enemy : CharacterBody3D, IEnemy, IProvide<IEnemyLo
protected void SetTarget(Vector3 targetPosition) => TargetPosition = targetPosition;
private void EnemyModelView_HitPlayer(object sender, System.EventArgs e)
private void EnemyModelView_HitPlayer(object sender, EventArgs e)
{
_player.TakeDamage(new AttackData(AttackComponent.CurrentAttack.Value, ElementType.None));
}