# Dogma fight effects (1000.169-172) and Dogma's brimstone Read from `Entity_Effect::Update` 005d4380 with `--asm` (variant switch at 005d47cc: `JMP [(variant-1)*4 + 0x606f8c]`), `Entity_Effect::Init` 005cdb20, `NpcAI::ENTITY_DOGMA` 004aafa0 and `NpcAI::ENTITY_DOGMA_angel` 004ae4d0. Effect fields: 0x450 State, 0x454 MinRadius (free float), 0x458 MaxRadius, 0x45c Timeout, 0x460 LifeSpan (`Entity_Effect::SetTimeout` sets both), 0x464 IsFollowing, 0x468 ParentOffset, 0x474 Rotation, 0x478 Scale. Entity: 0x173 `_dead`, 0x358 DepthOffset, 0x36c Friction, 0x370 Size, 0x39c speed multiplier (time scale, "ts" below). Common tail 00606e88 (every variant): `if timeout > 0: timeout--; if timeout <= 0: _dead = 1`. So "timeout ends" = `_dead` set at the end of that tick; the case code reacts on the next tick. `GetIntervalTicks(n, off)` = "frame count (+off) crossed a multiple of n this tick" (time-scale aware); effects pass off 0. ## creep_static (Entity_Effect::Update case 005eaf9d, 1000.169) Shared creep case (variants 22-26, 44-46, 53, 54, 56, 92, 94, 169, 204); 169 branches at 005eb8b0 / 005ebbaa / 005ec5d4. - Init 005cdb20: sortingLayer 0, renderZOffset 2000, timeout 125 (default; Dogma overrides), field 0x158 |= 0x20 (169 only; unknown). Invisible in room type 16. - First tick (state 0 -> 1): s = sprite scale x as spawned. Animation `Blood%02u` with index rand(6)+1: s < 0.99 SmallBlood, < 1.3 Blood, < 2.1 BigBlood, else BiggestBlood (all 22-frame loops). Size (0x370) = 20 * s * Scale (Scale 0x478 = 1). Sprite scale is then RESET to (Scale, Scale): the spawn scale only picks the art and radius. Starts at frame `GameFrameCount % 22`; 169 keeps playing (no frame stop, unlike 44/45/92). 0x454 = sprite alpha. - Every tick: non-player, non-friendly creep calls Die when the room is clear and its EntityList counter (+0xa8 + +0xac, FUN_00456540: probably live enemies) is <= 0 (also a flooded-stage case for stage ids 12/33). - `_dead` or EntityFlag 0x10000 (FLAG_NO_BLOOD_SPLASH) skips all damage. Dogma's Appear "Splat" creep sets that flag: it is decoration only. - Damage (not friendly; friendly static creep does nothing: the enemy-side branch at 005ec5d4 also requires !friendly, so it is unreachable): for each player not dead, EntityCollisionClass != 0, GridCollisionClass == 5 (ground, i.e. not flying), no trinket 14 (Callus), no collectible 571: if dist(player, creep) < Size * spriteScale.x + player.Size AND the creep sprite's texel under the player has alpha > 0.5 (FUN_0040b600 = GetTexel-like, layer -1, both positions * 0.65): unless FUN_007dba30 (Evil Charm 632 immunity to this source) or collectible 571, player TakeDamage(1, DamageFlag 0x10 ACID, source = creep's parent or the creep, countdown 30). No slow, no footprint colour (169 skips SetFootprintColor). - Fade (once `_dead`, 005ed1b0): each tick scale *= 0.98; alpha = clamp((40 - state) / 40, 0, 1) * 0x454; state++; Remove when state > 40. State is 1 when the fade starts, so it lasts 40 ticks. - LifeSpan (0x460) is not read by the creep code. ## dogma_debris (Entity_Effect::Update case 005dc73f, 1000.170) - Init: sortingLayer 0; overlay "Float" (64-frame loop) at a random frame; main "Idle" (11 frames) set, not played, to a random frame (one of 11 pieces); FlipX = rand(2) != 0 (sprite+0x100); FLAG_DONT_OVERWRITE (1<<21). - Update: every tick layer 0 takes the Float overlay's null 0 ("Offset") position, rotation and scale. Nothing else: no timeout, no collision (radius 0). Pure decoration for the rest of the room. - Spawn (ENTITY_DOGMA 004ab600 loop, on the intro's "Shoot"): 30 pieces, no spawner. Perimeter P = 2w + 2h of the room box (Room +0x14..0x20); t = (rand + i - 0.5) * P / 20 (yes /20 with i < 30), walked clockwise: t <= w top edge (TL.x + t, TL.y); <= w+h right edge; <= 2w+h bottom edge going left; else left edge going up y = TL.y + h - (t - 2w - h), so i >= 20 lands on the left edge's line above the top-left corner. Then pushed outward from the room centre by 10 + 80 * rand. Same moment: all 960.4, 1000.74 and 1000.169 in the room are Removed, doors removed, backdrop swapped. ## dogma_blackhole (Entity_Effect::Update case 005dc811, 1000.171) Anims: IdleClosed 6 loop, Open 14, Idle 16 loop, Death 21 (Shoot f12), Fizzle 21, Trail 15, Swirl 1. - Subtype 0 (the hole). Init: FLAG_DONT_OVERWRITE, sprite flag 0x20, IdleClosed, timeout 45. Collision radius 15. Every tick, any state: - velocity *= lerp(1, 0.8, min(FrameCount / 20, 1)) (Dogma launches it at 15 toward Isaac). - AddVelocity((Room::GetClampedPosition(pos, 80) - pos) * 0.02, capped at length 12) (stays 80 inside the walls). - QueryRadius(pos, 100, all): only Dogma's TV (950.1) gets AddVelocity((hole - tv) * 12 / dist^2, capped 12). - State 0 (closed): posOffset.y = min(posOffset.y + ts, 0) (Dogma spawns it at (0, -46): lands in 46 ticks). Every 2 ticks a 1000.111 (Haemolacria Trail) at pos, velocity = hole velocity * 0.5, same posOffset, colour (0,0,0,1) permanent, DepthOffset -10. When the timeout ends: state 1, Scale = 4, play Open, `_dead` cleared, SetTimeout(120), sound 545 (dogma/black hole opening, delay 2). - State 1 (open, 120 ticks): Open finished -> Idle. While the animation loops, every 3 ticks ShakeScreen(2). Every 6 ticks: a 1000.171.1 trail at pos, then a projectile 9.0 at pos + FromAngle(trail rotation) * 560 (trail rotation is random), velocity 0, spawner = the hole's spawner, spawnerType/Variant copied, subtype 2, Height -27, FallingSpeed 0, FallingAccel -0.095, Acceleration 0.6, Scale lerp(0.6, 1.8, rand), ProjectileFlags 1<<13 | 1<<27 (NO_WALL_COLLIDE | ACCELERATE by the Lua enum), colour (1,1,1,0) fading in over 10 ticks. Every 14 ticks a 1000.171.2 swirl. Scale += 0.25 * ts (4 -> 34 over the 120 ticks). Pull, every room entity except Dogma (950.*), itself, entities with its own status-effect target, at its exact position, or with Friction 0; only: vulnerable enemies, projectiles, tears, bombs (type 4), players, free (price 0) pickups (chests only with subtype > 0): d = distance; f = d < 64 ? d / 4096 : min(20 / d, 1); tears/projectiles f *= min(their FrameCount / 30, 1); players f *= min(d^2 / 230400, 1) (i.e. (d/480)^2). k = (enemy, tear or bomb ? 6 : 4) * Scale * f / Friction; AddVelocity(unit(hole - e) * k). Tears and projectiles first: velocity *= max(1 - 2f, 0.5) (time-scaled). Tears also lose a flag group (mask DAT_00c34b60) once their speed^2 < 1. Within 48 (d^2 < 2304): tears (not dead, without mask DAT_00c34c50 flags, FrameCount > 15, Height > -50) and projectiles (same tests) are Removed; pickups that CanReroll are Removed; bombs Removed; players TakeDamage(1, flags 0, source hole, countdown 30). At timeout 30: sound 546 (black hole closing bursting) with delay 30. Timeout end: state 2, play Death. - State 2: on Death's Shoot (frame 12): ShakeScreen(10), Game::ButterBeanFart(pos, 120) (push-back), 22 projectiles 9.0 (spawner = hole's spawner): dir = RandomVector, position pos + dir * 5, velocity dir * 15 * rand, Height lerp(-22, -30, rand), FallingSpeed 0, FallingAccel lerp(-0.06, -0.09, rand), Scale lerp(0.6, 1.8, rand), Acceleration 0.95, ProjectileFlags 1<<37 (ACCELERATE_EX by the Lua enum). Every projectile 9.0 with the hole's spawnerType and subtype 2 (the ring ones still flying in) Dies. Death finished -> Remove. - Fizzle: Dogma's death "Sound" sets state 2, plays Fizzle (no Shoot event: no burst), `_dead`; removed when it ends. The same pass sets every 950-spawned projectile's flags to 0 and `_dead`, lasers' timeout to 1, effect 1000.126 state 1. - Subtype 1 (Trail): DepthOffset -10; sprite rotation += Rotation (0x474, 0 unless set) * ts; Remove when Trail ends. Init: Trail, scale (1 + rand, 0.5 + 0.5 rand), rotation rand * 360. Dogma's own trails (state 12, every 8 ticks after "Sound" until "Splat") are at Dogma's pos, posOffset (0, -46), sprite scale (0.5 + 0.2 rand, 0.2 + 0.2 rand). - Subtype 2 (Swirl): Init scale 3, alpha 0, random rotation. Per tick DepthOffset -10, scale -= 0.1 ts, alpha += 0.07 ts, rotation += 30 ts; Remove when scale <= 0.1 (~29 ticks). - Dogma side (state 12, ENTITY_DOGMA spawn at 004ad70a): on "Shoot" sound 544 (black hole shooting), stop 543 (charge), spawn subtype 0 with velocity unit(player - Dogma) * 15, posOffset (0, -46) (0xc2380000), kept at Dogma+0xbec. While 0xbec is set Dogma's move speed (+0xc34) eases toward 0.05 instead of 0.9 (`c34 = (c34 - target) * 0.9^ts + target`). ## dogma_orb (Entity_Effect::Update case 005de1a6, 1000.172) Anims: Open 14, Idle 12 loop, Attack 8, Fizzle 21, Death 45 (Shoot f12), Swirl 1, Spot 3. Does NOT spawn NPCs or projectiles; its attacks are light beams (laser variant 5) fired by its subtype-1 "spots". (Angel Babies 950.10: spawner not found in these routines.) - Subtype 0 (the orb). Init: FLAG_DONT_OVERWRITE, sprite flag 0x20, layer 2 additive, Open, 0x454 = 0. The angel's NukeStart "Shoot" (state 9) spawns it with parent = angel, posOffset (0, -100), 0x454 = 3.0 (volleys left), 0x458 = 0, sound 561, ref at angel+0xbec. Every tick: with a parent, pos/velocity = parent's. DepthOffset 40. Not `_dead` and the animation finished -> Idle. Every 8 ticks (not `_dead`) a 1000.172.2 swirl with its posOffset. - Volleys (0x454 > 0), each tick while the animation loops (Idle): state++; at state 6 sound 563 (light ray charge, vol 0.2, pitch 1.05946). At state = cumulative sums of {6,5,4,3,3,2,2,1 x11} (6, 11, 15, 18, 21, 23, 25, 26..36) spot j (0..17): a0 = RNG(seed +0x3ec, shift 35).RandomFloat * 360 (same every volley), angle = j * 110 + a0 - 30 + rand * rand * 60; t = 75 - state; r = (rand + rand) * 4 - 4; angle -= (t - 20) * r + 8.33731 * r (pre-undoes its spin); spot timeout t, Rotation r, targetPosition FromAngle(angle) * 21 * sin((0.5 + 0.5 rand) * pi / 2), parent orb, orb's posOffset, sprite scale (1 + rand). At state 75 (all 18 spots expire together): stop 563, sound 564 (light ray fire, vol 0.7), play Attack, state 0, 0x454 -= 1. Three volleys. - 0x454 <= 0: state = -1 (the angel's NukeLoop waits for state < 0 and then SpreadAttack, state 13). While the parent remains, SetTimeout(45) every tick. SpreadAttack "Shoot": orb velocity = FromAngle(aim) * 15, parent and 0xbec cleared, sound 562 (light ball throw). - Thrown (no parent): velocity *= lerp(1, 0.8, min((LifeSpan - Timeout) / 20, 1)), speed at least 2; posOffset.y = min(posOffset.y + 2, -27.5). First thrown tick (state -> -3): 8 spots, angle i * 45 with the same spin pre-compensation, timeout = orb timeout + 12, radius 21, sprite scale 2. The orb's timeout (~45) ends -> state -2, Death; Death's Shoot (frame 12, when those spots fire) sound 564, velocity 0; Death finished -> Remove. - Contact (every tick, not `_dead`): QueryRadius(pos, Size, partitions 0x29 = familiar | enemy | player); hit list (+0x4a8) cleared every 5 ticks; targets on the other side than the orb (friendly flag vs player/familiar/friendly), not dead, once per hit-list period: enemies TakeDamage(orb CollisionDamage, 0, orb, 30), players/familiars TakeDamage(1, 0, orb, 30). Size: entities2 radius is 0 and nothing here sets it (unconfirmed whether it is ever > 0). - Angel death: state -2, Fizzle (once), `_dead`; Fizzle has no Shoot, removed at its end; spots Removed. - Subtype 1 (Spot, the beam telegraph). Init: Spot frame 0, layer 1 hidden, additive. Per tick: with a parent, pos/velocity/posOffset = parent's. State 0: DepthOffset 60; Spot frame by |target| (> 19: 3, > 17: 2, > 12: 1, else 0); state 1. Every tick: if timeout <= 20, Rotation *= 0.9^ts; target rotated by Rotation * ts; sprite rotation = angle(target), sprite offset = target * 0.65. Timeout end: `Entity_Laser::ShootAngle(5, pos + target + posOffset + (0, 15), angle(target), timeout 12, posOffset (0, -15), source spot)`, laser spawner = spot's spawner, laser scale (+0x4e0) = 0.5 * spot sprite scale x, colour white (permanent), disableInitSound = 1; then the spot Removes itself. No parent -> Remove (no beam). - Subtype 2 (Swirl): Init scale 0.7, alpha 1, random rotation. Per tick DepthOffset 20, scale += 0.1 ts, alpha -= 0.07 ts, rotation -= 30 ts, Remove at alpha <= 0 (~15 ticks). Moves with its spawn velocity (the angel's RingLoop, state 10, spawns one every 6 ticks with half the angel's velocity and the angel's posOffset). ## bullet_poof_static (Entity_Effect::Update case 005d4b7a, 1000.200) Shares the generic poof case with 3, 11, 12, 13, 15, ...: no own logic. Dogma's death "Sound" spawns one per stored (position, height) pair, sprite offset (0, height), then sound 30 (death burst small). ## dogma_brimstone (NpcAI::ENTITY_DOGMA ShootAngle call 004ac5e0, laser 7.1) State 8 "Shoot": `ShootAngle(1, (x, y - 15), axis angle of the facing, timeout max(90 - stateFrame, 0) + 15, posOffset (0, -30), source Dogma)`. Fields: +0x358 DepthOffset = -50 when aiming up (i1 == 1) else 1000; +0x518 `_disableInitSound` = 1 (Dogma plays 548 itself on the first frame, ShakeScreen 10); +0x428..0x434 TearFlags = {0, 0, 0x10, 0} = bit 68, the DAT_00c34b70 constant EvaluateItems adds for Eye of the Occult (572), i.e. TEAR_OCCULT; +0x334 `_targetPosition` = Dogma's target point: first frame start + dir * max(dot(player - start, dir), 100), later eased 0.1 a tick toward the player. With that flag `HomingLaser::build_bezier_path` 0099c790 bends the beam: a bezier from the origin through `_targetPosition` (control points at 0.333/0.666), then straight on from it to the wall (CalculateEndPoint). So it is a curving brimstone that tracks Isaac, not a homing or MaxDistance laser.