Files
isaac-port/notes/entities/shared_scripted_b.md
T

10 KiB

Shared enemies, scripted B (Phase C, 2026-10-26)

isaac-classic branch rif/shared-enemies (fork scripted_b). Monsters Flash and Repentance+ share; under the Enemies option Repentance+ a gated override in resources/data/repentance_plus/entities.json gives them the routine below, with Flash's art and clip names kept (the Flash anm2's timings and events stand in for Rep's clips).

stone_grimace / vomit_grimace: NpcAI::ENTITY_STONEHEAD 00520c60 (42.0 / 42.1). Changed

  • Init: anchored on its cell, invulnerable. Closes (CloseEyes, state 16) the tick GetAliveEnemyCount < 1 and the room's spawn queue (+0x11ec) is empty: no delay.
  • ProjectileCooldown < 1 and IsTargetInAttackRange(200, 0, 7) (IsFrame(7), within 200, CheckLine(3)): cooldown 84 as Shoot starts (Flash's firemode 12 checks x period 7 already matched).
  • Shoot: sound 0x106, FireProjectiles mode 0 (mode 3 for 42.2) at 7 (10 in hard mode) toward Isaac, HeightModifier 13, FallingAccelModifier -.101: fall -3, accel -.001. 42.1: VelocityMulti .55 (3.85), BulletFlags | 2 (EXPLODE), Scale 1.6, FallingSpeedModifier -30.5 and FallingAccelModifier .92 set outright (fall -33.5, accel 1.02), colorize (.4, 2, .5): the green lob's numbers, fixed instead of Flash's distance-scaled bossfire.
  • Override: mass 100, shots_still, cleared after 30 -> 0, range 240 -> 200, stone shot 7.49 / -6 / .05 -> 7 / -3 / -.001, vomit shot green -> aimed 3.85 / -33.5 / 1.02, scale 1.6, green tint, landing explosion. Left: hard mode's speed 10.

lump: NpcAI::ENTITY_LUMP 00522430 (56.0). Partial

  • Rep cycle: Appear (22 frames) at the cell picked while hidden; state 3 Shake, i1 counting; cooldown 63 and IsTargetInAttackRange(260, 0, 7) -> Spit (Shoot frame 4: FireProjectiles mode 2 at 7, boosted), i1 = 0; after Spit state 3 again (i1 < 36); in state 3 past i1 35 a 1 in 50 a tick -> Hide (16 frames), invisible; while hidden a random room point (20 in, 200+ from Isaac, not within 20 on both axes, grid path < 500) and 1 in 20 a tick: Appear there, cooldown at least 12.
  • Flash's one 68-frame Attack clip (emerge, Hold loop 1 in 50, shoot, hide) cannot be cut into Rep's separate clips: kept. Its range 260, period 7 and firemode 9 x 7 = 63 already match Rep.
  • Override: the three shots as mode 2's spread: centre (1, 0) and .9 * (.961, +-.276) as fan matrices (were .85 / .9-scaled Flash turns); speed 7, fall -3 / .1 kept (boosted: Rep's x1.2 and -1 rise).
  • Left: Rep's state machine (repeated spits while shown, the shown/hidden timers).

