summaryrefslogtreecommitdiff
path: root/scripts/actors/AI/HostileEnemyAI.cs
diff options
context:
space:
mode:
authorMatheus <matheus.guedes.mg.m@gmail.com>2025-09-01 19:41:25 -0300
committerMatheus <matheus.guedes.mg.m@gmail.com>2025-09-01 19:41:25 -0300
commit2023ac3fa6477142299115b056b4ad380a9a9f7a (patch)
tree7584324f71e3a3a1853240042f956298c1c8cf0b /scripts/actors/AI/HostileEnemyAI.cs
parent2d0139c3275d5c0bdaedc23d38da4d744870020d (diff)
Implementado sistema de ações gratuitas.
Diffstat (limited to 'scripts/actors/AI/HostileEnemyAI.cs')
-rw-r--r--scripts/actors/AI/HostileEnemyAI.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/actors/AI/HostileEnemyAI.cs b/scripts/actors/AI/HostileEnemyAI.cs
index af87360..35d6d1a 100644
--- a/scripts/actors/AI/HostileEnemyAI.cs
+++ b/scripts/actors/AI/HostileEnemyAI.cs
@@ -25,6 +25,14 @@ public partial class HostileEnemyAI : BaseAI
// Só faz sentido atacar o jogador se o inimigo estiver visível.
if (body.Map_Data.GetTile(body.GridPosition).IsInView) {
+ // Se o inimigo consegue ver que o jogador está morto,
+ // IT'S OVER.
+ if (!target.IsAlive) {
+ action = new WaitAction(body);
+ action.Perform();
+ return;
+ }
+
// Se estiver do lado do jogador, ataque.
if (distance <= 1) {
action = new MeleeAction(body, offset);