From 2529d01ff4373928aaa4a419bc85f9ab1c399c5a Mon Sep 17 00:00:00 2001 From: cojoedmo Date: Fri, 26 Jun 2026 02:52:08 -0400 Subject: [PATCH] cleared up issue with pathing, but still an issue with attacks? --- Peg.cs | 15 ++++++--------- PegController.cs | 6 +++--- 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/Peg.cs b/Peg.cs index 3009ead..82795c6 100644 --- a/Peg.cs +++ b/Peg.cs @@ -57,18 +57,14 @@ public partial class Peg : HoverableNode { Map map = _pegController._playArea._map; List goals = GetGoals(); + List> paths = new(); - List bestPath = map.GetPath(_address, goals[0]); - for (int i = 1; i < goals.Count; i++) + for (int i = 0; i < goals.Count; i++) { - Vector2I testGoal = goals[i]; - List testPath = map.GetPath(_address, testGoal); - if (testPath.Count < bestPath.Count) - { - bestPath = testPath; - } + paths.Add(map.GetPath(_address, goals[i])); } - return bestPath; + + return paths.Where(p => p.Count > 0).OrderBy(p => p.Count).ToList()[0]; } public virtual List GetGoals() @@ -99,6 +95,7 @@ public partial class Peg : HoverableNode { _staminaRemaining = _stamina; _action._usesRemaining = _action._usesMax; + GD.Print("ACTION ",_action._usesRemaining,", ",_action._usesRemaining); } public virtual void ChangeHealth(int DELTA, Commander BALLER) diff --git a/PegController.cs b/PegController.cs index 5bb0d35..53892ab 100644 --- a/PegController.cs +++ b/PegController.cs @@ -79,7 +79,7 @@ public partial class PegController : TurnController _pegs.ForEach(e => e._path.Clear()); List remainingPegs = GetRemainingPegs(); - while (remainingPegs.Count > 0 && _actionLoop < 100) + while (remainingPegs.Count > 0 && _actionLoop < 10) { for (int i = 0; i < remainingPegs.Count; i++) { @@ -89,9 +89,9 @@ public partial class PegController : TurnController } remainingPegs = GetRemainingPegs(); _actionLoop++; - if (_actionLoop == 100) + if (_actionLoop == 10) { - GD.Print(string.Join(", ",remainingPegs.Select(p => p._address.ToString() + p._staminaRemaining+p.CanMove()+p.CanAct()))); + Peg peg_ = remainingPegs[0]; GD.Print("LOOPMAXEDOUT"); } }