gurgle: NpcAI::ENTITY_GURGLE 0051aaa0 (87.0). Changed

  • Walk FindGridPath(.6, 0, 1), no friction of its own; groan 0xa5 delay 40, 1 in 3 with a direct path. Splat 1000.7 1 in 10 a tick, scale .2 + .5 rand (green for 87.0): matched.
  • Attack: rand % 60 == 0, then Isaac within 130 (no line): Attack, friction *.7. Shoot (frame 5; Flash's Shoot 4): FireBossProjectiles(1, Isaac, traj 10), scale 1.6, EXPLODE, colorize (.4, 2, .5), accel -.6, velocity * .55, fall .7 f - 3: Flash's green with fall_reduction 3 / acceleration_reduction .6 (matched).
  • Death (health above -25): rand % 100 < 15 -> Morph 238.0 (Splasher), health refilled, ProjectileCooldown 20 + rand % 20.
  • Override: move chase -> path (.6, retention 1), champion_roll (entities2.xml champion 1), transformation splasher one_in 7 (Rep's 15 in 100), overkill 25. Left: the exact 15 % (one_in is a whole number), the splasher's first cooldown.

heart: NpcAI::ENTITY_HEART 0051f2f0 (92.0). Changed

  • State 4: EvadeTarget(Isaac) (the flee kept as Flash's cover), friction *.8. Attack: IsFrame(3, 0) (not feared or charmed), Isaac within 100 (no alignment): HeartAttack, friction *.7; Shoot: FireProjectiles mode 6 (cardinal) at 12, no base fall.
  • Health 40 (entities2.xml), not Flash's 40 x .7.
  • Override: hp_multiplier 1, shots_still, attacks -> one: period 3, range 100, cardinal at 12 (were three: aligned within 20 at 8, and colour 23's looping pair); eternal's patch of attack 1 dropped. Left: Rep's EvadeTarget (pass9_u1.md's move evade proposal) instead of Flash's cover.

walking_boil / walking_gut / walking_sack: NpcAI::ENTITY_WALKINGBOIL 0051b570 (88.0-2). Changed

  • Friction *.75 first, then PathFinder::MoveRandomly(0) (feared: EvadeTarget, *.8): hops at .5 net.
  • Attack: rand % 50 == 0, then Isaac within 230 or rand & 3 == 0; 88.2 also fewer than 8 alive enemies and a Random(count) == 0. Shoot: near when within 250 - 20 rand (else aimed at nothing). 88.0: FireBossProjectiles(3 + rand & 1, target, 10); 88.1: FireBossProjectiles(1) green (EXPLODE, scale 1.6, accel -.3, fall .7 f - 13, velocity
    • .55, near * (.6 + rand)); 88.2: a Spider (85) thrown from it to a free spot by the midpoint (70) or near itself (100) when far: state 6, velocity (spot - pos) * .04, fall -8, height -30. Flash's attacks already match.
  • Override: move wander -> hop .5 (MoveRandomly), the sack's enemy_limit 10 -> 8, champion_roll.

mask: dispatcher case 006c2d98 + NpcAI::ENTITY_MASK_OF_INFAMY 00461fc0 (93.0). Changed

  • As mask_ii (pass8_j3.md) without its angry phase: MoveRandomlyAxisAligned(.85), friction x .85 / y .78; charge on IsFrame(4, index) at Isaac + vel * rand * 16, within 20 on an axis and 200, line clear; dir * 2 under .82.
  • Override: lane walk corridor -> roam (short_paths dropped), charge prediction_duration 8 -> 16.

eye / bloodshot_eye_60_1: NpcAI::ENTITY_EYE 00522ef0 (60.0 / 60.1). Changed

  • State 4: turns toward Isaac + 2 * his velocity at up to (variant + 1) * 3 + 3 - d / 330 degrees a tick (6 / 9); when the remaining turn is under half that, rand % 10 == 0, not charmed or feared and on screen: Shoot (60.0) / ShootOverlay (60.1), with Entity::SpawnFollowingEffect198 (the laser warning, timeout 15, width 4). Shoot event: Entity_Laser::ShootAngle(2 thin, timeout 3) for 60.0, (1 brimstone, timeout 8) for 60.1, from the pupil.
  • Override: turn rate 3 -> 6, variant_rate 3 (9 for the Bloodshot Eye), laser warning {15 ticks, width 4}, the Bloodshot Eye's health x1.25 -> x1 (entities2.xml 20). Left: the 2-tick lead on Isaac's velocity, the Bloodshot Eye's thick 8-tick beam (Flash's clip times it).

fred: NpcAI::ENTITY_FRED 00524a10 (59.0). Changed

  • Friction *.65. State 3: rand % 30 and Isaac within 200 -> Attack (green: FireBossProjectiles(1, Isaac, 10), EXPLODE, scale 1.6, accel -.3, fall .7 f - 13, velocity * .55), cooldown 60; rand % 20 -> burrow toward Isaac (100 px, a free spot), velocity = (target - pos) * V1, V1 = V1 * 1.07 + .005 (cap 1); on landing (Land then Shoot): FireProjectiles mode 6 (cardinal) at 7, default params; then a random spot 130-1000 from Isaac (grid path < 500), emerging there.
  • Override: the landing volley diagonal 7, damage 1 heart, scale 1.4 from an offset -> cardinal 7 from its place, still, default damage. Flash's spit, glide (100, 1.07, .005) and far teleport already match.

poky / slide: NpcAI::ENTITY_POKY 00521ab0 (44.0 / 44.1). Changed

  • Init: invulnerable, home = its cell. State 4: 44.0 MoveRandomlyAxisAligned(1); 44.1 springs home at min(d / 10, 1.8), settled below .4; friction *.8. Charge on IsFrame(3, index), age over 30 ticks, settled, not feared: Isaac + vel * rand * 16 (clamped 20), within 20 on an axis from its cell, within 200, CheckLine: state 8 along that axis, v += dir / f (44.1: 2.7225) under *.8, the cross axis pulled .5 to its cell and its speed halved; ends on a grid or entity hit. No live enemies 80 ticks into the room (44.0 only), or a cleared room: No-Spikes, harmless.
  • Override: lane walk corridor -> roam, short_paths dropped, charge prediction_duration 8 -> 16. Left: the 30-tick start delay, Poky's radius 16 (entities2.xml; Slide 13).

hanger: NpcAI::ENTITY_HANGER 0051cb30 (90.0). Changed

  • Init: spawns an Eternal Fly (96) as its child; head form i1 = seed's 2 bits (Head01..04). Every tick: hover push .13 / f toward CalcTargetPosition(10), friction *.93 after the push (net .1209 under .93); splat 1 in 10.
  • Attack: cooldown < 1 and IsTargetInAttackRange(260, 0, 7): AttackHead0N, cooldown (6 + rand & 1) * 7 from the start (Flash's 21-frame clip + 21 + {0, 7}: matched). Shoot: FireProjectiles mode 2 at 7 (boosted), HeightModifier -20, FallingSpeedModifier +2 (fall -1 before the boost's -1).
  • Override: hover speed .13 -> .1209, the fan (1, 0), (.8, +-.2) -> (1, 0), (.865, +-.248) (mode 2's .9 * (.961, .276)), champion_roll.

mem_brain / mama_guts: NpcAI::ENTITY_MEMBRAIN 0051c040 (57.0 / 57.1). Changed

  • Friction *.8 first, PathFinder::MoveRandomly(0) (feared: EvadeTarget). rand % 30 with fewer than 8 alive enemies: Attack; Shoot: sound 0x30, FireProjectiles mode 8 (eight fixed ways) at 10, Scale 1.4, default damage, no fall base. Death: two Brains (57.0) / two Guts (57.1) at +-10 along a random angle.
  • Override: move wander -> hop .5, attack enemy_limit 8, the eight 10 / scale 1.4 still, without Flash's full-heart damage, offset and fall shift; Mama Guts' health x1.25 -> x1 (entities2.xml 62).

swarmer: NpcAI::ENTITY_SWARMER 00518e20 (91.0). Changed (champion only)

  • Friction *.77 then *.9 (.693); bounce push .45 / f per axis by its velocity's signs (Skatole .25). Every 5 ticks while V1.x (coughs so far) < (1 - hp / max) * 10 and no cooldown: Attack; Shoot: gas 1000.59, then pooters (14) at aim * .1 + a random 10 while V1.y (+= 1 + rand) < V1.x, each only below 7 alive enemies. 1 in 100 a tick, below 10 alive and not feared: an Attack Fly at a random 10. Death: a Boom Fly unless a regenerating champion.
  • Flash's record already matches all of it; override: champion_roll (entities2.xml champion 1).

dople / evil_twin: NpcAI::ENTITY_DOPLE 00525650 (53.0 / 53.1). Changed

  • Position = 2 * room centre - Isaac's, velocity = -2 * his, friction *.75. Fires when Isaac's fired-tear count rises: along GetAxisAlignedUnitVectorFromDir((Isaac's head direction + 2) & 3) (always against his shooting), speed 10 plus .6 of its velocity (its backward part removed), FallingSpeedModifier +1, FallingAccelModifier -.101, Scale 1.4, from its eyes alternately (i2); 53.0 mode 0, 53.1 mode 2 (boosted) with cooldown 30.
  • Engine: shot facing.reversed (always against Isaac's shooting; Flash's centre / ratio test turned it back only across the room's axis).
  • Override: facing reversed, fall -3 / .1 -> -2 / -.001, default damage (was a full heart), the Dople's shot still, the Evil Twin's fan (1, 0), (.865, +-.248) boosted, its health x1.25 -> x1. Left: the .6 velocity carry, the alternating eye offset, the Evil Twin's cooldown 30 from the shot (Flash 28 after its 1-frame clip).