Files
isaac-port/notes/characters/tainted.md
T
shweetandClaude Opus 5.5 ad8f933086 Salvage Repentance+ 1.9.7.17 decompilation toolkit, notes and name database
Ghidra 12.2 project and full dump of isaac-ng.exe v1.9.7.17, query scripts, notes
indexed by entity, anm2/rooms reimplementations, and db/ (names + fields) that
build.sh re-applies. Fixes awk numeric address comparison in find.sh/decompile.sh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-24 13:08:19 -04:00

242 lines
20 KiB
Markdown

# REBIRTH
Tainted characters: Rebirth/Repentance+ rules, dependent records and art (read-only research, nothing changed)
**HUD rule from your request:** only Jacob and Esau get the two-player HUD. Every other partner body gets a life bar instead. That covers Strawman, Soul of the Forgotten and Soul of Jacob and Esau (a temporary Esau for one room). Among the tainted characters, none needs the dual HUD:
- **Tainted Forgotten and Tainted Soul** share one soul-heart pool, so they show one health display.
- **Dark Esau** is an enemy, not a player.
- **The two Tainted Lazarus forms** play one at a time.
**Rules and numbers (wiki, Repentance+)**
- **Tainted Isaac**
- Holds at most 8 passive items, shown top-left with one selected. Picking up a 9th drops the selected item on a pedestal; the swap key cycles the selection.
- These do not count toward the 8: actives, Polaroid, Negative, key and knife pieces, Dad's Note, Birthright, Damocles' passive (id 656), swallowed trinkets.
- Every rerollable pedestal, shop item and devil deal cycles between 2 items until taken. This matches what Soul of Isaac already does in the engine (`reroll_pedestals cycle_period 30`, done).
- Birthright allows more items. Starts with 3 red hearts and 1 bomb.
- **Tainted Magdalene**
- Starts with 2 of 4 containers filled (already done).
- Above 2 red hearts, she drains half a heart every 10 s and leaves red creep. The drain takes red hearts first, then others. Her first 2 containers, rotten and eternal hearts never drain. Empty bone hearts are not broken. Soul hearts alone drain down to half a heart.
- Healing is doubled except from heart pickups.
- Killed enemies may drop a half red heart that flickers and vanishes.
- Contact hug does 6x damage (from the triage comment).
- **Tainted Cain**
- Can't take pedestals: touching one bursts it into pickups, which depend on the room:
- Secret Room: bone hearts
- Curse Room: rotten hearts
- Planetarium: runes
- Devil / Angel Room: black / eternal hearts
- Ultra Secret Room: cracked keys
- Bag of Crafting:
- It is swung as a melee weapon (3 damage, knockback, blocks shots) to collect up to 8 of 29 pickup kinds.
- The 8 pickups craft one item. Recipes are seeded per run and ingredient order doesn't matter.
- A crafted active replaces the held one, which becomes consumables.
- **Tainted Judas: Dark Arts** (timed 6 s)
- On use: +1.0 speed and invulnerability until he fires (about 1 s).
- Enemies he passes through are frozen. When the effect ends they take 2.5x his damage + 3.5 (the item record says 2x + 3.5).
- Enemy shots he touches are destroyed.
- The end blast sums the damage. Each kill or destroyed shot gives a temporary damage boost that scales in size and duration.
- Health ups give black hearts; he can't gain red health.
- **Tainted ???**
- Poops replace bombs: bomb pickups become small (1) or large (3) poop pickups. Enemies sometimes drop them, and so does he when dealing damage.
- Carries 9 poops plus 1 in Hold. The order of poop types is seeded.
- Hold stores the leftmost poop and cycles to the next; the next use spends the stored one.
- Items that would give bombs give blue flies instead (2 of Clubs gives 2, Boom! gives 10).
- The poop types and their spell effects are on the wiki "Poop Spells" page; I did not fetch it.
- **Tainted Eve**
- Holding fire for 2 s spawns a clot: costs half a heart, the clot shoots tears, starts at 15 HP and decays toward a minimum. She can't go below half a heart this way.
- Sumptorium turns clots back into health. Excess clots drop on the ground beside her. Clots returning deal 3x her damage to enemies they pass through.
- With all clots dead and half a red heart left, she gets a Whore of Babylon-like boost.
- **Tainted Samson**
- Damage dealt and taken builds rage. 120 damage triggers Berserk; the threshold grows after each Berserk.
- Berserk:
- +0.4 speed, fire rate x0.5 then +2, +3 flat damage.
- Jawbone melee only: 3x damage on swings, 1.5x on throws, swings reflect shots.
- Lasts 5 s; each kill adds 1 s, +0.4 speed and brief invulnerability.
- Persists between rooms. If he runs out of health while berserk, he lives until the timer ends.
- **Tainted Azazel**
- Room-long thin beam at 0.5x damage per tick with a shorter duration.
- Starting a charge fires the Hemoptysis sneeze: short range, high knockback, 1.5x damage, marks enemies, and hitting one halves the remaining charge.
- Marked enemies take full damage +3 from the beam for about 5 s, and explode on death, spreading the mark.
- Enemies take damage when knocked into walls or obstacles.
- **Tainted Lazarus**
- Flip costs 4 charges for him.
- Forms swap on every room clear (including each wave). Each form has its own items, trinkets and consumables.
- Already done: the swap and separate health. Missing: separate items and pickups, and Flip's ghost pedestals.
- **Tainted Eden**
- Any non-self, non-fatal hit rerolls stats, all items, the trinket and the held card or pill.
- Never rerolled: Negative, Polaroid, Dad's Note, Damocles, Dogma, key and knife pieces.
- Missing: the trinket and pocket reroll, and the self-damage exception.
- **Tainted Lost**
- Starts with a Holy Card, not Holy Mantle.
- Defensive items are excluded (rerolled away).
- About 10% of spawned cards become Holy Cards.
- Damage x1.3. Lost rules are already done.
- **Tainted Lilith**
- Can't fire tears; she launches Gello on an umbilical cord in any direction. It aims itself at nearby enemies.
- Gello deals 3x damage on contact, and 1x tears while fire is held. It deals no contact damage while firing.
- It returns when fire is released.
- **Tainted Keeper**
- Already done: coin hearts, cap of 2, quadruple shot, heart pickups becoming blue flies, coin-priced devil deals.
- Gold hearts become coins.
- Missing: every kill drops a random coin that vanishes quickly; most other pedestals (treasure, boss, angel) are priced in coins.
- **Tainted Apollyon**
- Already done: the starting red locust.
- Abyss (4 charges for him) eats all pedestals in the room and turns them into permanent locusts. Locust damage is 0.5x to 2x by item quality, capped at 64 shared with flies, and many items give special locusts.
- **Tainted Forgotten**
- The bone body is immobile and invulnerable, and swings or throws the club while on the ground.
- Tainted Soul carries and throws it like Bob's Rotten Head. The throw swing does 3x damage and the impact does 5.
- The Soul is the only hitbox and can't attack. They share soul hearts and pickups. Enemies target the Soul; the body blocks shots and movement.
- **Tainted Bethany**
- Blood charges are already done.
- Missing: stat gains above base count at 75%; familiars deal x0.75; soft tears cap is 4.43. Fire rate multipliers move the base. Direct fire-rate changes are not reduced. Eye Drops is the exception: its x1.2 is reduced.
- Lemegeton's wisp item is drawn from the current room's pool 25% of the time.
- **Tainted Jacob**
- Dark Esau stalks every room. His touch turns Jacob into `tainted_jacob_ghost`, which follows Lost rules and has an eternal heart in its last slot, until the next floor.
- Anima Sola (timed 15 s) chains the nearest enemy motionless for 5 s; this is the engine's `enemy_freeze`, i.e. Rebirth's petrify. For Tainted Jacob it targets and launches Dark Esau.
**Records that depend on this (reference triage, mechanics tags)**
- `items/bag_of_crafting` (needs_mechanic): bag melee, 29 pickup kinds, recipe and quality table, HUD bag (`pickup:rebirth_kind`, `item:quality`, `active:state`, `weapon:melee`).
- `items/dark_arts` (needs_mechanic): timed active, intangible state, `effect:area`, `player:invulnerable`.
- `items/hold` (needs_mechanic): poop storage (`active:state`, `art:icon_state`). Also blocks `tainted_blue_baby`.
- `items/sumptorium` (needs_mechanic): clots as Esau-style mimic second bodies with decaying health, and reabsorbing them (`player:second_body`, `familiar:mimic`, health kinds).
- `items/berserk` (needs_mechanic): charge from damage dealt, timed state, melee, stat boosts. `tainted_samson` uses the same effect.
- `items/hemoptysis` (needs_mechanic): double-tap sneeze, `status:mark`, `enemy:impact_damage`, `projectile:reflect`. `tainted_azazel` needs the mark, the charge-halving and the beam variant.
- `items/flip` (partial): ghost pedestals (`item:ghost_pedestal`).
- `items/abyss` (needs_mechanic): absorb pedestals into quality-scaled locusts.
- `items/gello` (needs_mechanic): data ready, waiting on its package `003.240_umbilical baby.anm2`. Blocks `tainted_lilith`.
- `items/anima_sola` (needs_mechanic): single-target petrify, plus the Dark Esau link.
- `items/lemegeton` (partial): the 25% room-pool draw.
- `items/strawman` (needs_mechanic) and `cards/soul_of_the_forgotten`, `cards/soul_of_jacob_and_esau` (needs_mechanic): second bodies. Per your request these get a life bar, not the dual HUD.
- `cards/holy_card` and `cards/soul_of_isaac`: done. Tainted Isaac's cycling and Tainted Lost's shield can reuse them.
- `cards/soul_of_eden` (partial): `reroll_trinkets` and `reroll_pickups`. Tainted Eden's trinket and pocket reroll can reuse these.
- The characters themselves: `tainted_isaac`, `tainted_cain`, `tainted_judas`, `tainted_blue_baby`, `tainted_eve`, `tainted_samson`, `tainted_azazel`, `tainted_lilith`, `tainted_forgotten` and `tainted_soul` are needs_mechanic. `tainted_magdalene`, `tainted_lazarus` and `dead_tainted_lazarus`, `tainted_eden`, `tainted_lost`, `tainted_keeper`, `tainted_apollyon`, `tainted_bethany`, `tainted_jacob` and `tainted_jacob_ghost` are partial (what is missing is listed above).
**Art and sound** (all under `/home/anon/sda/Personal/Projects/Binding of Isaac Repentance Mods/shweet-sprites/dump/rep+full/resources/`)
- **Inventory, crafting and poop HUD:** `gfx/ui/ui_inventory.anm2/.png`, `gfx/ui/ui_crafting.anm2/.png`, `gfx/ui/ui_poops.anm2/.png`
- **Active-item HUD icons:** `gfx/ui/hud_bagofcrafting.png`, `gfx/ui/hud_flip.png`
- **Bag of Crafting:** `gfx/008.004_bag of crafting.anm2`
- **Dark Arts aura:** `gfx/1000.123_halo (dark arts).anm2`
- **Berserk:** `gfx/chargebar_berserk.anm2`, `gfx/characters/n_berserk_samson.anm2`, `gfx/characters/704_berserk.anm2`
- **Sneeze:** `gfx/characters/n_hemoptysis.anm2`
- **Gello:** `gfx/003.240_umbilical baby.anm2`, `gfx/079.020_umbilical cord.anm2`, `gfx/familiar/umbilical_baby/`
- **Clots:** `gfx/characters/254_bloodclot.anm2`, `gfx/familiar/familiar_clot_babies.png`
- **Dark Esau:** `gfx/monsters/repentance/dark_esau.png`, `gfx/monsters/repentance/dark_esau2.png`. I didn't search for his anm2.
- **Sounds:** `sfx/bagofcrafting.wav`, `sfx/berserkstart.wav`, `sfx/berserkend.wav`, `sfx/berserktick.wav`, `sfx/darkarts_activate.wav`, `sfx/darkesau_appearopen.wav`, `sfx/darkesau_deathopen.wav`, `sfx/drop_poop.wav`. Character-menu flip sounds also exist.
- I only searched the full dump; check the resprite for preferred versions of these files.
**Leanest first** (they reuse what the engine already has):
- Tainted Eden: trinket and pocket reroll plus the self-damage exception.
- Tainted Lost: share of cards turned into Holy Cards.
- Tainted Keeper: vanishing kill coins and coin-priced pedestals.
- Tainted Magdalene: heart drain above a threshold and double healing.
- Tainted Isaac: pedestal cycling (reuse Soul of Isaac) and the 8-passive cap.
- Tainted Bethany: 75% of stat gains above base.
**Heaviest:**
- Bag of Crafting: the recipe table and 29 pickup kinds.
- Poop spells.
- Tainted Forgotten and Soul: the carry and throw body.
- Dark Esau: an enemy plus the ghost form.
- Gello: blocked until its art is imported.
# DESIGN
DESIGN: tainted (nothing was edited, built or run)
Paths below are relative to the worktree /tmp/claude-1000/-home-anon-sda-Personal-Repos-isaac-classic/e2675a48-fa1c-4001-8a0b-8cf99428eb25/scratchpad/wt/tainted.
## 0. The user's request: only Jacob and Esau get the extra-body HUD; other partner bodies get a life bar
**New field `health_shown`** (bool, default false) on `BodyRules`:
- **Docs text:** "Shows this body's hearts as a second player HUD, offset by hud.body_offset. Without it, the body gets a life bar over its head instead."
- **Struct:** `src/game/effects/effect.hpp:237` `BodyRules` gets `bool isHealthShown = false;` added next to `isDropHeld`.
- **Loader:** `src/resources/effect_data.cpp:319` `body_rules_load` gets `flag_load(data, "health_shown")` added. Also add `"health_shown"` to the key lists of `body_add` (effect_data.cpp:~131) and `bodies` (`src/game/game_rules.cpp:~1057`).
- **Docs:** `docs/fields/characters.json` (bodies) and `docs/fields/items.json` (body_add). Then run field_registry to regenerate MODDING.md.
- **Save:** `run_save.cpp:288-291` and `:438-439` save and load `"health_shown"` next to `drop_hold`.
**Game side** (`src/game/game.cpp:1490`):
- In `hud_capture`, push only the bodies that have the flag: `if (body.body.isHealthShown) bodyHuds_.push_back(...)`.
- `bodyHuds_` and the app's offset loop are the only users of the list, so skipping entries is safe. Offsets close up, which is what the user wants anyway.
**App side** (`src/app/app.cpp:1051-1099`):
- Move the per-entity bar body of `health_bars_render` (lines ~1077-1098) into `health_bar_render(Vec2 position, float hp, float maxHp, int serial, ...)`. The enemy loop then calls it.
- Add a second loop over `view.bodies` that skips flagged bodies and calls it with the body's position, hp + armor, its container max, and a serial offset.
- Call the bodies loop outside the `profile_.options.healthBars` gate at app.cpp:933. The bar is the body's only HUD, so it always shows.
- The colour style still follows the option. When the option is off, use the classic colour.
**Data:**
- Add `"health_shown": true` to Esau at `mods/rebirth_in_flash/characters.json:685`.
- Base Flash data has no bodies, so there is no Flash change.
**The Forgotten's Soul** is `player_.partner`, not an extra body. Its health is merged into the main HUD when `partner.health_shown` is set. Under the user's rule it should get a life bar instead:
- Remove `health_shown` from The Forgotten's partner record in RiF.
- Draw the bar for `view.player.partner` in the same new bodies loop, but only while the partner form is not the one being controlled.
- This is about 3 lines and needs no new field.
- **Question for the user:** a bar for The Soul, or keep the merged hearts? The relayed request names "soul of forgotten", so I read it as a bar. That needs the user's approval because it changes current RiF behaviour.
## 1. Tainted features, leanest first (each is a generic field; RiF gets JSON only)
**A. Tainted Eden: full reroll on hit (finishes the partial record)**
- Reuse the existing hurt trigger (the `hurt_teleport` model) with existing kinds: `reroll_items`/stats (already on the record), plus `reroll_trinkets` and `reroll_pickups` from Soul of Eden.
- New trigger field `"self": false`: the effect skips self-inflicted damage. It is loaded on the hurt trigger, and the damage-source flag is already passed through `self_damage` (data sweep 3).
- The never-rerolled items (Negative, Polaroid, ...) become a trait `"reroll_kept"` on those items in items.json, following the item-properties memory. The reroll code skips items that have it.
- Triage: tainted_eden done; soul_of_eden done if `reroll_pickups` is finished.
**B. Tainted Lost: share of cards turned into Holy Cards**
- New character field `pocket_replace: {"card": "holy_card", "one_in": 10}`. When a card pickup spawns, `rng.one_in` swaps its id.
- This is about 10 lines in the pickup spawn path, plus the existing `starting_pocket` holy_card and `damage x1.3` via stat_mul.
- Defensive items: a trait `"defensive"` on the items and a character field `item_excluded_traits: ["defensive"]`, applied in pool draw as a reroll.
- Triage: tainted_lost done.
**C. Tainted Keeper: vanishing kill coins and coin-priced pedestals**
- New character field `kill_drop: {"pickup": "coin", "one_in": 1, "lifetime": ticks}`.
- It hooks the enemy-death path once.
- The pickup lifetime/flicker already exists for Maggy's flickering hearts? If not, add one `lifetime` on the spawned pickup. Tainted Magdalene's vanishing half hearts reuse the same field: `kill_drop {"pickup": "heart_half", "one_in": N, "lifetime"}`.
- Coin prices: the character field `item_price: {"rooms": ["treasure", "boss", "angel"], "coins": 15}` reuses the shop price code that already prices devil deals in coins for Keeper.
- Gold hearts to coins: reuse the `pickup_replace` that turns hearts into blue flies, with one more entry.
- Triage: tainted_keeper done.
**D. Tainted Magdalene: heart drain and double healing**
- New character field `heart_drain: {"above": 4, "period": 600, "creep": "red"}` (in half-hearts, ticks). On each period, if red hp is above `above`, lose 1 half heart with no hurt flash, then spawn creep with the existing creep spawn.
- Soul hearts drain only down to 1.
- Rotten and eternal hearts are skipped by taking only from red hp and armor.
- `heal_mul: 2` (non-pickup heals only), at the one heal entry point in `player_damage.cpp`. The heal source flag needs "pickup" as one source.
- Kill hearts: C's `kill_drop`.
- Hug 6x: skipped, because it needs the melee pulse (melee not merged here).
- Triage: partial, missing only the hug.
**E. Tainted Isaac: pedestal cycling and the 8-passive cap**
- Cycling: run_start effect `reroll_pedestals {"cycle_period": 30}` on room enter. This is existing data; it only needs a room-enter trigger in `effects` if one exists, or `room_start`.
- Cap: new character field `passive_cap: 8`.
- On item pickup, if the count of passives without trait `"cap_free"` is at least the cap, drop the selected passive on a pedestal at the player. The existing pedestal spawn and item removal paths (Soul of Eden / D4) handle this.
- Selection is `PlayerState::passiveSelected` (int), saved in playerJson. The swap/drop key cycles it, reusing the pocket-swap input when there is no pocket.
- HUD: the top-left list with highlight uses `ui_inventory.anm2` (imported via rebirth_art.py as a ui package) and draws in app.cpp next to the charge pips. This is about 30 lines.
- Triage: tainted_isaac done (Birthright noted as left).
**F. Tainted Bethany: 75% of stat gains**
- `stat_gain_mul: 0.75` on the character, applied in `player_stats_refresh` to (stat - base) for additive stats. Tears use the existing fire-rate path, plus the Eye Drops exception as an item trait.
- The familiar damage x0.75 is a second field, `familiar_damage_mul`.
- Triage: tainted_bethany partial (Lemegeton room pool is left).
**G. Tainted Samson: berserk**
- `player_rage.cpp` already exists. Add character field `berserk: {"threshold": 120, "threshold_growth": N, "duration": 300, "kill_extend": 60, "stats": [...]}` that reuses the timed temporary_item/stat_add for the boost, charged by damage dealt and taken.
- The jawbone melee-only part is blocked until melee is merged. Art: `chargebar_berserk.anm2`, sfx berserkstart/end.
- This is moderate work. Berserk is a partial record.
**Left, and why:**
- **Tainted Cain / Bag of Crafting:** needs 29 pickup kinds, a seeded recipe table and the bag melee. This is a new system.
- **Tainted ??? / Hold / poop spells:** 10 poop entity types plus a storage HUD. This is a new system.
- **Tainted Eve / Sumptorium:** decaying mimic bodies. It could reuse `body_add` and BodyRules plus hp decay, but clots fire as familiars, so it needs a new hold-to-spawn trigger. Medium; second wave.
- **Tainted Judas / Dark Arts:** needs an intangible dash state and delayed area damage. Medium.
- **Tainted Azazel:** needs a mark status, the sneeze and impact damage. Medium-heavy.
- **Tainted Lilith / Gello:** blocked on importing the umbilical baby package.
- **Tainted Lazarus:** needs separate inventories per form, which means duplicating player inventory state. Heavy.
- **Tainted Apollyon / Abyss:** quality-scaled locusts from eaten pedestals. Medium; reuses swarms.
- **Tainted Forgotten / Soul:** the carry-and-throw body, waiting on melee.
- **Tainted Jacob:** needs Dark Esau (enemy art not found) and the ghost form swap.
## 2. Testing (vibes mode)
- Build only: `cmake --build .../build --target isaac-classic`, then field_registry.
- No base JSON gains fields, so Flash parity is unaffected.
## 3. Things that would change Flash or current RiF behaviour
- **Flash:** none. Every new field defaults to off.
- **RiF:** The Forgotten's Soul HUD would change from merged hearts to a life bar. Needs the user's confirmation.