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:
2026-07-01 02:36:31 -04:00
parent 2c289333f0
commit bbe9eefcfa
7 changed files with 106 additions and 31 deletions
+23
View File
@@ -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;
}
}