Strange Key's Pandora's Box branch (UseActiveItem 0x5ba903): pool table read as ItemPoolType (6/8/12 = library/golden chest/curse, correcting parity_rooms2), shuffle, spawn loop; rng_vector_at 0x5cbd00

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-10-30 19:38:00 -04:00
1 parent cba1310e2e
commit 8aa913ef2b
3 files changed
+39 -1

No files matched your search

+37
View File
@@ -0,0 +1,37 @@
# Strange Key (TRINKET_STRANGE_KEY 175 / 0xaf): Pandora's Box part
Ported to isaac-classic (items parity sweep, branch items/strange_key): Strange Key's pandora_items trait, read by
Pandora's Box's record (item_give shuffled_pools + count_trait, item_remove trait).
## Pandora's Box with Strange Key (UseActiveItem 0x5b39d0, Pandora's case at 0x5ba8e0..0x5baaf3)
- Before either branch: sound 0x37e (both branches play it).
- `HasTrinket(player, 0xaf)` (0x5ba901): count 6 (-0x5e0), `GetTrinketMultiplier` 0x7cb6e0 == 2 -> 8, == 3 -> 10,
anything else 6. Then `TryRemoveTrinket(0xaf)` 0x771f60 (one copy: a slot's, else a smelted one via
TryRemoveSmeltedTrinket).
- Pool table on the stack at -0xc0 (ItemPoolType values, REPENTOGON's enum):
- normal (`Game::IsGreedMode` 0x6f8120 false): xmm 0xbab230 = {0, 2, 1, 3}, then -0xb0 xmm 0xbab4b0 = {4, 6, 8, 12},
-0xa0 = 0x1a, -0x9c = 5; n = 10:
TREASURE, BOSS, SHOP, DEVIL, ANGEL, LIBRARY, GOLDEN_CHEST, CURSE, PLANETARIUM, SECRET.
- Greed: xmm 0xbab580 = {16, 17, 18, 19}, xmm 0xbab5c0 = {20, 6, 8, 21}, -0xa0 = 0x1a; n = 9:
GREED_TREASURE, GREED_BOSS, GREED_SHOP, GREED_DEVIL, GREED_ANGEL, LIBRARY, GOLDEN_CHEST, GREED_CURSE, PLANETARIUM
(the normal list with each pool's Greed pool, SECRET left out). -0x9c is not written on the Greed path, so a
multiplier-3 Strange Key (10 items) in Greed reads a stale stack slot for the 10th pool. (Names by REPENTOGON's
enum, 19 / 20 / 21 = GREED_DEVIL / GREED_ANGEL / GREED_CURSE; itempools.xml lists greedCurse before greedDevil,
so whether the exe's indices follow the enum or the file's order was not checked. The set is the same either way.)
- CORRECTION to parity_rooms2.md: 6 / 8 / 12 are LIBRARY / GOLDEN_CHEST / CURSE, not golden chest / red chest /
ultra secret (POOL_RED_CHEST is 9, POOL_ULTRA_SECRET 24). Neither red chest nor ultra secret pool is used here.
- Shuffle (0x5ba9d0..0x5baa12): for i in 0 .. n-2: `r = i + RNG::RandomInt(rng, n - i)` (0x7e9020); if r != i,
`swap_ints 0x5cbf90(&pools[i], &pools[r])`. rng = `rng_vector_at 0x5cbd00(&player->_collectibleRNGs, 0x129)`
(Pandora's Box's own collectible RNG).
- Spawn loop (0x5baa30..): k = 0 .. count-1: seed = rng.Next() (0x7e90f0), then
`ItemPool::GetCollectible 0x733610(pool = pools[k], rng.Next(), 0, 0, 0)`,
`Room::FindFreePickupSpawnPosition 0x813520(player->_pos, 40.0, 0, 0, 0)`, `Game::Spawn(5, 100, pos, zero, player,
item, seed)`. Then `goto` the switch's common end: Pandora's own chapter effect does not run.
## Not ported yet
- `Room::TrySpawnBlueWombDoor 0x820170`: held -> isIgnoreTime (the `_blueWombParTime` test). The port has no Blue Womb
door / par time / room -8; to come with that route.
- `Entity_Pickup::HandleCollision 0x6e8ae0`: on stage 9 at multiplier >= 2 chests 0x3c / 0x35 / 0x37 open without a
key (not read further this session).