From 8aa913ef2b29aa07de575ddc95f84ab6471d29dd Mon Sep 17 00:00:00 2001 From: shweet Date: Fri, 30 Oct 2026 19:38:00 -0400 Subject: [PATCH] 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 --- db/names.tsv | 1 + notes/items/parity_rooms2.md | 2 +- notes/items/parity_strange_key.md | 37 +++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 notes/items/parity_strange_key.md diff --git a/db/names.tsv b/db/names.tsv index 06e1553..f5cacbb 100644 --- a/db/names.tsv +++ b/db/names.tsv @@ -3491,3 +3491,4 @@ 007cbcb0 Entity_Player::resolve_tainted_soul returns +0x1e68 (the Forgotten body) when the player type is 0x28 (Tainted Soul) and it is set, else the player itself 007d4340 Entity_Player::get_salvation_scale clamp(GetCollectibleEffect(0x2b8).count * 0.1 + 1, 1, 2) (asm; returns in XMM0); x1.2 is the halo's _scale (Entity_Player::Update, update_effects 0x799548) 0073d9b0 Level::get_door_slot GetTargetSlot 0073da40's helper: the door slot on a side of roomIdx for the cell roomIdx names (slot +4 for a second row/column), -1 when the room data lacks it (parity_blue_rooms) +005cbd00 rng_vector_at ? (ECX = RNG vector, index): &begin[index] (16-byte RNGs); UseActiveItem Pandora + Strange Key: player->_collectibleRNGs (+0x1770)[0x129]; parity_strange_key diff --git a/notes/items/parity_rooms2.md b/notes/items/parity_rooms2.md index 6226bc6..7640acb 100644 --- a/notes/items/parity_rooms2.md +++ b/notes/items/parity_rooms2.md @@ -67,7 +67,7 @@ Repentance+ 1.9.7.17. Follows parity_rooms.md (its findings are not repeated). P 5.10.6; < .63 5.100.0 (room pool); < .65 IncrementPlayerFormCounter(8 Leviathan, 3); else nothing. Each at FindFreePickupSpawnPosition(spike pos). -## Strange Key (TRINKET_STRANGE_KEY 175 / 0xaf): not ported (see the rooms2 questions) +## Strange Key (TRINKET_STRANGE_KEY 175 / 0xaf): Pandora's part ported, see parity_strange_key.md (its pool names correct these) - `Room::TrySpawnBlueWombDoor 0x820170`: held -> isIgnoreTime (the `_blueWombParTime` test). - Pandora's Box (UseActiveItem 0x5b39d0, at 0x5ba903): removed; count 6, multiplier 2 -> 8, 3 -> 10; pools 0xbab230 / diff --git a/notes/items/parity_strange_key.md b/notes/items/parity_strange_key.md new file mode 100644 index 0000000..3775517 --- /dev/null +++ b/notes/items/parity_strange_key.md @@ -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).