implemented more code for adding more pegs, but still a lot of work to do on pathfinding, targeting, map etc.
This commit is contained in:
@@ -18,7 +18,6 @@ public partial class BasicMovement : PegAction
|
||||
|
||||
public override Tween CreateAnimation(Peg PEG)
|
||||
{
|
||||
GD.Print(PEG._address);
|
||||
PegController pegController = PEG._pegController;
|
||||
Map map = pegController._playArea._map;
|
||||
Vector2I cell = PEG._path[0];
|
||||
@@ -33,7 +32,7 @@ public partial class BasicMovement : PegAction
|
||||
|
||||
public override void DoImmediately(Peg PEG)
|
||||
{
|
||||
List<Vector2I> path = PEG.GetBestPath();
|
||||
List<Vector2I> path = PEG.GetBestPath(true);
|
||||
PegController pegController = PEG._pegController;
|
||||
Map map = pegController._playArea._map;
|
||||
if (path?.Count == 0)
|
||||
@@ -48,7 +47,8 @@ public partial class BasicMovement : PegAction
|
||||
|
||||
public override bool MeetsCriteria(Peg PEG)
|
||||
{
|
||||
return base.MeetsCriteria(PEG) && PEG._address.Y > PEG._pegController._playArea._map._firstOpenRow;
|
||||
List<Vector2I> bestPath = PEG.GetBestPath(true);
|
||||
return base.MeetsCriteria(PEG) && bestPath.Count > 0 && (int)PEG._pegController._playArea._map.GetCellTileData(bestPath[0]).GetCustomData("disposition") != -PEG._disposition;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user