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;
|
||||
List<Vector2I> goals = GetGoals();
|
||||
List<List<Vector2I>> paths = new();
|
||||
|
||||
List<Vector2I> 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<Vector2I> 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<Vector2I> 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)
|
||||
|
||||
Reference in New Issue
Block a user