feat: Enemies

This commit is contained in:
2026-11-05 08:59:08 +01:00
parent cd65f702ae
commit 743703c6bd
109 changed files with 75286 additions and 15238 deletions

View File

@@ -164,6 +164,7 @@ namespace Arena.Characters
GetInputs();
UpdateStun();
Move(t);
UpdateLauncher();
// A stunned player only falls: no aiming, shooting nor interacting
if (_state.IsStunned)
@@ -178,6 +179,11 @@ namespace Arena.Characters
#region PUBLIC METHODS
/// <summary>
/// The player is always on the allied side.
/// </summary>
public Team Team => Team.Allied;
public void TakeDamage(DamageInfo damage)
{
_health.TakeDamage(damage);
@@ -350,6 +356,9 @@ namespace Arena.Characters
private void HandleDied()
{
_references.CharacterAnimator.Die();
if (_references.Launcher)
_references.Launcher.Drop();
}
@@ -404,11 +413,16 @@ namespace Arena.Characters
private void Attack()
{
// No shooting while running
if (_isAttacking && !_state.IsRunning)
if (_isAttacking)
_references.Launcher.TryFire();
}
private void UpdateLauncher()
{
// No shooting while running, dashing or stunned
_references.Launcher.SetDisabled(_state.IsRunning || _state.IsDashing || _state.IsStunned);
}
private void Interact()
{
if (_isInteracting)