From c6bbb834f7758027c0df338f1520f34fad3befea Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 9 Sep 2025 19:09:34 -0300 Subject: Organização MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/entities/actions/MeleeAction.cs | 48 --------------------------------- 1 file changed, 48 deletions(-) delete mode 100644 scripts/entities/actions/MeleeAction.cs (limited to 'scripts/entities/actions/MeleeAction.cs') diff --git a/scripts/entities/actions/MeleeAction.cs b/scripts/entities/actions/MeleeAction.cs deleted file mode 100644 index 09c5cc7..0000000 --- a/scripts/entities/actions/MeleeAction.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Godot; - -/// -/// Ação de ataque físico. Uma ação direcionada que ataca um alvo. -/// -public partial class MeleeAction : DirectionalAction -{ - public MeleeAction(Actor actor, Vector2I offset) : base(actor, offset) - { - } - - /// - /// Ataca o ator na direção da ação. - /// - public override bool Perform() - { - // Eu te disse que este método seria útil. - Entity potentialTarget = GetTarget(); - - // Só podemos atacar atores. - if (potentialTarget is not Actor) { - return false; - } - - Actor target = (Actor)potentialTarget; - - - // Se não houver um ator na direção, não podemos continuar. - // Isto é uma ação gratuita. - if (target == null) return false; - - // não podemos ter dano negativo. - int damage = actor.Atk - target.Def; - - string attackDesc = $"{actor.DisplayName} ataca {target.DisplayName}"; - - if (damage > 0) { - attackDesc += $" e remove {damage} de HP."; - target.Hp -= damage; - } else { - attackDesc += $" mas {target.DisplayName} tem músculos de aço."; - } - - MessageLogData.Instance.AddMessage(attackDesc); - actor.Energy -= cost; - return true; - } -} -- cgit v1.2.3