From 5e054d502ae478aa70b22e95cf6d816453a61f1f Mon Sep 17 00:00:00 2001 From: shweet Date: Sat, 24 Oct 2026 15:20:17 -0400 Subject: [PATCH] Greed doors/button/music and the Mega Satan door (rif/secret-doors) --- db/names.tsv | 3 +++ notes/README.md | 2 +- notes/systems/greed_mode.md | 22 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/db/names.tsv b/db/names.tsv index 92cacf8..64a4c59 100644 --- a/db/names.tsv +++ b/db/names.tsv @@ -377,3 +377,6 @@ 009bfd40 NpcHelper::hush_fly_shape_build Hush Fly path: 1/2 = 5/6-point stars (inner .382/.577), 3-5 polygons, 6 = 31-gon; cumulative lengths 009bffb0 NpcHelper::hush_fly_shape_point Hush Fly path: point at share of total length (fmod), linear between vertices 00548720 NpcHelper::leper_flesh_ai Leper 310.1 body (called from NpcAI::ENTITY_LEPER with ECX = npc); death aimed shot at 10 +0070d3f0 GridEntity_Door::LoadSprite door setup: loads Door_*.anm2 by room type / target idx (-7 Mega Satan, -8 blue womb, -9 Hush), greed treasure door 31 for the room that is not _greedModeTreasureRoomIdx, exit door 32 for type 0x17 +0061d6b0 Entity_Familiar::ai_key_full Key Full familiar: flies to the door in state 5 (gridpos - (13.85, 7.69)), turns layer to 90 by 2/tick, within 3 px: SOUND_GOLDENKEY, door state 8 + Open, removes Key Piece 1/2 (0xee/0xef) +009839f0 GridEntity_PressurePlate::update_greed_button greed button (plate state 2 branch of Update): pressed mid-wave damages 1 heart (half), or sets state flag 11 (0x1839c|0x800) for health type 2 / instant death curse diff --git a/notes/README.md b/notes/README.md index 4e68387..7686b75 100644 --- a/notes/README.md +++ b/notes/README.md @@ -6,7 +6,7 @@ stored here: `./decompile.sh 0xADDR` prints it from the dump, with the current n | folder | contents | |---|---| | `entities/` | per-entity findings from the monster-fidelity passes (state machines, timings, speeds, what the port changed or skipped) | -| `systems/greed_mode.md` | Greed waves' coins and music, Ultra Greed/coins/doors states, donation machine spawn | +| `systems/greed_mode.md` | Greed waves' coins and music, Ultra Greed/coins/doors states, donation machine spawn, Greed doors/button, Mega Satan door | | `items/items_sweep_10.md` | Smelter/Guppy's Tail room drop variant, Daemon's Tail pickup picker, I'm Drowsy slowdown, Guillotine orbit layer + orbit distance table, Converter | | `items/items_sweep_11.md` | Nancy Bombs flag roll (GetBombFlags) | | `characters/` | Rebirth behaviour + port design for tainted characters and Jacob & Esau | diff --git a/notes/systems/greed_mode.md b/notes/systems/greed_mode.md index dc33d1a..74d3e17 100644 --- a/notes/systems/greed_mode.md +++ b/notes/systems/greed_mode.md @@ -15,3 +15,25 @@ - 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).