# Items sweep 13: system ports ## Pocket slots (Entity_Player::GetMaxPocketItems 0x7ad440) - Slots are 4 pairs (id, type) at player+0x17a0 (type 0 pill, 1 card, 2 pocket active; the zhl names _actionHoldDrop for 0x17bc are slot 3's type). GetMaxPocketItems: 1, or 2 with Starter Deck (0xfb), Little Baggy (0xfc) or Polydactyly (0x1c6); +1 for each pocket active (type 2, id > 0) in slots 0..3. - AddPocketItem 0x7a3af0: max (+1 when adding a pocket active); when slot 0 and the last slot are both full the first non-active slot drops (DropPocketItem); the held ones shift down one and the new one goes in slot 0 (slot 1 when slot 0 is a pocket active). - RemovePocketItem 0x7a4850 / DropPocketItem 0x7a48f0 (slot -1: the first non-active one): the later slots shift up; a dropped card is 5.300, a pill 5.70. - FUN_007a42b0 (ACTION_DROP pressed): the filled slots rotate, slot 0 to the back; then SwapActiveItems (Schoolbag). - TriggerCollectibleRemoved (0x78ff90) cases 0xfb/0xfc/0x1a0/0x1c6: pockets past the new max drop from the back. - Polydactyly's own pickup spawn is not in the dump under 0x1c6 (likely a table or an offset switch). ## D7 (UseActiveItem case 0x24 @0x5bd779) - Variant 0 player; not in room type 5 (boss), not in the Beast dungeon (Room::IsBeastDungeon), not type 16 with subtype 2/3; a further check against 0xd (ICF-named getter); then Room::RespawnEnemies (0x81fd60; its decompile stops at a KAGE_LogMessage "SpawnRNG seed" the decompiler thinks does not return: read --asm) and FUN_005b1890 sets game+0x67744 = 1. ## D8 (UseActiveItem case 0x1e @0x5bd184) - Player _d8DamageModifier 0x193c, _d8SpeedModifier 0x1940, _d8RangeModifier 0x1944, _d8FireDelayModifier 0x1948. - Four RNG::RandomFloat shares; 5 rounds of offset = (2.0 - sum) * 0.25 computed once per round, each share = Math::clamp(share + offset, 0, 1) (0x42f2a0, bounds 0.0 / 1.0 from 0xbaa454); then share < 0.5 ? share + 0.5 : share * 2 (0xbaa2d0 = 0.5). Cache flags 0x1b, EvaluateItems. - EvaluateItems: fire delay = 30 / (tears * _d8FireDelayModifier) - 1; _damage and the tear damage (0x157c) both times _d8DamageModifier at the end. ## D10 (UseActiveItem case 2 @0x5ba56f) - Collects every room entity that has no mortal damage, is not dead and Entity::CanDevolve (0x6a8f80: its EntityConfig has a devolve list, config+0xa4..0xa8), then Game::DevolveEnemy (0x705480) on each. - DevolveEnemy: skips flag 0x20000000 and FUN_008667d0; type 0x19c excluded; health share hp/maxHp clamped 0..1 and champion color kept for enemies; a draw on the room's spawn seed (xorshift 4/3/0x1b) times the summed weights picks the entry (entities2.xml ); id 0 returns without change; 999 means type 1000 (an effect: critter); a ground form of a flyer is moved to a free grid spot; the form is Game::Spawn'd at its position. ## D12 (UseActiveItem case 0x1c @0x5bc8cf) - Two WeightedOutcomePickers (0xc7f95c: entries whose byte flag is 0; 0xc7f96c: all) over 29 entries of 16 bytes at 0xb62d60: (type, variant, flag, weight). Grid types: poop 14 v0-6 (500, 100, 100, 10, 10, 50, 10), 9 timed spikes 100, 10 web 150, 12 TNT 100, -33 v0/1 fire places 300/150, -292 movable TNT 50, 20 v1 reward plate 10, 20 v9 kill switch 1 (flag 0); then flag 1: 2 rock 500, 3 block 250, 4 tinted 25, 5 bomb rock 25, 6 alt 100, 25 spiked 100, 27 gold 25, 22 SS 5, 8 spikes 100, 11 lock 25, 17 trapdoor 5, 18 crawlspace 3, -33 v2/v3 blue/purple fires 40/40. - Jump table 0x5c7970/0x5c7984 by grid type: 2,3,4,6,11,22,24,25,27 (if intact, FUN_00499db0) and 8 draw from all; 9, 10 and 12, 14 (if intact) from the flag-0 group; others are left. Fire place entities: variant 0/1 the flag-0 group, 2/3 all (only while collidable); grid entities on their cells are removed. Each pick uses RNG(Next, 0x23). - Spawn: a negative type is an entity (Game::Spawn(-type, variant)); every spawned cell also gets effect 1000.15. ## How to Jump (UseActiveItem's `== 0x11a` test @0x5b78d9, no case of its own) - target = pos + velocity * 60, Room::GetClampedPosition; step = normalize(pos - target) * 10; walking back from the target while the remaining distance lasts: a spot with Room::GetGridCollisionAtPos == 0 and no enemy within (player size + enemy size + 5) is the landing; collision classes (entity and grid) set 0; sound 0x41f; PlayExtraAnimation (Jump, 20 frames, ~30 px arc in 001.000_player.anm2) unless _canFly. items.xml cooldown 14. ## Mars (593 / 0x251) - update_body_animations 00779b40 (around the HasCollectible(0x251) loop over actions 0..3): an action triggered with the same last action (+0x1e9c) and ticks since (+0x1ea0) < 11 and cooldown (+0x1e98..0x1e90 per the db) < 1 adds temporary effect 0x251 (items.xml cooldown=10 ticks), stores the direction (+0x1e94) and resets the cooldown from _marsUnk1 (90). The ticks counter caps at 10000. - update_effects 00794e50: on the dash's first tick AddVelocity(axis unit * 4.0) (mirrored in the mirror world), sound, costume; the cooldown counts down 1 a tick (2 with two items), a sound at -1. - HandleCollision 0078e1f0: touching a non-friendly enemy during 0x251 removes it, velocity = normalize(pos - enemy) * |velocity|, dash_impact. Entity_Player::dash_impact 007c8240: invulnerability +0x13bc at least 30, 8 effects 1000.147 (fire jet) at 40 px with AddBurn(10), QueryRadius: enemies within size + 80 knocked back, projectiles reflected/deflected. ## Godhead's glow (Entity_Tear::Update, tear flag bit 31 = 0xc34920, test at 0x66e5f9) - EvaluateItems' Godhead check sets flag bit 2 (homing, 0xc34ba0); the glow is bit 31. Tear Update: QueryRadius (tear size [+0x370] * local + 100.0), then for each vulnerable enemy (not its stuck/pierced target, 0x6a8fa0): hit when (enemy size + tear size)^2 < dist^2 < (enemy size + 4.0 * tear size)^2 (0xbaa75c = 4.0): TakeDamage(2.0, flags 0, source tear, countdown 0x1e). - Circle of Protection (0x1a7) and 120 Volt (0x22f) have no HasCollectible in the dump (their effect entities' Update is in Entity_Effect::Update, asm only). ## Familiars batch 1 - Rotten Baby (3.54): Update case 0x36 FollowParent + Shoot. Entity_Familiar::Shoot: cooldown 0x16 (22; 0x21 when game+0x26614 > 1, greed), variant 0x36 fires no tear: if its fly ref (+0xdc0) is empty, PickEnemyTarget(200, ..., 15) and Entity_Player::AddBlueFlies(1, its position, its target), the fly kept as +0xdc0. - King Baby (3.109): Update case 0x6d: Isaac not firing: FollowParent, SetTarget(none); firing: velocity * 0.7, Room::GetClampedPosition, PickEnemyTarget; Shoot plays StoppedDown while +0x162c != -1. - Punching Bag (3.67): FamiliarAI::punching_bag 0061c910: subtype 0xdead = dead (state reset); QueryRadius 8 (enemies): averages the vulnerable ones' (and types 0x21, 4) positions, then probes 8 headings 50 px out for free grid cells (PathFinder::EvadeTarget / FindGridPath). - Lil Gurdy (3.87): ai_lil_gurdy: state 0xd88 0 follow / 1 dash; charge 0xd4c +1 while firing (ChargeStart at 0, Charging), let go: 0xd4c = min(charge, 90), speed = charge / 90 * 20 + 5 along the aim plus 2 * 0.6 * player velocity (minus its part against the aim), Dashing. Dash: collided with grid (+0x190) -> DamageGridWithSource at the cell ahead with clamp(speed/10, 1, 4); PickEnemyTarget(800) -> velocity = normalize(target - pos) * speed; while 0xd4c > 0: 0xd4c -= 3, speed = min(40, speed + clamp(0xd4c / 60, 0, 1) * 3 / speed); else friction *= min(.98, .8 + .02 * speed); speed < 1 -> DashStop, state 0. Not dashing: friction .8, pulled at .05 of the gap when more than 50 px from Isaac. Hit sounds by approach speed (> 20 big, > 4 small). - Bumbo (3.88): FamiliarAI::bumbo, levels in +0xd88 (Level1Float, Level2Idle/Walking, Level3 Idle/Walking/Shoot, Level4 Walking with bombs Game::Spawn(4,0) 1 in 4 within 50 px); not ported yet. ## Tech X (Weapon_TechX::Fire 00a0d9c0, GetMaxCharge 00a0e260, FUN_009f6980, Entity_Player::FireTechXLaser 007cb230) - Weapon +0x10 fire delay ("max"), +0x14 charge; GetMaxCharge = max * 3. Released (or full) once charge >= max(max, 1): t = (min(charge + 1, 3 * (max + 1)) - (max + 1)) / (2 * (max + 1)); ring radius (XMM3) = t * 45 + 15 (0xbaa910, 0xbaa854), damage multiplier = t * 0.75 + 0.25 (0xbaa380, 0xbaa1d4); velocity = aim * 10 + FUN_009f5890 (movement inheritance), scaled by the owner's shot speed field +0x1464; multishot copies (GetMultiShotParams) and random +-25 degree extras at 0.5-1 of the multiplier. FireTechXLaser spawns laser 7.2 (variant 1 with Brimstone, 0xb past 1.5x, 9/0xe with item 0x44), damage multiplier sqrt'd input, halved for familiars.