minor changes, next step is to add 2-3 friendly pegs, 2 neutral pegs, 2 hostile pegs, 2 buildings and all associated actions for these additions
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
using Godot;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public partial class Spearman : FriendlyPeg
|
||||
{
|
||||
public override void _Ready()
|
||||
{
|
||||
base._Ready();
|
||||
_stamina = 2;
|
||||
_visibility = 4;
|
||||
}
|
||||
|
||||
public override List<Vector2I> GetGoals()
|
||||
{
|
||||
Map map = _pegController._playArea._map;
|
||||
List<Peg> enemies = [.. _pegController._pegs.Where(p => p._disposition == -_disposition)];
|
||||
List<Vector2I> neighboring = [.. map._cells.Where(c => enemies.Any(e => (e._address - c).Length() <= 1f))];
|
||||
List<Vector2I> closest = [.. neighboring.OrderBy(c => (c - _address).Length())];
|
||||
return closest;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user