mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-16 04:20:07 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user