Files
isaac-port/notes/systems/greed_mode.md
T

40 lines
3.5 KiB
Markdown

# Greed mode: waves, coins, Ultra Greed (found 2026-10-24, rif/ultra-greed)
- `Room::SpawnGreedModeWave` 0x816910: wave coins (ebp-0x54): normal 2 (Greedier 1), boss +2, Greedier wave 9 +1, 11 +3,
final wave 0, Lost-pressed flag (0x1839c & 0x800) -1, +1 when spawned-wave counter (0x18374) %3==0. Paid when the new
wave index > last paid (0x1836c): pennies (5.20.1) at FindFreePickupSpawnPosition near grid (width/2, 4), AppearFast.
Music: normal waves EnableLayer / 0x26 in stage 0x18; boss 9 (0x1a flag, 0x29 stage 4/5); final 0x17.
- 0x801ee0 (Room::Update greed part): wave timer; stage 7 boss room: Isaac above y 320 starts boss music 9, flag 0x1000.
- 0x7fb250 (named Entity_Bomb::Update, really the room-clear award): greed difficulty skips normal awards; boss 62 room
clear spawns 6.11 Greed Donation Machine per player 80 px random dir (only 6.11 spawn in the exe), and 5.340 big chest.
- `NpcAI::ENTITY_ULTRA_GREED` 0x59edb0: states 2 hang (60) 4 walk 3 idle(30) 100 slot 200 coin tantrum 300->310 dash
400 guard (coins>=6, ends <5) 500 spin once 510 spin 600 shoot 700/710 smash (v1) 6 jump (v1) 9000 death/morph 9001 final.
Anger h=clamp((i2+15-15*hpfrac)/25); pick every IsFrame(15) by WeightedOutcomePicker (weights in the code).
Slot faces: frame0 key x doors /8 ticks, 1 bomb 12 /2, 2 heart 7 /7, 3 spinner 7 /7.
- 0x59e730 smash helper: shockwave, 60 blast, sets doors state 8/9 (pairs via 0x59e630 slot map 0-2,1-3,4-6,5-7) or 10.
- 0x59e2a0 heal: hp += maxhp*0.00125*n, i2 += n (cap 25).
- `NpcAI::ENTITY_ULTRA_COIN` 0x5a4820: timers 225/60/150 * (0.5+0.5*UG hpfrac) (x0.9 hard); spinner decays mhp/330 a tick.
- `NpcAI::ENTITY_ULTRA_DOOR` 0x5a5b60: state 13 open, greed gaper (299) every 10 ticks for 80; 8/9 laser angle slot*90.
## Doors, button, saves (found 2026-10-24, rif/secret-doors)
- Door setup `GridEntity_Door::LoadSprite` 0x70d3f0: a treasure door uses Door_31_TreasureRoomDoorGreed (silver, KeyClosed
lock) in Greed unless its room or the current room is `_greedModeTreasureRoomIdx` (that one keeps Door_02, opens free).
Target room type 0x17 (greed exit) uses Door_32_ExitDoor. Port: stages.json greed/rooms[]/open and /door.
- Button 0x9839f0 (`GridEntity_PressurePlate::update_greed_button`): within 25 px while the wave timer (room+0x723c) > 0:
health type 2 (Lost) or HasInstantDeathCurse -> state flag 11 (0x1839c |= 0x800), else TakeDamage(1.0, 0x10000080).
SpawnGreedModeWave subtracts one coin while that flag is set and clears it. Port: GreedWaveState isPressDocked
(the coin deduction belongs in the wave-coins code of rif/ultra-greed).
- SpawnGreedModeWave music in full: normal waves EnableLayer(0) (stage 0x18: Crossfade 0x26); the last wave
((Greedier)+0xb) Crossfade 0x17 (Satan boss); boss waves Crossfade 0x29 on stage types 4/5, else 9 (0x1a if the room
descriptor flag 0x40). Port: music.json rules[]/when/waves (boss_wave -> boss, final -> boss_satan).
# Mega Satan door
- `Room::TrySpawnMegaSatanRoomDoor` 0x7f9df0: only in the start room of stage 11 (Chest/Dark Room), not Greed, with
the challenge flag (+0xe7) or the unlock; logs "[warn] no space for Mega Satan door" when the slot is taken.
Room index -7 (off grid) is the Mega Satan room; its door anm2 is Door_24_MegaSatanDoor ("Closed").
- Opened by `Entity_Familiar::ai_key_full` 0x61d6b0 (Key Piece 1+2 = Key Full familiar flies into it, both pieces
removed) or by `GridEntity_Door::TryUnlock` 0x710480 forced (Dad's Key): state 5 sets level flag 0x20000 as the
familiar does. Port: stages.json chapters[]/linked_rooms (LINKED_ROOM_INDEX 170, lock_items, Dad's Key via all_open).