# Parity sweep: red chest (PICKUP_REDCHEST 5.360) and POOL_RED_CHEST 9 Repentance+ 1.9.7.17. Ported to isaac-classic (branch of the items parity sweep) as the Red Chest Loot gameplay option (Flash's c2 chain or this), the red_chest item pool, The Left Hand's golden interactions and the AltarRedChest pedestal. ## Entity_Pickup::GetChestLoot 0x6dae40, variant 0x168 (360) branch The trinket proc loop (Child's Heart 0x22, Rusted Key 0x24, Match Stick 0x29, Safety Cap 0x2c, Ace of Spades 0x2d) and the Poker Chip (0x4c) roll run first for every chest and draw from the loot RNG, but none of their flags is read in the 360 branch: a red chest gets no trinket bonus, no Mom's Key (199) doubling, no Lucky Toe roll. - Stage 11 (Dark Room / Chest), difficulty not Greed (2/3), deathmatch <= 1, and `_currentRoomIdx == _startingRoomIdx`: one LootEntry (5, 100, GetCollectible(pool 3 devil, seed, flags | 0x200)) and nothing else. - Else a WeightedOutcomePicker of (outcome, weight): - 0, 10: (5, 100, GetCollectible(pool 9 POOL_RED_CHEST)). - 1, 5: (0, 1) = the deal-room trip; added only when `_currentRoomIdx` is neither -1 (the devil/angel room slot) nor -12 (Genesis). `local_c9` is that test. - 2, 13: two (0x55 = 85 spider) entries; left out when the opening player's `GetTrinketMultiplier(0x3d Left Hand)` is 3 or more. - 3, 13: (4, 4) one live megatroll bomb. - 4, 7: three (3, 0x2b) = blue flies. 5, 7: three (3, 0x49) = blue spiders. - 6, 15 (3 with Daemon's Tail 0x16 held by anyone): (5, 10, 3) soul heart; a second when RandomInt(2) == 0 and (no Daemon's Tail, or Daemon's Tail's own RNG RandomInt(5) == 0). - 7, 15: two (5, 40, 3) troll bombs. 8, 15: two (5, 70, 0) pills. - After the pick (not after the stage 11 deal): Left Hand multiplier >= 2 adds one more: seed even -> (5, 70, 3) pill colour 3, odd -> (5, 10, 3) soul heart. ## Entity_Pickup::TryOpenChest 0x6e6e40, as it spawns that loot - Every chest: Open animation, SFX 22 (chest open; 60/53/55 also 0x9c unlock), a 1000.15 poof at the chest (scale 0.8, offset y -10 x scale, tint alpha 0.3, render depth +4). Subtype set 0 (opened). - (5, 100, id): the first one Morphs the chest itself into the collectible (later ones spawn); red chest in stage 11's start room (not Greed): `MakeShopItem(-2)` (a devil deal) + a coloured poof; then `SetAlternatePedestal(5)` for a red chest (0x6e1a80; 10 for an ordinary chest, 6 locked, 7 eternal / bomb ...; 11 Mom's chest). The pedestal sets isPickupSpawned: the opening player within 40 is pushed, velocity = (velocity - (40 - d) * 0.4 * dir) * 0.5; the pickup's Wait = 20. - (0, 1): `Level::InitializeDevilAngelRoom(0, 0)`, `_leaveDoor = -1`, `StartRoomTransition(-1, -1, 3 teleport)`: the deal room as rolled (devil or angel), as The Joker. - 0x55: `Entity_NPC::ThrowSpider 0x6c2750(chestPos, chest, target, 0, -30)`: the first entry's target is `Room::FindFreePickupSpawnPosition(midpoint(player, chest), 70)`, the rest zero, which ThrowSpider turns into FindFreePickupSpawnPosition(chestPos, 100). ThrowSpider: state 6, v1 = velocity = (target - pos) * 0.04, v2.y = -8, collision class 0, posOffset.y = yOffset (-30); stage ids 0x1b/0x1c with water make it ThrowStrider. - (3, 0x2b): `Entity_Player::AddBlueFlies(1, chestPos)` each. (3, 0x49): `_numBlueSpiders++`, spawn_blue_spider at the chest. - Anything else (pickups, the live bomb): spawned at chestPos + a unit-circle offset (dropRng angle), velocity `Isaac::GetRandomPickupVelocity(chestPos, 0, dropRng)`. - The chest stays (opened) unless Morphed into the item. ## Pickup_PickVariant 0x6ddcd0, where red chests come from (not ported) - 5.50.0 (subtype 0): 1/40 mimic 54; else 1/20 red 360; else 1/50 bomb 51; else 1/80 spiked 52; else 1/100 sack 69; else 1/80 wooden 56 (achievement 0x261); else 1/40 haunted 58 (achievement 0x263, not in room shapes 2/3/5/7); then 1/1600 eternal 53 (also 60's chain); Left Hand (0x3d) turns 50/51/52/53/54/56/58/60 into 360; Gilded Key (0x9f) without Left Hand -> 60; 60: 1/120 mega 57 (achievement 0x259); a spiked 52 with Flat File 0x97 -> 54. isaac-classic has no chest variant roll at all (a room's or reward's 5.50.0 stays an ordinary chest), so this whole chain is a separate port. - NpcHelper::ChampionDrop 0x6bf120: champion colour 9 drops a red chest (per-colour drops are not ported either). - Room layouts: the rebirth room files already place 5.360 red chests. ## Item pool 9 (itempools.xml redChest) Dead Cat, Guppy's Paw, Guppy's Tail, Bob's Curse, Guppy's Head, Guppy's Collar, Pandora's Box, Cursed Eye, Curse of the Tower (weight 1, DecreaseBy 0.4), Plan C 0.1, Blood Puppy 0.5, Red Key 0.1, Magic Skin 1, False PHD 0.2, Guppy's Eye 1.