Miniboss warps
This page explains how to modify miniboss portal warps.
The code for the miniboss portal object (INTERAC_MINIBOSS_PORTAL) can be found in object_code/common/interactions/minibossPortal.s#L140. The data structure which determines where the warps lead to looks as follows:
; Each row corresponds to a dungeon. The first byte is the miniboss room index, the second
; is the dungeon entrance (the two locations of the portal).
; If bit 7 is set in the miniboss room's flags, the portal is enabled.
@dungeonRoomTable:
.ifdef ROM_AGES
.db $01 $04
.db $18 $24
.db $34 $46
.db $4d $66
.db $80 $91
.db $b4 $bb
.db $12 $26
.db $4d $56
.db $82 $aa
.else
.db $01 $01
.db $0b $15
.db $21 $39
.db $48 $4b
.db $6a $81
.db $a2 $a7
.db $c8 $ba
.db $42 $5b
.db $72 $87
.endif
The first part is for Ages' warps, the second part (after the .else
) is for Seasons' warps. The data format is explained in the comments, but let's break it down anyway.
The first 2 lines for Ages are:
.db $01 $04
.db $18 $24
These are for dungeons 0 and 1, respectively. It's interesting that dungeon 0, maku path, would have data for this, considering there is no miniboss in that dungeon. In any case, let's skip over that and focus on the data for dungeon 1:
.db $18 $24
This data serves two purposes:
- Tells the game which room is the miniboss room, for determining whether the warps should be active (checks
ROOMFLAG_80
in that room to decide, see room flags). - Tells the game the destinations of the two respective warps.
Here, $18
is the room index for the miniboss room, as we can confirm in LynnaLab. Note that while LynnaLab lists the room index as $418
, we ignore the starting $4
in this case, and look only at the lower byte value, $18
. The starting $4
is actually the group number. The game assumes that the group number will remain unchanged between the two rooms, so it doesn't require that value to be specified here.
Then, $24
is the dungeon's starting room, which you can confirm in the same way.
This tells the game where the portals should send you. It does NOT tell the game to spawn a miniboss portal in those respective rooms. In addition to changing the above data, you would also need to create an instance of INTERAC_MINIBOSS_PORTAL
in the respective rooms.