feat: WarShips red color outside if target current player

Hard to know when warship captures your trade so if they target one of
your trade or war ship they are highlighted in red.
Known limitation: doesn't work well if the WarShip is already in red
(player's color)
This commit is contained in:
ilan schemoul
2025-03-04 00:46:22 +01:00
parent 9fd1203d50
commit d2208755c4
6 changed files with 38 additions and 9 deletions
+1
View File
@@ -96,6 +96,7 @@ export class WarshipExecution implements Execution {
return distSortUnit(this.mg, this.warship)(a, b);
})[0] ?? null;
this.warship.setTarget(this.target);
if (this.target == null || this.target.type() != UnitType.TradeShip) {
// Patrol unless we are hunting down a tradeship
const result = this.pathfinder.nextTile(