5.9 KiB
5.9 KiB
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).