summaryrefslogtreecommitdiff
path: root/scripts/actors/Actor.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-08-30 23:21:20 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-08-30 23:21:20 -0300
commit50ba75c55e9e7a483c8a98a9e3f88214678a5244 (patch)
tree1d075999afd5449c13e2ee7a4d9238ba77257aea /scripts/actors/Actor.cs
parent178f9e3363f1b0bb2a04ef53ae98b689a13570f3 (diff)
Múltiplas formas de input
Diffstat (limited to 'scripts/actors/Actor.cs')
-rw-r--r--scripts/actors/Actor.cs15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/actors/Actor.cs b/scripts/actors/Actor.cs
index afa6989..06cfd69 100644
--- a/scripts/actors/Actor.cs
+++ b/scripts/actors/Actor.cs
@@ -6,10 +6,22 @@ using Godot;
[GlobalClass]
public abstract partial class Actor : Sprite2D
{
+ /// <summary>
+ /// Sinal emitido toda vez que o HP mudar.
+ /// </summary>
+ /// <param name="hp">Novo HP</param>
+ /// <param name="maxHp">Quantidade máxima de HP.</param>
[Signal]
public delegate void HealthChangedEventHandler(int hp, int maxHp);
/// <summary>
+ /// Sinal emitido se o ator morrer.
+ /// </summary>
+ [Signal]
+ public delegate void DiedEventHandler();
+
+
+ /// <summary>
/// A definição do ator possui caracterísitcas padrões que definem
/// o ator em questão.
/// </summary>
@@ -229,7 +241,8 @@ public abstract partial class Actor : Sprite2D
Texture = definition.deathTexture;
blocksMovement = false;
ZIndex = 0;
- actorName = $"Restos mortais de ${actorName}";
+ actorName = $"Restos mortais de {actorName}";
Map_Data.UnregisterBlockingActor(this);
+ EmitSignal(SignalName.Died);
}
} \ No newline at end of file