Files
isaac-port/notes/systems/rules_pickups.md
T
2026-10-26 11:15:03 -04:00

12 KiB

Rules: pickups (room clear awards, random pickup variants, chests, tinted rocks, champion drops)

Flash engine side = isaac-classic src/game/pickups/{room_rewards,rewards,pickup,chest}.cpp, src/game/props/tinted_rock.cpp, src/game/enemies/enemy_death_effects.cpp, data rooms.json rewards, entities.json shared_rules/pickups/{physics,chests}, champions.json drop. Numbers below are Repentance+ 1.9.7.17. "one in N" = RandomInt(N) == 0.

Room::SpawnClearAward (Function 0x7fb250)

Called from Room::TriggerClear 0x8068f0 only when the room descriptor's flag 0x80 (bit 7 of +0x44, no-reward) is clear, and from Ambush::Update 0x834350 (challenge room / boss rush end). RNG = room descriptor seed (+0x60), shifts 5,9,7.

Branches:

  • Greed/Greedier (difficulty 2/3): own branch (see greed.md), never the normal award.
  • room type 5 (boss) and 17 (boss rush): boss branch (pedestal, trapdoor 17, heaven light 1000.39, 5.340 big chest, 5.370 trophy, ending checks). Fixed boss items: bossId 19 Gish -> 99, 20 Steven -> 50 or (5/6) 100, 21 C.H.A.D. -> 96, 22 Headless Horseman -> 130, 38 Conquest -> 181, horsemen (9-12, 22, 38) -> 1/2 73 Cube of Meat / 207 Ball of Bandages (the held one if any), boss rush + 550 -> 551, bossId 84 -> 650 (once), each only while ItemPool::is_collectible_available; otherwise ItemPool::GetSeededCollectible (room pool). There's Options (249) / More Options: second pedestal.
  • room type 16 (crawl space) and the mineshaft dimension (Level::HasAbandonedMineshaft && dimension 1): nothing.
  • every other room type (normal, challenge, miniboss, start, ...): the normal award below. No start-room branch.

Normal award:

  1. variant = RoomClear_PickVariant(rng, isForce = 0) (0x7fa920, below). 0 = nothing.
  2. count = 1. Contract from Below (241, variant != 350 trinket): count = N + 1, zeroed when RandomFloat() < 0.666^N * 0.5.
  3. Hard mode (difficulty 1) and variant == 10 heart: count zeroed unless RandomInt(100) < 66 (34 % of heart awards vanish).
  4. Glyph of Balance (464, non-chest) picks its own variant/subtype; trinket 150 (Blue Key) multiplies count when the descriptor's first field is -16 (meaning unverified).
  5. Deep Pockets (416): variant 20, 0 or count 0 -> coins, count = max(1, RandomInt(3) + count).
  6. Rib of Greed (trinket 84) x2+ on a coin award: 666 / 1300 of 10000 -> coin subtype from {4,2,3,5,7}.
  7. Each copy: Game::Spawn(5, variant, FindFreePickupSpawnPosition(room centre), subtype) with subtype 0 (random; Entity_Pickup::Init picks it, see below) unless one of the above set it. A 52/54 (spiked/mimic) chest whose spot can't hold an obstacle morphs to 5.50.1. Options? (670) -> spawn_options_alternative.
  8. Then: Old Capacitor (143) Lil Battery chance min((0.2 + 0.03 luck) x mult, 0.33); Temporary Tattoo (177) in a challenge room (11): 5.100 / 5.50 + stat ups; challenge 43: a 5.300.1.

