Add retreating warship indicator and warship 2-color treatment

Warships now render with a dedicated center accent band so their state
reads at a glance:
- Normal: center + outer ring share the territory color (2-color look),
  hull uses the border color.
- Angry (attacking): outer ring and center turn red.
- Retreating to repair: the center blinks black.

The warship sprite center moved to its own gray value (100) in the unit
atlas so the shader can drive it via a new fourth replacement band, with
no per-unit-type branching — the missiles' shared 130 blend band is
untouched.

Warship repair-retreat (warshipState.state === "retreating") now feeds
the existing UnitState.retreating boolean in UnitView, which UnitPass
maps to a FLAG_RETREATING instance flag.
This commit is contained in:
evanpelle
2026-06-08 17:32:21 -07:00
parent 611560a0b2
commit 65e99b25e7
4 changed files with 36 additions and 15 deletions
+6 -2
View File
@@ -53,7 +53,9 @@ function unitStateFromUpdate(u: UnitUpdate): UnitState {
lastPos: u.lastPos,
isActive: u.isActive,
reachedTarget: u.reachedTarget,
retreating: u.transportShipState?.isRetreating ?? false,
retreating:
(u.transportShipState?.isRetreating ?? false) ||
u.warshipState?.state === "retreating",
targetable: u.targetable,
markedForDeletion: u.markedForDeletion,
health: u.health ?? null,
@@ -79,7 +81,9 @@ function applyUpdateInPlace(target: UnitState, u: UnitUpdate): void {
target.lastPos = u.lastPos;
target.isActive = u.isActive;
target.reachedTarget = u.reachedTarget;
target.retreating = u.transportShipState?.isRetreating ?? false;
target.retreating =
(u.transportShipState?.isRetreating ?? false) ||
u.warshipState?.state === "retreating";
target.targetable = u.targetable;
target.markedForDeletion = u.markedForDeletion;
target.health = u.health ?? null;