Party Avatar Presentation and Command Gate - HoraceAndTheSpider/Bloodwych-68k GitHub Wiki

Party avatar presentation and command gate

In SPS 439, each player's interface record contains a one-byte avatar presentation state at PlayerX_Data+$3E. It is not a record of whether a party member is alive or present. It is four independent presentation bits:

Bit Slot Normal presentation Set presentation
0 Main champion large portrait full-length character
1 First lower shield shield avatar selected/full-length shield character
2 Second lower shield shield avatar selected/full-length shield character
3 Third lower shield shield avatar selected/full-length shield character

Click_ChampionPresentationOrPartyCommand at memory $420C toggles one of these bits with bchg. A click in a lower shield row (local Y at least $37) derives bit 1--3 from the 32-pixel X column; a click left of X $30 in the upper region toggles bit 0.

The bit change is independent of the slot's visible artwork. A dead champion keeps its dead shield picture and a vacant slot keeps its empty shield picture, but their lower presentation bit still toggles. This invisible state matters to the party-command gate.

Opening party commands

The compact statistics area begins at X $30. Enter_PartyCommandInterface at $4234 copies the presentation byte and masks it with $0E. If any lower slot bit is set, it returns without opening the command interface. The main avatar bit does not block entry.

When all lower bits are clear, the routine clears the command-selection state, clears the complete presentation byte, and draws the party-command interface. Thus a successful command entry restores all four avatar presentations, including invisible state held by dead or vacant slots.

Movement reset

After a successful dungeon position update, Store_PlayerXY at $6F38 tests the presentation byte. A non-zero value is cleared in full before the party-command interface is redrawn. Movement therefore provides a reliable way to reset every avatar presentation bit; it is not limited to whichever standing character was visibly drawn.

Status bars

Draw_MainPlayerInterface checks only bit 0. With bit 0 clear it draws the leader's three compact horizontal values. With bit 0 set it calls Draw_PartyShieldStatusBars, which draws a vertical HP bar for each eligible party slot. The lower presentation bits do not select that status-bar mode.

The class/alignment bar-colour lookup is four bytes at memory $81CA (binary offset $7E46): $06, $0D, $0C, $07.