RoomClear_PickVariant (Function 0x7fa920)

  • roll = RandomFloat; Lucky Foot (46): roll = roll * 0.9 + 0.1.
  • L = sum of Luck (+0x156c) over non-ghost main players, clamped to [0, 10]. roll += RandomFloat * L * 0.1. (Negative luck has no effect.)
  • Lucky Toe (trinket 42): roll = roll * 0.9 + 0.1, or * 0.98 + 0.02 with Lucky Foot and L > 0.
  • Options? (670): roll < 0.06 -> 1 - (roll / 0.06) * 0.78. isForce: roll <= 0.22 -> 0.2201 + (roll / 0.22) * 0.7799.
  • roll <= 0.22: 0 (nothing; skips everything but Guppy's Tail).
  • < 0.30: one in 3 card 300, else rand & 1 == 0 trinket 350, else pill 70.
  • < 0.45 (< 0.50 with Rib of Greed, trinket 84): coin 20.
  • < 0.60: heart 10 (Daemon's Tail 22: 4 in 5 go on to the next band, i.e. key).
  • < 0.80: key 30. < 0.95: bomb 40. else chest 50.
  • Watch Battery (72): one in 15 -> 90. Gilded Key (159): x2 one in 10, x3 one in 4 -> 50. Trinkets Ace of Spades 45 / Safety Cap 44 / Child's Heart 34 / Match Stick 41 / Rusted Key 36: 10 / 20 / 50 % (x1/x2/x3) -> 300/70/10/40/30.
  • one in 50 -> 69 (grab bag), unconditional (any award that was not nothing).
  • Smelter (479): one in 50 -> 350. Guppy's Tail (134): one in 3 -> 50 or 60 (1/2); else (not force) one in 3 nothing.

Entity_Pickup::Init (Function 0x6e02f0), Pickup_PickVariant (Function 0x6ddcd0)

Init calls Pickup_PickVariant(&variant/&subtype, 1, 0) first; shop items (150) call it again. Variants:

  • 5.0.N (random pickup), WeightedOutcomePicker: coin 20 x20 (not N=3), heart 10 x15, key 30 x15, bomb 40 x15, chest 50 x5 and locked 60 x5 (not N=1,3,4), pill 70 x4, card 300 x4, battery 90 x2, trinket 350 x1 (not N=4), collectible 100 x1 (N=0 only). Total 87 for N=0. Daemon's Tail: a heart is redrawn 4 in 5 from {coin 20, key 15, bomb 15, heart 15}. Rib of Greed: first float < 0.1 -> coin; Watch Battery: 0.1-0.2 -> battery.
  • 5.10.0 heart, sequential (later wins): full 1; one in 2 half 2; one in 20 (hard mode: 50) double 5; one in 50 rotten 12 (unlock 0x19b); one in 100 scared 9 (unlock 0x148); one in 100 blended 10; one in 50 eternal 4 (also Bible Tract 18: one in 30/mult; Key Piece 1/2: one in 40 each); soul branch when one in 10 (or Mitre 173 one in 3, Mom's Pearl 38 one in 10/mult, Eve (player 5) one in 16): soul 3, then one in 4 half soul 8 (unlock 0x21), one in 20 bone 11 (unlock 0x187), one in 20 black 6 (Black Lipstick 17: one in 10/mult), one in 5 bone for The Forgotten/Soul; one in 160 gold 7 (unlock 0xe0); Daemon's Tail -> black. Super secret rooms (type 8) force a subtype by room variant. No luck term anywhere.
  • 5.20.0 coin: penny 1; one in 20 nickel 2, else (still penny) one in 100 sticky 6 (unlock 0xf0); one in 100 dime 3, else (still penny) one in 100 lucky 5 (unlock 0xf2); one in 200 golden 7 (unlock 0x265). No luck term. Double penny 4 only from Humbleing Bundle (203).
  • 5.30.0 key: weights {key 1: 49, golden 2: 1, charged 4: 1 (unlock 0x14d, else +1 to key)}.
  • 5.40.0 bomb: single 1; one in 7 double 2; one in 100 golden 4 (unlock 0xe2); one in 50 megatroll 5 (golden: 6); one in 10 troll 3 (golden: 6). BOGO Bombs (250) / Humbleing Bundle: single -> double.
  • 5.50.0 chest: one in 40 mimic 54; else one in 20 red 360; else one in 50 bomb chest 51; else one in 80 spiked 52; else one in 100 grab bag 69; else one in 80 wooden 56 (unlock 0x261); else one in 40 haunted 58 (unlock 0x263, not in room shapes 2,3,5,7). Then the locked-chest step for 50/60 subtype 0: one in 1600 eternal 53; Left Hand (61) -> red 360; Gilded Key -> 60; 60: one in 120 mega 57 (unlock 0x259, subtype 2..8). A spiked 52 with Flat File (151) -> 54.
  • 5.69.0 sack: grab bag 1; one in 100 black sack 2 (unlock 0x25c).
  • 5.70.0 pill: ItemPool::GetPill. 5.300.0: GetCardEx(rng, 25, 10, 10, 1). 5.350.0: GetTrinket, card if empty.
  • 5.90.0 battery: lil 1; micro 2 when unlock 0x21 and rand % 3 != 0 (or hard mode and an odd draw, unverified); one in 100 mega 3, else one in 120 golden 4 (unlock 0x267).
  • Keeper-only parties: shop hearts become 50/50 bombs/keys. Challenge 25: hearts -> coins. Entity_Pickup::Morph (0x6e30a0) re-runs Init on the new variant/subtype (so subtype 0 is re-rolled).

Entity_Pickup::GetChestLoot (Function 0x6dae40)

One RNG (the pickup's drop RNG). Ordinary (50, also 52 spiked, 54 mimic) and "golden" (60 locked, 51 bomb, 53 eternal, 57 mega) draw ONE outcome (mega: 5 outcomes, 1/2 two treasure-pool items instead):

  • ordinary: trinket 10, chest 50 1, locked 60 1, pill 10, pickups 78.
  • golden: trinket 10, chest 1, locked 1, card 10, item 20 (pool 8 golden chest), pickups 58. Mega chest has no chest/locked/item weights. Gilded Key: pickups 80 (the 9-kind table) + item 20.
  • pickups: n = max(2, RandomInt(4)) ordinary / max(2, RandomInt(7)) golden; Lucky Toe +1 when RandomInt(3) != 0; Mom's Key x2. Each: coins 35 (RandomInt(3) + 1 random coins), heart 20 (Daemon's Tail 4), key 15, bomb 30. No heart cost, no chest inside the pickups.
  • stage 11 non-Greed: every one of these chests gives a pool-0 (treasure) item (mega: two).
  • red chest 360 (stage 11 with a condition: devil pool 3 item, unverified): item pool 9 x10, teleport x5 (not in rooms -1/-12), 2 spiders 85 x13 (Left Hand x3 drops it), megatroll 4.4 x13, 3 blue flies x7, 3 blue spiders x7, 1-2 soul hearts x15 (Daemon's Tail 3), 2 troll bombs 5.40.3 x15, 2 pills x15.
  • old chest 55: soul hearts 43 / 3 trinkets 42 / pool 27 item 10 / pool 4 item 5. wooden 56: pool 29 item 2 / cards 10 / pills 10. sack 69: RandomInt(2) + 2 draws. Mom's chest 390: pool 15 item (or 580 before unlock 0x19f).

GridEntity_Rock::SpawnDrops (Function 0x71b410), tinted rock (grid 4) / super tinted (22)

One in 10: The Small Rock (90) if ItemPool::RemoveCollectible(90) succeeds. Else n = 2 (super: 4); Lucky Toe +1 when rand % 3 != 0; trinket procs (Child's Heart etc. 33/66/100 %). Each roll: f < 0.6 soul heart 5.10.3 (Mines: 1/2 a rock spider instead; Daemon's Tail 4 in 5 to the next bands), then rand even -> n - 1 (heart costs a roll half the time); < 0.7 key (loot continues); < 0.71 first roll only chest 50, ends; < 0.9 first roll only locked 60, ends; else bomb.

NpcHelper::ChampionDrop (Function 0x6bf120)

Chance (percent): 100; hard mode 33 unless the kill damage flag 0x200000000 (meaning unverified); Purple Heart (5) raises it to 50/66/75. None in Greed, spawner type 306, challenge 34, victory laps, or room flag (+1) off. Stage 12 (the Void) without Purple Heart: one in 20 (one in 7 with the flag). The drop is fixed per champion colour index: 0/20 heart, 1 battery, 2 pill, 3 1-3 coins, 4 three blue flies, 5 bomb + explosion, 6 eternal heart, 7 key, 8 locked chest, 9 red chest, 11 trinket, 12 double heart (10.5), 13 half heart (10.2) + 8 shots, 14 card, 15 two copies, 17 a fly, 18/19 one in 5 a pill (forced effect 33/32), 21 RandomInt(3) + 4 blue flies, 22 2-3 random-pickup 5.0.4, 23 uses item 35, 25 one of each of 7 variants (table 0xb67400) + explosion + 8 shots. No luck term.

Differences from the Flash engine (for the port)

RULES (pickups both games have):

  1. Room clear luck: Flash boosts roll*.9+.1 for any luck > 0 and adds 0.1luck when negative (room_rewards.cpp room_reward_roll); Rep adds RandomFloatclamp(L,0,10)*0.1, nothing for negative.
  2. Bands: Flash coin < .45 + .03chapterluck, heart < .58 (+ mercy 1/(30-2luck) when hp < max-1), key < .76 - .007* chapter + .02luck - .01min(10,keys), soul-heart rewards (luck mercy / hard no-containers 1/max(20,40-5luck)); Rep coin < .45, heart < .60, key < .80, no adjustments, no mercy, no soul-heart reward (Init's subtype roll).
  3. Hard mode: Flash 1/(6+luck) nothing, 1/(6-luck) heart; Rep 34 % of heart awards vanish.
  4. Heart: eternal Flash 1/max(20, 50-10luck), Rep 1/50. Coin: dime Flash 1/max(50, 100-20luck), Rep 1/100. Golden key Flash 1/50, Rep 1/51. Flash's 1/50 magnetic bomb (subtype 5) is Rep's 1/50 megatroll slot (Rep has no magnetic bomb). Same: half heart 1/2, soul 1/10, Eve 1/16, nickel 1/20, double bomb 1/7, troll 1/10.
  5. Flash hard mode turns a touched single/double bomb into a troll bomb 1/(10+luck) (pickup.cpp); Rep has no such rule (Entity_Pickup::HandleCollision 0x6e8ae0 never reads the difficulty).
  6. Chest counts: Flash max(2, random(4|8) - 1) (ordinary always 2), Rep max(2, RandomInt(4|7)); Flash hearts cost a roll 1/2, Rep's chest hearts don't (its tinted rock's do). Category odds: Rep ordinary 10/1/1/10/78 = Flash's 20 % special split 10/10 (same), chest/locked 1 % vs Flash 0.8 %; Rep golden item 20 / trinket 10 / card 10 vs Flash item 20 / trinket 8 / card 8, chest/locked 1 % vs 0.64 %.
  7. Tinted rock: Flash's key ends the loot (chest.cpp isLast = tintedRock); Rep's continues.
  8. Champion drops: hard mode Flash random(max(10-luck,1)) < 3 (30 %, + luck), Rep 33 % flat; what drops: Flash's roll table (champions.json drop), Rep's per-colour table (enemies / content: Rep's champion colours). CONTENT: 1/50 grab bag on any room award; Rep-only subtypes (double/rotten/scared/blended/half soul/bone/black/gold hearts; sticky/lucky/golden/double coins; charged key; golden/megatroll/giga bombs; batteries; chest kinds; sacks). Not ported shared rules: poop and fire place drops (the engine has no shared rule for them).