implemented visibility, so pegs can only scope out as far as they can see.
This commit is contained in:
@@ -9,7 +9,6 @@ public partial class BasicMovement : PegAction
|
||||
base._Ready();
|
||||
_category = "movement";
|
||||
_priority = 0;
|
||||
_healthChange = 0;
|
||||
_cost = 1;
|
||||
_range = 2^32;
|
||||
_usesMax = 2^32;
|
||||
@@ -17,23 +16,28 @@ public partial class BasicMovement : PegAction
|
||||
}
|
||||
|
||||
public override Tween CreateAnimation(Peg PEG)
|
||||
{
|
||||
PegController pegController = PEG._pegController;
|
||||
Map map = pegController._playArea._map;
|
||||
Vector2I cell = PEG._path[0];
|
||||
Tween subtween = CreateTween();
|
||||
subtween.TweenProperty(PEG, "global_position", map.GetCellPositionFromAddress(cell), 0.25f);
|
||||
PEG._path.RemoveAt(0);
|
||||
return subtween;
|
||||
}
|
||||
|
||||
public override void DoImmediately(Peg PEG)
|
||||
{
|
||||
List<Vector2I> path = PEG.GetBestPath();
|
||||
PegController pegController = PEG._pegController;
|
||||
Map map = pegController._playArea._map;
|
||||
if (path?.Count == 0)
|
||||
{
|
||||
return null;
|
||||
return;
|
||||
}
|
||||
Vector2I cell = path[0];
|
||||
|
||||
map.SetCellPeg(cell, PEG);
|
||||
PEG._path.Add(cell);
|
||||
|
||||
Tween subtween = CreateTween();
|
||||
subtween.TweenProperty(PEG, "global_position", map.GetCellPositionFromAddress(cell), 0.25f);
|
||||
|
||||
return subtween;
|
||||
}
|
||||
|
||||
public override bool MeetsCriteria(Peg PEG)
|
||||
|
||||
Reference in New Issue
Block a user