think i finally solved movement going into enemy territory

This commit is contained in:
2026-07-05 02:51:09 -04:00
parent dbafefd660
commit bfcd48e657
9 changed files with 14 additions and 38 deletions
+3 -2
View File
@@ -25,9 +25,10 @@ public partial class PegAction : Node2D
public virtual bool MeetsCriteria(Peg PEG)
{
MapCell target = Target(PEG);
return PEG._staminaRemaining >= _cost
&& _usesRemaining > 0
&& (PEG._address - Target(PEG)._address).Length() <= _range;
&& (PEG._address - target._address).Length() <= _range;
}
public virtual void Reset()
@@ -37,6 +38,6 @@ public partial class PegAction : Node2D
public virtual MapCell Target(Peg PEG)
{
return PEG._cell;
return PEG.Goal();
}
}