add target visualization for boat attacks (#2025)

## Description:
- Adds warship count, transport count (deployed out of maximum) to unit
display
- Adds a target that appears when a boat attack is dispatched, which
disappears when the boat attack arrives
- Updates the unit display alt text to pass through translation

## Please complete the following:

- [X] I have added screenshots for all UI updates (see below)
- [X] I process any text displayed to the user through translateText()
and I've added it to the en.json file (in this case it is only alt-text)
- [X] I have added relevant tests to the test directory (n/a, fully
visual)
- [X] I confirm I have thoroughly tested these changes and take full
responsibility for any bugs introduced

See new target effect and addition to units display 

As each transport ship arrives, the target draw stops, together with the
effect for the trail.


https://github.com/user-attachments/assets/c36c57d3-e2b7-456e-85ab-1e786bd28a07

## Please put your Discord username so you can be contacted if a bug or
regression is found:

@dxtron_28992 (my invite is still pending to dev discord)
This commit is contained in:
Will Dunlop
2025-09-24 19:08:52 +01:00
committed by GitHub
parent 019a9dc57c
commit eeb9f0c279
3 changed files with 117 additions and 0 deletions
@@ -133,6 +133,12 @@ export class TransportShipExecution implements Execution {
troops: this.startTroops,
});
if (this.dst !== null) {
this.boat.setTargetTile(this.dst);
} else {
this.boat.setTargetTile(undefined);
}
// Notify the target player about the incoming naval invasion
if (this.targetID && this.targetID !== mg.terraNullius().id()) {
mg.displayIncomingUnit(
@@ -169,6 +175,10 @@ export class TransportShipExecution implements Execution {
if (this.boat.retreating()) {
this.dst = this.src!; // src is guaranteed to be set at this point
if (this.boat.targetTile() !== this.dst) {
this.boat.setTargetTile(this.dst);
}
}
const result = this.pathFinder.nextTile(this.boat.tile(), this.dst);