cleared up issue with pathing, but still an issue with attacks?
This commit is contained in:
@@ -57,18 +57,14 @@ public partial class Peg : HoverableNode
|
|||||||
{
|
{
|
||||||
Map map = _pegController._playArea._map;
|
Map map = _pegController._playArea._map;
|
||||||
List<Vector2I> goals = GetGoals();
|
List<Vector2I> goals = GetGoals();
|
||||||
|
List<List<Vector2I>> paths = new();
|
||||||
|
|
||||||
List<Vector2I> bestPath = map.GetPath(_address, goals[0]);
|
for (int i = 0; i < goals.Count; i++)
|
||||||
for (int i = 1; i < goals.Count; i++)
|
|
||||||
{
|
{
|
||||||
Vector2I testGoal = goals[i];
|
paths.Add(map.GetPath(_address, goals[i]));
|
||||||
List<Vector2I> testPath = map.GetPath(_address, testGoal);
|
|
||||||
if (testPath.Count < bestPath.Count)
|
|
||||||
{
|
|
||||||
bestPath = testPath;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return bestPath;
|
|
||||||
|
return paths.Where(p => p.Count > 0).OrderBy(p => p.Count).ToList()[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual List<Vector2I> GetGoals()
|
public virtual List<Vector2I> GetGoals()
|
||||||
@@ -99,6 +95,7 @@ public partial class Peg : HoverableNode
|
|||||||
{
|
{
|
||||||
_staminaRemaining = _stamina;
|
_staminaRemaining = _stamina;
|
||||||
_action._usesRemaining = _action._usesMax;
|
_action._usesRemaining = _action._usesMax;
|
||||||
|
GD.Print("ACTION ",_action._usesRemaining,", ",_action._usesRemaining);
|
||||||
}
|
}
|
||||||
|
|
||||||
public virtual void ChangeHealth(int DELTA, Commander BALLER)
|
public virtual void ChangeHealth(int DELTA, Commander BALLER)
|
||||||
|
|||||||
+3
-3
@@ -79,7 +79,7 @@ public partial class PegController : TurnController
|
|||||||
_pegs.ForEach(e => e._path.Clear());
|
_pegs.ForEach(e => e._path.Clear());
|
||||||
|
|
||||||
List<Peg> remainingPegs = GetRemainingPegs();
|
List<Peg> remainingPegs = GetRemainingPegs();
|
||||||
while (remainingPegs.Count > 0 && _actionLoop < 100)
|
while (remainingPegs.Count > 0 && _actionLoop < 10)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < remainingPegs.Count; i++)
|
for (int i = 0; i < remainingPegs.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -89,9 +89,9 @@ public partial class PegController : TurnController
|
|||||||
}
|
}
|
||||||
remainingPegs = GetRemainingPegs();
|
remainingPegs = GetRemainingPegs();
|
||||||
_actionLoop++;
|
_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");
|
GD.Print("LOOPMAXEDOUT");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user