public override double Value() { double total = 1; if (Coord.Distance(Target, Oponent.GetCultCenter().Position) < Coord.Distance(AllyPos, Oponent.GetCultCenter().Position)) { total += 2 * (1 + 1.0 / Coord.Distance(AllyPos, Oponent.GetCultCenter().Position)); } ETerrain terrainAtTarget = Boards.TerrainAt(Target); foreach (ETerrain terrain in CurPlayer.GetPawnAt(AllyPos).PositiveTerrains) { if (terrainAtTarget == terrain) { total += 1; break; } } foreach (ABasicPawn enemy in Oponent.GetAttackers()) { if (Coord.Distance(enemy.Position, CurPlayer.GetCultCenter().Position) < BoardConsts.MAX_COL / 2 && Coord.Distance(Target, enemy.Position) < Coord.Distance(AllyPos, enemy.Position)) { total += 3.0 * (1 + 1.0 / Coord.Distance(AllyPos, enemy.Position)); } } return(total); }
public override double Value() { double total = 10; if (Oponent.GetUnitAt(Target) is CulturalCenter) { total += 1.0; } double remainingHealth = Oponent.GetUnitAt(Target).CurrLife / Oponent.GetUnitAt(Target).TotalLife; if (remainingHealth < 0.5) { total += 3.0; } if (Coord.Distance(Target, CurPlayer.GetCultCenter().Position) < BoardConsts.MAX_COL / 2) { total += 1 + 100 / Coord.Distance(Target, CurPlayer.GetCultCenter().Position); } return(total); }