diff --git a/README.md b/README.md index 9353554..624fa1e 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,10 @@ functions by their body, not their name. **Struct fields are only shown where this exe confirms the offset.** REPENTOGON's definitions target 1.9.7.12 and members drift (Game +0x58 .. +0xd98 in steps, Entity_Player +4 .. +0x2c, Entity_Familiar +0x14, GridEntity_Door +0x114), so a -REPENTOGON offset is never evidence by itself. `scripts/zhl_fields.py` keeps a REPENTOGON field only when a trivial getter -or the game's Lua field table confirms it, or when it sits between two confirmed fields with the same shift; -`db/fields.tsv` holds the rest, each with the function that proves it (about 600 were verified that way). Anything else is +REPENTOGON offset is never evidence by itself, not even between two confirmed neighbours with the same shift (that put +Entity `_mass` at 0x2d4; the Lua getter reads 0x37c). `scripts/zhl_fields.py` keeps a REPENTOGON field only when a trivial +getter or the game's Lua field table confirms it; `db/fields.tsv` holds the rest, each with the function that proves it +(about 1,000 so far), and a row with type `-` deletes a wrong one. Anything else is `field_0xNNN`: unknown, not guessed. `src/structs.hpp` is generated from the same data and only compiles if every offset is consistent. diff --git a/build.sh b/build.sh index ed6f5e0..42a8efa 100755 --- a/build.sh +++ b/build.sh @@ -16,13 +16,12 @@ NPC_DISPATCH=006c2990 # Entity_NPC_UpdateAI_dispatch (callee of Entity_NPC::Up GAME="${GAME:-$HOME/.steam/steam/steamapps/common/The Binding of Isaac Rebirth}" apply_db() { # db names -> struct types (zhl + db fields) G -process isaac-ng.exe -noanalysis -postScript ApplyDb.java "$D/db/names.tsv" - grep -hv '^#' "$D/zhl_fields.tsv" "$D/lua_fields.tsv" "$D/db/fields.tsv" > "$D/build_fields.tsv" # later lines win + P headers.py --merged "$D/build_fields.tsv" "$D/src/structs.hpp" "$D/zhl_fields.tsv" "$D/lua_fields.tsv" "$D/db/fields.tsv" # later rows win, "-" deletes + echo '#include "structs.hpp"' | g++ -std=c++17 -fsyntax-only -I"$D/src" -x c++ - \ + || echo "src/structs.hpp does not compile: a db/fields.tsv offset contradicts another" >&2 G -process isaac-ng.exe -noanalysis -postScript ApplyTypes.java "$D/build_fields.tsv" G -process isaac-ng.exe -noanalysis -postScript ApplyProtos.java "$D/db" "$D/repentogon/libzhl/functions" # only where RET n agrees G -process isaac-ng.exe -noanalysis -postScript ApplyLocals.java "$D/db/locals.tsv" # after types: names refer to that decompile - P headers.py "$D/src/structs.hpp" "$D/zhl_fields.tsv" "$D/lua_fields.tsv" "$D/db/fields.tsv" - echo '#include "structs.hpp"' | g++ -std=c++17 -fsyntax-only -I"$D/src" -x c++ - \ - || echo "src/structs.hpp does not compile: a db/fields.tsv offset contradicts another" >&2 } types_dump() { # final dump, built in dump.new and swapped in at the end so readers never see a half-written dump O="$D/dump.new"; command rm -rf "$O" diff --git a/db/fields.tsv b/db/fields.tsv index 7776bbf..1e01932 100644 --- a/db/fields.tsv +++ b/db/fields.tsv @@ -715,3 +715,333 @@ RoomSpawn 0x2 short _y Lua Spawn.Y via binder 0088e450: getter 008c1e80 pushinte RoomSpawn 0x8 uint8_t _entryCount Lua Spawn.EntryCount via binder 0088e6c0: getter 008c1f40 pushinteger(byte, high 0), setter stores byte RoomSpawn 0xc float _sumWeights Lua Spawn.SumWeights via binder 0088e840: getter 008c2000 pushnumber, setter checknumber -> float Game 0x264fc int _timeCounter Lua Game.TimeCounter via binder 008952b0: getter 008c2850 FUN_0085bfd0 signed dword, setter dword +# +# Identified from the most-used unnamed offsets in the code (6 subagents, 2026-10-24). "?" = plausible, not certain +Entity 0x37c float _mass Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 +Entity_Player 0x122c PlayerCostumeMap _playerCostumeMap[15] Update 00782af0 walks this+0x1238 (+0xc _isBodyLayer) stride 0x10 for 15 layers; entry 4 index 0x126c: Update/trigger_collectible_effect_removed 00793970 (Mega Mush 625) index*0x130 + _costumeSpriteDescs, -1 = none +Entity_Player 0x1398 bool _isPlayingExtraAnimation PlayExtraAnimation 007abe20 (Lua) sets 1; IsExtraAnimationFinished 007ab110 returns !0x1398 && !0x139a; Update 00782af0 clears it when the animation finishes +Entity_Player 0x1399 bool _isHurtPending TakeDamage 007729d0 sets 1 at the end; Update 00782af0 clears it once no item anim (0x1398) and rolls Intruder (575) spider burst +Entity_Player 0x139a bool _isPlayingItemAnimation PlayExtraAnimation 007abe90 (the anm2-swap variant used by AnimatePickup/Collectible) sets 1 and 0x1398=0; IsExtraAnimationFinished 007ab110 tests it +Entity_Player 0x13c4 std_string _name Lua EntityPlayer:GetName 007e9280 returns this+0x13c4 (SSO, cap 0x13d8); RestoreGameState 007ae4b0 assigns EntityConfig_Player::GetDisplayName; AddCollectible logs it +Entity_Player 0x14f0 Vector _playerSpriteScale Lua EntityPlayer.SpriteScale getter 0060d0a0 returns this+0x14f0/0x14f4; Update 00782af0 Sprite::SetScale(&this+0x14f0); Store/RestoreGameState save it +Entity_Player 0x14f8 Vector _bodyScale ? Render 0078b640 scales layers whose _playerCostumeMap[i]._isBodyLayer is set by this vector (0x1500 for the others); Update 00782af0 assigns it as body layer scale; saved in GameStatePlayer +Entity_Player 0x1500 Vector _headScale ? Render 0078b640 scales non-body layers' pos/size by it; Update 00782af0 offsets head layers by (0x1504-0x14fc)*2.5; saved in GameStatePlayer next to 0x14f8 +Entity_Player 0x1580 ActiveItemDesc _activeDesc[4] ctor 00753da0 zeroes 4 x 0x20 bytes at 0x1580; GetCollectibleNum 00770ca0 counts ids at 0x1580/0x15a0/0x15c0/0x15e0 (stride 0x20, REPENTOGON 0x1574 x 0x1c) +Entity_Player 0x1770 vector_RNG _collectibleRNGs GetCollectibleRNG 005b17c0: id<0 -> begin, bounds (end 0x1774 - begin)>>4, returns begin + id*0x10; UseActiveItem/IncrementPlayerFormCounter use RNG at begin+id*0x10 +Entity_Player 0x17dc int _playerForms[16] IncrementPlayerFormCounter 0075e320 writes this+0x17dc+form*4 (as _pocketSlots[form+0xf]); form 15 at 0x1818 recounts Necronomicon/Missing Page 2/trinket Missing Page; level_start 007a4ba0 recharges Necronomicon when it is >2 +Entity_Player 0x181c uint32_t _playerFormsRewarded IncrementPlayerFormCounter 0075e320 tests bit (1<0.3); 0 without the item +Entity_Player 0x1efc float _jellyBellyBounceTimer TakeDamage 007729d0: Jelly Belly (690) deflect sets 14/20; Update 00782af0 decrements by speedMult and wobbles sprite scale with sin(t*2pi/10) +Entity_Player 0x1fc0 EntityPtr _darkEsau NpcAI::ENTITY_DARK_ESAU 005542e0 checks spawner player's +0x1fc0 == npc; DischargeActiveItem 007ac7e0 / release_weapons_and_effects 00757ac0 move/clear it with the EntityPtr multiset erase/insert +Entity_Player 0x20dc std_vector_int _greedResetCollectibles ? ResetPlayer 007daed0 re-adds every id of begin 0x20dc..end 0x20e0 via AddCollectible; Game::reset_players_for_greed 007db3b0 copies it (also for the backup player) +Entity_Player 0x1544 short _greedsGulletHearts Game::render_debug_player_info 007cfba0 prints "Greed's Gullet: %d (overflow:%d)" from shorts 0x1544/0x1546; update_greeds_gullet 007ce420 compares GetGreedsGulletHearts with it +Entity_Player 0x1546 short _greedsGulletOverflow render_debug_player_info 007cfba0 prints it as the overflow; update_greeds_gullet 007ce420 adds it to the heart cap and writes it back +History 0xc bool _isLocked Entity_Player::RemoveCollectibleByHistoryIndex 0078fec0 / reroll_collectibles_on_damage 005c88a0 set player+0x1df8 (History 0x1dec +0xc) to 1 around RemoveCollectible and restore it so no history entry is touched +History 0x10 Entity_Player* _player Entity_Player ctor 00753da0 writes this into 0x1dfc (History 0x1dec +0x10) +Entity_Player 0x530 ANM2 _crownOfLightSprite ctor 00753da0 ANM2 ctor; TriggerNewRoom_TemporaryEffects 007a8350 / UpdateHeartDependentEffects play "FloatGlow"/"FloatNoGlow" on it next to Crown of Light (415) effect add/remove; Update ANM2::Update +Entity_Player 0x644 ANM2 _darkPrincesCrownSprite ctor 00753da0 ANM2 ctor; TriggerNewRoom_TemporaryEffects 007a8350 / UpdateHeartDependentEffects play "FloatGlow" on it with Dark Prince's Crown (442) effect; Update ANM2::Update +Entity_Player 0x758 ANM2 _chargeBarSprites[7] ctor 00753da0 _eh_vector_constructor_iterator_(0x758, 0x114, 7, ANM2 ctor); FUN_0075ea40 sets bar percent on 0x758 (weapon charge / Bag of Crafting), 0xcbc, 0xdd0 (Sumptorium); Update updates all 7 +Entity_Player 0x13dc Weapon* _weapons[5] release_weapons_and_effects 00757ac0 destroys 0x13e0..0x13ec (vtable+0x14 then deleting dtor) and 0x13dc; FUN_0075ea40 reads charge via vtable+0x1c of 0x13e0..; FUN_0042bca0 creates 0x13e0 (REPENTOGON 0x13d8) +Entity_Player 0x1548 short _greedsGulletRedHearts ? update_greeds_gullet 007ce420: when GetGreedsGulletHearts grew past it, adds red hearts and stores the new value here +Entity_Player 0x154a bool _isUpdatingGreedsGullet update_greeds_gullet 007ce420 returns if set, sets 1 on both twins, clears at the end; AddSoulHearts 00758d00 skips its extra handling while set +Entity_Player 0x205c int _curseMistRedHearts AddCurseMistEffect stores _redHearts here for Keeper (type 14) before AddMaxHearts(0); RemoveCurseMistEffect restores _redHearts from it +Entity_Player 0x2060 int _curseMistPocketSlots[8] AddCurseMistEffect copies _pocketSlots[0..7] here and clears them; RemoveCurseMistEffect copies back; MorphToCoopGhost moves it into 0x20ac +Entity_Player 0x2080 uint32_t _curseMistTrinkets[2] AddCurseMistEffect saves _trinketsID[0..1] here; RemoveCurseMistEffect restores them; MorphToCoopGhost moves and zeroes it +Entity_Player 0x2088 Vector _minecartOffset AttachMinecart stores pos - minecart._targetPosition here (x 0x2088, y 0x208c); ctor zeroes both +Entity_Player 0x20ac int _ghostPocketSlots[8] MorphToCoopGhost copies _pocketSlots[0..7] (or the Curse Mist backup 0x2060) here; RevivePlayerGhost restores _pocketSlots from it; Store/RestoreGameState +Entity_Player 0x20cc uint32_t _ghostTrinkets[2] MorphToCoopGhost stores the trinkets here; RevivePlayerGhost restores _trinketsID[0..1] from 0x20cc/0x20d0 +Entity_Player 0x1380 short _tonsilCounter TakeDamage 007729d0 with Tonsil (trinket 97) decrements it and at <1 spawns a tonsil; FUN_007d9ca0 rerolls it to 6 + rand%7 from the trinket RNG; Store/RestoreGameState save it as short +Entity_Player 0x1382 short _tonsilCount TakeDamage 007729d0: ++ (cache 0x200 familiars) while < multiplier+1, then TryRemoveTrinket(97 Tonsil) +Entity_Player 0x1390 int _threeDollarBillItem HasCollectible 007706e0 / GetCollectibleNum 00770ca0: with 3 Dollar Bill (191) the id stored here counts as owned +Entity_Player 0x13b6 bool _isBrokenRemotePending ControlActiveItem sets it when slot 0 is used with Broken Remote (trinket 4); Update 00782af0 then uses Teleport (44) or Teleport 2.0 (419) and clears it with 0x13b8 +Entity_Player 0x13b8 int _cursedPennyPending ? Update 00782af0 rolls Cursed Penny (trinket 172) teleports with GetTrinketMultiplier when it is non-zero (1 = rand 100 ...), cleared next to 0x13b6; set by Entity_Pickup::HandleCollision 006e8ae0 +Entity_Player 0x1620 int _glowingHourglassIndex ? ctor 00753da0 inits -1; UseActiveItem 005b39d0 / UseCard index GlowingHourglassState (+0x19d80 + it*0x5dc) with it when >= 0 +Entity_Player 0x167c EntityRef _lastDamageSource Lua EntityPlayer:GetLastDamageSource 0085e270 returns this+0x167c; try_trigger_astral_projection checks its _type == 6; update_effects zeroes it beside _lastDamageFlags (0x16a8) +Entity_Player 0x173c std_vector_int _levelEffectItems ? TriggerNewRoom_TemporaryEffects 007a8350 re-adds every id (negative = ~index into the level's list) as a temporary effect each room; level_start 007a4ba0 clears the vector +Entity_Player 0x177c vector_RNG _trinketRNGs ctor 00753da0 zeroes begin/end/cap 0x177c..0x1784 after _collectibleRNGs; FUN_007d9ca0 uses *(0x177c)+0x610 (= trinket 97 * 0x10) for Tonsil; ControlActiveItem uses +0x950 (trinket 149) +Entity_Player 0x1890 short _brittleBonesUpgrades TakeDamage 007729d0: ++ (by broken bone hearts) with Brittle Bones (549), sets cache 2; EvaluateItems 00763570 adds it*0.4 to the tears formula +Entity_Player 0x18c0 int _coopBabyBuffTimers[8] update_baby_skin_effects: co-op babies set 150-frame buffs for every player: 0x18c0 damage (cache 1), 0x18c4 fire delay (2), 0x18c8 speed (0x10), 0x18cc shot speed/range (0xc), 0x18d0 luck (0x400), 0x18d4 shrink / 0x18d8 grow (0x800), 0x18dc trinket multiplier; Update counts each down; EvaluateItems reads them +Entity_Player 0x1ae4 float _bodyAngle update_body_animations 00779b40 LerpAngleDeg's it toward atan2 of the movement; GetBodyMoveDirection 00779900 / update_shooting fire Montezuma's Revenge (680) laser at it+180 +Entity_Player 0x1ae8 int _flashCountdown ? Update 00782af0: while >0 (or Azazel's Rage 699 effect count == 4) tints the player with a sin flash, decremented each frame +Entity_Player 0x1ddc std_vector_int _pendingWisps TriggerRoomClear 007a8fd0 calls AddWisp(id) for every id of begin 0x1ddc..end 0x1de0, then empties it; ctor zeroes the 3 dwords +Entity_Player 0x1ee4 Entity* _montezumaLaser GetBodyMoveDirection 00779900: with Montezuma's Revenge (680) uses its angle (+0x41c)+180 when it is non-null and _type == 7 (laser) +Entity_Player 0x1f18 deque_EchoChamberItem _echoChamberItems TriggerEchoChamber: with Echo Chamber (700) replays every queued (id, type) pair (type 1 card -> UseCard, 0 pill -> UsePill), push_back the new one, keeps at most 3 (size 0x1f28, off 0x1f24); ctor builds the deque proxy +Entity_Player 0x1f58 char _poopSpellQueue[6] update_bomb_input 00780f40 UsePoopSpell(0x1f58) then shifts 0x1f59..0x1f5d down; UseActiveItem does the same (REPENTOGON 0x1f34, shift +0x24) +Entity_Player 0x1f88 float _forgottenBHeight Update 00782af0: for Tainted Forgotten (type 35) += 0x1f8c each frame, clamped at 0 with a -0.45 bounce, added to the render y; PlayerManager::replace_player copies it with 0x1f8c and 0x1e70 +Entity_Player 0x1f8c float _forgottenBHeightVelocity Update 00782af0: Tainted Forgotten (type 35) vertical speed, +0.6 per frame, *-0.45 on landing when >=2, reduced by 0x1f88*0.2 while falling +Entity_Player 0x1fd4 std_vector_uint8 _extraCollectibleCounts ? GetCollectibleNum 00770ca0 adds byte begin[id] (bounds end 0x1fd8 - begin) to the count; is_achievement_79_unlocked 007db860 reads byte [0x8f] +Entity_Player 0x1eec uint8_t _holyMantleStacks ? TriggerNewRoom_TemporaryEffects 007a8350 re-adds the Holy Mantle (313, item config +0x4e4) effect (it >> 4) times each new room; FUN_007dafb0 subtracts the low nibble, FUN_007daff0/FUN_007db0a0 rewrite it; saved in GameStatePlayer +Entity 0x1a4 Vector _renderPosition Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same +Entity_Player 0x17d8 bool _isHeldItemVisible Update 00782af0 stores IsHeldItemVisible() here each frame and tests it later in the same update +Entity_Player 0x1b1c Vector _moveToTarget Update 00782af0: while != (0,0) moves the player 0.18 of the way toward it (SetPosition); FUN_005cd780 sets it, GridEntity_TrapDoor::Update / RoomTransition::Update aim it at a grid cell (col*40+40, row*40+120); level_start / release_weapons_and_effects zero it +Entity_Player 0x1d9c Entity_Familiar* _forgottenBody FUN_007cbef0 (The Soul, type 17) SpawnEx(3, 900 Forgotten body) and keeps it here (Remove via vtable+0x28 first); init_player_type_state / MorphToCoopGhost test it +Entity_Player 0x1f08 int _forgottenBodyRoomIdx FUN_007cbef0 / init_player_type_state 007cc200 split it into room idx%169 and dimension idx/169 to find the room the body is in, -99999 = none (level_start resets it) +Entity_Player 0x1f0c Vector _forgottenBodyPos FUN_007cbef0 spawns the Forgotten body here when 0x1f08 != -99999; PlayerManager::replace_player copies 0x1f08..0x1f10 and resets the source +Entity_Player 0x1fb0 std_map_int_int _roomTemporaryCollectibles ctor builds a tree head at 0x1fb0 (size 0x1fb4); ClearTemporaryEffects 007907a0 walks it and RemoveCollectible(id) count (node+0x14) times, zeroes the counts and erases the tree +Entity 0x330 EntityConfig_Entity* _config Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) +Entity_Player 0x110c ANM2 _statusEffectSprite ctor 00753da0 ANM2 ctor; Update 00782af0 loads "gfx/StatusEffects.anm2" into it and plays "Charm"...; Render 0078ca00 draws it above the head (-35 * spriteScale.y) +PlayerCostumeMap 0x0 int _index ClearCollectibleAnim 007ad5a0: -1 = none, else index into Entity_Player::_costumeSpriteDescs (stride 0x130) +PlayerCostumeMap 0xc bool _isBodyLayer Update 00782af0 layer loop over Entity_Player+0x1238 stride 0x10: 0 -> head-style scale/offset (0x1500), else body scale only +Entity_Player 0x137e short _deadCatLives GetExtraLives 007bf670 adds it to the 1up/... counts; TriggerDeath 007a1090 decrements it and removes Dead Cat (81) copies above lives*9-8; TriggerCollectibleRemoved 0078ff90 clamps it to 9*GetCollectibleNum(81) +Entity_Player 0x1384 short _numLeprosy AddLeprosy 00759b90: ++ while <3, cache 0x200; EvaluateItems CheckFamiliar(0x79 Leprosy, it) +Entity_Player 0x138c int _bleedOutHealth TakeDamage 007729d0 sets 600 with Shard of Glass (448) under FLAG_BLEED_OUT self-bleed; Update 00782af0 subtracts GetHitPointsLost, at <1 deals damage and resets 600, tints <150, clears the flag+0 when healed; AddHearts/AddRottenHearts zero it +Entity_Player 0x13b4 uint8_t _holyMantleState TakeDamage 007729d0: with Holy Mantle (313) and 0 -> set 1 (shield consumed) else remove null 0x2e; room_exit 007a6680 clears; TriggerNewRoom_TemporaryEffects 007a8350 x = x>1; Restore sets 0/2 +Entity_Player 0x1444 EntityPtr _breathOfLifeEffect ? release_weapons_and_effects 00757ac0 removes (vtable +0x28) and unregisters it like the 0x1420..0x144c EntityPtr run; update_effects 00794e50 releases it when the Breath of Life (326) effect is gone; ControlActiveItem drops it on re-trigger +Entity_Player 0x165c int _slipperyTimer Update 00782af0: 60 while FLAG_SLIPPERY_PHYSICS (1<<27), else counts down to 0; update_body_animations 00779b40 uses it/60 to blend the slippery movement +Entity_Player 0x1660 Vector _lastVelocity update_body_animations 00779b40 copies _velocity into 0x1660/0x1664 each frame; GetTearMovementInheritance 007aaea0 uses it *0.6*2 as the tear inherited velocity +Entity_Player 0x1680 int _lastDamageSourceVariant DeathScreen::Show 009997c0 "Killed by (type.%d)"; zeroed with _lastDamageFlags in UseCard 007b2230 and update_effects 00794e50 +Entity_Player 0x1684 int _lastDamageSpawnerType DeathScreen::Show 009997c0 "spawned by (%d.%d)" first value +Entity_Player 0x1688 int _lastDamageSpawnerVariant DeathScreen::Show 009997c0 "spawned by (%d.%d)" second value +Entity_Player 0x16b0 int _roomDamageTaken TakeDamage 007729d0 adds the damage amount; room_exit 007a6680 resets it to 0 (beside _totalDamageTaken 0x16b4) +Entity_Player 0x16d4 std_vector_int _pillEffectUses UsePill 007c4180 ++[pillEffect] (twice for horse pills), unlock 0x182 when [43]>4; AddPrettyFly 007abdf0 ++[10 PILLEFFECT_PRETTY_FLY] then cache 0x200; remove_twin merges the counts +Entity_Player 0x1788 vector_RNG _pillRNGs UsePill 007c4180 indexes begin+effect*0x10 (bounds (0x178c-0x1788)>>4); StoreGameState saves the seeds +Entity_Player 0x1794 vector_RNG _cardRNGs UseCard 007b2230 RNG at cardType*0x10 + begin; StoreGameState saves (0x1798-0x1794)>>4 seeds +QueueItemData 0x8 uint8_t _flags Lua QueueItemData.Touched 007538f0 returns byte+8 & 1; GetTrinketMultiplier 007cb6e0 / replace_trinket test bit 2 (golden queued trinket); ClearQueueItem zeroes the byte +Entity_Player 0x18a0 int _strengthMaxHearts UseCard 007b2230 Strength (12) ++ per temporary heart container; ClearTemporaryEffects 007907a0 removes that many and zeroes it; trigger_max_hearts_removed takes from it +Entity_Player 0x1b10 bool _hasBabyRoomShield ? room_enter 007a6c50 sets 1; TakeDamage 007729d0 for a co-op baby (variant 1) with _babySkin 11 consumes it and ignores the hit +Entity_Player 0x1d94 short _damageMultiplierStacks ? FUN_0060d0c0 increments it; EvaluateItems 00763570 damage *= pow(1.5, it) when >0; Update 00782af0 re-evaluates cache 1 when it differs from 0x1d96 and resets it to 0 later +Entity_Player 0x1d96 short _lastDamageMultiplierStacks ? Update 00782af0 copies 0x1d94 here after setting cache 1 when they differ +History 0x0 vector_HistoryItem _historyItems Entity_Player::RemoveCollectibleByHistoryIndex 0078fec0 / DropCollectible index begin 0x1dec / end 0x1df0 with stride 0x1c +Entity_Player 0x1e80 EntityPtr _salvationEffect update_effects 00794e50 spawns it with Salvation (696), removes it (vtable +0x28) without it; Update 00782af0 keeps it on the player and spins its sprite by frame count; release_weapons_and_effects removes it +Entity_Player 0x1ecc int _reverseEmpressMaxHearts UseCard 007b2230 Reverse Empress (59, null 0x3e) ++ per temporary heart container; trigger_collectible_effect_removed 00793970 null 0x3e removes that many and zeroes it; trigger_max_hearts_removed takes from it first +Entity_Player 0x1ed0 int _reverseChariotMoveCooldown update_body_animations 00779b40 under null effect 63 (added by card 63 Reverse Chariot): moving input gives a velocity lurch and sets 5, counts down; 0 without the effect +Entity_Player 0x1ed4 int _reverseSunBoneHearts UseCard 007b2230 Reverse Sun (75) converts red heart containers to bone hearts and stores the count; trigger_collectible_effect_removed null 0x42 converts them back while >0 +Entity_Player 0x1ef0 int _ductTapeMode update_body_animations 00779b40: golden Duct Tape (trinket 109, multiplier >=2) drop action cycles 1..3, 0 otherwise; TriggerTrinketAdded 007ad860 sets 1; saved as a byte +Entity_Player 0x1f78 int _bagOfCraftingHoldFrames ControlActiveItem 00791a40: with item state 710 and an output, ++ while held, >29 crafts and resets; FUN_0075ea40 renders ((x-5)/25)*100 % charge; UseActiveItem zeroes +Entity_Player 0x1fa4 std_vector_uint _itemCards AddItemCard 007d8240 push_back up to min(Starter Deck count+3, 20) entries, spawning the oldest as card 300 when full; pockets_rotate 007a42b0 rotates it; PlayerHUD::Update draws it +Entity_Player 0x1fc4 bool _isLevelStartPending level_start 007a4ba0 sets it on the _backupPlayer and clears its own; Update 00782af0 runs level_start(1) once it is set; saved +Entity_Player 0x2024 int _grantedCollectibleCountdown ? FUN_007d8740 adds to it capped at 4 with the flags in 0x2028; update_effects 00794e50 counts it down and clears 0x2028 at 0; EvaluateItems gives +1.5 tears/+1 while >0 +Entity_Player 0x2028 uint32_t _grantedCollectibleFlags HasCollectible 007706e0 / GetCollectibleNum 00770ca0 report Scorpio 305 (0x10), Fire Mind 257 (8), Ball of Tar 231 (0x20), Sacred Heart 182 (0x40) while the bit is set; set by FUN_007d8740, cleared by update_effects +Entity_Player 0x2050 vector_FamiliarData _curseMistFamiliars AddCurseMistEffect 007d8980 pushes 0x34-byte familiar records into begin 0x2050 / end 0x2054 / cap 0x2058; RemoveCurseMistEffect 007d8d20 respawns from it; StoreGameState saves it +Entity_Player 0x2098 int _wildCardVarData ControlActiveItem 00791a40 stores the active slot's _varData (pill color) beside _wildCardItem; UseCard 007b2230 Wild Card UsePill(_wildCardItem, it, 0x180); saved +Entity_Player 0x418 int _fireBlockCooldown Update 00782af0 counts it down beside _controlsCooldown; update_shooting 0077b020 sets it after a Maw of the Void / Revelation release and blocks firing while >0 +EntityDesc 0x0 uint32_t _type Entity_Player::update_shooting 0077b020 Friend Ball capture writes type/variant/subtype into _friendBallEnemy +0/+4/+8 +EntityDesc 0x4 uint32_t _variant update_shooting 0077b020 Friend Ball capture (_friendBallEnemy 0x1914) +EntityDesc 0x8 uint32_t _subtype update_shooting 0077b020 Friend Ball capture (_friendBallEnemy 0x1918) +EntityDesc 0xc int _championId Entity_Player ctor 00753da0 sets _friendBallEnemy+0xc (0x191c) to -1; saved in GameStatePlayer +EntityDesc 0x10 float _health update_shooting 0077b020 Friend Ball capture: maxHealth*0.5 (_friendBallEnemy 0x1920) +EntityDesc 0x14 float _maxHealth update_shooting 0077b020 Friend Ball capture: baseHP (_friendBallEnemy 0x1924) +EntityDesc 0x18 bool _playerControlled Entity_Player ctor 00753da0 zeroes the byte at 0x1928 (_friendBallEnemy+0x18); saved in GameStatePlayer +Entity 0x8 vector_DamageEvent _damageEvents damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) +Entity 0x14 float _pendingDamage Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it +Entity 0x18 uint64_t _pendingDamageFlags Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) +Entity 0x160 Vector _shadowOffset Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes +Entity 0x174 bool _isKillOnTouch ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR +Entity 0x178 vector_Vector _collisionPoints Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size +Entity 0x18c bool _collidesWithEntity ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) +Entity 0x194 Vector _gridCollisionVelocity Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 +Entity 0x19c Vector _gridCollisionNormal Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 +Entity 0x1b8 ColorMod _color Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 +Entity 0x240 EntityRef _charmSource Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) +Entity 0x268 EntityRef _entityRef2 ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong +Entity 0x290 EntityRef _entityRef3 ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) +Entity 0x2b8 EntityRef _entityRef4 ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) +Entity 0x310 EntityPtr _iceFrozenEffect ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it +Entity 0x314 Vector _pausePosition Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it +Entity 0x320 float _poisonTickDamage Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it +Entity 0x324 float _burnTickDamage Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it +Entity 0x328 int _spawnFrame Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 +Entity 0x344 Vector _preInterpolatePos Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step +Entity 0x358 float _renderDepthOffset Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) +Entity 0x368 float _baseFriction Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen +Entity 0x374 Vector _sizeMulti Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there +Entity 0x384 float _maxHitPoints Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it +Entity 0x38c Vector _prevPosition Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement +Entity 0x394 Vector _prevVelocity Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 +Entity 0x3a0 float _prevUpdateTime Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed +Entity 0x3a4 float _updateTime Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns +Entity 0x3cc std_multiset_uint _entityPtrReferrers Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase +Entity 0x3d8 EntityPtr _hitEffect ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it +Entity 0x3f0 int _holdCountdown Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 +Entity 0x3f4 Vector _holdPosition Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 +NPCAI_Pathfinder 0x0 Entity* _entity PathFinder::Init 007e31a0 stores the owner (called from the NPC/Familiar constructors with this); UpdateGridIndex 007e6ff0 reads owner+0x33c position +NPCAI_Pathfinder 0x4 Vector _movementTarget PathFinder::MoveRandomly 007e6300 picks a random destination into +4/+8 and steers toward it; Lua ResetMovementTarget 007e6fa0 and Reset 007e3260 zero it (NPC +0x418) +NPCAI_Pathfinder 0xc Vector _moveDirection ? PathFinder::MoveRandomlyBoss accumulates and normalises a direction in +0xc/+0x10 and negates it on grid collision; ResetMovementTarget 007e6fa0 zeroes it (NPC +0x420) +NPCAI_Pathfinder 0x20 int _gridIndex Lua PathFinder.UpdateGridIndex 007e6ff0 writes the owner's grid index (or -1) to +0x20, GetGridIndex returns it; Reset sets -1 (NPC +0x434) +NPCAI_Pathfinder 0x72c bool _hasDirectPath Lua PathFinder.HasDirectPath returns byte +0x72c; Reset 007e3260 clears it (NPC +0xb40, tested by Gaper-family AIs); same struct as lua_fields 'PathFinder' +NPCAI_Pathfinder 0x730 Vector _gridPathTarget PathFinder::FindGridPath stores the target position in +0x730/+0x734 (in_ECX[0x1cc/0x1cd]) and reuses it; Reset zeroes it (NPC +0xb44) +NPCAI_Pathfinder 0x738 bool _canCrushRocks Lua PathFinder.SetCanCrushRocks 00499dc0 writes byte +0x738; FindGridPath tests it; Reset clears it (NPC +0xb4c) +NPCAI_Pathfinder 0x73c int _evadeMovementCountdown Lua PathFinder.GetEvadeMovementCountdown 00456740 returns +0x73c; EvadeTarget sets 3 / subtracts elapsed ticks (NPC +0xb50); same as lua_fields 'PathFinder' +NPCAI_Pathfinder 0x744 float _evadeDistance ? PathFinder::EvadeTarget clamps +0x744 to <=20 and decays it *0.9, picking random moves while >20; Reset zeroes it (NPC +0xb58, Heart AI tests <=20) +Entity_NPC 0xb68 int _savedState Entity_NPC::Update 006c4b30 stores _state here and sets _state=1 while FLAG_APPEAR is set, restores _state from it afterwards; Init 006b8b20 zeroes +Entity_NPC 0xb70 int _appearFrames Entity_NPC::Update 006c4b30 counts up while _state==1 (appear) and runs the init AI call when it is 0; Init zeroes +Entity_NPC 0xb74 int _aiCallPhase Entity_NPC::Update 006c4b30 sets 1 (pre/paused call), 4 (post-update call), HandleCollision 006cd410 sets 3 (collision call) around Entity_NPC_UpdateAI_dispatch, then 0; Beast AIs branch on ==1 +Entity_NPC 0xb78 bool _collisionIsLow Entity_NPC::HandleCollision 006cd410 stores its 'low' argument here before the phase-3 AI call +Entity_NPC 0xb7c Entity* _collisionEntity Entity_NPC::HandleCollision 006cd410 stores the collider here for the phase-3 AI call; AIs read collider+0x28 type, compare with _parent/_spawnerEntity +Entity_NPC 0xb80 int _collisionResult Entity_NPC::HandleCollision 006cd410 sets -1 before the phase-3 AI call; AI writes 0 (ignore collision) or >0 (block); HandleCollision returns accordingly +Entity_NPC 0xb84 int _decoyTargetTimer ? Entity_NPC::Update 006c4b30 counts it up while the target is familiar 3.67 (Punching Bag), wraps to -1 past 180, decays toward 0; GetPlayerTarget 006be840 ignores decoys while it is <0 +Entity_NPC 0xb88 vector_DamageEvent _killDamageEvents Entity_NPC::Kill 006be6f0 copies Entity +0x8 damage events here (vector::assign_0x38) together with 0xb94/0xb98 before Entity::Kill; Init clears it +Entity_NPC 0xb94 float _killDamage Entity_NPC::Kill 006be6f0 copies Entity _pendingDamage (+0x14) here +Entity_NPC 0xb98 uint64_t _killDamageFlags Entity_NPC::Kill 006be6f0 copies Entity _pendingDamageFlags (+0x18/+0x1c) here; NpcHelper::ChampionDrop 006bf120 reads it +Entity_NPC 0xba8 int _championTimer Entity_NPC::MakeChampion 006d03e0 sets Random%20+40 for colors 10/25; Update 006c4b30 decrements and shoots/respawns at <1; TakeDamage 006d60a0 (color 21) gates on it and sets 60 +Entity_NPC 0xbac float _championSpeed Entity_NPC::MakeChampion 006d03e0 sets 1.333 (yellow/rainbow), 0.8 (dark blue/grey), scales it for tiny/giant; Update 006c4b30 friction = 1-(1-this)*(1-friction); Init/Morph reset 1.0 +Entity_NPC 0xbe4 uint32_t _deliriumCycleIDHigh NpcAI::ENTITY_DELIRIUM 004a6500 builds a bitfield across _deliriumCycleID (0xbe0)>>25 | (0xbe4&7)<<7 and zeroes 0xbe4 when it rewrites 0xbe0 +Entity_NPC 0xbe8 Entity* _deliriumEntity ? NpcAI::ENTITY_DELIRIUM 004a6500 reads it and tests its _dead (+0x173); Init 006b8b20 zeroes it +Entity_NPC 0xbec EntityPtr _entityRef Lua EntityNPC.EntityRef 004e4850 returns *(this+0xbec); AIs assign it via multiset insert/erase (EntityPtr), Init zeroes; 45 AIs use it as their linked entity +Entity_NPC 0xbf0 deque_EntityPtr _entityDeque Entity_NPC::Constructor 006b8590 builds a std::deque (proxy new(8), 5 dwords 0xbf0..0xc00); Hornfel_UpdateAI 004b92e0 calls std::deque::resize(2) and indexes map 0xbf4/mapsize 0xbf8/off 0xbfc (4 per block) +Entity_NPC 0xc04 deque_Vector _vectorDeque1 Entity_NPC::Constructor 006b8590 builds a std::deque (proxy, 0xc04..0xc14); std::deque::assign(&npc+0xc04) in Evis/Chub/Dogma AIs, map 0xc08, off 0xc10 (2 per block) +Entity_NPC 0xc18 deque_Vector _vectorDeque2 Entity_NPC::Constructor 006b8590 builds a std::deque (proxy, 0xc18..0xc28); std::deque::assign(&npc+0xc18) (Beast soul 005971e0), Dogma/Wormwood index map 0xc1c/off 0xc24 +Entity_NPC 0xc2c Vector _confusionTargetPos Entity_NPC::CalcTargetPosition 006bec40: with FLAG_CONFUSION (0x200) it picks a random clamped spot every 15 frames into 0xc2c/0xc30 and returns it; Init zeroes +Entity_NPC 0xc34 float _aiFloat generic AI scratch float: Init 006b8b20 sets 1.0; Lamb/War/Beast/Gemini AIs store speeds/thresholds (e.g. maxHP*0.4) in it +Entity_NPC 0xc38 float _scale Lua EntityNPC.Scale 004567a0 returns this+0xc38; MakeChampion 006d03e0 sets the tiny/giant scale; Init/Morph 1.0 +Entity_NPC 0xc3c bool _canShutDoors Entity_NPC::CanShutDoors 006b8450 (vtable 18) returns it unless FLAG_FRIENDLY; 00436220 (named Entity::SetVisibleFlag) sets it to arg unless FLAG_FRIENDLY; Update 006c4b30 clears it when unreachable twice or no bosses alive +Entity_NPC 0xc3e bool _isUnreachableOnce ? Entity_NPC::Update 006c4b30: first time no player has a path it sets 0xc3e=1, the next time it clears _canShutDoors; Init clears +Entity_NPC 0xc44 int _shieldFrames Entity_NPC::champion_init 006bb790 copies EntityConfig shieldFrames (+0xe4); Init 006b8b20 / Delirium / Ultra Greed set 120 +Entity_NPC 0xc5c float _totalDamageTaken Entity_NPC::Update 006c4b30 adds max(0, hp before - hp after Entity::Update) each update; Init/Morph zero it +Entity_NPC 0xc60 bool _isBestiaryEncountered Entity_NPC::Update 006c4b30 calls PersistentGameData::TryAddBestiaryEncounter(type,variant) once and sets it; Init/Morph clear +Entity_NPC 0xc68 int _flickerTimer Entity_NPC::Update 006c4b30 flicker champion (color 9) / type 252 state machine: countdown, reset to 60+Random(30) +Entity_NPC 0xc6c int _flickerState Entity_NPC::Update 006c4b30 flicker champion state 0 wait, 1 fade out, 2 fade in, 3 invisible +Entity_NPC 0xc70 float _flickerAlpha Entity_NPC::Update 006c4b30 steps it by 0.05 between 0 and 1 and applies it as the sprite alpha; Init 1.0 +Entity_NPC 0xc76 short _championRegenCount Entity_NPC::Update 006c4b30 increments it each time the dark red champion (12) regenerates; Clotty/Hive/Mulligan/Hopper AIs scale spawns by it +Entity_NPC 0xc80 ColorMod _floorColor ? Entity_NPC::Constructor 006b8590 inits a ColorMod (1,1,1,1, 7 zeros); Update 006c4b30 samples the room render surface into it every 30 frames and Color::Lerp's the sprite toward it (0.1) +Entity_NPC 0xcd8 ANM2 _statusEffectSprite Entity_NPC::Update 006c4b30 loads gfx/StatusEffects.anm2 into this+0xcd8 and plays the status animation; Render 006d2e50 draws it; constructor builds the ANM2 (0xd0c/0xd1c/0xde1/0xde8 are inside it) +Entity_NPC 0xf0c std_vector_uint _secondaryHitList Entity_NPC::Constructor/ClearReferences 006b8f30 manage a 3-dword vector 0xf0c..0xf14; NpcAI::ENTITY_WHIPPER 004e5170 clears it and binary-searches it for GetHitListIndex of whip-hit entities +Entity_NPC 0xf18 uint32_t _aiCallFlags bitmask of extra AI calls: Update 006c4b30 calls the AI with phase 1 if &1, phase 4 if &8; HandleCollision 006cd410 phase 3 if &4; regen champion saves it <<16 and restores from 0xf1a +Entity_NPC 0xf30 Vector _forwardVector Entity_NPC::GetForwardVector 006d48a0 (vtable 22) returns it when non-zero (else velocity dir); Gyro/Dust/Knight AIs set it; Init zeroes +Entity_NPC 0xf38 EntityPtr _forcedTarget Entity_NPC::TryForceTarget 006b9910 assigns the target (multiset erase/insert); TakeDamage 006d60a0 and many AIs test it +Entity_NPC 0xf3c int _forcedTargetTimer Entity_NPC::TryForceTarget 006b9910 stores Duration (refuses when <0); Update 006c4b30 counts it down, bosses get -150 cooldown, releases _forcedTarget at 0 +Entity_NPC 0xf44 float _hitPointsMulti Entity_NPC::Morph 006c0f30 sets _maxHitPoints = 0xf44 * new maxHP; ENTITY_CAGE 004878a0 multiplies maxHP/HP of split children by the parent's; Init 1.0 +Entity_NPC 0xf48 float _scaleMulti ENTITY_CAGE 004878a0 SetScale(child scale * parent 0xf48) and multiplies it; Init 1.0 +Entity_NPC 0xf4c int _lastGridIndex Entity_NPC::Update 006c4b30 (brown champion) compares Room::GetGridIndex(_pos) with it, spawns poop at the old index, stores the new one; Init -1 +Entity_NPC 0xb6c int _aiCounter ? generic AI int: Init 006b8b20 zeroes; NpcHelper::moms_heart_attack_pattern 004d33d0 / ENTITY_MOMS_HEART 004d48b0 use it as a phase (==3, =4), Bumbino/Gideon count with it +Camera 0x0 uint8_t _aimOffsetBuffer[0x10] ring buffer {Vector* data, int capacity, int count, int head} of 60 aim/focus-entity look-ahead offsets: ctor 009428d0 fills 0x3c, update_focus_position 009439d0 pushes aimDirection*35 (or knife/Epic Fetus focus offset), FUN_00943190 averages it +Camera 0x10 uint8_t _velocityOffsetBuffer[0x10] ring buffer (90) of player velocity*4.5 look-ahead: update_focus_position 009439d0 pushes it, averages with FUN_00943190; SnapToPosition 00944d40 refills with zero +Camera 0x20 uint8_t _enemyOffsetBuffer[0x10] ring buffer (300) of FUN_00942f20 result (average offset of active enemies type 10..999 from the players' center, room+0x125c entity list); update_focus_position 009439d0 pushes/averages it +Camera 0x30 uint8_t _playerSpreadBuffer[0x10] ring buffer (15) of the average (player pos - players center)*0.25 over players: update_focus_position 009439d0 pushes/averages it +Camera 0x40 uint8_t _shakeOffsetBuffer[0x10] ring buffer (4) of screen-shake offsets: update_follow 009446e0 / update_focus_position push zero when Game+0x26508 < 1, else a random 10px offset scaled by timer/11, average written to Game._screenShakeOffset (0x2650c) +Camera 0x50 uint8_t _focusPositionBuffer[0x10] ring buffer (120) of focus positions: SetFocusPosition 00944d10 pushes when !_shouldOverride; update_follow 009446e0 follows its last entry; ctor fills with -(1,1) sentinels replaced by the target in update_focus_position +Camera 0x60 Vector _playersCenter update_focus_position 009439d0 stores players_center_position() here at the end of each update +Camera 0x68 Room* _room ctor 009428d0 stores its Room* argument; get_clamp_bounds 009432f0 / ClampedToRoom 00943490 read room bounds (+0x14..+0x20, +0x11fc) through it +Camera 0x6c Vector _position camera position: ctor/SnapToPosition 00944d40/update_follow 009446e0 write it (lerp by +0x90) and copy it to Room+0x1204 (_renderScrollOffset); IsPosVisible 00944a40 tests against it +Camera 0x74 Vector _screenAnchor ctor 009428d0 sets (1.0*0.5, 1.0*0.5); ClampedToRoom 00943490 / update_focus_position compute pos = screenSize*anchor - ... +Camera 0x7c Vector _unk7c ? only zeroed in ctor 009428d0 (pair with +0x84); no reader found in the dump +Camera 0x84 Vector _unk84 ? only zeroed in ctor 009428d0; no reader found in the dump +Camera 0x90 float _followLerp ctor 009428d0 sets 0.1 (this[1]+3); update_follow 009446e0 moves it +-0.01 within 0.1..0.5 by target distance and lerps _position by it +Room 0x24 GridEntity* _gridEntities[0x1c0] Room::SpawnGridEntity 007ebca0 deletes/stores the new GridEntity at this+0x24+idx*4; CheckLine 007f0df0 bounds idx <= 0x1bf (REPENTOGON says [0x1BF]; 0x24+0x700 = 0x724 = _doors) +Room 0x724 GridEntity_Door* _doors[8] Room::GetDoor 00436020 returns this+0x724+slot*4 (slot -1..7); TrySpawnDevilRoomDoor 007f83b0 / MakeDoor 007eea90 use it +Room 0x744 int _doorGridPositions[8] Camera::constructor 009428d0 converts room+0x744+enterDoor*4 to a position with gridWidth (x%w*40+40, x/w*40+120); Room::UpdateRedKey 008271e0 spawns outlines at the same index +Room 0x76c int _gridPaths[0x1c0] Lua Room:GetGridPath 004565c0 / SetGridPath 0042a290 read/write this+0x76c+idx*4 for idx < 0x1c0; SetGridPath 004565e0 only overwrites values < 951 +Room 0x1210 uint32_t _brokenWatchState Room::GetBrokenWatchState 0081edd0 returns it (2 in challenge 0x16); SetBrokenWatchState 0081edf0 writes it then calls time_scale_update 007ea2d0 +Room 0x6e40 ANM2 _lightSprite ctor 007e9400 ANM2::constructor; lighting helper 00806c20 (called by Room::render_lighting 0080ea80, ZHL-misnamed Game::Render) plays Light/flame/sparks and sets its _scale (+0x9c = 0x6edc/0x6ee0) per light source; render_player_light 0080bd20 / render_grid_entity_light 0080c810 render it +Room 0x706c int _shopRestockTimer Room::TriggerRestock 00815800 sets 30; Room::Update 00802980 counts it down and calls ShopRestockPartial at 0 (then -1); on_leave 007efa50 flushes it the same way +Room 0x7234 uint8_t _pendingGridRemovals[0x8] std::set (ctor 007e9400 head node 0x14 bytes); Room::Update 00802980 destroys the grid entity at every index in it, then clears it; filled by Room::Init 007f2800 +Room 0x7308 uint8_t _litGridIndices[0x8] ? std::set (ctor 007e9400 head node); Room::render_lighting 0080ea80 clears it each frame, lighting helper 00806c20 looks entities' grid index up in it before drawing their light +Room 0x7328 uint8_t _outputGroupGridIndices[0x50] std::set[10] (ctor 007e9400 vector ctor 8 x 10); Room::TriggerOutput 00823080 calls GridEntity::trigger_output on every grid index in set[group] +Room 0x7378 uint8_t _outputGroupCallbacks[0x78] std::vector[10] (ctor 007e9400 vector ctor 0xc x 10); Room::TriggerOutput 00823080 calls each function in vector[group] +Room 0x7744 EntityPtr _redDoorOutlines[8] ctor 007e9400 builds 8 EntityPtr (ctor 0042a020 / dtor 00579700 multiset erase); Room::UpdateRedKey 008271e0 spawns effect 1000.154 per free door slot and stores it with multiset insert, clears them without Red Key +Level 0xc uint32_t _curses Level::generate_dungeon 00740e10 ORs this+0xc with Game+0x26550 and Seeds::GetForcedCurses (Game._curses at the same offset; Level*==Game*) +Level 0x14 RoomDescriptor _roomList[0x20f] Level::GetRoomByIdx 00740bc0 returns this+0x14+n*0xb8 for n = roomMap[...] < 0x20f; QueryRoomTypeIndex 007484c0 reads ->Data (+0x10 = 0x24), +0xc (0x20), +0xb4 (0xc8) per 0xb8 stride +Level 0x17adc int _roomMap[0x1fb] Level::GetRoomByIdx 00740bc0 reads this+0x17adc+(dimension*0xa9+idx)*4 as the _roomList index (3 dimensions x 169) +Level 0x182c8 int* _currentRoomMap Level::ChangeRoom 0073fc80 / Init 00744940 set it to &_roomMap[dimension*0xa9] (this+0x17adc+dim*0x2a4) +Level 0x182d4 RNG _generationRNG Level::generate_dungeon 00740e10 / Init 00744940 seed+step the RNG at 0x182d4..0x182e0 (Game._generationRNG) +Level 0x18300 Room* _room Level::ChangeRoom 0073fc80 / RestoreGameState 007475b0 use it as the current Room (Game._room, Level::GetCurrentRoom 00407480) +Level 0x1830c int _currentDimensionIdx Level::GetRoomByIdx 00740bc0 uses it as default dimension; ChangeRoom 0073fc80 sets it with _currentRoomMap (Game._currentDimensionIdx) +Level 0x18310 int _lastRoomDimensionIdx Level::ChangeRoom 0073fc80 / Init 00744940 write it (Game._lastRoomDimensionIdx) +Level 0x18378 uint8_t _ventricleRazorPortals[0x18] 2 x {int roomIdx, int gridIdx, bool}: FUN_0074a280 ("PortalIdx is bigger than 2!") stores _currentRoomIndex/arg/flag at this+0x18378+i*0xc, called from UseActiveItem case 0x18c (Ventricle Razor); Init 00744940 / ChangeRoom (Beast room) reset roomIdx to -99999 +Game 0x14 RoomDescriptor _roomList[0x20f] Level*==Game*: Level::GetRoomByIdx 00740bc0 returns this+0x14+n*0xb8, n < 0x20f +Game 0x17adc int _roomMap[0x1fb] Level*==Game*: Level::GetRoomByIdx 00740bc0 indexes this+0x17adc+(dimension*0xa9+idx)*4 +Game 0x182c8 int* _currentRoomMap Level*==Game*: Level::ChangeRoom 0073fc80 sets it to this+0x17adc+dimension*0x2a4 +Game 0x18378 uint8_t _ventricleRazorPortals[0x18] Level*==Game*: FUN_0074a280 writes 2 x 0xc portal records (Ventricle Razor, UseActiveItem case 0x18c) +Game 0x264f4 int _freezeFrames Game::Update 006fadc0 decrements it while >0 and returns right after HUD::PostUpdate (no game update); Game::IsPaused 006fd350 returns 1 while >0; reset_run_state 006f43b0 zeroes it +Game 0x26508 int _screenShakeTimer Lua Game:ShakeScreen 00703670 writes the timeout; Game::Update 006fadc0 counts down, zeroes _screenShakeOffset at 0; Camera::update_follow 009446e0 scales shake by timer/11 +Game 0x26514 int _darknessTimeout Lua Game:Darken 00440ee0 writes param 2; Game::Update 006fadc0: while >0 decrement and raise +0x26518 by 1/21, else lower it by 1/30 +Game 0x26518 float _darknessModifier Game::GetDarknessModifier 00440610 returns it; Game::Update 006fadc0 ramps it 0..1 by _darknessTimeout; renderer uses 1 - _darknessStrength*it*0.96 +Game 0x2651c float _darknessStrength Lua Game:Darken 00440ee0 writes param 1; multiplied with _darknessModifier in Room::render_darkness_overlay 00825de0 +Game 0x26520 uint8_t _giantBookClickerImage[0x8] image handle (+0 ptr, +4 owner): Game::Render 006fbc10 loads gfx/ui/giantbook/GiantBook_Clicker.png into it when null; ~Game 006f3060 releases it +Game 0x26528 int _bloomTimer Game::SetBloom 00703830 sets it = Time; Game::Update 006fadc0 counts it down; Game::Render 006fbc10 bloom pass while >0, intensity sin(1-|t-dur/2|/(dur/2)) +Game 0x2652c int _bloomDuration Game::SetBloom 00703830 sets it = Time; Game::Render 006fbc10 uses it as the total for the bloom curve +Game 0x26530 float _bloomStrength Game::SetBloom 00703830 stores the XMM2 Strength; Game::Render 006fbc10 multiplies the bloom curve by it +Game 0x26538 int _hallucinationTimer Lua Game:ShowHallucination 007059f0 sets it; HasHallucination 004a5d00 returns >0; Game::Update 006fadc0 counts it down; Game::Render 006fbc10 draws the effect while >0 +Game 0x2653c int _hallucinationDuration ShowHallucination 007059f0 sets it with the timer; Game::Render 006fbc10 fades by (timer - duration + 20) +Game 0x26540 bool _isRoomSnapshotTaken ? Game::Render 006fbc10 renders into render target DAT_00c797a4 30 frames after room entry (or 1 in 3 by room seed when already set) and sets it to 1; ResetState 006f4520 clears it +Game 0x2658c KColor _fadeInColor Lua Game:Fadein 006f5210 copies a KColor (5 dwords 0x2658c..0x2659c), alpha +0xc (0x26598) set 1.0; Game::Update 006fadc0 lowers alpha by _fadeSpeed; Render 006fbc10 draws the quad while alpha > 0 +Game 0x265a0 bool _isFadeInIconShown ? Fadein 006f5210 param 2 / FUN_00707ad0 sets 1; Game::Render 006fbc10 calls FUN_009522b0 (frame%16 animated icon) during the fade-in +Game 0x265a4 KColor _fadeOutColor Lua Game:Fadeout 006f5290 copies the KColor to 0x265a4..0x265b4 and adds speed to its alpha (0x265b0); Game::Update 006fadc0 raises alpha to 1 then acts on _fadeOutTarget +Game 0x265b8 float _fadeSpeed Fadein 006f5210 / Fadeout 006f5290 store the speed; Game::Update 006fadc0 steps the fade alphas by it +Game 0x265bc int _fadeOutTarget Game::Fadeout 006f5290 stores the target (<= 0xb, "Invalid target specified to Game::Fadeout()"); Game::Update 006fadc0 switches on it when the fade completes +Game 0x265c0 int _framesSinceRoomTransition Game::Update 006fadc0 increments it each normal frame and zeroes it while a RoomTransition is active; FUN_00708350 returns true while < 8; ResetState/ctor zero it +Game 0x269d4 uint8_t _encounteredBosses[0xc] std::vector<{int type, int variant}>: Lua Game:AddEncounteredBoss 00703470 pushes (8-byte stride 0x269d4/d8/dc), HasEncounteredBoss 00703510 / GetNumEncounteredBosses 0085e370 scan it +Game 0x269e0 int _pixelationTimer Lua Game:AddPixelation 00753cc0 sets it to max(cur, arg); Game::Update 006fadc0 counts it down; Room::Render 0080f200 pixelation while >0 +Game 0x269e4 int _pixelationDuration ? AddPixelation 00753cc0 writes the same max value; read by Room::Render 0080f200 as the total +Game 0x269e8 bool _isInstantFadeIn Console::RunCommand (restart branch, FUN_00685ee0) sets 1 after Manager::RestartGame; Fadein 006f5210 / FUN_00707ad0 then start alpha at 1e-5 instead of 1.0; Game::Update 006fadc0 clears it when the fade ends +Entity_Knife 0x438 float _rotation Lua EntityKnife.Rotation getter 004d7790 returns this+0x438; Update 00961b00 sets sprite rotation = +0x438 - 90 +Entity_Knife 0x440 float _displayRotation Entity_Knife::Update 00961b00 LerpAngleDeg's it toward _rotation+_rotationOffset (+0x438 + +0x43c) and places the knife at parent pos + sin/cos(+0x440); SetAttackAnimation 009680d0 / SpinAttack 00968430 snap it to +0x438 +Entity_Knife 0x434 float _knifeDepthOffset Entity_Knife::GetRenderZ 009665e0 returns floor((+0x434 + pos.y)*100 + 10030); Update writes it from the swing direction, Shoot 00966ef0 zeroes it +Entity_Knife 0x44c Vector _anchorPosition Entity_Knife::Update 00961b00 lerps it toward the parent pos by 1 - charge*dist*0.8 (set to parent pos when zero); SetAttackAnimation 009680d0 sets it to parent+0x33c; update_target 00967650 uses it as the throw origin +Entity_Knife 0x454 Vector _initPosition ? only written: Entity_Knife::Init 00960c10 copies pos into +0x454/+0x458 (ctor zeroes it); no reader in the dump +Entity_Knife 0x468 HomingLaser _homingLaser ctor 00960a70 runs the HomingLaser init 0099c290 there; InitHomingPath 00961320 resets _samples (+0x484/+0x490), _unkVec (+0x49c), _bezier (+0x4b0), sets _origin +0x46c=pos, _endPoint +0x474, _sampleNum +0x480=30, then HomingLaser::build_bezier_path; Update walks the 0x18-byte bezier entries at +0x4b0; Free tidies +0x4b0 +Entity_Knife 0x4bc int _pathSegment Entity_Knife::Update 00961b00 searches bezier segments of _homingLaser from index +0x4bc (bezier_closest_point) and stores the chosen segment back; InitHomingPath 00961320 / Init reset it to 0 +Entity_Knife 0x4c0 float _pathProgress Entity_Knife::Update 00961b00 stores the closest bezier t (must not go backwards within the current segment) and evaluates the cubic at t and t+_pathFollowSpeed; InitHomingPath / Init set -100.0 +Entity_Knife 0x4cc float _height Entity_Knife::Update 00961b00: +0x4cc += +0x4d0 each frame, clamped to 0 on landing, posOffset.y = +0x4cc + +0x4d4; Shoot 00966ef0 resets it to 0 for the hop +Entity_Knife 0x4d0 float _fallingSpeed Entity_Knife::Update 00961b00 adds 1.5 per frame (gravity) and adds it to +0x4cc; Shoot 00966ef0 sets -10.0 (jump) when the tear-flag mask 0xc345e0 is set +Entity_Knife 0x4d4 float _basePosOffsetY Entity_Knife::Update 00961b00 saves posOffset.y into +0x4d4 and later sets posOffset.y = _height(+0x4cc) + +0x4d4; copied from the parent knife with +0x4cc/+0x4d0 +Entity_Knife 0x4d8 std_vector_uint _hitList Entity_Knife::GetHitEntities 009612e0 returns this+0x4d8 (of the root knife); Shoot/SetAttackAnimation/SpinAttack clear it (end=begin +0x4dc); ctor zeroes +0x4d8..+0x4e0, Free tidies it +Entity_Knife 0x4e7 bool _isUsingParentHitList Entity_Knife::GetHitEntities 009612e0 walks to the parent knife (+0x3bc, type 8) while this+0x4e7 is set; apply_hit_effects 0096ae70 sets it on the knives it spawns; Init clears it +Entity 0x175 bool _isInterpolating Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it +Entity_Tear 0x46a bool _isFireSoundPending Entity_Tear::Init 006660a0 sets it to 1; Entity_Tear::Update 006670f0 calls play_fire_sound() once and clears it +Entity_Tear 0x46c short _popBounceCount Entity_Tear::Update 006670f0 increments it on both tears on a tear-tear bounce, HandleCollision 00673660 increments it when TEAR_POP (bit 58, mask 0xc345b0) is set; Update keeps bouncing only while < 9; Init zeroes it +Entity_Tear 0x470 int _hitCount Entity_Tear::HandleCollision 00673660 tests ==0 for first-hit effects then increments it on every enemy hit; Init zeroes it +Entity_Tear 0x474 uint32_t _deathFlags Entity_Tear::Update 006670f0 ORs a reason into it whenever it sets _dead (+0x173): 1 grid hit, 2 grid collision type 4, 4 hit the floor, 0x10 damage depleted, 0x20, 0x40 timeout/forced die; tests ==4 for the hydro-bounce revive; Init zeroes it +Entity_Tear 0x488 EntityPtr _techZeroLaser Entity_Tear::Update 006670f0 (TEAR_LASER bit 57, mask 0xc345a0): Entity_Laser::ShootAngle result stored here, repositioned between the tears, Remove()d (vtable+0x28) when the linked tear dies or >350 apart; ClearReferences 006666c0 removes it +Entity_Tear 0x48c EntityPtr _techZeroTarget Entity_Tear::Update 006670f0 (TEAR_LASER bit 57): nearest other tear (QueryRadius, type 2) whose +0x48c is not this; laser +0x488 spans to it; Interpolate 00679400 reads it; ClearReferences 006666c0 resets it +Entity_Tear 0x490 EntityPtr _laserShotLaser Entity_Tear::Update 006670f0 (TEAR_LASERSHOT bit 60, mask 0xc345d0) spawns a laser via Entity_Laser::ShootAngle along the tear's (continue)velocity and keeps it here; without the flag it is Remove()d; ClearReferences 006666c0 removes it +Entity_Tear 0x494 EntityPtr _linkPrev Entity_Tear::apply_link_spring_forces 0067aaf0 springs toward +0x494 and +0x498 (rest length 10); link setter 0067ae30 joins prev/next; ClearReferences 006666c0 relinks prev<->next (EntityPtr set 0067dac0) when both are tears +Entity_Tear 0x498 EntityPtr _linkNext see _linkPrev: apply_link_spring_forces 0067aaf0, 0067ae30, ClearReferences 006666c0; Init 006660a0 resets both +Entity_Tear 0x49c EntityPtr _attachedEffect ? Entity_Tear::Update 006670f0 spawns (Game::Spawn) an entity for several tear-flag cases into +0x49c, sets its parent/color and scales it with _fScale every frame; ClearReferences 006666c0 Remove()s it +Entity_Tear 0x7fc int _holdTimer Entity_Tear::Update 006670f0: while >0 counts down, pins the tear to parent(+0x3bc) pos + +0x800 with zero velocity and bobs height ±0.5 per 15 frames; on expiry restores velocity from +0x808; Interpolate 00679400 does the same pin +Entity_Tear 0x800 Vector _holdOffset Entity_Tear::Update 006670f0 / Interpolate 00679400 set pos = parent pos + this+0x800/+0x804 while _holdTimer (+0x7fc) > 0; Init zeroes it +Entity_Tear 0x808 Vector _holdVelocity Entity_Tear::Update 006670f0 copies +0x808/+0x80c into velocity when _holdTimer (+0x7fc) reaches 0 +Entity_Familiar 0x414 Entity_Player* _sirenOriginalPlayer Siren charm 0064b920 saves the old _player (+0x410) here before handing the familiar over; Entity_Familiar::RemoveFromPlayer 0064bab0 restores the owner from it and clears it; Init zeroes it, delirium_morph 00631b20 carries it over +Entity_Familiar 0xeec EntityPtr _sirenHelper Siren charm 0064b920 spawns entity 966 (Siren helper, parent=Siren, target=familiar) into +0xeec; RemoveFromPlayer 0064bab0 Remove()s it; HandleCollision 006261f0 / convert_shot_for_enemy_owner 0064bb70 check its age; Init erases it +Entity_Familiar 0xef0 int _sirenCharmFrames Siren charm 0064b920 sets +0xef0=1, Entity_Familiar::Update 0061da10 increments it each frame while >0, RemoveFromPlayer 0064bab0 clears it +Entity_Familiar 0xdc0 EntityPtr _linkedEntity Entity_Familiar::Shoot 00614b10 stores the blue fly from AddBlueFlies, FireBrimstone 00638c10 the laser, Init 0060de70 the effect 1000.201 of variant 240; ClearReferences 006121d0 Remove()s it for variant 240 and resets it +Entity_Familiar 0xdb8 int _appearTimer Entity_Familiar::Init 0060de70 sets 5; Update 0061da10 counts it down while entity flag 4 (appear) is set, spawns the poof at 3, keeps the familiar invisible until 0 and skips its AI +Entity_Familiar 0xda8 int _counter multi-purpose per-variant counter: Update 0061da10 counts it down / up to 749, HandleCollision 006261f0 sets 300 (variant 58), TriggerRoomClear 0062aab0 increments it, update_weapon 0062e620 uses it as a fire delay, TakeDamage 0062cdc0 ignores damage while >0 for variant 238; Init zeroes it +Entity_Familiar 0xee0 void* _extraData ReferenceCount pointer: set_extra_data 004357e0 allocates it (in_ECX[1]); Render 00624e10 RTDynamicCasts +0xee0 to IsaacsBodyData for variant 48; ctor zeroes +0xee0/+0xee4 +Entity_Familiar 0xdbc int _chargeLevel ? Entity_Familiar::Update 0061da10 variant 226 only: counts 0..5 up while an entity flag is set and down otherwise, sound volume min(level*0.2,1) and pitch from it, stops the loop sound at 0 +Entity_Familiar 0xd76 bool _isNotCountedAsFollower ? Entity_Familiar::FollowParent 00612bb0 counts only followers with priority>0 and +0xd76==0; set by Init 0060de70 (subtype 55555 and some variants) and WispInit 00436330 for intangible wisps; Init clears it +Entity_Familiar 0xd77 bool _isSubtype55555 ? Entity_Familiar::Init 0060de70 sets it = (subtype == 55555) and then gives the familiar ItemConfig collectible 661, a color and no appear flag; AddToFollowers 0062db20 / AddToDelayed 00613fe0 return early and Kill 00610540 skips the orbit-layer logic when set +Entity_Projectile 0x444 int _animKey Entity_Projectile::Update 00653070 caches the animation it last played (size index 0..12, or 100/200/.../1000 per variant) and re-plays only when it changes; Init 00652b90 sets -1 to force the first play +Entity_Projectile 0x420 float _scale Lua EntityProjectile.Scale (folded Entity_Tear::Scale 00557cd0) returns this+0x420; AddScale 0085e320 adds to it; Init sets 1.0; Update multiplies shadow size by it +Entity_Projectile 0x424 float _homingStrength Lua EntityProjectile.HomingStrength (folded Entity_Tear::BaseScale 0060ccb0) returns this+0x424; Init 00652b90 sets 1.0 +Entity_Projectile 0x428 float _curvingStrength Lua EntityProjectile.CurvingStrength 004d3060 returns this+0x428; Init 00652b90 sets 0.015 +Entity_Projectile 0x41c float _damage Lua EntityProjectile.Damage 0085e360 returns this+0x41c +Entity_Projectile 0x458 float _changeVelocity Lua EntityProjectile.ChangeVelocity (folded Entity_Tear::Rotation 0060ccc0) returns this+0x458; Init zeroes it +Entity_Projectile 0x440 bool _isRenderedAtGround ? Entity_Projectile::Render 0065cb60: when set, subtracts _height from _posOffset.y before rendering and adds it back after; ctor/Init zero it, no writer found +Entity_Effect 0x414 float _fallingSpeed Lua EntityEffect.FallingSpeed (folded Entity_Tear::FallingSpeed) returns this+0x414; Entity_Effect::Init 005cdb20 gibs set -5-rand*10 next to m_Height(+0x410)=-23 +Entity_Effect 0x418 float _fallingAcceleration Lua EntityEffect.FallingAcceleration (folded Entity_Tear::FallingAcceleration) returns this+0x418; Entity_Effect::Init 005cdb20 gibs set 1.3 +Entity 0x3fc int _pitfallState Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it +Entity_Pickup 0x558 ColorMod _colorMod ? ctor 006e0010 sets +0x558..+0x564 = 1.0 (tint) and +0x568..+0x580 = 0 (colorize/offset), Init 006e02f0 assigns a ColorMod to it as one block (ends right before State 0x584) +Entity_Pickup 0x54c int _collisionCooldown Entity_Pickup::HandleCollision 006e8ae0: player touch while >0 just refreshes it to 10 and returns; Update decrements; Player::DropTrinket sets 4, TakeDamage zeroes +Entity_Pickup 0x588 int _coopDuplicateIndex Entity_Pickup::HandleCollision 006e8ae0: in co-op, while +1 < alive players spawns another collectible and calls setter 006e2ff0(this+0x588 +1), -1 = none; Room::SpawnClearAward sets 0; Init -1 +Entity_Pickup 0x52f bool _isPayToPlay Entity_Pickup::Init 006e02f0 sets it for chest variants 53/55/57/60 when someone has Pay To Play (380); HandleCollision/TryOpenChest then spend a coin instead of TryUseKey +Entity_Pickup 0x548 int _chestReCloseTimer Entity_Pickup::TryOpenChest 006e6e40 sets 60; Update 006e3940 decrements and at 0 an Eternal Chest (53) plays "Close" and gets subtype 1; CanFlip checks it +Entity_Pickup 0x5c4 int _invisibleFrames Entity_Pickup::Update 006e3940: while invisible with collision, ++ and after 3 frames sets _visible; Init/Morph zero it +Entity_Pickup 0x530 int _itemPoolType ? Entity_Player::DropCollectible 00790530 copies History item +0x18 (REPENTOGON _itemPoolType) into it; HandleCollision passes it to SetQueuedItem as QueueItemData +0x10; Morph keeps it, ==3 with price 0 rerolls tag 0x200000000 items +Entity_Pickup 0x58c EntityPtr _unkEntityRef ? Entity_Pickup::ClearReferences 006ee130 resets it like the other EntityPtrs (multiset erase); ctor zeroes; no setter found +Entity_Pickup 0x550 int _gridRepositionState ? Entity_Pickup::HandleCollision 006e8ae0 sets 1 after a pedestal swap near a room grid entity (<70px); Update 006e3940 1: scans grids -> 2; 2: TargetPosition = pos, -> 0 +Entity_Laser 0x53c EntityPtr _tearWaitEffect Entity_Laser::Update 00977cc0: with TEAR_WAIT (bit 17, Anti-Gravity) spawns effect 1000.71/126 into this+0x53c, copies tear flags/colour to it; laser stays frozen while that effect's state (+0x450) is 0; ClearReferences resets it +Entity_Laser 0x540 int _waitFrames Entity_Laser::Update 00977cc0 sets 2 (hidden) with the Anti-Gravity effect and returns early while it counts down; Interpolate 0097e6f0 skips while >0; update_laser sets it on OneHit continuum lasers; Init zeroes +Entity_Laser 0x538 EntityPtr _continuumLaser Entity_Laser::update_laser 00973c60: with TEAR_CONTINUUM (bit 38) spawns the wrapped laser at the room edge via ShootAngle into this+0x538 (sets its _disableInitSound/_disableFollowParent); Remove/ClearReferences free it +Entity_Laser 0x52c EntityPtr _parentLaser Game::BombTearflagEffects 007009a0 sets it (multiset insert); Update and CanDamageEntity 0096cf80 walk this+0x52c->+0x52c to the root laser whose hit list is shared; ClearReferences resets +Entity_Laser 0x4ec EntityPtr _childLaser ? Entity_Laser::Remove 0097ea30 removes it with the laser (unless _oneHit) like _bounceLaser(+0x4e8); ClearReferences resets; Init zeroes; setter not found +Entity_Laser 0x530 EntityPtr _subLasers[2] ? ctor 0096cb60 eh-vector-constructs 2 EntityPtrs at +0x530; Remove 0097ea30 removes both unless _oneHit; ClearReferences resets them +Entity_Laser 0x448 BitSet128 _heldTearFlags ? Entity_Laser::Update 00977cc0 moves TEAR_WAIT out of _tearFlags into this+0x448..0x454 (OR) when it spawns the Anti-Gravity effect; ctor/Init zero 16 bytes +Entity_Bomb 0x450 EntityPtr _stickyTarget Entity_Bomb::HandleCollision 006a5f00 with TEAR_STICKY (bit 37) sets it to the collider (multiset insert) and stores the offset in _targetPosition; Update 006a24d0 follows that entity's pos/velocity +Entity_Bomb 0x430 short _collisionCooldown Entity_Bomb::HandleCollision 006a5f00: while >0 refreshes to 4 and ignores the collision; Update 006a24d0 decrements, sets 4 when invisible; Init sets 4 +Entity_Bomb 0x432 short _parentCollisionCooldown Entity_Bomb::HandleCollision 006a5f00: collider == _parent and >0 -> refresh to 4, ignore; Update decrements; Init sets 4 (0x40004 with +0x430) +Entity_Bomb 0x424 int _bounceCount Entity_Bomb::Update 006a24d0 increments it on each floor bounce (fallSpeed *= -0.7) and stops bouncing after 3; Init zeroes +Entity_Bomb 0x454 int _bombIndex Entity_Bomb::Update 006a24d0 on its first frame gives player bombs a global running number (DAT_00c7ec64++); &1 alternates a side offset +Entity_Bomb 0x458 int _updateDelay Entity_Bomb::Update 006a24d0 returns early while >0 (decrementing); set 5 for variants 17/20 when Ipecac-style flags are added; Init zeroes +Entity_Bomb 0x45c int _scatterTimer ? Entity_Bomb::Update 006a24d0 sets 90 when it gives the bomb a random 5-10 velocity, decrements; HandleCollision 006a5f00 checks <1 in room type 0x10 +Entity_Bomb 0x461 bool _isSkipNextUpdate Entity_Bomb::Update 006a24d0 starts: if set, clear it and return; Init 006a2050 zeroes +Entity_Bomb 0x462 bool _hasCostumes Entity_Bomb::update_sparks 006a6f10 (costume loader) sets 1 when a costume ANM2 loaded; Update/Render 006a5a60 only update/draw _bombCostumesSprites when set +# Deletions: REPENTOGON fields that a confirmed field contradicts +Entity 0x2d4 - _mass the Lua Entity.Mass getter 00431520 reads +0x37c (see Entity 0x37c); 0x2d4 was only bracketed +Entity 0x2b0 - _depthOffset the Lua Entity.DepthOffset getter 00435d10 reads +0x358 (see Entity 0x358); 0x2b0 was only bracketed diff --git a/scripts/headers.py b/scripts/headers.py index 181c8f4..353a2f7 100644 --- a/scripts/headers.py +++ b/scripts/headers.py @@ -2,20 +2,28 @@ # db/fields.tsv; later files win at the same offset), base-class fields flattened in, gaps as explicit padding, and a # static_assert on every member offset. Only offsets this exe confirms are in these files, so the header is as trustworthy # as the evidence behind them. Pointers are uint32_t (the game is 32-bit), so it compiles on any host. -# Usage: headers.py out.hpp zhl_fields.tsv lua_fields.tsv db/fields.tsv +# A db row with type "-" ("Entity0x2d4- _masswhy") deletes a wrong field from the earlier files. +# Usage: headers.py [--merged fields_out.tsv] out.hpp zhl_fields.tsv lua_fields.tsv db/fields.tsv +# --merged also writes the merged field list (what ApplyTypes.java gets) import collections, re, sys -out, *srcs = sys.argv[1:] +args = sys.argv[1:] +merged = args.pop(args.index('--merged') + 1) if '--merged' in args else None +if merged: args.remove('--merged') +out, *srcs = args SIZE = {'bool': 1, 'char': 1, 'int8_t': 1, 'uint8_t': 1, 'unsigned char': 1, 'short': 2, 'int16_t': 2, 'uint16_t': 2, 'unsigned short': 2, 'int': 4, 'int32_t': 4, 'uint32_t': 4, 'unsigned int': 4, 'unsigned long': 4, 'long': 4, 'float': 4, 'uint64_t': 8, 'int64_t': 8, 'unsigned long long': 8, 'long long': 8, 'double': 8, 'Vector': 8} CTYPE = {'unsigned int': 'uint32_t', 'unsigned long': 'uint32_t', 'long': 'int32_t', 'unsigned short': 'uint16_t', 'unsigned char': 'uint8_t', 'unsigned long long': 'uint64_t', 'long long': 'int64_t', 'char': 'int8_t'} -fields, bases = collections.defaultdict(dict), {} +fields, bases, rows = collections.defaultdict(dict), {}, {} for p in srcs: for l in open(p): if l.startswith('#') or not l.strip(): continue c = l.rstrip('\n').split('\t') if c[1] == 'base': bases[c[0]] = c[2]; continue + if c[2].startswith('- '): + fields[c[0]].pop(int(c[1], 16), None); rows.pop((c[0], int(c[1], 16)), None); continue + rows[(c[0], int(c[1], 16))] = l if l.endswith('\n') else l + '\n' decl = c[2].replace('const ', '').strip() count = re.search(r'\[(\w+)\]\s*$', decl) # "int _trinketsID[2]" if count: decl = decl[:count.start()] @@ -63,4 +71,6 @@ with open(out, 'w') as o: '// add or fix fields in db/fields.tsv and regenerate. Offsets not confirmed in this exe are padding.\n' '#pragma once\n#include \n#include \n\n#pragma pack(push, 1)\n' 'struct Vector { float x, y; };\n\n' + '\n'.join(o_ for o_ in order if not o_.startswith('struct Vector ')) + '#pragma pack(pop)\n') +if merged: + with open(merged, 'w') as o: o.writelines([f'{c}\tbase\t{b}\n' for c, b in bases.items()] + list(rows.values())) print(f'headers: {len(done)} structs' + (f'; duplicate member names in {dupes}' if dupes else '')) diff --git a/scripts/zhl_fields.py b/scripts/zhl_fields.py index 974ebd2..c28ad1f 100644 --- a/scripts/zhl_fields.py +++ b/scripts/zhl_fields.py @@ -1,8 +1,8 @@ # REPENTOGON's struct offsets target an older exe (1.9.7.12); fields drift as the game adds members, so they are only # kept where THIS exe confirms them. Evidence ("anchors"): a trivial getter in the corpus ("Class::GetFoo" returning # this+N anchors field "_foo" at N) or the game's Lua field table (lua_bindings.tsv: "EntityNPC State field+0xb64"). -# A field is kept when it is anchored, or lies between two anchors of its class with the same shift; everything else -# is dropped (the decompiler then shows field_0xNNN) until db/fields.tsv confirms it. Base-class rows are always kept. +# A field is kept only when it is anchored; everything else is dropped (the decompiler then shows field_0xNNN) until +# db/fields.tsv confirms it. Base-class rows are always kept. # Usage: zhl_fields.py all.c zhl_dir lua_bindings.tsv out.tsv [names.tsv: addr \t Class::Member, overrides corpus names] # Prints per class: kept/total and the shifts seen. import collections, glob, os, re, sys @@ -49,9 +49,7 @@ with open(fout, 'w') as o: shifts = sorted((off, anchor[(c, norm(d.split()[-1]))] - off) for off, d in fields if (c, norm(d.split()[-1])) in anchor) kept = 0 for off, d in fields: - lo = [s for a, s in shifts if a <= off]; hi = [s for a, s in shifts if a >= off] if (c, norm(d.split()[-1])) in anchor: new = anchor[(c, norm(d.split()[-1]))] - elif lo and hi and lo[-1] == hi[0]: new = off + lo[-1] - else: continue + else: continue # not confirmed: being between two anchors with the same shift is not proof (Entity _mass, _depthOffset) o.write(f'{c}\t0x{new:x}\t{d}\n'); kept += 1 if shifts: print(f'{c}: kept {kept}/{len(fields)}, shifts ' + ' '.join(f'{a:x}{s:+#x}' for a, s in shifts if s)) diff --git a/src/structs.hpp b/src/structs.hpp index 07ac6fb..6af6b6e 100644 --- a/src/structs.hpp +++ b/src/structs.hpp @@ -93,20 +93,18 @@ static_assert(offsetof(ANM2, _bitflags) == 0x110); struct ActiveItemDesc { int _item; - int _unk; + uint8_t _pad_0x4[0x4]; int _charge; int _batteryCharge; int _subCharge; - int _timeRechargeCooldown; + uint8_t _pad_0x14[0x4]; int _partialCharge; int _varData; }; static_assert(offsetof(ActiveItemDesc, _item) == 0x0); -static_assert(offsetof(ActiveItemDesc, _unk) == 0x4); static_assert(offsetof(ActiveItemDesc, _charge) == 0x8); static_assert(offsetof(ActiveItemDesc, _batteryCharge) == 0xc); static_assert(offsetof(ActiveItemDesc, _subCharge) == 0x10); -static_assert(offsetof(ActiveItemDesc, _timeRechargeCooldown) == 0x14); static_assert(offsetof(ActiveItemDesc, _partialCharge) == 0x18); static_assert(offsetof(ActiveItemDesc, _varData) == 0x1c); @@ -118,13 +116,58 @@ static_assert(offsetof(BitSet128, _l) == 0x0); static_assert(offsetof(BitSet128, _h) == 0x8); struct Camera { - uint8_t _pad_0x0[0x8c]; + uint8_t _aimOffsetBuffer[16]; // ring buffer {Vector* data, int capacity, int count, int head} of 60 aim/focus-entity look-ahead offsets: ctor 009428d0 fills 0x3c, update_focus_position 009439d0 pushes aimDirection*35 (or knife/Epic Fetus focus offset), FUN_00943190 averages it + uint8_t _velocityOffsetBuffer[16]; // ring buffer (90) of player velocity*4.5 look-ahead: update_focus_position 009439d0 pushes it, averages with FUN_00943190; SnapToPosition 00944d40 refills with zero + uint8_t _enemyOffsetBuffer[16]; // ring buffer (300) of FUN_00942f20 result (average offset of active enemies type 10..999 from the players' center, room+0x125c entity list); update_focus_position 009439d0 pushes/averages it + uint8_t _playerSpreadBuffer[16]; // ring buffer (15) of the average (player pos - players center)*0.25 over players: update_focus_position 009439d0 pushes/averages it + uint8_t _shakeOffsetBuffer[16]; // ring buffer (4) of screen-shake offsets: update_follow 009446e0 / update_focus_position push zero when Game+0x26508 < 1, else a random 10px offset scaled by timer/11, average written to Game._screenShakeOffset (0x2650c) + uint8_t _focusPositionBuffer[16]; // ring buffer (120) of focus positions: SetFocusPosition 00944d10 pushes when !_shouldOverride; update_follow 009446e0 follows its last entry; ctor fills with -(1,1) sentinels replaced by the target in update_focus_position + Vector _playersCenter; // update_focus_position 009439d0 stores players_center_position() here at the end of each update + uint32_t _room; // Room* // ctor 009428d0 stores its Room* argument; get_clamp_bounds 009432f0 / ClampedToRoom 00943490 read room bounds (+0x14..+0x20, +0x11fc) through it + Vector _position; // camera position: ctor/SnapToPosition 00944d40/update_follow 009446e0 write it (lerp by +0x90) and copy it to Room+0x1204 (_renderScrollOffset); IsPosVisible 00944a40 tests against it + Vector _screenAnchor; // ctor 009428d0 sets (1.0*0.5, 1.0*0.5); ClampedToRoom 00943490 / update_focus_position compute pos = screenSize*anchor - ... + Vector _unk7c; // ? only zeroed in ctor 009428d0 (pair with +0x84); no reader found in the dump + Vector _unk84; // ? only zeroed in ctor 009428d0; no reader found in the dump bool _shouldOverride; // Camera::SetFocusPosition 00944d10: if !+0x8c push pos into ring +0x50 and set +0x8c=1; Camera::update_follow 009446e0 follows ring +0x50 instead of players when set; Camera::ClampedToRoom 00943490 skips X clamp + uint8_t _pad_0x8d[0x3]; + float _followLerp; // ctor 009428d0 sets 0.1 (this[1]+3); update_follow 009446e0 moves it +-0.01 within 0.1..0.5 by target distance and lerps _position by it }; +static_assert(offsetof(Camera, _aimOffsetBuffer) == 0x0); +static_assert(offsetof(Camera, _velocityOffsetBuffer) == 0x10); +static_assert(offsetof(Camera, _enemyOffsetBuffer) == 0x20); +static_assert(offsetof(Camera, _playerSpreadBuffer) == 0x30); +static_assert(offsetof(Camera, _shakeOffsetBuffer) == 0x40); +static_assert(offsetof(Camera, _focusPositionBuffer) == 0x50); +static_assert(offsetof(Camera, _playersCenter) == 0x60); +static_assert(offsetof(Camera, _room) == 0x68); +static_assert(offsetof(Camera, _position) == 0x6c); +static_assert(offsetof(Camera, _screenAnchor) == 0x74); +static_assert(offsetof(Camera, _unk7c) == 0x7c); +static_assert(offsetof(Camera, _unk84) == 0x84); static_assert(offsetof(Camera, _shouldOverride) == 0x8c); +static_assert(offsetof(Camera, _followLerp) == 0x90); + +struct EntityRef { + int _type; // Lua EntityRef.Type via binder 00875c50: getter 008bb900 pushes dword via FUN_0085bfd0 (signed pushinteger), setter 008bb960 luaL_checkinteger dword + uint32_t _variant; // Lua EntityRef.Variant via binder 00875dd0: getter 008bb9c0 pushes dword via FUN_0085bff0 (pushinteger, high=0 unsigned), setter 008bb960 dword + int _spawnerType; // Lua EntityRef.SpawnerType via binder 00875f40: getter 008bba20 lua_pushinteger(*(int*), sign-extended; separate instance from Type, likely an enum), setter dword + uint32_t _spawnerVariant; // Lua EntityRef.SpawnerVariant via binder 00875dd0: getter 008bb9c0 pushes dword via FUN_0085bff0 (pushinteger, high=0 unsigned), setter 008bb960 dword + Vector _position; // Lua EntityRef.Position via binder 008760c0: getter 008bba80 copies 8 bytes into UserdataValue + uint8_t _pad_0x18[0xc]; + uint32_t _entity; // Entity* // Lua EntityRef.Entity via binder 008763b0: getter 008bbbc0 UserdataPtr with Entity class key c8297a (nil if 0), setter stores pointer +}; +static_assert(offsetof(EntityRef, _type) == 0x0); +static_assert(offsetof(EntityRef, _variant) == 0x4); +static_assert(offsetof(EntityRef, _spawnerType) == 0x8); +static_assert(offsetof(EntityRef, _spawnerVariant) == 0xc); +static_assert(offsetof(EntityRef, _position) == 0x10); +static_assert(offsetof(EntityRef, _entity) == 0x24); struct Entity { - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -138,95 +181,78 @@ struct Entity { Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it }; +static_assert(offsetof(Entity, _damageEvents) == 0x8); +static_assert(offsetof(Entity, _pendingDamage) == 0x14); +static_assert(offsetof(Entity, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity, _index) == 0x20); static_assert(offsetof(Entity, _collisionIndex) == 0x24); static_assert(offsetof(Entity, _type) == 0x28); @@ -238,69 +264,56 @@ static_assert(offsetof(Entity, _sprite) == 0x48); static_assert(offsetof(Entity, _spriteOffset) == 0xdc); static_assert(offsetof(Entity, _spriteScale) == 0xe4); static_assert(offsetof(Entity, _isFlipX) == 0x148); -static_assert(offsetof(Entity, _shadowSize) == 0x15c); -static_assert(offsetof(Entity, _flags) == 0x168); -static_assert(offsetof(Entity, _valid) == 0x170); +static_assert(offsetof(Entity, _shadowOffset) == 0x160); static_assert(offsetof(Entity, _visible) == 0x171); static_assert(offsetof(Entity, _exists) == 0x172); static_assert(offsetof(Entity, _dead) == 0x173); -static_assert(offsetof(Entity, _removedByFactory) == 0x177); -static_assert(offsetof(Entity, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity, _isInterpolating) == 0x175); +static_assert(offsetof(Entity, _collisionPoints) == 0x178); static_assert(offsetof(Entity, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity, _colorParams) == 0x1ac); +static_assert(offsetof(Entity, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity, _color) == 0x1b8); static_assert(offsetof(Entity, _splatColor) == 0x1e4); -static_assert(offsetof(Entity, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity, _damageCountdown) == 0x214); -static_assert(offsetof(Entity, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity, _fearCountdown) == 0x230); -static_assert(offsetof(Entity, _burnCountdown) == 0x234); -static_assert(offsetof(Entity, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity, _poisonDamage) == 0x278); -static_assert(offsetof(Entity, _burnDamage) == 0x27c); -static_assert(offsetof(Entity, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity, _mass) == 0x2d4); -static_assert(offsetof(Entity, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity, _iceCountdown) == 0x300); -static_assert(offsetof(Entity, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity, _charmSource) == 0x240); +static_assert(offsetof(Entity, _entityRef2) == 0x268); +static_assert(offsetof(Entity, _entityRef3) == 0x290); +static_assert(offsetof(Entity, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity, _pausePosition) == 0x314); +static_assert(offsetof(Entity, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity, _spawnFrame) == 0x328); static_assert(offsetof(Entity, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity, _config) == 0x330); static_assert(offsetof(Entity, _targetPosition) == 0x334); -static_assert(offsetof(Entity, _pos) == 0x33c); -static_assert(offsetof(Entity, _posOffset) == 0x34c); +static_assert(offsetof(Entity, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity, _renderZOffset) == 0x354); +static_assert(offsetof(Entity, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity, _velocity) == 0x360); +static_assert(offsetof(Entity, _baseFriction) == 0x368); static_assert(offsetof(Entity, _friction) == 0x36c); -static_assert(offsetof(Entity, _size) == 0x370); -static_assert(offsetof(Entity, _health) == 0x380); -static_assert(offsetof(Entity, _collisionDamage) == 0x388); -static_assert(offsetof(Entity, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity, _sizeMulti) == 0x374); +static_assert(offsetof(Entity, _mass) == 0x37c); +static_assert(offsetof(Entity, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity, _prevPosition) == 0x38c); +static_assert(offsetof(Entity, _prevVelocity) == 0x394); +static_assert(offsetof(Entity, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity, _updateTime) == 0x3a4); static_assert(offsetof(Entity, _parent) == 0x3bc); static_assert(offsetof(Entity, _child) == 0x3c0); static_assert(offsetof(Entity, _target) == 0x3c4); static_assert(offsetof(Entity, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity, _minecart) == 0x3d4); +static_assert(offsetof(Entity, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity, _hitEffect) == 0x3d8); static_assert(offsetof(Entity, _dropRNG) == 0x3dc); static_assert(offsetof(Entity, _initSeed) == 0x3ec); +static_assert(offsetof(Entity, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity, _pitfallState) == 0x3fc); static_assert(offsetof(Entity, _luaBridgeRef) == 0x408); struct EntityConfig { @@ -484,24 +497,28 @@ static_assert(offsetof(EntityConfig_Player, _moddedGameOverANM2) == 0x13c); static_assert(offsetof(EntityConfig_Player, _moddedCoopMenuANM2) == 0x140); static_assert(offsetof(EntityConfig_Player, _moddedControlsANM2) == 0x144); -struct EntityRef { - int _type; // Lua EntityRef.Type via binder 00875c50: getter 008bb900 pushes dword via FUN_0085bfd0 (signed pushinteger), setter 008bb960 luaL_checkinteger dword - uint32_t _variant; // Lua EntityRef.Variant via binder 00875dd0: getter 008bb9c0 pushes dword via FUN_0085bff0 (pushinteger, high=0 unsigned), setter 008bb960 dword - int _spawnerType; // Lua EntityRef.SpawnerType via binder 00875f40: getter 008bba20 lua_pushinteger(*(int*), sign-extended; separate instance from Type, likely an enum), setter dword - uint32_t _spawnerVariant; // Lua EntityRef.SpawnerVariant via binder 00875dd0: getter 008bb9c0 pushes dword via FUN_0085bff0 (pushinteger, high=0 unsigned), setter 008bb960 dword - Vector _position; // Lua EntityRef.Position via binder 008760c0: getter 008bba80 copies 8 bytes into UserdataValue - uint8_t _pad_0x18[0xc]; - uint32_t _entity; // Entity* // Lua EntityRef.Entity via binder 008763b0: getter 008bbbc0 UserdataPtr with Entity class key c8297a (nil if 0), setter stores pointer +struct EntityDesc { + uint32_t _type; // Entity_Player::update_shooting 0077b020 Friend Ball capture writes type/variant/subtype into _friendBallEnemy +0/+4/+8 + uint32_t _variant; // update_shooting 0077b020 Friend Ball capture (_friendBallEnemy 0x1914) + uint32_t _subtype; // update_shooting 0077b020 Friend Ball capture (_friendBallEnemy 0x1918) + int _championId; // Entity_Player ctor 00753da0 sets _friendBallEnemy+0xc (0x191c) to -1; saved in GameStatePlayer + float _health; // update_shooting 0077b020 Friend Ball capture: maxHealth*0.5 (_friendBallEnemy 0x1920) + float _maxHealth; // update_shooting 0077b020 Friend Ball capture: baseHP (_friendBallEnemy 0x1924) + bool _playerControlled; // Entity_Player ctor 00753da0 zeroes the byte at 0x1928 (_friendBallEnemy+0x18); saved in GameStatePlayer }; -static_assert(offsetof(EntityRef, _type) == 0x0); -static_assert(offsetof(EntityRef, _variant) == 0x4); -static_assert(offsetof(EntityRef, _spawnerType) == 0x8); -static_assert(offsetof(EntityRef, _spawnerVariant) == 0xc); -static_assert(offsetof(EntityRef, _position) == 0x10); -static_assert(offsetof(EntityRef, _entity) == 0x24); +static_assert(offsetof(EntityDesc, _type) == 0x0); +static_assert(offsetof(EntityDesc, _variant) == 0x4); +static_assert(offsetof(EntityDesc, _subtype) == 0x8); +static_assert(offsetof(EntityDesc, _championId) == 0xc); +static_assert(offsetof(EntityDesc, _health) == 0x10); +static_assert(offsetof(EntityDesc, _maxHealth) == 0x14); +static_assert(offsetof(EntityDesc, _playerControlled) == 0x18); struct Entity_Bomb { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -515,93 +532,73 @@ struct Entity_Bomb { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; int _explosionCountdown1; // Lua EntityBomb.SetExplosionCountdown 00452c40 writes this+0x410 (and +0x414) @@ -609,22 +606,30 @@ struct Entity_Bomb { // : Entity (flattened) float _explosionDamage; // (not in REPENTOGON) Lua EntityBomb.ExplosionDamage getter (folded with Entity_Tear::FallingAcceleration 00435e50) returns this+0x418; Init sets 100.0 float _fallSpeed; // Entity_Bomb::Update 006a24d0 adds this+0x41c to _posOffset.y, then adds this+0x420 to it; bounce sets it to -0.7*speed float _fallAcceleration; // Entity_Bomb::Update 006a24d0 adds this+0x420 (default 0.8 when 0) to _fallSpeed each frame - uint8_t _pad_0x424[0x4]; + int _bounceCount; // Entity_Bomb::Update 006a24d0 increments it on each floor bounce (fallSpeed *= -0.7) and stops bouncing after 3; Init zeroes float _rocketAngle; // Entity_Bomb::Update 006a24d0 (rockets) velocity += sin/cos(this+0x428 deg); Angelic Prism (Familiar::Update) sets it via 00456820 on copies float _rocketSpeed; // Entity_Bomb::Update 006a24d0 this+0x42c += _speedMultiplier and scales rocket thrust; prism copies set it via 0060ce10 - uint8_t _pad_0x430[0x4]; + short _collisionCooldown; // Entity_Bomb::HandleCollision 006a5f00: while >0 refreshes to 4 and ignores the collision; Update 006a24d0 decrements, sets 4 when invisible; Init sets 4 + short _parentCollisionCooldown; // Entity_Bomb::HandleCollision 006a5f00: collider == _parent and >0 -> refresh to 4, ignore; Update decrements; Init sets 4 (0x40004 with +0x430) float _scale; // Entity_Bomb::Update 006a24d0 multiplies SetSize/sprite scale by this+0x434; Init 006a2050 sets 1.0 BitSet128 _tearFlags; // (not in REPENTOGON) Lua EntityBomb.Flags 005cd560 copies 16 bytes from this+0x438 bool _isFetus; uint8_t _pad_0x449[0x3]; float _radiusMultiplier; // (not in REPENTOGON) Lua EntityBomb.RadiusMultiplier 0060cdc0 returns this+0x44c; Init sets 1.0 - uint8_t _pad_0x450[0x10]; + uint8_t _stickyTarget[0x4]; // EntityPtr; Entity_Bomb::HandleCollision 006a5f00 with TEAR_STICKY (bit 37) sets it to the collider (multiset insert) and stores the offset in _targetPosition; Update 006a24d0 follows that entity's pos/velocity + int _bombIndex; // Entity_Bomb::Update 006a24d0 on its first frame gives player bombs a global running number (DAT_00c7ec64++); &1 alternates a side offset + int _updateDelay; // Entity_Bomb::Update 006a24d0 returns early while >0 (decrementing); set 5 for variants 17/20 when Ipecac-style flags are added; Init zeroes + int _scatterTimer; // ? Entity_Bomb::Update 006a24d0 sets 90 when it gives the bomb a random 5-10 velocity, decrements; HandleCollision 006a5f00 checks <1 in room type 0x10 bool _prismTouched; // Entity_Familiar::Update 0061da10 (Angelic Prism) copies a Dr.Fetus bomb only if bomb+0x460==0 (0060cdd0) and sets it on the copies (0060cde0); REPENTOGON 0x45c is an int countdown here (Update sets 90, decrements) - uint8_t _pad_0x461[0x2]; + bool _isSkipNextUpdate; // Entity_Bomb::Update 006a24d0 starts: if set, clear it and return; Init 006a2050 zeroes + bool _hasCostumes; // Entity_Bomb::update_sparks 006a6f10 (costume loader) sets 1 when a costume ANM2 loaded; Update/Render 006a5a60 only update/draw _bombCostumesSprites when set bool _loadCostumes; // set to 1 by 006a6910 (sets flags at +0x438) and 006a6930 (sets _scale); Entity_Bomb::Update 006a24d0 calls 006a6f10 (loads costume ANM2s at +0x464) when this+0x463 != 0 ANM2 _bombCostumesSprites[5]; // 006a6f10 (named update_sparks, actually costume load) ANM2::Load into this+0x464...; ctor 006a1e80 eh-vector-constructs ANM2s at +0x464 uint8_t _hitList[0x4]; // std_vector_uint; Entity_Bomb::HandleCollision 006a5f00 (6a61dd) passes this+0x9c8 to EntityList::HitListContains }; +static_assert(offsetof(Entity_Bomb, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Bomb, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Bomb, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Bomb, _index) == 0x20); static_assert(offsetof(Entity_Bomb, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Bomb, _type) == 0x28); @@ -636,87 +641,86 @@ static_assert(offsetof(Entity_Bomb, _sprite) == 0x48); static_assert(offsetof(Entity_Bomb, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Bomb, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Bomb, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Bomb, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Bomb, _flags) == 0x168); -static_assert(offsetof(Entity_Bomb, _valid) == 0x170); +static_assert(offsetof(Entity_Bomb, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Bomb, _visible) == 0x171); static_assert(offsetof(Entity_Bomb, _exists) == 0x172); static_assert(offsetof(Entity_Bomb, _dead) == 0x173); -static_assert(offsetof(Entity_Bomb, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Bomb, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Bomb, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Bomb, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Bomb, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Bomb, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Bomb, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Bomb, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Bomb, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Bomb, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Bomb, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Bomb, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Bomb, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Bomb, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Bomb, _color) == 0x1b8); static_assert(offsetof(Entity_Bomb, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Bomb, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Bomb, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Bomb, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Bomb, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Bomb, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Bomb, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Bomb, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Bomb, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Bomb, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Bomb, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Bomb, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Bomb, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Bomb, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Bomb, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Bomb, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Bomb, _mass) == 0x2d4); -static_assert(offsetof(Entity_Bomb, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Bomb, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Bomb, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Bomb, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Bomb, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Bomb, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Bomb, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Bomb, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Bomb, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Bomb, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Bomb, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Bomb, _charmSource) == 0x240); +static_assert(offsetof(Entity_Bomb, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Bomb, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Bomb, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Bomb, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Bomb, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Bomb, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Bomb, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Bomb, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Bomb, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Bomb, _config) == 0x330); static_assert(offsetof(Entity_Bomb, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Bomb, _pos) == 0x33c); -static_assert(offsetof(Entity_Bomb, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Bomb, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Bomb, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Bomb, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Bomb, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Bomb, _velocity) == 0x360); +static_assert(offsetof(Entity_Bomb, _baseFriction) == 0x368); static_assert(offsetof(Entity_Bomb, _friction) == 0x36c); -static_assert(offsetof(Entity_Bomb, _size) == 0x370); -static_assert(offsetof(Entity_Bomb, _health) == 0x380); -static_assert(offsetof(Entity_Bomb, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Bomb, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Bomb, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Bomb, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Bomb, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Bomb, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Bomb, _mass) == 0x37c); +static_assert(offsetof(Entity_Bomb, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Bomb, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Bomb, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Bomb, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Bomb, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Bomb, _parent) == 0x3bc); static_assert(offsetof(Entity_Bomb, _child) == 0x3c0); static_assert(offsetof(Entity_Bomb, _target) == 0x3c4); static_assert(offsetof(Entity_Bomb, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Bomb, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Bomb, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Bomb, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Bomb, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Bomb, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Bomb, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Bomb, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Bomb, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Bomb, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Bomb, _explosionCountdown1) == 0x410); static_assert(offsetof(Entity_Bomb, _explosionDamage) == 0x418); static_assert(offsetof(Entity_Bomb, _fallSpeed) == 0x41c); static_assert(offsetof(Entity_Bomb, _fallAcceleration) == 0x420); +static_assert(offsetof(Entity_Bomb, _bounceCount) == 0x424); static_assert(offsetof(Entity_Bomb, _rocketAngle) == 0x428); static_assert(offsetof(Entity_Bomb, _rocketSpeed) == 0x42c); +static_assert(offsetof(Entity_Bomb, _collisionCooldown) == 0x430); +static_assert(offsetof(Entity_Bomb, _parentCollisionCooldown) == 0x432); static_assert(offsetof(Entity_Bomb, _scale) == 0x434); static_assert(offsetof(Entity_Bomb, _tearFlags) == 0x438); static_assert(offsetof(Entity_Bomb, _isFetus) == 0x448); static_assert(offsetof(Entity_Bomb, _radiusMultiplier) == 0x44c); +static_assert(offsetof(Entity_Bomb, _stickyTarget) == 0x450); +static_assert(offsetof(Entity_Bomb, _bombIndex) == 0x454); +static_assert(offsetof(Entity_Bomb, _updateDelay) == 0x458); +static_assert(offsetof(Entity_Bomb, _scatterTimer) == 0x45c); static_assert(offsetof(Entity_Bomb, _prismTouched) == 0x460); +static_assert(offsetof(Entity_Bomb, _isSkipNextUpdate) == 0x461); +static_assert(offsetof(Entity_Bomb, _hasCostumes) == 0x462); static_assert(offsetof(Entity_Bomb, _loadCostumes) == 0x463); static_assert(offsetof(Entity_Bomb, _bombCostumesSprites) == 0x464); static_assert(offsetof(Entity_Bomb, _hitList) == 0x9c8); struct Entity_Effect { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -730,97 +734,79 @@ struct Entity_Effect { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; float _height; // Lua EntityEffect.m_Height via binder 00885330: getter 008bee70 pushnumber, setter 008beed0 checknumber -> float - uint8_t _pad_0x414[0xc]; + float _fallingSpeed; // Lua EntityEffect.FallingSpeed (folded Entity_Tear::FallingSpeed) returns this+0x414; Entity_Effect::Init 005cdb20 gibs set -5-rand*10 next to m_Height(+0x410)=-23 + float _fallingAcceleration; // Lua EntityEffect.FallingAcceleration (folded Entity_Tear::FallingAcceleration) returns this+0x418; Entity_Effect::Init 005cdb20 gibs set 1.3 + uint8_t _pad_0x41c[0x4]; BitSet128 _varData; // Entity_Effect::CreateTimer 0060af00 stores the timer callback/delay/times in effect(1000.119)+0x420/+0x424/+0x428 (per-variant scratch data) uint8_t _pad_0x430[0x20]; int _state; @@ -835,6 +821,9 @@ struct Entity_Effect { // : Entity (flattened) uint8_t _pad_0x474[0x34]; uint8_t _hitList[0x4]; // std_vector_uint; (not in REPENTOGON) Entity_Effect::Update passes this+0x4a8 to EntityList::HitListContains 00431640 (5df65f, 5ecd27); ctor 005cd960 zeroes +0x4a8..0x4b0 }; +static_assert(offsetof(Entity_Effect, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Effect, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Effect, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Effect, _index) == 0x20); static_assert(offsetof(Entity_Effect, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Effect, _type) == 0x28); @@ -846,71 +835,60 @@ static_assert(offsetof(Entity_Effect, _sprite) == 0x48); static_assert(offsetof(Entity_Effect, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Effect, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Effect, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Effect, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Effect, _flags) == 0x168); -static_assert(offsetof(Entity_Effect, _valid) == 0x170); +static_assert(offsetof(Entity_Effect, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Effect, _visible) == 0x171); static_assert(offsetof(Entity_Effect, _exists) == 0x172); static_assert(offsetof(Entity_Effect, _dead) == 0x173); -static_assert(offsetof(Entity_Effect, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Effect, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Effect, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Effect, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Effect, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Effect, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Effect, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Effect, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Effect, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Effect, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Effect, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Effect, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Effect, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Effect, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Effect, _color) == 0x1b8); static_assert(offsetof(Entity_Effect, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Effect, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Effect, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Effect, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Effect, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Effect, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Effect, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Effect, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Effect, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Effect, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Effect, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Effect, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Effect, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Effect, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Effect, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Effect, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Effect, _mass) == 0x2d4); -static_assert(offsetof(Entity_Effect, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Effect, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Effect, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Effect, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Effect, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Effect, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Effect, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Effect, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Effect, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Effect, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Effect, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Effect, _charmSource) == 0x240); +static_assert(offsetof(Entity_Effect, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Effect, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Effect, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Effect, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Effect, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Effect, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Effect, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Effect, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Effect, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Effect, _config) == 0x330); static_assert(offsetof(Entity_Effect, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Effect, _pos) == 0x33c); -static_assert(offsetof(Entity_Effect, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Effect, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Effect, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Effect, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Effect, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Effect, _velocity) == 0x360); +static_assert(offsetof(Entity_Effect, _baseFriction) == 0x368); static_assert(offsetof(Entity_Effect, _friction) == 0x36c); -static_assert(offsetof(Entity_Effect, _size) == 0x370); -static_assert(offsetof(Entity_Effect, _health) == 0x380); -static_assert(offsetof(Entity_Effect, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Effect, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Effect, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Effect, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Effect, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Effect, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Effect, _mass) == 0x37c); +static_assert(offsetof(Entity_Effect, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Effect, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Effect, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Effect, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Effect, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Effect, _parent) == 0x3bc); static_assert(offsetof(Entity_Effect, _child) == 0x3c0); static_assert(offsetof(Entity_Effect, _target) == 0x3c4); static_assert(offsetof(Entity_Effect, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Effect, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Effect, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Effect, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Effect, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Effect, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Effect, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Effect, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Effect, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Effect, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Effect, _height) == 0x410); +static_assert(offsetof(Entity_Effect, _fallingSpeed) == 0x414); +static_assert(offsetof(Entity_Effect, _fallingAcceleration) == 0x418); static_assert(offsetof(Entity_Effect, _varData) == 0x420); static_assert(offsetof(Entity_Effect, _state) == 0x450); static_assert(offsetof(Entity_Effect, _minRadius) == 0x454); @@ -923,7 +901,10 @@ static_assert(offsetof(Entity_Effect, _damageSource) == 0x470); static_assert(offsetof(Entity_Effect, _hitList) == 0x4a8); struct Entity_Familiar { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -937,99 +918,78 @@ struct Entity_Familiar { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; uint32_t _player; // Entity_Player* - uint8_t _pad_0x414[0x1e4]; - int _moveDelayNum; - uint8_t _pathfinder[0x750]; // NPCAI_Pathfinder + uint32_t _sirenOriginalPlayer; // Entity_Player* // Siren charm 0064b920 saves the old _player (+0x410) here before handing the familiar over; Entity_Familiar::RemoveFromPlayer 0064bab0 restores the owner from it and clears it; Init zeroes it, delirium_morph 00631b20 carries it over + uint8_t _pad_0x418[0x934]; int _fireCooldown; // Lua EntityFamiliar.FireCooldown via binder 00885f80: getter 008bf210 FUN_0085bfd0 signed dword, setter dword int _headFrameDelay; // Lua EntityFamiliar.HeadFrameDelay via binder 00885f80: getter 008bf210 FUN_0085bfd0 signed dword, setter dword int _moveDirection; // Lua EntityFamiliar.MoveDirection via binder 00885f80: getter 008bf210 FUN_0085bfd0 signed dword, setter dword @@ -1041,24 +1001,35 @@ struct Entity_Familiar { // : Entity (flattened) int _orbitLayer; // Lua EntityFamiliar.OrbitLayer via binder 00885f80: getter 008bf210 FUN_0085bfd0 signed dword, setter dword bool _isFollower; bool _isDelayed; - uint8_t _pad_0xd76[0x6]; + bool _isNotCountedAsFollower; // ? Entity_Familiar::FollowParent 00612bb0 counts only followers with priority>0 and +0xd76==0; set by Init 0060de70 (subtype 55555 and some variants) and WispInit 00436330 for intangible wisps; Init clears it + bool _isSubtype55555; // ? Entity_Familiar::Init 0060de70 sets it = (subtype == 55555) and then gives the familiar ItemConfig collectible 661, a color and no appear flag; AddToFollowers 0062db20 / AddToDelayed 00613fe0 return early and Kill 00610540 skips the orbit-layer logic when set + uint8_t _pad_0xd78[0x4]; int _coins; int _hearts; int _keys; int _state; int _roomClearCount; // Lua EntityFamiliar.RoomClearCount via binder 00885f80: getter 008bf210 FUN_0085bfd0 signed dword, setter dword - uint8_t _pad_0xd90[0x1c]; - uint8_t _hitList[0x18]; // std_vector_uint; (not in REPENTOGON) Entity_Familiar::HandleCollision 006261f0, ai_umbilical_baby, ai_pickup_sack, apollyons_best_friend pass this+0xdac to EntityList::HitListContains + uint8_t _pad_0xd90[0x18]; + int _counter; // multi-purpose per-variant counter: Update 0061da10 counts it down / up to 749, HandleCollision 006261f0 sets 300 (variant 58), TriggerRoomClear 0062aab0 increments it, update_weapon 0062e620 uses it as a fire delay, TakeDamage 0062cdc0 ignores damage while >0 for variant 238; Init zeroes it + uint8_t _hitList[0xc]; // std_vector_uint; (not in REPENTOGON) Entity_Familiar::HandleCollision 006261f0, ai_umbilical_baby, ai_pickup_sack, apollyons_best_friend pass this+0xdac to EntityList::HitListContains + int _appearTimer; // Entity_Familiar::Init 0060de70 sets 5; Update 0061da10 counts it down while entity flag 4 (appear) is set, spawns the poof at 3, keeps the familiar invisible until 0 and skips its AI + int _chargeLevel; // ? Entity_Familiar::Update 0061da10 variant 226 only: counts 0..5 up while an entity flag is set and down otherwise, sound volume min(level*0.2,1) and pitch from it, stops the loop sound at 0 + uint8_t _linkedEntity[0x4]; // EntityPtr; Entity_Familiar::Shoot 00614b10 stores the blue fly from AddBlueFlies, FireBrimstone 00638c10 the laser, Init 0060de70 the effect 1000.201 of variant 240; ClearReferences 006121d0 Remove()s it for variant 240 and resets it uint32_t _weapon; // Weapon* // Entity_Familiar::update_weapon 0062e620 stores Isaac::CreateWeapon() in this+0xdc4 / destroys it; delirium_morph 00631b20 frees it bool _isLilDelirium; // Entity_Familiar::delirium_morph 00631b20 sets this+0xdc8=1; Entity_Familiar::Update 0061da10 tests it each frame uint8_t _pad_0xdc9[0x3]; ANM2 _chargeBarSprite; // (not in REPENTOGON) Entity_Familiar::Init 0060de70 loads gfx/chargebar.anm2 into this+0xdcc; ctor 0060d200 constructs an ANM2 there - uint8_t _pad_0xee0[0x8]; + uint32_t _extraData; // void* // ReferenceCount pointer: set_extra_data 004357e0 allocates it (in_ECX[1]); Render 00624e10 RTDynamicCasts +0xee0 to IsaacsBodyData for variant 48; ctor zeroes +0xee0/+0xee4 + uint8_t _pad_0xee4[0x4]; uint32_t _item; // ItemConfig_Item* // Isaac::SpawnLocust 005b35c0 stores the ItemConfig collectible entry at this+0xee8 (Init 0060de70 does too for subtype 55555) - uint8_t _pad_0xeec[0x8]; + uint8_t _sirenHelper[0x4]; // EntityPtr; Siren charm 0064b920 spawns entity 966 (Siren helper, parent=Siren, target=familiar) into +0xeec; RemoveFromPlayer 0064bab0 Remove()s it; HandleCollision 006261f0 / convert_shot_for_enemy_owner 0064bb70 check its age; Init erases it + int _sirenCharmFrames; // Siren charm 0064b920 sets +0xef0=1, Entity_Familiar::Update 0061da10 increments it each frame while >0, RemoveFromPlayer 0064bab0 clears it ColorMod _dirtColor; // Entity_Familiar::UpdateDirtColor 0064ca30 writes Room::GetFloorColorAt*2 to this+0xef4..0xefc (+0xf00=1.0) and lerps layers toward it int _wispCollectibleType; // Entity_Familiar::WispInit 00436330 stores the source collectible (712 Lemegeton, or the original 515/490 before rerolling the subtype) in this+0xf20 }; +static_assert(offsetof(Entity_Familiar, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Familiar, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Familiar, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Familiar, _index) == 0x20); static_assert(offsetof(Entity_Familiar, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Familiar, _type) == 0x28); @@ -1070,73 +1041,59 @@ static_assert(offsetof(Entity_Familiar, _sprite) == 0x48); static_assert(offsetof(Entity_Familiar, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Familiar, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Familiar, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Familiar, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Familiar, _flags) == 0x168); -static_assert(offsetof(Entity_Familiar, _valid) == 0x170); +static_assert(offsetof(Entity_Familiar, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Familiar, _visible) == 0x171); static_assert(offsetof(Entity_Familiar, _exists) == 0x172); static_assert(offsetof(Entity_Familiar, _dead) == 0x173); -static_assert(offsetof(Entity_Familiar, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Familiar, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Familiar, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Familiar, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Familiar, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Familiar, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Familiar, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Familiar, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Familiar, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Familiar, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Familiar, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Familiar, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Familiar, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Familiar, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Familiar, _color) == 0x1b8); static_assert(offsetof(Entity_Familiar, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Familiar, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Familiar, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Familiar, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Familiar, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Familiar, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Familiar, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Familiar, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Familiar, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Familiar, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Familiar, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Familiar, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Familiar, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Familiar, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Familiar, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Familiar, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Familiar, _mass) == 0x2d4); -static_assert(offsetof(Entity_Familiar, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Familiar, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Familiar, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Familiar, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Familiar, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Familiar, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Familiar, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Familiar, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Familiar, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Familiar, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Familiar, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Familiar, _charmSource) == 0x240); +static_assert(offsetof(Entity_Familiar, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Familiar, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Familiar, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Familiar, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Familiar, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Familiar, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Familiar, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Familiar, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Familiar, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Familiar, _config) == 0x330); static_assert(offsetof(Entity_Familiar, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Familiar, _pos) == 0x33c); -static_assert(offsetof(Entity_Familiar, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Familiar, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Familiar, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Familiar, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Familiar, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Familiar, _velocity) == 0x360); +static_assert(offsetof(Entity_Familiar, _baseFriction) == 0x368); static_assert(offsetof(Entity_Familiar, _friction) == 0x36c); -static_assert(offsetof(Entity_Familiar, _size) == 0x370); -static_assert(offsetof(Entity_Familiar, _health) == 0x380); -static_assert(offsetof(Entity_Familiar, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Familiar, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Familiar, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Familiar, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Familiar, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Familiar, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Familiar, _mass) == 0x37c); +static_assert(offsetof(Entity_Familiar, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Familiar, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Familiar, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Familiar, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Familiar, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Familiar, _parent) == 0x3bc); static_assert(offsetof(Entity_Familiar, _child) == 0x3c0); static_assert(offsetof(Entity_Familiar, _target) == 0x3c4); static_assert(offsetof(Entity_Familiar, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Familiar, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Familiar, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Familiar, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Familiar, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Familiar, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Familiar, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Familiar, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Familiar, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Familiar, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Familiar, _player) == 0x410); -static_assert(offsetof(Entity_Familiar, _moveDelayNum) == 0x5f8); -static_assert(offsetof(Entity_Familiar, _pathfinder) == 0x5fc); +static_assert(offsetof(Entity_Familiar, _sirenOriginalPlayer) == 0x414); static_assert(offsetof(Entity_Familiar, _fireCooldown) == 0xd4c); static_assert(offsetof(Entity_Familiar, _headFrameDelay) == 0xd50); static_assert(offsetof(Entity_Familiar, _moveDirection) == 0xd54); @@ -1148,21 +1105,33 @@ static_assert(offsetof(Entity_Familiar, _orbitSpeed) == 0xd6c); static_assert(offsetof(Entity_Familiar, _orbitLayer) == 0xd70); static_assert(offsetof(Entity_Familiar, _isFollower) == 0xd74); static_assert(offsetof(Entity_Familiar, _isDelayed) == 0xd75); +static_assert(offsetof(Entity_Familiar, _isNotCountedAsFollower) == 0xd76); +static_assert(offsetof(Entity_Familiar, _isSubtype55555) == 0xd77); static_assert(offsetof(Entity_Familiar, _coins) == 0xd7c); static_assert(offsetof(Entity_Familiar, _hearts) == 0xd80); static_assert(offsetof(Entity_Familiar, _keys) == 0xd84); static_assert(offsetof(Entity_Familiar, _state) == 0xd88); static_assert(offsetof(Entity_Familiar, _roomClearCount) == 0xd8c); +static_assert(offsetof(Entity_Familiar, _counter) == 0xda8); static_assert(offsetof(Entity_Familiar, _hitList) == 0xdac); +static_assert(offsetof(Entity_Familiar, _appearTimer) == 0xdb8); +static_assert(offsetof(Entity_Familiar, _chargeLevel) == 0xdbc); +static_assert(offsetof(Entity_Familiar, _linkedEntity) == 0xdc0); static_assert(offsetof(Entity_Familiar, _weapon) == 0xdc4); static_assert(offsetof(Entity_Familiar, _isLilDelirium) == 0xdc8); static_assert(offsetof(Entity_Familiar, _chargeBarSprite) == 0xdcc); +static_assert(offsetof(Entity_Familiar, _extraData) == 0xee0); static_assert(offsetof(Entity_Familiar, _item) == 0xee8); +static_assert(offsetof(Entity_Familiar, _sirenHelper) == 0xeec); +static_assert(offsetof(Entity_Familiar, _sirenCharmFrames) == 0xef0); static_assert(offsetof(Entity_Familiar, _dirtColor) == 0xef4); static_assert(offsetof(Entity_Familiar, _wispCollectibleType) == 0xf20); struct Entity_Knife { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -1176,117 +1145,109 @@ struct Entity_Knife { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; BitSet128 _tearFlags; // Lua EntityKnife.TearFlags getter 0085de90 copies 16 bytes from this+0x410 uint8_t _pad_0x420[0x10]; float _scale; // Lua EntityKnife.Scale via binder 00889f70: getter 008c04f0 pushnumber, setter checknumber -> float - uint8_t _pad_0x434[0x8]; + float _knifeDepthOffset; // Entity_Knife::GetRenderZ 009665e0 returns floor((+0x434 + pos.y)*100 + 10030); Update writes it from the swing direction, Shoot 00966ef0 zeroes it + float _rotation; // Lua EntityKnife.Rotation getter 004d7790 returns this+0x438; Update 00961b00 sets sprite rotation = +0x438 - 90 float _rotationOffset; // Lua EntityKnife.RotationOffset via binder 00889f70: getter 008c04f0 pushnumber, setter checknumber -> float - uint8_t _pad_0x440[0x4]; + float _displayRotation; // Entity_Knife::Update 00961b00 LerpAngleDeg's it toward _rotation+_rotationOffset (+0x438 + +0x43c) and places the knife at parent pos + sin/cos(+0x440); SetAttackAnimation 009680d0 / SpinAttack 00968430 snap it to +0x438 float _knifeDistance; // Lua EntityKnife.GetKnifeDistance 0085deb0 returns this+0x444 float _knifeVelocity; // Lua EntityKnife.GetKnifeVelocity 004d77a0 returns this+0x448 - uint8_t _pad_0x44c[0x10]; + Vector _anchorPosition; // Entity_Knife::Update 00961b00 lerps it toward the parent pos by 1 - charge*dist*0.8 (set to parent pos when zero); SetAttackAnimation 009680d0 sets it to parent+0x33c; update_target 00967650 uses it as the throw origin + Vector _initPosition; // ? only written: Entity_Knife::Init 00960c10 copies pos into +0x454/+0x458 (ctor zeroes it); no reader in the dump float _maxDistance; // Lua EntityKnife.MaxDistance via binder 00889f70: getter 008c04f0 pushnumber, setter checknumber -> float float _charge; // Lua EntityKnife.Charge via binder 00889f70: getter 008c04f0 pushnumber, setter checknumber -> float bool _isFlying; bool _isSwinging; // Entity_Knife::SetAttackAnimation 009680d0 (Attack*/Swing anims) sets this+0x465=1 (word 0x101 with +0x466); SpinAttack 00968430 sets it too - uint8_t _pad_0x466[0x5e]; + uint8_t _pad_0x466[0x2]; + uint8_t _homingLaser[0x54]; // HomingLaser; ctor 00960a70 runs the HomingLaser init 0099c290 there; InitHomingPath 00961320 resets _samples (+0x484/+0x490), _unkVec (+0x49c), _bezier (+0x4b0), sets _origin +0x46c=pos, _endPoint +0x474, _sampleNum +0x480=30, then HomingLaser::build_bezier_path; Update walks the 0x18-byte bezier entries at +0x4b0; Free tidies +0x4b0 + int _pathSegment; // Entity_Knife::Update 00961b00 searches bezier segments of _homingLaser from index +0x4bc (bezier_closest_point) and stores the chosen segment back; InitHomingPath 00961320 / Init reset it to 0 + float _pathProgress; // Entity_Knife::Update 00961b00 stores the closest bezier t (must not go backwards within the current segment) and evaluates the cubic at t and t+_pathFollowSpeed; InitHomingPath / Init set -100.0 float _pathOffset; float _pathFollowSpeed; - uint8_t _pad_0x4cc[0x19]; + float _height; // Entity_Knife::Update 00961b00: +0x4cc += +0x4d0 each frame, clamped to 0 on landing, posOffset.y = +0x4cc + +0x4d4; Shoot 00966ef0 resets it to 0 for the hop + float _fallingSpeed; // Entity_Knife::Update 00961b00 adds 1.5 per frame (gravity) and adds it to +0x4cc; Shoot 00966ef0 sets -10.0 (jump) when the tear-flag mask 0xc345e0 is set + float _basePosOffsetY; // Entity_Knife::Update 00961b00 saves posOffset.y into +0x4d4 and later sets posOffset.y = _height(+0x4cc) + +0x4d4; copied from the parent knife with +0x4cc/+0x4d0 + uint8_t _hitList[0xd]; // std_vector_uint; Entity_Knife::GetHitEntities 009612e0 returns this+0x4d8 (of the root knife); Shoot/SetAttackAnimation/SpinAttack clear it (end=begin +0x4dc); ctor zeroes +0x4d8..+0x4e0, Free tidies it bool _prismApplied; // Entity_Knife::spawn_child_knife 00961870, called from the Angelic Prism block of Entity_Familiar::Update 0061da10 for flying knives, returns if this+0x4e5 set then sets it bool _multidimensionalApplied; // Entity_Familiar::multidimensional_baby_copy_knife 009615e0 returns if knife+0x4e6 set, then sets it to 1 and spawns the two copies - uint8_t _pad_0x4e7[0x3]; + bool _isUsingParentHitList; // Entity_Knife::GetHitEntities 009612e0 walks to the parent knife (+0x3bc, type 8) while this+0x4e7 is set; apply_hit_effects 0096ae70 sets it on the knives it spawns; Init clears it + uint8_t _pad_0x4e8[0x2]; bool _isSpinAttack; // Entity_Knife::SpinAttack 00968430 (Spin* anims) sets this+0x4ea=1; SetAttackAnimation 009680d0 clears it }; +static_assert(offsetof(Entity_Knife, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Knife, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Knife, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Knife, _index) == 0x20); static_assert(offsetof(Entity_Knife, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Knife, _type) == 0x28); @@ -1298,87 +1259,90 @@ static_assert(offsetof(Entity_Knife, _sprite) == 0x48); static_assert(offsetof(Entity_Knife, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Knife, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Knife, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Knife, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Knife, _flags) == 0x168); -static_assert(offsetof(Entity_Knife, _valid) == 0x170); +static_assert(offsetof(Entity_Knife, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Knife, _visible) == 0x171); static_assert(offsetof(Entity_Knife, _exists) == 0x172); static_assert(offsetof(Entity_Knife, _dead) == 0x173); -static_assert(offsetof(Entity_Knife, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Knife, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Knife, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Knife, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Knife, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Knife, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Knife, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Knife, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Knife, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Knife, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Knife, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Knife, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Knife, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Knife, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Knife, _color) == 0x1b8); static_assert(offsetof(Entity_Knife, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Knife, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Knife, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Knife, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Knife, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Knife, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Knife, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Knife, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Knife, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Knife, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Knife, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Knife, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Knife, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Knife, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Knife, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Knife, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Knife, _mass) == 0x2d4); -static_assert(offsetof(Entity_Knife, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Knife, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Knife, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Knife, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Knife, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Knife, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Knife, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Knife, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Knife, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Knife, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Knife, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Knife, _charmSource) == 0x240); +static_assert(offsetof(Entity_Knife, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Knife, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Knife, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Knife, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Knife, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Knife, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Knife, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Knife, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Knife, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Knife, _config) == 0x330); static_assert(offsetof(Entity_Knife, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Knife, _pos) == 0x33c); -static_assert(offsetof(Entity_Knife, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Knife, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Knife, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Knife, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Knife, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Knife, _velocity) == 0x360); +static_assert(offsetof(Entity_Knife, _baseFriction) == 0x368); static_assert(offsetof(Entity_Knife, _friction) == 0x36c); -static_assert(offsetof(Entity_Knife, _size) == 0x370); -static_assert(offsetof(Entity_Knife, _health) == 0x380); -static_assert(offsetof(Entity_Knife, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Knife, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Knife, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Knife, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Knife, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Knife, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Knife, _mass) == 0x37c); +static_assert(offsetof(Entity_Knife, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Knife, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Knife, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Knife, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Knife, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Knife, _parent) == 0x3bc); static_assert(offsetof(Entity_Knife, _child) == 0x3c0); static_assert(offsetof(Entity_Knife, _target) == 0x3c4); static_assert(offsetof(Entity_Knife, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Knife, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Knife, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Knife, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Knife, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Knife, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Knife, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Knife, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Knife, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Knife, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Knife, _tearFlags) == 0x410); static_assert(offsetof(Entity_Knife, _scale) == 0x430); +static_assert(offsetof(Entity_Knife, _knifeDepthOffset) == 0x434); +static_assert(offsetof(Entity_Knife, _rotation) == 0x438); static_assert(offsetof(Entity_Knife, _rotationOffset) == 0x43c); +static_assert(offsetof(Entity_Knife, _displayRotation) == 0x440); static_assert(offsetof(Entity_Knife, _knifeDistance) == 0x444); static_assert(offsetof(Entity_Knife, _knifeVelocity) == 0x448); +static_assert(offsetof(Entity_Knife, _anchorPosition) == 0x44c); +static_assert(offsetof(Entity_Knife, _initPosition) == 0x454); static_assert(offsetof(Entity_Knife, _maxDistance) == 0x45c); static_assert(offsetof(Entity_Knife, _charge) == 0x460); static_assert(offsetof(Entity_Knife, _isFlying) == 0x464); static_assert(offsetof(Entity_Knife, _isSwinging) == 0x465); +static_assert(offsetof(Entity_Knife, _homingLaser) == 0x468); +static_assert(offsetof(Entity_Knife, _pathSegment) == 0x4bc); +static_assert(offsetof(Entity_Knife, _pathProgress) == 0x4c0); static_assert(offsetof(Entity_Knife, _pathOffset) == 0x4c4); static_assert(offsetof(Entity_Knife, _pathFollowSpeed) == 0x4c8); +static_assert(offsetof(Entity_Knife, _height) == 0x4cc); +static_assert(offsetof(Entity_Knife, _fallingSpeed) == 0x4d0); +static_assert(offsetof(Entity_Knife, _basePosOffsetY) == 0x4d4); +static_assert(offsetof(Entity_Knife, _hitList) == 0x4d8); static_assert(offsetof(Entity_Knife, _prismApplied) == 0x4e5); static_assert(offsetof(Entity_Knife, _multidimensionalApplied) == 0x4e6); +static_assert(offsetof(Entity_Knife, _isUsingParentHitList) == 0x4e7); static_assert(offsetof(Entity_Knife, _isSpinAttack) == 0x4ea); struct Entity_Laser { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -1392,93 +1356,73 @@ struct Entity_Laser { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; Vector _parentOffset; // Lua EntityLaser.ParentOffset via binder 00888a70: getter 008bfac0 UserdataValue 8-byte copy @@ -1487,7 +1431,8 @@ struct Entity_Laser { // : Entity (flattened) float _lastAngleDegrees; // Lua EntityLaser.LastAngleDegrees via binder 00888be0: getter 008bfc00 pushnumber, setter 008bfc60 checknumber -> float uint8_t _pad_0x424[0x4]; BitSet128 _tearFlags; - uint8_t _pad_0x438[0x20]; + uint8_t _pad_0x438[0x10]; + BitSet128 _heldTearFlags; // ? Entity_Laser::Update 00977cc0 moves TEAR_WAIT out of _tearFlags into this+0x448..0x454 (OR) when it spawns the Anti-Gravity effect; ctor/Init zero 16 bytes int _timeout; bool _isFirstUpdate; // Lua EntityLaser.FirstUpdate via binder 00889050: getter 008bfeb0 pushboolean(byte), setter toboolean -> bool bool _sampleLaser; @@ -1505,25 +1450,31 @@ struct Entity_Laser { // : Entity (flattened) float _maxDistance; uint32_t _homingType; Vector _endPoint; - float _scale; + uint8_t _pad_0x4e0[0x4]; bool _disableFollowParent; uint8_t _pad_0x4e5[0x3]; uint32_t _bounceLaser; // Entity* // Lua EntityLaser.BounceLaser via binder 008897c0: getter 008c03c0 UserdataPtr Entity key c8297a, setter stores pointer - uint8_t _pad_0x4ec[0x8]; + uint8_t _childLaser[0x8]; // EntityPtr; ? Entity_Laser::Remove 0097ea30 removes it with the laser (unless _oneHit) like _bounceLaser(+0x4e8); ClearReferences resets; Init zeroes; setter not found float _blackHpDropChance; // Lua EntityLaser.BlackHpDropChance via binder 00888be0: getter 008bfc00 pushnumber, setter 008bfc60 checknumber -> float - uint8_t _pad_0x4f8[0x8]; - bool _multidimensionalTouched; - uint8_t _pad_0x501[0x13]; - bool _prismTouched; + uint8_t _pad_0x4f8[0x1d]; bool _oneHit; bool _isGridHit; // Lua EntityLaser.GridHit via binder 00889050: getter 008bfeb0 pushboolean(byte), setter toboolean -> bool uint8_t _pad_0x517[0x1]; bool _disableInitSound; // Entity_Laser::PlayInitSound 0096f880 returns at once if this+0x518 != 0; update_laser 00973c60 sets it on chained child lasers it spawns uint8_t _pad_0x519[0x3]; float _damageMultiplier; // Entity_Player::FireTechLaser 007aab70 stores its damageScale arg in laser+0x51c; Entity_Laser::Init 0096f590 sets 1.0 - uint8_t _hitList[0x40]; // std_vector_uint; Entity_Laser::CanDamageEntity 0096cf80 passes this+0x520 (or the parent laser chain via +0x52c) to EntityList::HitListContains + uint8_t _hitList[0xc]; // std_vector_uint; Entity_Laser::CanDamageEntity 0096cf80 passes this+0x520 (or the parent laser chain via +0x52c) to EntityList::HitListContains + uint8_t _parentLaser[0x4]; // EntityPtr; Game::BombTearflagEffects 007009a0 sets it (multiset insert); Update and CanDamageEntity 0096cf80 walk this+0x52c->+0x52c to the root laser whose hit list is shared; ClearReferences resets + uint8_t _subLasers[0x8]; // EntityPtr; ? ctor 0096cb60 eh-vector-constructs 2 EntityPtrs at +0x530; Remove 0097ea30 removes both unless _oneHit; ClearReferences resets them + uint8_t _continuumLaser[0x4]; // EntityPtr; Entity_Laser::update_laser 00973c60: with TEAR_CONTINUUM (bit 38) spawns the wrapped laser at the room edge via ShootAngle into this+0x538 (sets its _disableInitSound/_disableFollowParent); Remove/ClearReferences free it + uint8_t _tearWaitEffect[0x4]; // EntityPtr; Entity_Laser::Update 00977cc0: with TEAR_WAIT (bit 17, Anti-Gravity) spawns effect 1000.71/126 into this+0x53c, copies tear flags/colour to it; laser stays frozen while that effect's state (+0x450) is 0; ClearReferences resets it + int _waitFrames; // Entity_Laser::Update 00977cc0 sets 2 (hidden) with the Anti-Gravity effect and returns early while it counts down; Interpolate 0097e6f0 skips while >0; update_laser sets it on OneHit continuum lasers; Init zeroes + uint8_t _pad_0x544[0x1c]; int _chainedLasers; // Entity_Laser::update_laser 00973c60 spawns a child laser with child+0x560 = this+0x560 - 1 while > 0, then zeroes it; copy_from_parent 0096f070 copies it }; +static_assert(offsetof(Entity_Laser, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Laser, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Laser, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Laser, _index) == 0x20); static_assert(offsetof(Entity_Laser, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Laser, _type) == 0x28); @@ -1535,75 +1486,63 @@ static_assert(offsetof(Entity_Laser, _sprite) == 0x48); static_assert(offsetof(Entity_Laser, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Laser, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Laser, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Laser, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Laser, _flags) == 0x168); -static_assert(offsetof(Entity_Laser, _valid) == 0x170); +static_assert(offsetof(Entity_Laser, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Laser, _visible) == 0x171); static_assert(offsetof(Entity_Laser, _exists) == 0x172); static_assert(offsetof(Entity_Laser, _dead) == 0x173); -static_assert(offsetof(Entity_Laser, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Laser, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Laser, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Laser, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Laser, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Laser, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Laser, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Laser, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Laser, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Laser, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Laser, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Laser, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Laser, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Laser, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Laser, _color) == 0x1b8); static_assert(offsetof(Entity_Laser, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Laser, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Laser, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Laser, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Laser, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Laser, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Laser, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Laser, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Laser, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Laser, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Laser, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Laser, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Laser, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Laser, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Laser, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Laser, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Laser, _mass) == 0x2d4); -static_assert(offsetof(Entity_Laser, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Laser, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Laser, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Laser, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Laser, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Laser, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Laser, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Laser, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Laser, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Laser, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Laser, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Laser, _charmSource) == 0x240); +static_assert(offsetof(Entity_Laser, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Laser, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Laser, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Laser, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Laser, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Laser, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Laser, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Laser, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Laser, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Laser, _config) == 0x330); static_assert(offsetof(Entity_Laser, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Laser, _pos) == 0x33c); -static_assert(offsetof(Entity_Laser, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Laser, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Laser, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Laser, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Laser, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Laser, _velocity) == 0x360); +static_assert(offsetof(Entity_Laser, _baseFriction) == 0x368); static_assert(offsetof(Entity_Laser, _friction) == 0x36c); -static_assert(offsetof(Entity_Laser, _size) == 0x370); -static_assert(offsetof(Entity_Laser, _health) == 0x380); -static_assert(offsetof(Entity_Laser, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Laser, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Laser, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Laser, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Laser, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Laser, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Laser, _mass) == 0x37c); +static_assert(offsetof(Entity_Laser, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Laser, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Laser, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Laser, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Laser, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Laser, _parent) == 0x3bc); static_assert(offsetof(Entity_Laser, _child) == 0x3c0); static_assert(offsetof(Entity_Laser, _target) == 0x3c4); static_assert(offsetof(Entity_Laser, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Laser, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Laser, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Laser, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Laser, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Laser, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Laser, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Laser, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Laser, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Laser, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Laser, _parentOffset) == 0x410); static_assert(offsetof(Entity_Laser, _startAngleDegrees) == 0x418); static_assert(offsetof(Entity_Laser, _angleDegrees) == 0x41c); static_assert(offsetof(Entity_Laser, _lastAngleDegrees) == 0x420); static_assert(offsetof(Entity_Laser, _tearFlags) == 0x428); +static_assert(offsetof(Entity_Laser, _heldTearFlags) == 0x448); static_assert(offsetof(Entity_Laser, _timeout) == 0x458); static_assert(offsetof(Entity_Laser, _isFirstUpdate) == 0x45c); static_assert(offsetof(Entity_Laser, _sampleLaser) == 0x45d); @@ -1619,21 +1558,53 @@ static_assert(offsetof(Entity_Laser, _rotationSpd) == 0x4cc); static_assert(offsetof(Entity_Laser, _maxDistance) == 0x4d0); static_assert(offsetof(Entity_Laser, _homingType) == 0x4d4); static_assert(offsetof(Entity_Laser, _endPoint) == 0x4d8); -static_assert(offsetof(Entity_Laser, _scale) == 0x4e0); static_assert(offsetof(Entity_Laser, _disableFollowParent) == 0x4e4); static_assert(offsetof(Entity_Laser, _bounceLaser) == 0x4e8); +static_assert(offsetof(Entity_Laser, _childLaser) == 0x4ec); static_assert(offsetof(Entity_Laser, _blackHpDropChance) == 0x4f4); -static_assert(offsetof(Entity_Laser, _multidimensionalTouched) == 0x500); -static_assert(offsetof(Entity_Laser, _prismTouched) == 0x514); static_assert(offsetof(Entity_Laser, _oneHit) == 0x515); static_assert(offsetof(Entity_Laser, _isGridHit) == 0x516); static_assert(offsetof(Entity_Laser, _disableInitSound) == 0x518); static_assert(offsetof(Entity_Laser, _damageMultiplier) == 0x51c); static_assert(offsetof(Entity_Laser, _hitList) == 0x520); +static_assert(offsetof(Entity_Laser, _parentLaser) == 0x52c); +static_assert(offsetof(Entity_Laser, _subLasers) == 0x530); +static_assert(offsetof(Entity_Laser, _continuumLaser) == 0x538); +static_assert(offsetof(Entity_Laser, _tearWaitEffect) == 0x53c); +static_assert(offsetof(Entity_Laser, _waitFrames) == 0x540); static_assert(offsetof(Entity_Laser, _chainedLasers) == 0x560); +struct NPCAI_Pathfinder { + uint32_t _entity; // Entity* // PathFinder::Init 007e31a0 stores the owner (called from the NPC/Familiar constructors with this); UpdateGridIndex 007e6ff0 reads owner+0x33c position + Vector _movementTarget; // PathFinder::MoveRandomly 007e6300 picks a random destination into +4/+8 and steers toward it; Lua ResetMovementTarget 007e6fa0 and Reset 007e3260 zero it (NPC +0x418) + Vector _moveDirection; // ? PathFinder::MoveRandomlyBoss accumulates and normalises a direction in +0xc/+0x10 and negates it on grid collision; ResetMovementTarget 007e6fa0 zeroes it (NPC +0x420) + uint8_t _pad_0x14[0xc]; + int _gridIndex; // Lua PathFinder.UpdateGridIndex 007e6ff0 writes the owner's grid index (or -1) to +0x20, GetGridIndex returns it; Reset sets -1 (NPC +0x434) + uint8_t _pad_0x24[0x708]; + bool _hasDirectPath; // Lua PathFinder.HasDirectPath returns byte +0x72c; Reset 007e3260 clears it (NPC +0xb40, tested by Gaper-family AIs); same struct as lua_fields 'PathFinder' + uint8_t _pad_0x72d[0x3]; + Vector _gridPathTarget; // PathFinder::FindGridPath stores the target position in +0x730/+0x734 (in_ECX[0x1cc/0x1cd]) and reuses it; Reset zeroes it (NPC +0xb44) + bool _canCrushRocks; // Lua PathFinder.SetCanCrushRocks 00499dc0 writes byte +0x738; FindGridPath tests it; Reset clears it (NPC +0xb4c) + uint8_t _pad_0x739[0x3]; + int _evadeMovementCountdown; // Lua PathFinder.GetEvadeMovementCountdown 00456740 returns +0x73c; EvadeTarget sets 3 / subtracts elapsed ticks (NPC +0xb50); same as lua_fields 'PathFinder' + uint8_t _pad_0x740[0x4]; + float _evadeDistance; // ? PathFinder::EvadeTarget clamps +0x744 to <=20 and decays it *0.9, picking random moves while >20; Reset zeroes it (NPC +0xb58, Heart AI tests <=20) +}; +static_assert(offsetof(NPCAI_Pathfinder, _entity) == 0x0); +static_assert(offsetof(NPCAI_Pathfinder, _movementTarget) == 0x4); +static_assert(offsetof(NPCAI_Pathfinder, _moveDirection) == 0xc); +static_assert(offsetof(NPCAI_Pathfinder, _gridIndex) == 0x20); +static_assert(offsetof(NPCAI_Pathfinder, _hasDirectPath) == 0x72c); +static_assert(offsetof(NPCAI_Pathfinder, _gridPathTarget) == 0x730); +static_assert(offsetof(NPCAI_Pathfinder, _canCrushRocks) == 0x738); +static_assert(offsetof(NPCAI_Pathfinder, _evadeMovementCountdown) == 0x73c); +static_assert(offsetof(NPCAI_Pathfinder, _evadeDistance) == 0x744); + struct Entity_NPC { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -1647,141 +1618,150 @@ struct Entity_NPC { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; int _stateFrame; - uint8_t _pathfinder[0x750]; // NPCAI_Pathfinder + NPCAI_Pathfinder _pathfinder; + uint8_t _pad_0xb5c[0x8]; int _state; - uint8_t _pad_0xb68[0x38]; + int _savedState; // Entity_NPC::Update 006c4b30 stores _state here and sets _state=1 while FLAG_APPEAR is set, restores _state from it afterwards; Init 006b8b20 zeroes + int _aiCounter; // ? generic AI int: Init 006b8b20 zeroes; NpcHelper::moms_heart_attack_pattern 004d33d0 / ENTITY_MOMS_HEART 004d48b0 use it as a phase (==3, =4), Bumbino/Gideon count with it + int _appearFrames; // Entity_NPC::Update 006c4b30 counts up while _state==1 (appear) and runs the init AI call when it is 0; Init zeroes + int _aiCallPhase; // Entity_NPC::Update 006c4b30 sets 1 (pre/paused call), 4 (post-update call), HandleCollision 006cd410 sets 3 (collision call) around Entity_NPC_UpdateAI_dispatch, then 0; Beast AIs branch on ==1 + bool _collisionIsLow; // Entity_NPC::HandleCollision 006cd410 stores its 'low' argument here before the phase-3 AI call + uint8_t _pad_0xb79[0x3]; + uint32_t _collisionEntity; // Entity* // Entity_NPC::HandleCollision 006cd410 stores the collider here for the phase-3 AI call; AIs read collider+0x28 type, compare with _parent/_spawnerEntity + int _collisionResult; // Entity_NPC::HandleCollision 006cd410 sets -1 before the phase-3 AI call; AI writes 0 (ignore collision) or >0 (block); HandleCollision returns accordingly + int _decoyTargetTimer; // ? Entity_NPC::Update 006c4b30 counts it up while the target is familiar 3.67 (Punching Bag), wraps to -1 past 180, decays toward 0; GetPlayerTarget 006be840 ignores decoys while it is <0 + uint8_t _killDamageEvents[0xc]; // vector_DamageEvent; Entity_NPC::Kill 006be6f0 copies Entity +0x8 damage events here (vector::assign_0x38) together with 0xb94/0xb98 before Entity::Kill; Init clears it + float _killDamage; // Entity_NPC::Kill 006be6f0 copies Entity _pendingDamage (+0x14) here + uint64_t _killDamageFlags; // Entity_NPC::Kill 006be6f0 copies Entity _pendingDamageFlags (+0x18/+0x1c) here; NpcHelper::ChampionDrop 006bf120 reads it int _projectileCooldown; int _projectileDelay; - uint8_t _pad_0xba8[0x8]; + int _championTimer; // Entity_NPC::MakeChampion 006d03e0 sets Random%20+40 for colors 10/25; Update 006c4b30 decrements and shoots/respawns at <1; TakeDamage 006d60a0 (color 21) gates on it and sets 60 + float _championSpeed; // Entity_NPC::MakeChampion 006d03e0 sets 1.333 (yellow/rainbow), 0.8 (dark blue/grey), scales it for tiny/giant; Update 006c4b30 friction = 1-(1-this)*(1-friction); Init/Morph reset 1.0 Vector _v1; Vector _v2; int _i1; int _i2; - uint32_t _deliriumBossType; - uint32_t _deliriumBossVariant; - uint16_t _deliriumTransformationTimer; - uint8_t _deliriumRemainingAttacks; - uint8_t _deliriumState; - uint8_t _pad_0xbd4[0x4]; - uint32_t _deliriumAttackID; - uint8_t _deliriumAttackAngle; - uint8_t _pad_0xbdd[0x3]; - uint32_t _deliriumCycleID; - uint8_t _pad_0xbe4[0x59]; - bool _isBoss; - uint8_t _pad_0xc3e[0x2]; - float _shieldStrength; - uint8_t _pad_0xc44[0x1f]; + uint8_t _pad_0xbc8[0x1c]; + uint32_t _deliriumCycleIDHigh; // NpcAI::ENTITY_DELIRIUM 004a6500 builds a bitfield across _deliriumCycleID (0xbe0)>>25 | (0xbe4&7)<<7 and zeroes 0xbe4 when it rewrites 0xbe0 + uint32_t _deliriumEntity; // Entity* // ? NpcAI::ENTITY_DELIRIUM 004a6500 reads it and tests its _dead (+0x173); Init 006b8b20 zeroes it + uint8_t _entityRef[0x4]; // EntityPtr; Lua EntityNPC.EntityRef 004e4850 returns *(this+0xbec); AIs assign it via multiset insert/erase (EntityPtr), Init zeroes; 45 AIs use it as their linked entity + uint8_t _entityDeque[0x14]; // deque_EntityPtr; Entity_NPC::Constructor 006b8590 builds a std::deque (proxy new(8), 5 dwords 0xbf0..0xc00); Hornfel_UpdateAI 004b92e0 calls std::deque::resize(2) and indexes map 0xbf4/mapsize 0xbf8/off 0xbfc (4 per block) + uint8_t _vectorDeque1[0x14]; // deque_Vector; Entity_NPC::Constructor 006b8590 builds a std::deque (proxy, 0xc04..0xc14); std::deque::assign(&npc+0xc04) in Evis/Chub/Dogma AIs, map 0xc08, off 0xc10 (2 per block) + uint8_t _vectorDeque2[0x14]; // deque_Vector; Entity_NPC::Constructor 006b8590 builds a std::deque (proxy, 0xc18..0xc28); std::deque::assign(&npc+0xc18) (Beast soul 005971e0), Dogma/Wormwood index map 0xc1c/off 0xc24 + Vector _confusionTargetPos; // Entity_NPC::CalcTargetPosition 006bec40: with FLAG_CONFUSION (0x200) it picks a random clamped spot every 15 frames into 0xc2c/0xc30 and returns it; Init zeroes + float _aiFloat; // generic AI scratch float: Init 006b8b20 sets 1.0; Lamb/War/Beast/Gemini AIs store speeds/thresholds (e.g. maxHP*0.4) in it + float _scale; // Lua EntityNPC.Scale 004567a0 returns this+0xc38; MakeChampion 006d03e0 sets the tiny/giant scale; Init/Morph 1.0 + bool _canShutDoors; // Entity_NPC::CanShutDoors 006b8450 (vtable 18) returns it unless FLAG_FRIENDLY; 00436220 (named Entity::SetVisibleFlag) sets it to arg unless FLAG_FRIENDLY; Update 006c4b30 clears it when unreachable twice or no bosses alive + uint8_t _pad_0xc3d[0x1]; + bool _isUnreachableOnce; // ? Entity_NPC::Update 006c4b30: first time no player has a path it sets 0xc3e=1, the next time it clears _canShutDoors; Init clears + uint8_t _pad_0xc3f[0x5]; + int _shieldFrames; // Entity_NPC::champion_init 006bb790 copies EntityConfig shieldFrames (+0xe4); Init 006b8b20 / Delirium / Ultra Greed set 120 + uint8_t _pad_0xc48[0x14]; + float _totalDamageTaken; // Entity_NPC::Update 006c4b30 adds max(0, hp before - hp after Entity::Update) each update; Init/Morph zero it + bool _isBestiaryEncountered; // Entity_NPC::Update 006c4b30 calls PersistentGameData::TryAddBestiaryEncounter(type,variant) once and sets it; Init/Morph clear + uint8_t _pad_0xc61[0x2]; bool _isChampion; int _championColorIdx; - uint8_t _pad_0xc68[0xc]; - uint16_t _championRegenTimer; - uint8_t _pad_0xc76[0x2]; + int _flickerTimer; // Entity_NPC::Update 006c4b30 flicker champion (color 9) / type 252 state machine: countdown, reset to 60+Random(30) + int _flickerState; // Entity_NPC::Update 006c4b30 flicker champion state 0 wait, 1 fade out, 2 fade in, 3 invisible + float _flickerAlpha; // Entity_NPC::Update 006c4b30 steps it by 0.05 between 0 and 1 and applies it as the sprite alpha; Init 1.0 + uint8_t _pad_0xc74[0x2]; + short _championRegenCount; // Entity_NPC::Update 006c4b30 increments it each time the dark red champion (12) regenerates; Clotty/Hive/Mulligan/Hopper AIs scale spawns by it int _bosscoloridx; int _groupIdx; // Lua EntityNPC.GroupIdx via binder 008877e0: getter 008bf5b0 FUN_0085bfd0 signed dword, setter dword - uint8_t _pad_0xc80[0x2c]; + ColorMod _floorColor; // ? Entity_NPC::Constructor 006b8590 inits a ColorMod (1,1,1,1, 7 zeros); Update 006c4b30 samples the room render surface into it every 30 frames and Color::Lerp's the sprite toward it (0.1) ColorMod _dirtColor; // Entity_NPC::UpdateDirtColor 006c04b0 writes Room::GetFloorColorAt*2 to this+0xcac..0xcb4 and lerps sprite layers toward it - uint8_t _pad_0xcd8[0x114]; + ANM2 _statusEffectSprite; // Entity_NPC::Update 006c4b30 loads gfx/StatusEffects.anm2 into this+0xcd8 and plays the status animation; Render 006d2e50 draws it; constructor builds the ANM2 (0xd0c/0xd1c/0xde1/0xde8 are inside it) ANM2 _chargeBarSprite; // gfx/chargebar.anm2 loaded by Entity_NPC::UpdateChargeBar (006d8e40) - uint8_t _hitList[0x1c]; // std_vector_uint; Entity_NPC::HandleCollision 006cd410 (6cdfb3, 6cfdfa...) and NpcAI::ENTITY_DARK_ESAU 005542e0 pass this+0xf00 to EntityList::HitListContains 00431640 + uint8_t _hitList[0xc]; // std_vector_uint; Entity_NPC::HandleCollision 006cd410 (6cdfb3, 6cfdfa...) and NpcAI::ENTITY_DARK_ESAU 005542e0 pass this+0xf00 to EntityList::HitListContains 00431640 + uint8_t _secondaryHitList[0xc]; // std_vector_uint; Entity_NPC::Constructor/ClearReferences 006b8f30 manage a 3-dword vector 0xf0c..0xf14; NpcAI::ENTITY_WHIPPER 004e5170 clears it and binary-searches it for GetHitListIndex of whip-hit entities + uint32_t _aiCallFlags; // bitmask of extra AI calls: Update 006c4b30 calls the AI with phase 1 if &1, phase 4 if &8; HandleCollision 006cd410 phase 3 if &4; regen champion saves it <<16 and restores from 0xf1a int32_t _controllerID; // Entity_NPC::IsControllerActionPressed 006d8260 passes this+0xf1c to input_is_action_pressed (-1 = none); GetControllerMovementInput 006d85a0 / UpdateControllerMovement 006d9050 test it Vector _controllerMovement; // movement written by Entity_NPC::UpdateControllerMovement (006d9050); 21 AIs reset it each frame uint32_t _aimTargetEffect; // void* // effect 1000.30 an NPC under player control aims at (Entity_NPC::GetAimTargetPosition 006d8d30) - uint8_t _pad_0xf2c[0x14]; + uint8_t _pad_0xf2c[0x4]; + Vector _forwardVector; // Entity_NPC::GetForwardVector 006d48a0 (vtable 22) returns it when non-zero (else velocity dir); Gyro/Dust/Knight AIs set it; Init zeroes + uint8_t _forcedTarget[0x4]; // EntityPtr; Entity_NPC::TryForceTarget 006b9910 assigns the target (multiset erase/insert); TakeDamage 006d60a0 and many AIs test it + int _forcedTargetTimer; // Entity_NPC::TryForceTarget 006b9910 stores Duration (refuses when <0); Update 006c4b30 counts it down, bosses get -150 cooldown, releases _forcedTarget at 0 uint32_t _sirenPlayerEntity; // Entity_Player* // NpcHelper::siren_charmed_count 0058e590 counts familiars whose _player (+0x410) == npc+0xf40; NpcAI::siren_release_stolen_items 005911b0 animates the collectible pickup on it - uint8_t _pad_0xf44[0xc]; + float _hitPointsMulti; // Entity_NPC::Morph 006c0f30 sets _maxHitPoints = 0xf44 * new maxHP; ENTITY_CAGE 004878a0 multiplies maxHP/HP of split children by the parent's; Init 1.0 + float _scaleMulti; // ENTITY_CAGE 004878a0 SetScale(child scale * parent 0xf48) and multiplies it; Init 1.0 + int _lastGridIndex; // Entity_NPC::Update 006c4b30 (brown champion) compares Room::GetGridIndex(_pos) with it, spawns poop at the old index, stores the new one; Init -1 uint32_t _pickupGhostsEntity; // Entity_Effect* // Entity_NPC::UpdatePickupGhosts 006da530 passes/stores this+0xf50 through Entity_Effect::CreateLootPreview and removes it }; +static_assert(offsetof(Entity_NPC, _damageEvents) == 0x8); +static_assert(offsetof(Entity_NPC, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_NPC, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_NPC, _index) == 0x20); static_assert(offsetof(Entity_NPC, _collisionIndex) == 0x24); static_assert(offsetof(Entity_NPC, _type) == 0x28); @@ -1793,105 +1773,125 @@ static_assert(offsetof(Entity_NPC, _sprite) == 0x48); static_assert(offsetof(Entity_NPC, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_NPC, _spriteScale) == 0xe4); static_assert(offsetof(Entity_NPC, _isFlipX) == 0x148); -static_assert(offsetof(Entity_NPC, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_NPC, _flags) == 0x168); -static_assert(offsetof(Entity_NPC, _valid) == 0x170); +static_assert(offsetof(Entity_NPC, _shadowOffset) == 0x160); static_assert(offsetof(Entity_NPC, _visible) == 0x171); static_assert(offsetof(Entity_NPC, _exists) == 0x172); static_assert(offsetof(Entity_NPC, _dead) == 0x173); -static_assert(offsetof(Entity_NPC, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_NPC, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_NPC, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_NPC, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_NPC, _collisionPoints) == 0x178); static_assert(offsetof(Entity_NPC, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_NPC, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_NPC, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_NPC, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_NPC, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_NPC, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_NPC, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_NPC, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_NPC, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_NPC, _color) == 0x1b8); static_assert(offsetof(Entity_NPC, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_NPC, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_NPC, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_NPC, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_NPC, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_NPC, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_NPC, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_NPC, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_NPC, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_NPC, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_NPC, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_NPC, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_NPC, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_NPC, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_NPC, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_NPC, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_NPC, _mass) == 0x2d4); -static_assert(offsetof(Entity_NPC, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_NPC, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_NPC, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_NPC, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_NPC, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_NPC, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_NPC, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_NPC, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_NPC, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_NPC, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_NPC, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_NPC, _charmSource) == 0x240); +static_assert(offsetof(Entity_NPC, _entityRef2) == 0x268); +static_assert(offsetof(Entity_NPC, _entityRef3) == 0x290); +static_assert(offsetof(Entity_NPC, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_NPC, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_NPC, _pausePosition) == 0x314); +static_assert(offsetof(Entity_NPC, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_NPC, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_NPC, _spawnFrame) == 0x328); static_assert(offsetof(Entity_NPC, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_NPC, _config) == 0x330); static_assert(offsetof(Entity_NPC, _targetPosition) == 0x334); -static_assert(offsetof(Entity_NPC, _pos) == 0x33c); -static_assert(offsetof(Entity_NPC, _posOffset) == 0x34c); +static_assert(offsetof(Entity_NPC, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_NPC, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_NPC, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_NPC, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_NPC, _velocity) == 0x360); +static_assert(offsetof(Entity_NPC, _baseFriction) == 0x368); static_assert(offsetof(Entity_NPC, _friction) == 0x36c); -static_assert(offsetof(Entity_NPC, _size) == 0x370); -static_assert(offsetof(Entity_NPC, _health) == 0x380); -static_assert(offsetof(Entity_NPC, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_NPC, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_NPC, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_NPC, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_NPC, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_NPC, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_NPC, _mass) == 0x37c); +static_assert(offsetof(Entity_NPC, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_NPC, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_NPC, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_NPC, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_NPC, _updateTime) == 0x3a4); static_assert(offsetof(Entity_NPC, _parent) == 0x3bc); static_assert(offsetof(Entity_NPC, _child) == 0x3c0); static_assert(offsetof(Entity_NPC, _target) == 0x3c4); static_assert(offsetof(Entity_NPC, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_NPC, _minecart) == 0x3d4); +static_assert(offsetof(Entity_NPC, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_NPC, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_NPC, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_NPC, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_NPC, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_NPC, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_NPC, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_NPC, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_NPC, _stateFrame) == 0x410); static_assert(offsetof(Entity_NPC, _pathfinder) == 0x414); static_assert(offsetof(Entity_NPC, _state) == 0xb64); +static_assert(offsetof(Entity_NPC, _savedState) == 0xb68); +static_assert(offsetof(Entity_NPC, _aiCounter) == 0xb6c); +static_assert(offsetof(Entity_NPC, _appearFrames) == 0xb70); +static_assert(offsetof(Entity_NPC, _aiCallPhase) == 0xb74); +static_assert(offsetof(Entity_NPC, _collisionIsLow) == 0xb78); +static_assert(offsetof(Entity_NPC, _collisionEntity) == 0xb7c); +static_assert(offsetof(Entity_NPC, _collisionResult) == 0xb80); +static_assert(offsetof(Entity_NPC, _decoyTargetTimer) == 0xb84); +static_assert(offsetof(Entity_NPC, _killDamageEvents) == 0xb88); +static_assert(offsetof(Entity_NPC, _killDamage) == 0xb94); +static_assert(offsetof(Entity_NPC, _killDamageFlags) == 0xb98); static_assert(offsetof(Entity_NPC, _projectileCooldown) == 0xba0); static_assert(offsetof(Entity_NPC, _projectileDelay) == 0xba4); +static_assert(offsetof(Entity_NPC, _championTimer) == 0xba8); +static_assert(offsetof(Entity_NPC, _championSpeed) == 0xbac); static_assert(offsetof(Entity_NPC, _v1) == 0xbb0); static_assert(offsetof(Entity_NPC, _v2) == 0xbb8); static_assert(offsetof(Entity_NPC, _i1) == 0xbc0); static_assert(offsetof(Entity_NPC, _i2) == 0xbc4); -static_assert(offsetof(Entity_NPC, _deliriumBossType) == 0xbc8); -static_assert(offsetof(Entity_NPC, _deliriumBossVariant) == 0xbcc); -static_assert(offsetof(Entity_NPC, _deliriumTransformationTimer) == 0xbd0); -static_assert(offsetof(Entity_NPC, _deliriumRemainingAttacks) == 0xbd2); -static_assert(offsetof(Entity_NPC, _deliriumState) == 0xbd3); -static_assert(offsetof(Entity_NPC, _deliriumAttackID) == 0xbd8); -static_assert(offsetof(Entity_NPC, _deliriumAttackAngle) == 0xbdc); -static_assert(offsetof(Entity_NPC, _deliriumCycleID) == 0xbe0); -static_assert(offsetof(Entity_NPC, _isBoss) == 0xc3d); -static_assert(offsetof(Entity_NPC, _shieldStrength) == 0xc40); +static_assert(offsetof(Entity_NPC, _deliriumCycleIDHigh) == 0xbe4); +static_assert(offsetof(Entity_NPC, _deliriumEntity) == 0xbe8); +static_assert(offsetof(Entity_NPC, _entityRef) == 0xbec); +static_assert(offsetof(Entity_NPC, _entityDeque) == 0xbf0); +static_assert(offsetof(Entity_NPC, _vectorDeque1) == 0xc04); +static_assert(offsetof(Entity_NPC, _vectorDeque2) == 0xc18); +static_assert(offsetof(Entity_NPC, _confusionTargetPos) == 0xc2c); +static_assert(offsetof(Entity_NPC, _aiFloat) == 0xc34); +static_assert(offsetof(Entity_NPC, _scale) == 0xc38); +static_assert(offsetof(Entity_NPC, _canShutDoors) == 0xc3c); +static_assert(offsetof(Entity_NPC, _isUnreachableOnce) == 0xc3e); +static_assert(offsetof(Entity_NPC, _shieldFrames) == 0xc44); +static_assert(offsetof(Entity_NPC, _totalDamageTaken) == 0xc5c); +static_assert(offsetof(Entity_NPC, _isBestiaryEncountered) == 0xc60); static_assert(offsetof(Entity_NPC, _isChampion) == 0xc63); static_assert(offsetof(Entity_NPC, _championColorIdx) == 0xc64); -static_assert(offsetof(Entity_NPC, _championRegenTimer) == 0xc74); +static_assert(offsetof(Entity_NPC, _flickerTimer) == 0xc68); +static_assert(offsetof(Entity_NPC, _flickerState) == 0xc6c); +static_assert(offsetof(Entity_NPC, _flickerAlpha) == 0xc70); +static_assert(offsetof(Entity_NPC, _championRegenCount) == 0xc76); static_assert(offsetof(Entity_NPC, _bosscoloridx) == 0xc78); static_assert(offsetof(Entity_NPC, _groupIdx) == 0xc7c); +static_assert(offsetof(Entity_NPC, _floorColor) == 0xc80); static_assert(offsetof(Entity_NPC, _dirtColor) == 0xcac); +static_assert(offsetof(Entity_NPC, _statusEffectSprite) == 0xcd8); static_assert(offsetof(Entity_NPC, _chargeBarSprite) == 0xdec); static_assert(offsetof(Entity_NPC, _hitList) == 0xf00); +static_assert(offsetof(Entity_NPC, _secondaryHitList) == 0xf0c); +static_assert(offsetof(Entity_NPC, _aiCallFlags) == 0xf18); static_assert(offsetof(Entity_NPC, _controllerID) == 0xf1c); static_assert(offsetof(Entity_NPC, _controllerMovement) == 0xf20); static_assert(offsetof(Entity_NPC, _aimTargetEffect) == 0xf28); +static_assert(offsetof(Entity_NPC, _forwardVector) == 0xf30); +static_assert(offsetof(Entity_NPC, _forcedTarget) == 0xf38); +static_assert(offsetof(Entity_NPC, _forcedTargetTimer) == 0xf3c); static_assert(offsetof(Entity_NPC, _sirenPlayerEntity) == 0xf40); +static_assert(offsetof(Entity_NPC, _hitPointsMulti) == 0xf44); +static_assert(offsetof(Entity_NPC, _scaleMulti) == 0xf48); +static_assert(offsetof(Entity_NPC, _lastGridIndex) == 0xf4c); static_assert(offsetof(Entity_NPC, _pickupGhostsEntity) == 0xf50); struct Entity_Pickup { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -1905,93 +1905,73 @@ struct Entity_Pickup { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; ANM2 _priceANM2; // Entity_Pickup::update_price_sprite 006e2570 ANM2::Reset/Load (shop price sprite) on this+0x410; ctor 006e0010 constructs ANM2 there @@ -2000,27 +1980,34 @@ struct Entity_Pickup { // : Entity (flattened) bool _isTouched; uint8_t _pad_0x52d[0x1]; bool _isForceBlind; // Entity_Pickup::SetForceBlind 006e1e60 stores the arg at this+0x52e and calls UpdateSprite when a collectible changes - uint8_t _pad_0x52f[0x5]; + bool _isPayToPlay; // Entity_Pickup::Init 006e02f0 sets it for chest variants 53/55/57/60 when someone has Pay To Play (380); HandleCollision/TryOpenChest then spend a coin instead of TryUseKey + int _itemPoolType; // ? Entity_Player::DropCollectible 00790530 copies History item +0x18 (REPENTOGON _itemPoolType) into it; HandleCollision passes it to SetQueuedItem as QueueItemData +0x10; Morph keeps it, ==3 with price 0 rerolls tag 0x200000000 items int _price; bool _isAutoUpdatePrice; uint8_t _pad_0x539[0x3]; int _shopItemId; int _timeout; int _wait; - uint8_t _pad_0x548[0xc]; + int _chestReCloseTimer; // Entity_Pickup::TryOpenChest 006e6e40 sets 60; Update 006e3940 decrements and at 0 an Eternal Chest (53) plays "Close" and gets subtype 1; CanFlip checks it + int _collisionCooldown; // Entity_Pickup::HandleCollision 006e8ae0: player touch while >0 just refreshes it to 10 and returns; Update decrements; Player::DropTrinket sets 4, TakeDamage zeroes + int _gridRepositionState; // ? Entity_Pickup::HandleCollision 006e8ae0 sets 1 after a pedestal swap near a room grid entity (<70px); Update 006e3940 1: scans grids -> 2; 2: TargetPosition = pos, -> 0 int _dropDelay; // Entity_Pickup::Update 006e3940 starts: if this+0x554>0 decrement and skip the update; Entity_Player::AddCollectible staggers spawned pickups via +0x554 - uint8_t _pad_0x558[0x2c]; + ColorMod _colorMod; // ? ctor 006e0010 sets +0x558..+0x564 = 1.0 (tint) and +0x568..+0x580 = 0 (colorize/offset), Init 006e02f0 assigns a ColorMod to it as one block (ends right before State 0x584) uint32_t _state; // Lua EntityPickup.State via binder 00884ea0: getter 008bedb0 dword via FUN_0085bff0 (unsigned pushinteger), setter dword - uint8_t _pad_0x588[0x8]; + int _coopDuplicateIndex; // Entity_Pickup::HandleCollision 006e8ae0: in co-op, while +1 < alive players spawns another collectible and calls setter 006e2ff0(this+0x588 +1), -1 = none; Room::SpawnClearAward sets 0; Init -1 + uint8_t _unkEntityRef[0x4]; // EntityPtr; ? Entity_Pickup::ClearReferences 006ee130 resets it like the other EntityPtrs (multiset erase); ctor zeroes; no setter found uint32_t _pickupGhost; // Entity_Effect* // Entity_Pickup::UpdateLootPreview 006e17c0 (Guppys Eye) stores Entity_Effect::CreateLootPreview result at this+0x590 and removes it uint32_t _megaChestCollectible[2]; // Entity_Pickup* // Entity_Pickup::SetAlternatePedestal 006e1a80 links two pedestals at the same position (types 14/19) via this+0x594 / other+0x598 int _varData; // Entity_Player::DropCollectible 00790530 copies the active slot _varData (player+0x1580+i*0x20+0x1c) into pickup+0x59c next to _charge (+0x524); Morph 006e30a0 zeroes it uint32_t _cycleCollectibleList[8]; // Entity_Pickup::TryFlip 006e1640 rebuilds the cycle list: this[+0x5a0 + count*4] = id, count at +0x5c0 uint32_t _cycleCollectibleCount; // Entity_Pickup::TryFlip 006e1640 zeroes and increments this+0x5c0 while filling +0x5a0[] - uint8_t _pad_0x5c4[0x4]; + int _invisibleFrames; // Entity_Pickup::Update 006e3940: while invisible with collision, ++ and after 3 frames sets _visible; Init/Morph zero it uint8_t _flipSaveState[0x8]; // KAGE_SmartPointer_EntitySaveState; Entity_Pickup::TryFlip 006e1640 requires this+0x5c8 != 0 and swaps the pedestal with that save state; ctor zeroes +0x5c8/+0x5cc (smart pointer) ANM2 _altPedestalANM2; // Entity_Pickup::Update 006e3940: when +0x5c8 set and a player has Flip (711), copies the main sprite into this+0x5d0 and load_collectible_gfx of the flip item (the ghost item sprite); ANM2::Reset otherwise }; +static_assert(offsetof(Entity_Pickup, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Pickup, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Pickup, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Pickup, _index) == 0x20); static_assert(offsetof(Entity_Pickup, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Pickup, _type) == 0x28); @@ -2032,113 +2019,118 @@ static_assert(offsetof(Entity_Pickup, _sprite) == 0x48); static_assert(offsetof(Entity_Pickup, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Pickup, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Pickup, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Pickup, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Pickup, _flags) == 0x168); -static_assert(offsetof(Entity_Pickup, _valid) == 0x170); +static_assert(offsetof(Entity_Pickup, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Pickup, _visible) == 0x171); static_assert(offsetof(Entity_Pickup, _exists) == 0x172); static_assert(offsetof(Entity_Pickup, _dead) == 0x173); -static_assert(offsetof(Entity_Pickup, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Pickup, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Pickup, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Pickup, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Pickup, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Pickup, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Pickup, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Pickup, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Pickup, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Pickup, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Pickup, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Pickup, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Pickup, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Pickup, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Pickup, _color) == 0x1b8); static_assert(offsetof(Entity_Pickup, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Pickup, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Pickup, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Pickup, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Pickup, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Pickup, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Pickup, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Pickup, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Pickup, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Pickup, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Pickup, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Pickup, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Pickup, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Pickup, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Pickup, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Pickup, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Pickup, _mass) == 0x2d4); -static_assert(offsetof(Entity_Pickup, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Pickup, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Pickup, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Pickup, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Pickup, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Pickup, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Pickup, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Pickup, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Pickup, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Pickup, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Pickup, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Pickup, _charmSource) == 0x240); +static_assert(offsetof(Entity_Pickup, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Pickup, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Pickup, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Pickup, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Pickup, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Pickup, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Pickup, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Pickup, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Pickup, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Pickup, _config) == 0x330); static_assert(offsetof(Entity_Pickup, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Pickup, _pos) == 0x33c); -static_assert(offsetof(Entity_Pickup, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Pickup, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Pickup, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Pickup, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Pickup, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Pickup, _velocity) == 0x360); +static_assert(offsetof(Entity_Pickup, _baseFriction) == 0x368); static_assert(offsetof(Entity_Pickup, _friction) == 0x36c); -static_assert(offsetof(Entity_Pickup, _size) == 0x370); -static_assert(offsetof(Entity_Pickup, _health) == 0x380); -static_assert(offsetof(Entity_Pickup, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Pickup, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Pickup, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Pickup, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Pickup, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Pickup, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Pickup, _mass) == 0x37c); +static_assert(offsetof(Entity_Pickup, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Pickup, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Pickup, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Pickup, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Pickup, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Pickup, _parent) == 0x3bc); static_assert(offsetof(Entity_Pickup, _child) == 0x3c0); static_assert(offsetof(Entity_Pickup, _target) == 0x3c4); static_assert(offsetof(Entity_Pickup, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Pickup, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Pickup, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Pickup, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Pickup, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Pickup, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Pickup, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Pickup, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Pickup, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Pickup, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Pickup, _priceANM2) == 0x410); static_assert(offsetof(Entity_Pickup, _charge) == 0x524); static_assert(offsetof(Entity_Pickup, _optionsPickupIndex) == 0x528); static_assert(offsetof(Entity_Pickup, _isTouched) == 0x52c); static_assert(offsetof(Entity_Pickup, _isForceBlind) == 0x52e); +static_assert(offsetof(Entity_Pickup, _isPayToPlay) == 0x52f); +static_assert(offsetof(Entity_Pickup, _itemPoolType) == 0x530); static_assert(offsetof(Entity_Pickup, _price) == 0x534); static_assert(offsetof(Entity_Pickup, _isAutoUpdatePrice) == 0x538); static_assert(offsetof(Entity_Pickup, _shopItemId) == 0x53c); static_assert(offsetof(Entity_Pickup, _timeout) == 0x540); static_assert(offsetof(Entity_Pickup, _wait) == 0x544); +static_assert(offsetof(Entity_Pickup, _chestReCloseTimer) == 0x548); +static_assert(offsetof(Entity_Pickup, _collisionCooldown) == 0x54c); +static_assert(offsetof(Entity_Pickup, _gridRepositionState) == 0x550); static_assert(offsetof(Entity_Pickup, _dropDelay) == 0x554); +static_assert(offsetof(Entity_Pickup, _colorMod) == 0x558); static_assert(offsetof(Entity_Pickup, _state) == 0x584); +static_assert(offsetof(Entity_Pickup, _coopDuplicateIndex) == 0x588); +static_assert(offsetof(Entity_Pickup, _unkEntityRef) == 0x58c); static_assert(offsetof(Entity_Pickup, _pickupGhost) == 0x590); static_assert(offsetof(Entity_Pickup, _megaChestCollectible) == 0x594); static_assert(offsetof(Entity_Pickup, _varData) == 0x59c); static_assert(offsetof(Entity_Pickup, _cycleCollectibleList) == 0x5a0); static_assert(offsetof(Entity_Pickup, _cycleCollectibleCount) == 0x5c0); +static_assert(offsetof(Entity_Pickup, _invisibleFrames) == 0x5c4); static_assert(offsetof(Entity_Pickup, _flipSaveState) == 0x5c8); static_assert(offsetof(Entity_Pickup, _altPedestalANM2) == 0x5d0); -struct TemporaryEffects { - uint32_t _cacheFlags; // new vs REPENTOGON: 00930220 AddEffect / 009303f0 RemoveEffect OR ItemConfig_Item cacheFlags (+0x54) into *this - uint8_t _effects[0xc]; // vector_TemporaryEffect; 007537a0 Lua GetEffectsList returns this+4; 00930220 AddEffect/009303f0 RemoveEffect walk this[1]..this[2] stride 0x10, push/erase - bool _shouldEvaluateCache; // 00930220 AddEffect / 009303f0 RemoveEffect / 009306c0 ClearEffects set byte this+0x10 = 1 after any change - bool _disabled; // 00930220 AddEffect, 009303f0 RemoveEffect, 00930680 HasNullEffect, 009306c0 ClearEffects all bail out if byte this+0x11 != 0 - uint8_t _pad_0x12[0x2]; - uint32_t _player; // Entity_Player* // 00930220 AddEffect: Entity_Player::AddCostume(this[5],...) ; RemoveEffect: this[5]==0 -> Room::TriggerEffectRemoved else Entity_Player::trigger_collectible_effect_removed +struct History { + uint8_t _historyItems[0xc]; // vector_HistoryItem; Entity_Player::RemoveCollectibleByHistoryIndex 0078fec0 / DropCollectible index begin 0x1dec / end 0x1df0 with stride 0x1c + bool _isLocked; // Entity_Player::RemoveCollectibleByHistoryIndex 0078fec0 / reroll_collectibles_on_damage 005c88a0 set player+0x1df8 (History 0x1dec +0xc) to 1 around RemoveCollectible and restore it so no history entry is touched + uint8_t _pad_0xd[0x3]; + uint32_t _player; // Entity_Player* // Entity_Player ctor 00753da0 writes this into 0x1dfc (History 0x1dec +0x10) }; -static_assert(offsetof(TemporaryEffects, _cacheFlags) == 0x0); -static_assert(offsetof(TemporaryEffects, _effects) == 0x4); -static_assert(offsetof(TemporaryEffects, _shouldEvaluateCache) == 0x10); -static_assert(offsetof(TemporaryEffects, _disabled) == 0x11); -static_assert(offsetof(TemporaryEffects, _player) == 0x14); +static_assert(offsetof(History, _historyItems) == 0x0); +static_assert(offsetof(History, _isLocked) == 0xc); +static_assert(offsetof(History, _player) == 0x10); struct QueueItemData { uint32_t _item; // ItemConfig_Item* int _charge; + uint8_t _flags; // Lua QueueItemData.Touched 007538f0 returns byte+8 & 1; GetTrinketMultiplier 007cb6e0 / replace_trinket test bit 2 (golden queued trinket); ClearQueueItem zeroes the byte }; static_assert(offsetof(QueueItemData, _item) == 0x0); static_assert(offsetof(QueueItemData, _charge) == 0x4); +static_assert(offsetof(QueueItemData, _flags) == 0x8); + +struct PlayerCostumeMap { + int _index; // ClearCollectibleAnim 007ad5a0: -1 = none, else index into Entity_Player::_costumeSpriteDescs (stride 0x130) + uint8_t _pad_0x4[0x8]; + bool _isBodyLayer; // Update 00782af0 layer loop over Entity_Player+0x1238 stride 0x10: 0 -> head-style scale/offset (0x1500), else body scale only +}; +static_assert(offsetof(PlayerCostumeMap, _index) == 0x0); +static_assert(offsetof(PlayerCostumeMap, _isBodyLayer) == 0xc); struct Entity_Player { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -2152,110 +2144,94 @@ struct Entity_Player { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; bool _isControlsEnabled; uint8_t _pad_0x411[0x3]; int _controlsCooldown; - uint8_t _pad_0x418[0x4]; + int _fireBlockCooldown; // Update 00782af0 counts it down beside _controlsCooldown; update_shooting 0077b020 sets it after a Maw of the Void / Revelation release and blocks firing while >0 ANM2 _bodySprite; // ctor 00753da0 builds ANM2 here first; Render 0078b640 checks its _loaded and reads its null frame for the held item - uint8_t _pad_0x530[0x9b4]; + ANM2 _crownOfLightSprite; // ctor 00753da0 ANM2 ctor; TriggerNewRoom_TemporaryEffects 007a8350 / UpdateHeartDependentEffects play "FloatGlow"/"FloatNoGlow" on it next to Crown of Light (415) effect add/remove; Update ANM2::Update + ANM2 _darkPrincesCrownSprite; // ctor 00753da0 ANM2 ctor; TriggerNewRoom_TemporaryEffects 007a8350 / UpdateHeartDependentEffects play "FloatGlow" on it with Dark Prince's Crown (442) effect; Update ANM2::Update + ANM2 _chargeBarSprites[7]; // ctor 00753da0 _eh_vector_constructor_iterator_(0x758, 0x114, 7, ANM2 ctor); FUN_0075ea40 sets bar percent on 0x758 (weapon charge / Bag of Crafting), 0xcbc, 0xdd0 (Sumptorium); Update updates all 7 ANM2 _bloodGushSprite; // ctor 00753da0 builds ANM2 here after the 7-sprite array at 0x758; Update 00782af0 ANM2::Update on it; same layout as REPENTOGON (shift 0 up to 0x1368) ANM2 _heldSprite; // ctor 00753da0 ANM2; AnimateCollectible 007ab380 loads the item graphic into it, rewinds and plays it - uint8_t _pad_0x110c[0x114]; - uint8_t _costumeSpriteDescs[0x100]; // vector_CostumeSpriteDesc; ctor 00753da0 zeroes a 3-dword vector at 0x1220..0x1228 right after the ANM2 at 0x110c; shift-0 region bracketed by 0xff8 and 0x1340 + ANM2 _statusEffectSprite; // ctor 00753da0 ANM2 ctor; Update 00782af0 loads "gfx/StatusEffects.anm2" into it and plays "Charm"...; Render 0078ca00 draws it above the head (-35 * spriteScale.y) + uint8_t _costumeSpriteDescs[0xc]; // vector_CostumeSpriteDesc; ctor 00753da0 zeroes a 3-dword vector at 0x1220..0x1228 right after the ANM2 at 0x110c; shift-0 region bracketed by 0xff8 and 0x1340 + PlayerCostumeMap _playerCostumeMap[15]; // Update 00782af0 walks this+0x1238 (+0xc _isBodyLayer) stride 0x10 for 15 layers; entry 4 index 0x126c: Update/trigger_collectible_effect_removed 00793970 (Mega Mush 625) index*0x130 + _costumeSpriteDescs, -1 = none + uint8_t _pad_0x12ef[0x31]; uint8_t _headAnim[0x18]; // std_string; ctor 00753da0 inits an MSVC std::string at 0x1320 (size 0x1330=0, cap 0x1334=0xf); shift-0 region int _blinkTime; // Lua field HeadFrameDelay = +0x1338; update_shooting 0077b020 sets 8/10 and counts it down int _headDirectionTime; // update_shooting 0077b020 counts it down beside 0x1338 and only refocuses the head while it is <0; bracketed by 0x1338 and 0x1340 (shift 0) int _maxHearts; - int _redHearts; + uint8_t _pad_0x1344[0x4]; int _eternalHearts; int _soulHearts; int _blackHearts; @@ -2272,44 +2248,58 @@ struct Entity_Player { // : Entity (flattened) int _gnawedLeafTimer; // Update 00782af0: HasCollectible(210 Gnawed Leaf) with no action triggers -> ++, >60 adds the null costume; reset to 0 otherwise int _lastActionTriggers; short _bloodLustCounter; // EvaluateItems 00763570 reads it as short beside GetCollectibleEffectNum(411 Blood Lust); TakeDamage 007729d0 increments it - uint8_t _pad_0x137e[0xa]; + short _deadCatLives; // GetExtraLives 007bf670 adds it to the 1up/... counts; TriggerDeath 007a1090 decrements it and removes Dead Cat (81) copies above lives*9-8; TriggerCollectibleRemoved 0078ff90 clamps it to 9*GetCollectibleNum(81) + short _tonsilCounter; // TakeDamage 007729d0 with Tonsil (trinket 97) decrements it and at <1 spawns a tonsil; FUN_007d9ca0 rerolls it to 6 + rand%7 from the trinket RNG; Store/RestoreGameState save it as short + short _tonsilCount; // TakeDamage 007729d0: ++ (cache 0x200 familiars) while < multiplier+1, then TryRemoveTrinket(97 Tonsil) + short _numLeprosy; // AddLeprosy 00759b90: ++ while <3, cache 0x200; EvaluateItems CheckFamiliar(0x79 Leprosy, it) + uint8_t _pad_0x1386[0x2]; int _metronomeCollectibleID; // UseActiveItem 005b39d0 Metronome case stores the rolled item id; GetCollectibleNum 00770ca0 +1 when HasCollectibleEffect(488) and id matches; room_exit 007a6680 clears it - uint8_t _pad_0x138c[0x8]; + int _bleedOutHealth; // TakeDamage 007729d0 sets 600 with Shard of Glass (448) under FLAG_BLEED_OUT self-bleed; Update 00782af0 subtracts GetHitPointsLost, at <1 deals damage and resets 600, tints <150, clears the flag+0 when healed; AddHearts/AddRottenHearts zero it + int _threeDollarBillItem; // HasCollectible 007706e0 / GetCollectibleNum 00770ca0: with 3 Dollar Bill (191) the id stored here counts as owned int _monkeyPawCounter; // TakeDamage 007729d0 decrements it, at <1 TryRemoveTrinket(20 Monkey Paw) and resets to 3 - uint8_t _pad_0x1398[0x24]; + bool _isPlayingExtraAnimation; // PlayExtraAnimation 007abe20 (Lua) sets 1; IsExtraAnimationFinished 007ab110 returns !0x1398 && !0x139a; Update 00782af0 clears it when the animation finishes + bool _isHurtPending; // TakeDamage 007729d0 sets 1 at the end; Update 00782af0 clears it once no item anim (0x1398) and rolls Intruder (575) spider burst + bool _isPlayingItemAnimation; // PlayExtraAnimation 007abe90 (the anm2-swap variant used by AnimatePickup/Collectible) sets 1 and 0x1398=0; IsExtraAnimationFinished 007ab110 tests it + uint8_t _pad_0x139b[0x19]; + uint8_t _holyMantleState; // TakeDamage 007729d0: with Holy Mantle (313) and 0 -> set 1 (shield consumed) else remove null 0x2e; room_exit 007a6680 clears; TriggerNewRoom_TemporaryEffects 007a8350 x = x>1; Restore sets 0/2 + uint8_t _pad_0x13b5[0x1]; + bool _isBrokenRemotePending; // ControlActiveItem sets it when slot 0 is used with Broken Remote (trinket 4); Update 00782af0 then uses Teleport (44) or Teleport 2.0 (419) and clears it with 0x13b8 + uint8_t _pad_0x13b7[0x1]; + int _cursedPennyPending; // ? Update 00782af0 rolls Cursed Penny (trinket 172) teleports with GetTrinketMultiplier when it is non-zero (1 = rand 100 ...), cleared next to 0x13b6; set by Entity_Pickup::HandleCollision 006e8ae0 int _damageCooldown; int _playerType; - uint8_t _pad_0x13c4[0x48]; - uint32_t _markedTarget; // Entity_Effect* - uint32_t _heldEntity; // Entity* - uint8_t _pad_0x1414[0x1c]; + uint8_t _name[0x18]; // std_string; Lua EntityPlayer:GetName 007e9280 returns this+0x13c4 (SSO, cap 0x13d8); RestoreGameState 007ae4b0 assigns EntityConfig_Player::GetDisplayName; AddCollectible logs it + uint32_t _weapons[5]; // Weapon* // release_weapons_and_effects 00757ac0 destroys 0x13e0..0x13ec (vtable+0x14 then deleting dtor) and 0x13dc; FUN_0075ea40 reads charge via vtable+0x1c of 0x13e0..; FUN_0042bca0 creates 0x13e0 (REPENTOGON 0x13d8) + uint8_t _pad_0x13f0[0x40]; int _tractorBeam; - uint8_t _pad_0x1434[0x24]; - uint32_t _megaBlastLaser; // Entity_Laser* - int _rUaWizardTimer; + uint8_t _pad_0x1434[0x10]; + uint8_t _breathOfLifeEffect[0x1c]; // EntityPtr; ? release_weapons_and_effects 00757ac0 removes (vtable +0x28) and unregisters it like the 0x1420..0x144c EntityPtr run; update_effects 00794e50 releases it when the Breath of Life (326) effect is gone; ControlActiveItem drops it on re-trigger float _maxfiredelay; float _shotspeed; uint8_t _pad_0x1468[0x8]; float _damage; float _tearheight; - float _tearfallspeed; - float _tearfallaccel; + uint8_t _pad_0x1478[0x8]; float _tearrange; uint8_t _pad_0x1484[0x4]; BitSet128 _tearFlags; // Lua EntityPlayer.TearFlags via binder 00883ab0: getter 008be780 UserdataValue 16-byte copy ColorMod _tearColor; // Lua EntityPlayer.TearColor via binder 00883c30: getter 008be8a0 -> 008ab7d0 UserdataValue, setter 008be900 copies 0x2c bytes ColorMod _laserColor; - uint8_t _pad_0x14f0[0x18]; - TemporaryEffects _temporaryeffects; - int _speedModifier; - int _fireDelayModifier; - int _damageModifier; + Vector _playerSpriteScale; // Lua EntityPlayer.SpriteScale getter 0060d0a0 returns this+0x14f0/0x14f4; Update 00782af0 Sprite::SetScale(&this+0x14f0); Store/RestoreGameState save it + Vector _bodyScale; // ? Render 0078b640 scales layers whose _playerCostumeMap[i]._isBodyLayer is set by this vector (0x1500 for the others); Update 00782af0 assigns it as body layer scale; saved in GameStatePlayer + Vector _headScale; // ? Render 0078b640 scales non-body layers' pos/size by it; Update 00782af0 offsets head layers by (0x1504-0x14fc)*2.5; saved in GameStatePlayer next to 0x14f8 + uint8_t _pad_0x1508[0x24]; int _tearRangeModifier; int _shotSpeedModifier; // EvaluateItems 00763570 shot-speed block: shotspeed = (this+0x1530 + ...)*0.2 + ...; zeroed under Curse Mist/coop ghost like the kept 0x1520..0x152c modifiers (shift +8) int _luckModifier; // EvaluateItems 00763570 luck block (cache 0x400) adds it, zeroed under Curse Mist/coop ghost (shift +8) int _donateLuck; // DonateLuck 007b2200 (Lua EntityPlayer:DonateLuck) adds the argument here and sets cache flag 0x400; EvaluateItems adds it to luck int _potatoPeelerCounter; // EvaluateItems 00763570: damage += (0x153c+0x1540)*0.2 and Cube of Meat level = 0x153c + GetCollectibleNum(73) + effect num(73) (shift +8) - uint8_t _pad_0x1540[0xc]; + uint8_t _pad_0x1540[0x4]; + short _greedsGulletHearts; // Game::render_debug_player_info 007cfba0 prints "Greed's Gullet: %d (overflow:%d)" from shorts 0x1544/0x1546; update_greeds_gullet 007ce420 compares GetGreedsGulletHearts with it + short _greedsGulletOverflow; // render_debug_player_info 007cfba0 prints it as the overflow; update_greeds_gullet 007ce420 adds it to the heart cap and writes it back + short _greedsGulletRedHearts; // ? update_greeds_gullet 007ce420: when GetGreedsGulletHearts grew past it, adds red hearts and stores the new value here + bool _isUpdatingGreedsGullet; // update_greeds_gullet 007ce420 returns if set, sets 1 on both twins, clears at the end; AddSoulHearts 00758d00 skips its extra handling while set + uint8_t _pad_0x154b[0x1]; float _edenSpeed; // EvaluateItems 00763570 speed block (cache 0x10) writes it into the per-player-type base speed table at Eden (9) and Tainted Eden (0x1e) slots float _edenFireDelay; // EvaluateItems 00763570 fire-delay block (cache 2) adds it when playerType is 9/0x1e (shift +0xc) float _edenDamage; // EvaluateItems 00763570 damage block adds it when playerType is 9/0x1e (shift +0xc) @@ -2320,22 +2310,15 @@ struct Entity_Player { // : Entity (flattened) float _movespeed; float _luck; bool _canFly; - uint8_t _pad_0x1571[0x3]; - uint32_t _cacheFlags; - int8_t _tearDisplacement; - uint8_t _pad_0x1579[0x3]; + uint8_t _pad_0x1571[0xb]; float _meleeDamage; // EvaluateItems' damage before weapon multipliers; the hug's 2x base (characters_9.md) - uint8_t _pad_0x1580[0x80]; + ActiveItemDesc _activeDesc[4]; // ctor 00753da0 zeroes 4 x 0x20 bytes at 0x1580; GetCollectibleNum 00770ca0 counts ids at 0x1580/0x15a0/0x15c0/0x15e0 (stride 0x20, REPENTOGON 0x1574 x 0x1c) int _itemState; - int _itemStateCooldown; - uint32_t _vampireCharmKills; - uint8_t _pad_0x160c[0x4]; - int _bombPlaceDelay; - int _forgottenSwapFormCooldown; + uint8_t _pad_0x1604[0x14]; int _controllerIndex; - int _playerIndex; - uint8_t _pad_0x1620[0x4]; - int _moveDirection; + uint8_t _pad_0x161c[0x4]; + int _glowingHourglassIndex; // ? ctor 00753da0 inits -1; UseActiveItem 005b39d0 / UseCard index GlowingHourglassState (+0x19d80 + it*0x5dc) with it when >= 0 + uint8_t _pad_0x1624[0x4]; int _headDirection; int _fireDirection; Vector _aimDirection; @@ -2345,86 +2328,91 @@ struct Entity_Player { // : Entity (flattened) Vector _movementVector; Vector _tearsOffset; Vector _recentMovementVector; - uint8_t _pad_0x165c[0x4c]; + int _slipperyTimer; // Update 00782af0: 60 while FLAG_SLIPPERY_PHYSICS (1<<27), else counts down to 0; update_body_animations 00779b40 uses it/60 to blend the slippery movement + Vector _lastVelocity; // update_body_animations 00779b40 copies _velocity into 0x1660/0x1664 each frame; GetTearMovementInheritance 007aaea0 uses it *0.6*2 as the tear inherited velocity + uint8_t _pad_0x1668[0x14]; + uint8_t _lastDamageSource[0x4]; // EntityRef; Lua EntityPlayer:GetLastDamageSource 0085e270 returns this+0x167c; try_trigger_astral_projection checks its _type == 6; update_effects zeroes it beside _lastDamageFlags (0x16a8) + int _lastDamageSourceVariant; // DeathScreen::Show 009997c0 "Killed by (type.%d)"; zeroed with _lastDamageFlags in UseCard 007b2230 and update_effects 00794e50 + int _lastDamageSpawnerType; // DeathScreen::Show 009997c0 "spawned by (%d.%d)" first value + int _lastDamageSpawnerVariant; // DeathScreen::Show 009997c0 "spawned by (%d.%d)" second value + uint8_t _pad_0x168c[0x1c]; uint64_t _lastDamageFlags; - uint8_t _pad_0x16b0[0x4]; + int _roomDamageTaken; // TakeDamage 007729d0 adds the damage amount; room_exit 007a6680 resets it to 0 (beside _totalDamageTaken 0x16b4) int _totalDamageTaken; uint8_t _pad_0x16b8[0x8]; uint32_t _trinketsID[2]; // not in the input list (REPENTOGON 0x16b0): HasGoldenTrinket 00771620 and FUN_007a42b0 loop 2 slots at 0x16c0 masking id 0x7fff / golden 0x8000 - uint8_t _collectibleCounts[0x80]; // std_vector_int; GetCollectibleNum 00770ca0 indexes begin 0x16c8 / end 0x16cc by collectible id (shift +0x10) + uint8_t _collectibleCounts[0xc]; // std_vector_int; GetCollectibleNum 00770ca0 indexes begin 0x16c8 / end 0x16cc by collectible id (shift +0x10) + uint8_t _pillEffectUses[0x68]; // std_vector_int; UsePill 007c4180 ++[pillEffect] (twice for horse pills), unlock 0x182 when [43]>4; AddPrettyFly 007abdf0 ++[10 PILLEFFECT_PRETTY_FLY] then cache 0x200; remove_twin merges the counts + uint8_t _levelEffectItems[0xc]; // std_vector_int; ? TriggerNewRoom_TemporaryEffects 007a8350 re-adds every id (negative = ~index into the level's list) as a temporary effect each room; level_start 007a4ba0 clears the vector uint8_t _smeltedTrinkets[0xc]; // vector_SmeltedTrinketDesc; HasGoldenTrinket 00771620 indexes *(this+0x1748) by trinket id *4 and tests the short at +2; TryRemoveSmeltedTrinket 00772260 (shift +0x10) - uint8_t _voidedCollectibles[0x4c]; // std_vector_int; VoidHasCollectible 007711a0: when an active slot holds 477 Void, scans begin 0x1754 / end 0x1758 for the id (shift +0x10) + uint8_t _voidedCollectibles[0x1c]; // std_vector_int; VoidHasCollectible 007711a0: when an active slot holds 477 Void, scans begin 0x1754 / end 0x1758 for the id (shift +0x10) + uint8_t _collectibleRNGs[0xc]; // vector_RNG; GetCollectibleRNG 005b17c0: id<0 -> begin, bounds (end 0x1774 - begin)>>4, returns begin + id*0x10; UseActiveItem/IncrementPlayerFormCounter use RNG at begin+id*0x10 + uint8_t _trinketRNGs[0xc]; // vector_RNG; ctor 00753da0 zeroes begin/end/cap 0x177c..0x1784 after _collectibleRNGs; FUN_007d9ca0 uses *(0x177c)+0x610 (= trinket 97 * 0x10) for Tonsil; ControlActiveItem uses +0x950 (trinket 149) + uint8_t _pillRNGs[0xc]; // vector_RNG; UsePill 007c4180 indexes begin+effect*0x10 (bounds (0x178c-0x1788)>>4); StoreGameState saves the seeds + uint8_t _cardRNGs[0xc]; // vector_RNG; UseCard 007b2230 RNG at cardType*0x10 + begin; StoreGameState saves (0x1798-0x1794)>>4 seeds int _pocketSlots[8]; // AddPocketItem/RemovePocketItem/GetMaxPocketItems: 4 (id, type) pairs, type 0 pill 1 card 2 pocket active uint32_t _actionHoldDrop; // FUN_007a42b0 (called by Update): ++ while ACTION_DROP (11) is pressed, 0 when released; >=0x79 frames drops both trinkets and pocket items QueueItemData _queuedItem; // Lua EntityPlayer.QueuedItem via binder 008840c0: getter 008bebc0 UserdataValue 0x14-byte copy - uint8_t _pad_0x17cc[0x58]; + uint8_t _pad_0x17cd[0xb]; + bool _isHeldItemVisible; // Update 00782af0 stores IsHeldItemVisible() here each frame and tests it later in the same update + uint8_t _pad_0x17d9[0x3]; + int _playerForms[16]; // IncrementPlayerFormCounter 0075e320 writes this+0x17dc+form*4 (as _pocketSlots[form+0xf]); form 15 at 0x1818 recounts Necronomicon/Missing Page 2/trinket Missing Page; level_start 007a4ba0 recharges Necronomicon when it is >2 + uint32_t _playerFormsRewarded; // IncrementPlayerFormCounter 0075e320 tests bit (1<0 (or Azazel's Rage 699 effect count == 4) tints the player with a sin flash, decremented each frame int _babySkin; - uint8_t _pad_0x1af0[0x28c]; - uint8_t _movingBoxContents[0xc]; // vector_EntitySaveState + uint8_t _pad_0x1af0[0x20]; + bool _hasBabyRoomShield; // ? room_enter 007a6c50 sets 1; TakeDamage 007729d0 for a co-op baby (variant 1) with _babySkin 11 consumes it and ignores the hit + uint8_t _pad_0x1b11[0xb]; + Vector _moveToTarget; // Update 00782af0: while != (0,0) moves the player 0.18 of the way toward it (SetPosition); FUN_005cd780 sets it, GridEntity_TrapDoor::Update / RoomTransition::Update aim it at a grid cell (col*40+40, row*40+120); level_start / release_weapons_and_effects zero it + int _delayedSfxId; // PlayDelayedSFX 007cb5d0 (ZHL soundEffectID) stores it; Update 00782af0 plays it when 0x1b2c counts down to 0 + float _delayedSfxVolume; // PlayDelayedSFX 007cb5d0 stores the volume (xmm2) here + int _delayedSfxDelay; // PlayDelayedSFX 007cb5d0 stores soundDelay; Update 00782af0 decrements and plays 0x1b24 at 0; room_enter sets 30/60 + int _delayedSfxFrameDelay; // PlayDelayedSFX 007cb5d0 stores frameDelay, passed as SoundEffects::Play frameDelay + uint8_t _pad_0x1b34[0x254]; int _boneHearts; - int _boneHeartsMask; - int _hallowedGroundCountdown; - uint8_t _pad_0x1d94[0x4]; + uint8_t _pad_0x1d8c[0x8]; + short _damageMultiplierStacks; // ? FUN_0060d0c0 increments it; EvaluateItems 00763570 damage *= pow(1.5, it) when >0; Update 00782af0 re-evaluates cache 1 when it differs from 0x1d96 and resets it to 0 later + short _lastDamageMultiplierStacks; // ? Update 00782af0 copies 0x1d94 here after setting cache 1 when they differ int _subPlayer; - uint8_t _pad_0x1d9c[0x4]; + uint32_t _forgottenBody; // Entity_Familiar* // FUN_007cbef0 (The Soul, type 17) SpawnEx(3, 900 Forgotten body) and keeps it here (Remove via vtable+0x28 first); init_player_type_state / MorphToCoopGhost test it int _brokenHearts; int _rottenHearts; int _effectiveSoulCharge; int _effectiveBloodCharge; - uint8_t _pad_0x1db0[0x20]; - uint32_t _urnSouls; + uint8_t _pad_0x1db0[0x24]; int _numGigaBombs; - uint8_t _pad_0x1dd8[0x14]; - uint8_t _history[0x14]; // History; DischargeActiveItem 007ac7e0 calls History::AddHistoryItem 00721a70 with ECX = this+0x1dec; ctor 00753da0 inits 0x1dec..0x1dfc (owner ptr = this at +0x10) right before _inventory 0x1e00 (shift +0x14) + uint8_t _pad_0x1dd8[0x4]; + uint8_t _pendingWisps[0x10]; // std_vector_int; TriggerRoomClear 007a8fd0 calls AddWisp(id) for every id of begin 0x1ddc..end 0x1de0, then empties it; ctor zeroes the 3 dwords + History _history; // DischargeActiveItem 007ac7e0 calls History::AddHistoryItem 00721a70 with ECX = this+0x1dec; ctor 00753da0 inits 0x1dec..0x1dfc (owner ptr = this at +0x10) right before _inventory 0x1e00 (shift +0x14) int _inventory[16]; // Tainted Isaac's slots of history indices, -1 empty; slot 0 dropped by a pickup past GetMaxInventorySize (characters_9.md) uint8_t _pad_0x1e40[0x14]; uint8_t _afterImageFrames[0x14]; // deque_afterImageFrames; Render 0078ca00 walks a deque (map 0x1e58, mapsize 0x1e5c, off 0x1e60, size 0x1e64) of frames and redraws the player at each stored position with alpha frame/10 (the after images); ctor 00753da0 inits it with a proxy (shift +0x1c) uint8_t _twinPlayer[0x4]; // EntityPtr; InitTwin 007d2000 sets it on both twins with the EntityPtr multiset erase/insert; GetOtherTwin 00417820 returns it (same member as the Lua _otherTwin; shift +0x1c) uint32_t _backupPlayer; // Entity_Player* // GetCollectibleNum 00770ca0 adds GetCollectibleNum(*(this+0x1e6c)) for tag-0x40000000 items and AddCostume 0075d1d0 mirrors costumes onto it, as REPENTOGON's GetOwners/GetTotalCount do with _backupPlayer - uint8_t _pad_0x1e70[0x4]; + float _heightVelocity; // Update 00782af0: posOffset.y += it, then += 1.1 (0.6 with flag 0x4000000) per frame like gravity, reset to 0 on landing; room_enter zeroes it; update_body_animations bails while it is <0 int _redStewBonusDuration; // EvaluateItems 00763570 damage += (it/10)*0.04 while >0; update_effects 00794e50 counts it down and re-evaluates at each /10 step; UseActiveItem 005b39d0 adds 2700 behind a HasCollectible test; bracketed by _backupPlayer 0x1e6c and Mars 0x1e8c, all +0x1c - uint8_t _pad_0x1e78[0x14]; + uint8_t _pad_0x1e78[0x8]; + uint8_t _salvationEffect[0xc]; // EntityPtr; update_effects 00794e50 spawns it with Salvation (696), removes it (vtable +0x28) without it; Update 00782af0 keeps it on the player and spins its sprite by frame count; release_weapons_and_effects removes it int _marsUnk1; // ctor 00753da0 inits it to 90; update_body_animations 00779b40 copies it into the Mars cooldown 0x1e90 on a dash (it is the dash cooldown length) int _marsCooldown; // update_body_animations 00779b40: a Mars (593) double tap dashes only while it is <1, then it is set from 0x1e8c int _marsUnk2; // ctor inits -1; update_body_animations 00779b40 stores the dash direction (the tapped action) here on a Mars dash @@ -2432,20 +2420,35 @@ struct Entity_Player { // : Entity (flattened) uint8_t _pad_0x1e99[0x3]; int _marsLastTapDirection; // not in REPENTOGON: update_body_animations 00779b40 stores the last tapped move action (0..3); a repeat within 11 frames triggers the Mars dash int _marsTapFrames; // not in REPENTOGON: update_body_animations 00779b40 frames since the last move tap, ++ each frame capped at 10000, reset to 0 on a tap; <0xb means double tap - uint8_t _pad_0x1ea4[0xc]; + uint8_t _pad_0x1ea4[0x4]; + int _poisonDamageFrames; // ? Update 00782af0: ++ each frame while the pending damage flags at Entity +0x18 (OR-ed by TakeDamage 007729d0 for 0-damage hits) hold DAMAGE_POISON_BURN 0x8000 (cleared by Evil Charm 632), plays SFX 590 and tints by min(it/30,1); 0 when the bit is gone + uint8_t _pad_0x1eac[0x4]; float _rockBottomMoveSpeed; // EvaluateItems 00763570 Rock Bottom (562) block, cache 0x10: movespeed = max(movespeed, this+0x1eb0) and stores it back (shift +0x1c) float _rockBottomMaxFireDelay; // EvaluateItems 00763570 Rock Bottom block, cache 2: stores max(30/(maxfiredelay+1), it), the tears rate, then rebuilds maxfiredelay from it float _rockBottomDamage; // EvaluateItems 00763570 Rock Bottom block, cache 1: damage = max(damage, it), stored back float _rockBottomTearRange; // EvaluateItems 00763570 Rock Bottom block, cache 8: tearrange = max(tearrange, it), stored back float _rockBottomShotSpeed; // EvaluateItems 00763570 Rock Bottom block, cache 4: shotspeed = max(shotspeed, it), stored back float _rockBottomLuck; // EvaluateItems 00763570 Rock Bottom block, cache 0x400: luck = max(luck, it), stored back - uint8_t _pad_0x1ec8[0x14]; + uint8_t _pad_0x1ec8[0x4]; + int _reverseEmpressMaxHearts; // UseCard 007b2230 Reverse Empress (59, null 0x3e) ++ per temporary heart container; trigger_collectible_effect_removed 00793970 null 0x3e removes that many and zeroes it; trigger_max_hearts_removed takes from it first + int _reverseChariotMoveCooldown; // update_body_animations 00779b40 under null effect 63 (added by card 63 Reverse Chariot): moving input gives a velocity lurch and sets 5, counts down; 0 without the effect + int _reverseSunBoneHearts; // UseCard 007b2230 Reverse Sun (75) converts red heart containers to bone hearts and stores the count; trigger_collectible_effect_removed null 0x42 converts them back while >0 + uint8_t _pad_0x1ed8[0x4]; uint32_t _revelationChargeTimer; // update_shooting 0077b020: with Revelation (643) fires the laser once it is >150 (shift +0x1c) uint32_t _montezumaChargeTimer; // update_shooting 0077b020: with Montezuma's Revenge (680) fires the backward laser once it is >150 (shift +0x1c) - uint8_t _pad_0x1ee4[0x10]; + uint32_t _montezumaLaser; // Entity* // GetBodyMoveDirection 00779900: with Montezuma's Revenge (680) uses its angle (+0x41c)+180 when it is non-null and _type == 7 (laser) + float _jupiterCharge; // update_body_animations 00779b40: with Jupiter (594) += speedMult/60 up to 1 while standing still, drains while moving (fart sounds >0.3); 0 without the item + uint8_t _holyMantleStacks; // ? TriggerNewRoom_TemporaryEffects 007a8350 re-adds the Holy Mantle (313, item config +0x4e4) effect (it >> 4) times each new room; FUN_007dafb0 subtracts the low nibble, FUN_007daff0/FUN_007db0a0 rewrite it; saved in GameStatePlayer + uint8_t _pad_0x1eed[0x3]; + int _ductTapeMode; // update_body_animations 00779b40: golden Duct Tape (trinket 109, multiplier >=2) drop action cycles 1..3, 0 otherwise; TriggerTrinketAdded 007ad860 sets 1; saved as a byte uint32_t _maggyHealthDrainCooldown; // Update 00782af0: set to 300 and counted down; at <1 drains one red/soul heart (Tainted Magdalene temporary hearts); TakeDamage 007729d0 resets it to 0 (shift +0x24) int _maggySwingCooldown; // same member as db/fields.tsv _hugCountdown (Tainted Magdalene swing: 9 on a swing, swings again under 3); REPENTOGON 0x1ed4 +0x24 like its neighbour 0x1ef4 - uint8_t _pad_0x1efc[0x30]; + float _jellyBellyBounceTimer; // TakeDamage 007729d0: Jelly Belly (690) deflect sets 14/20; Update 00782af0 decrements by speedMult and wobbles sprite scale with sin(t*2pi/10) + uint8_t _pad_0x1f00[0x8]; + int _forgottenBodyRoomIdx; // FUN_007cbef0 / init_player_type_state 007cc200 split it into room idx%169 and dimension idx/169 to find the room the body is in, -99999 = none (level_start resets it) + Vector _forgottenBodyPos; // FUN_007cbef0 spawns the Forgotten body here when 0x1f08 != -99999; PlayerManager::replace_player copies 0x1f08..0x1f10 and resets the source + uint8_t _pad_0x1f14[0x4]; + uint8_t _echoChamberItems[0x14]; // deque_EchoChamberItem; TriggerEchoChamber: with Echo Chamber (700) replays every queued (id, type) pair (type 1 card -> UseCard, 0 pill -> UsePill), push_back the new one, keeps at most 3 (size 0x1f28, off 0x1f24); ctor builds the deque proxy int _suplexState; // update_suplex 007d4390: state machine (1 aim, 2 grab, 3 leap up, 5 super leap) at this+0x7cb*4 int _suplexAimCountdown; // update_suplex 007d4390 counts it down (this+0x7cc*4) and ends the aim at <=0; update_effects 00794e50 sets it to 60 when Suplex starts Vector _suplexTargetPos; // update_suplex 007d4390 stores the held entity's (or own) position here on LeapUp (this+0x7cd/0x7ce*4) @@ -2453,36 +2456,58 @@ struct Entity_Player { // : Entity (flattened) int8_t _bagOfCraftingContent[8]; // not in the input list (REPENTOGON 0x1f20): FUN_007a42b0 rotates the 8 bytes at 0x1f44 on the drop button when playerType is 23 Tainted Cain (shift +0x24) uint8_t _bagOfCraftingOutput[0x8]; // BagOfCraftingOutput; ControlActiveItem 00791a40: with item state 710 Bag of Crafting, holding 30 frames queues collectible *(this+0x1f4c) from pool *(this+0x1f50), then clears it to 0/-1 with the 8-byte bag at 0x1f44; UseActiveItem 005b39d0 fills both int _poopMana; - uint8_t _pad_0x1f58[0x24]; - int _eveSumptoriumCharge; - uint8_t _itemWispsList[0x38]; // std_map_int_int + int8_t _poopSpellQueue[6]; // update_bomb_input 00780f40 UsePoopSpell(0x1f58) then shifts 0x1f59..0x1f5d down; UseActiveItem does the same (REPENTOGON 0x1f34, shift +0x24) + uint8_t _pad_0x1f5e[0x1a]; + int _bagOfCraftingHoldFrames; // ControlActiveItem 00791a40: with item state 710 and an output, ++ while held, >29 crafts and resets; FUN_0075ea40 renders ((x-5)/25)*100 % charge; UseActiveItem zeroes + uint8_t _pad_0x1f7c[0xc]; + float _forgottenBHeight; // Update 00782af0: for Tainted Forgotten (type 35) += 0x1f8c each frame, clamped at 0 with a -0.45 bounce, added to the render y; PlayerManager::replace_player copies it with 0x1f8c and 0x1e70 + float _forgottenBHeightVelocity; // Update 00782af0: Tainted Forgotten (type 35) vertical speed, +0.6 per frame, *-0.45 on landing when >=2, reduced by 0x1f88*0.2 while falling + uint8_t _pad_0x1f90[0x14]; + uint8_t _itemCards[0xc]; // std_vector_uint; AddItemCard 007d8240 push_back up to min(Starter Deck count+3, 20) entries, spawning the oldest as card 300 when full; pockets_rotate 007a42b0 rotates it; PlayerHUD::Update draws it + uint8_t _roomTemporaryCollectibles[0x8]; // std_map_int_int; ctor builds a tree head at 0x1fb0 (size 0x1fb4); ClearTemporaryEffects 007907a0 walks it and RemoveCollectible(id) count (node+0x14) times, zeroes the counts and erases the tree int _modelingClayEffect; int _keepersSackBonus; // FUN_007d8630 adds coins spent here when HasCollectible(716 Keeper's Sack); EvaluateItems 00763570 turns it into damage/range/speed bonuses (shift +0x24) - uint8_t _pad_0x1fc0[0x44]; + uint8_t _darkEsau[0x4]; // EntityPtr; NpcAI::ENTITY_DARK_ESAU 005542e0 checks spawner player's +0x1fc0 == npc; DischargeActiveItem 007ac7e0 / release_weapons_and_effects 00757ac0 move/clear it with the EntityPtr multiset erase/insert + bool _isLevelStartPending; // level_start 007a4ba0 sets it on the _backupPlayer and clears its own; Update 00782af0 runs level_start(1) once it is set; saved + uint8_t _pad_0x1fc5[0xf]; + uint8_t _extraCollectibleCounts[0x30]; // std_vector_uint8; ? GetCollectibleNum 00770ca0 adds byte begin[id] (bounds end 0x1fd8 - begin) to the count; is_achievement_79_unlocked 007db860 reads byte [0x8f] bool _darkArtsBlastPending; // set as Dark Arts ends; the blast waits for the last snare (characters_9.md) uint8_t _pad_0x2005[0x3]; float _darkArtsDamage; // the snares' summed damage, the end blast's DamageRadius damage (characters_9.md) uint32_t _darkArtsLastSnare; // Entity* // the newest 1000.194 Dark Snare (characters_9.md) - uint8_t _pad_0x2010[0x1c]; + uint8_t _pad_0x2010[0x14]; + int _grantedCollectibleCountdown; // ? FUN_007d8740 adds to it capped at 4 with the flags in 0x2028; update_effects 00794e50 counts it down and clears 0x2028 at 0; EvaluateItems gives +1.5 tears/+1 while >0 + uint32_t _grantedCollectibleFlags; // HasCollectible 007706e0 / GetCollectibleNum 00770ca0 report Scorpio 305 (0x10), Fire Mind 257 (8), Ball of Tar 231 (0x20), Sacred Heart 182 (0x40) while the bit is set; set by FUN_007d8740, cleared by update_effects bool _hasCurseMistEffect; uint8_t _pad_0x202d[0x3]; - uint8_t _consumablesBackup[0x60]; // ConsumableData; AddCurseMistEffect 007d8980 copies coins/keys/bombs/golden key/golden bomb/soul charge/giga bombs/poop mana/blood charge into 0x2030..0x204c in ConsumableData order (shift +0x1c) + uint8_t _consumablesBackup[0x20]; // ConsumableData; AddCurseMistEffect 007d8980 copies coins/keys/bombs/golden key/golden bomb/soul charge/giga bombs/poop mana/blood charge into 0x2030..0x204c in ConsumableData order (shift +0x1c) + uint8_t _curseMistFamiliars[0xc]; // vector_FamiliarData; AddCurseMistEffect 007d8980 pushes 0x34-byte familiar records into begin 0x2050 / end 0x2054 / cap 0x2058; RemoveCurseMistEffect 007d8d20 respawns from it; StoreGameState saves it + int _curseMistRedHearts; // AddCurseMistEffect stores _redHearts here for Keeper (type 14) before AddMaxHearts(0); RemoveCurseMistEffect restores _redHearts from it + int _curseMistPocketSlots[8]; // AddCurseMistEffect copies _pocketSlots[0..7] here and clears them; RemoveCurseMistEffect copies back; MorphToCoopGhost moves it into 0x20ac + uint32_t _curseMistTrinkets[2]; // AddCurseMistEffect saves _trinketsID[0..1] here; RemoveCurseMistEffect restores them; MorphToCoopGhost moves and zeroes it + Vector _minecartOffset; // AttachMinecart stores pos - minecart._targetPosition here (x 0x2088, y 0x208c); ctor zeroes both uint8_t _wildCardItemType; // UseCard 007b78de case CARD_WILD (80): switches on this byte (0 pill, 1 card, 2 active item) (shift +0x2c) uint8_t _pad_0x2091[0x3]; int _wildCardItem; // UseCard case CARD_WILD (80) reuses this id as the pill/card/active item; 0x2098 holds the pill flags / active var data passed with it - uint8_t _pad_0x2098[0x4]; + int _wildCardVarData; // ControlActiveItem 00791a40 stores the active slot's _varData (pill color) beside _wildCardItem; UseCard 007b2230 Wild Card UsePill(_wildCardItem, it, 0x180); saved int _samsonBerserkCharge; // Lua EntityPlayer.SamsonBerserkCharge via binder 00884240: getter 008becf0 FUN_0085bfd0 signed dword, setter checkinteger dword float _ibsCharge; // Lua EntityPlayer.IBSCharge via binder 00883940: getter 008be6b0 FUN_0085c050 pushnumber, setter checknumber -> float uint8_t _pad_0x20a4[0x5]; bool _isCoopGhost; - uint8_t _pad_0x20aa[0x2a]; + uint8_t _pad_0x20aa[0x2]; + int _ghostPocketSlots[8]; // MorphToCoopGhost copies _pocketSlots[0..7] (or the Curse Mist backup 0x2060) here; RevivePlayerGhost restores _pocketSlots from it; Store/RestoreGameState + uint32_t _ghostTrinkets[2]; // MorphToCoopGhost stores the trinkets here; RevivePlayerGhost restores _trinketsID[0..1] from 0x20cc/0x20d0 uint32_t _playerHUD; // PlayerHUD* // Update 00782af0 (00782b86): MOV ECX,[EDI+0x20d4]; if non-null CALL PlayerHUD::Update 00842230 (shift +0x2c) - uint8_t _pad_0x20d8[0x10]; + uint8_t _pad_0x20d8[0x4]; + uint8_t _greedResetCollectibles[0xc]; // std_vector_int; ? ResetPlayer 007daed0 re-adds every id of begin 0x20dc..end 0x20e0 via AddCollectible; Game::reset_players_for_greed 007db3b0 copies it (also for the backup player) bool _hasUnlistedRestoreState; // PlayerManager::replace_player 009bee80 sets it to 1 after StoreGameState into 0x20ec; when set on the incoming player it restores from 0x20ec and clears it uint8_t _pad_0x20e9[0x3]; uint8_t _unlistedRestoreState[0x5dc]; // GameStatePlayer; PlayerManager::replace_player 009bee80: GameStatePlayer::Init + Entity_Player::StoreGameState on this+0x20ec, and RestoreGameState from it later uint32_t _replacedPlayer; // Entity_Player* // PlayerManager::replace_player 009bee80 writes the other player into 0x26c8 of both the old and the new player (shift +0x4c: GameStatePlayer grew by 0x20) }; +static_assert(offsetof(Entity_Player, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Player, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Player, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Player, _index) == 0x20); static_assert(offsetof(Entity_Player, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Player, _type) == 0x28); @@ -2494,81 +2519,73 @@ static_assert(offsetof(Entity_Player, _sprite) == 0x48); static_assert(offsetof(Entity_Player, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Player, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Player, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Player, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Player, _flags) == 0x168); -static_assert(offsetof(Entity_Player, _valid) == 0x170); +static_assert(offsetof(Entity_Player, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Player, _visible) == 0x171); static_assert(offsetof(Entity_Player, _exists) == 0x172); static_assert(offsetof(Entity_Player, _dead) == 0x173); -static_assert(offsetof(Entity_Player, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Player, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Player, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Player, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Player, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Player, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Player, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Player, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Player, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Player, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Player, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Player, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Player, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Player, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Player, _color) == 0x1b8); static_assert(offsetof(Entity_Player, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Player, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Player, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Player, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Player, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Player, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Player, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Player, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Player, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Player, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Player, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Player, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Player, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Player, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Player, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Player, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Player, _mass) == 0x2d4); -static_assert(offsetof(Entity_Player, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Player, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Player, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Player, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Player, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Player, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Player, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Player, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Player, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Player, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Player, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Player, _charmSource) == 0x240); +static_assert(offsetof(Entity_Player, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Player, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Player, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Player, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Player, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Player, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Player, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Player, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Player, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Player, _config) == 0x330); static_assert(offsetof(Entity_Player, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Player, _pos) == 0x33c); -static_assert(offsetof(Entity_Player, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Player, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Player, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Player, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Player, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Player, _velocity) == 0x360); +static_assert(offsetof(Entity_Player, _baseFriction) == 0x368); static_assert(offsetof(Entity_Player, _friction) == 0x36c); -static_assert(offsetof(Entity_Player, _size) == 0x370); -static_assert(offsetof(Entity_Player, _health) == 0x380); -static_assert(offsetof(Entity_Player, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Player, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Player, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Player, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Player, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Player, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Player, _mass) == 0x37c); +static_assert(offsetof(Entity_Player, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Player, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Player, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Player, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Player, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Player, _parent) == 0x3bc); static_assert(offsetof(Entity_Player, _child) == 0x3c0); static_assert(offsetof(Entity_Player, _target) == 0x3c4); static_assert(offsetof(Entity_Player, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Player, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Player, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Player, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Player, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Player, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Player, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Player, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Player, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Player, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Player, _isControlsEnabled) == 0x410); static_assert(offsetof(Entity_Player, _controlsCooldown) == 0x414); +static_assert(offsetof(Entity_Player, _fireBlockCooldown) == 0x418); static_assert(offsetof(Entity_Player, _bodySprite) == 0x41c); +static_assert(offsetof(Entity_Player, _crownOfLightSprite) == 0x530); +static_assert(offsetof(Entity_Player, _darkPrincesCrownSprite) == 0x644); +static_assert(offsetof(Entity_Player, _chargeBarSprites) == 0x758); static_assert(offsetof(Entity_Player, _bloodGushSprite) == 0xee4); static_assert(offsetof(Entity_Player, _heldSprite) == 0xff8); +static_assert(offsetof(Entity_Player, _statusEffectSprite) == 0x110c); static_assert(offsetof(Entity_Player, _costumeSpriteDescs) == 0x1220); +static_assert(offsetof(Entity_Player, _playerCostumeMap) == 0x122c); static_assert(offsetof(Entity_Player, _headAnim) == 0x1320); static_assert(offsetof(Entity_Player, _blinkTime) == 0x1338); static_assert(offsetof(Entity_Player, _headDirectionTime) == 0x133c); static_assert(offsetof(Entity_Player, _maxHearts) == 0x1340); -static_assert(offsetof(Entity_Player, _redHearts) == 0x1344); static_assert(offsetof(Entity_Player, _eternalHearts) == 0x1348); static_assert(offsetof(Entity_Player, _soulHearts) == 0x134c); static_assert(offsetof(Entity_Player, _blackHearts) == 0x1350); @@ -2584,34 +2601,46 @@ static_assert(offsetof(Entity_Player, _numBlueSpiders) == 0x1370); static_assert(offsetof(Entity_Player, _gnawedLeafTimer) == 0x1374); static_assert(offsetof(Entity_Player, _lastActionTriggers) == 0x1378); static_assert(offsetof(Entity_Player, _bloodLustCounter) == 0x137c); +static_assert(offsetof(Entity_Player, _deadCatLives) == 0x137e); +static_assert(offsetof(Entity_Player, _tonsilCounter) == 0x1380); +static_assert(offsetof(Entity_Player, _tonsilCount) == 0x1382); +static_assert(offsetof(Entity_Player, _numLeprosy) == 0x1384); static_assert(offsetof(Entity_Player, _metronomeCollectibleID) == 0x1388); +static_assert(offsetof(Entity_Player, _bleedOutHealth) == 0x138c); +static_assert(offsetof(Entity_Player, _threeDollarBillItem) == 0x1390); static_assert(offsetof(Entity_Player, _monkeyPawCounter) == 0x1394); +static_assert(offsetof(Entity_Player, _isPlayingExtraAnimation) == 0x1398); +static_assert(offsetof(Entity_Player, _isHurtPending) == 0x1399); +static_assert(offsetof(Entity_Player, _isPlayingItemAnimation) == 0x139a); +static_assert(offsetof(Entity_Player, _holyMantleState) == 0x13b4); +static_assert(offsetof(Entity_Player, _isBrokenRemotePending) == 0x13b6); +static_assert(offsetof(Entity_Player, _cursedPennyPending) == 0x13b8); static_assert(offsetof(Entity_Player, _damageCooldown) == 0x13bc); static_assert(offsetof(Entity_Player, _playerType) == 0x13c0); -static_assert(offsetof(Entity_Player, _markedTarget) == 0x140c); -static_assert(offsetof(Entity_Player, _heldEntity) == 0x1410); +static_assert(offsetof(Entity_Player, _name) == 0x13c4); +static_assert(offsetof(Entity_Player, _weapons) == 0x13dc); static_assert(offsetof(Entity_Player, _tractorBeam) == 0x1430); -static_assert(offsetof(Entity_Player, _megaBlastLaser) == 0x1458); -static_assert(offsetof(Entity_Player, _rUaWizardTimer) == 0x145c); +static_assert(offsetof(Entity_Player, _breathOfLifeEffect) == 0x1444); static_assert(offsetof(Entity_Player, _maxfiredelay) == 0x1460); static_assert(offsetof(Entity_Player, _shotspeed) == 0x1464); static_assert(offsetof(Entity_Player, _damage) == 0x1470); static_assert(offsetof(Entity_Player, _tearheight) == 0x1474); -static_assert(offsetof(Entity_Player, _tearfallspeed) == 0x1478); -static_assert(offsetof(Entity_Player, _tearfallaccel) == 0x147c); static_assert(offsetof(Entity_Player, _tearrange) == 0x1480); static_assert(offsetof(Entity_Player, _tearFlags) == 0x1488); static_assert(offsetof(Entity_Player, _tearColor) == 0x1498); static_assert(offsetof(Entity_Player, _laserColor) == 0x14c4); -static_assert(offsetof(Entity_Player, _temporaryeffects) == 0x1508); -static_assert(offsetof(Entity_Player, _speedModifier) == 0x1520); -static_assert(offsetof(Entity_Player, _fireDelayModifier) == 0x1524); -static_assert(offsetof(Entity_Player, _damageModifier) == 0x1528); +static_assert(offsetof(Entity_Player, _playerSpriteScale) == 0x14f0); +static_assert(offsetof(Entity_Player, _bodyScale) == 0x14f8); +static_assert(offsetof(Entity_Player, _headScale) == 0x1500); static_assert(offsetof(Entity_Player, _tearRangeModifier) == 0x152c); static_assert(offsetof(Entity_Player, _shotSpeedModifier) == 0x1530); static_assert(offsetof(Entity_Player, _luckModifier) == 0x1534); static_assert(offsetof(Entity_Player, _donateLuck) == 0x1538); static_assert(offsetof(Entity_Player, _potatoPeelerCounter) == 0x153c); +static_assert(offsetof(Entity_Player, _greedsGulletHearts) == 0x1544); +static_assert(offsetof(Entity_Player, _greedsGulletOverflow) == 0x1546); +static_assert(offsetof(Entity_Player, _greedsGulletRedHearts) == 0x1548); +static_assert(offsetof(Entity_Player, _isUpdatingGreedsGullet) == 0x154a); static_assert(offsetof(Entity_Player, _edenSpeed) == 0x154c); static_assert(offsetof(Entity_Player, _edenFireDelay) == 0x1550); static_assert(offsetof(Entity_Player, _edenDamage) == 0x1554); @@ -2621,17 +2650,11 @@ static_assert(offsetof(Entity_Player, _edenLuck) == 0x1560); static_assert(offsetof(Entity_Player, _movespeed) == 0x1568); static_assert(offsetof(Entity_Player, _luck) == 0x156c); static_assert(offsetof(Entity_Player, _canFly) == 0x1570); -static_assert(offsetof(Entity_Player, _cacheFlags) == 0x1574); -static_assert(offsetof(Entity_Player, _tearDisplacement) == 0x1578); static_assert(offsetof(Entity_Player, _meleeDamage) == 0x157c); +static_assert(offsetof(Entity_Player, _activeDesc) == 0x1580); static_assert(offsetof(Entity_Player, _itemState) == 0x1600); -static_assert(offsetof(Entity_Player, _itemStateCooldown) == 0x1604); -static_assert(offsetof(Entity_Player, _vampireCharmKills) == 0x1608); -static_assert(offsetof(Entity_Player, _bombPlaceDelay) == 0x1610); -static_assert(offsetof(Entity_Player, _forgottenSwapFormCooldown) == 0x1614); static_assert(offsetof(Entity_Player, _controllerIndex) == 0x1618); -static_assert(offsetof(Entity_Player, _playerIndex) == 0x161c); -static_assert(offsetof(Entity_Player, _moveDirection) == 0x1624); +static_assert(offsetof(Entity_Player, _glowingHourglassIndex) == 0x1620); static_assert(offsetof(Entity_Player, _headDirection) == 0x1628); static_assert(offsetof(Entity_Player, _fireDirection) == 0x162c); static_assert(offsetof(Entity_Player, _aimDirection) == 0x1630); @@ -2640,80 +2663,97 @@ static_assert(offsetof(Entity_Player, _lastDirection) == 0x163c); static_assert(offsetof(Entity_Player, _movementVector) == 0x1644); static_assert(offsetof(Entity_Player, _tearsOffset) == 0x164c); static_assert(offsetof(Entity_Player, _recentMovementVector) == 0x1654); +static_assert(offsetof(Entity_Player, _slipperyTimer) == 0x165c); +static_assert(offsetof(Entity_Player, _lastVelocity) == 0x1660); +static_assert(offsetof(Entity_Player, _lastDamageSource) == 0x167c); +static_assert(offsetof(Entity_Player, _lastDamageSourceVariant) == 0x1680); +static_assert(offsetof(Entity_Player, _lastDamageSpawnerType) == 0x1684); +static_assert(offsetof(Entity_Player, _lastDamageSpawnerVariant) == 0x1688); static_assert(offsetof(Entity_Player, _lastDamageFlags) == 0x16a8); +static_assert(offsetof(Entity_Player, _roomDamageTaken) == 0x16b0); static_assert(offsetof(Entity_Player, _totalDamageTaken) == 0x16b4); static_assert(offsetof(Entity_Player, _trinketsID) == 0x16c0); static_assert(offsetof(Entity_Player, _collectibleCounts) == 0x16c8); +static_assert(offsetof(Entity_Player, _pillEffectUses) == 0x16d4); +static_assert(offsetof(Entity_Player, _levelEffectItems) == 0x173c); static_assert(offsetof(Entity_Player, _smeltedTrinkets) == 0x1748); static_assert(offsetof(Entity_Player, _voidedCollectibles) == 0x1754); +static_assert(offsetof(Entity_Player, _collectibleRNGs) == 0x1770); +static_assert(offsetof(Entity_Player, _trinketRNGs) == 0x177c); +static_assert(offsetof(Entity_Player, _pillRNGs) == 0x1788); +static_assert(offsetof(Entity_Player, _cardRNGs) == 0x1794); static_assert(offsetof(Entity_Player, _pocketSlots) == 0x17a0); static_assert(offsetof(Entity_Player, _actionHoldDrop) == 0x17c0); static_assert(offsetof(Entity_Player, _queuedItem) == 0x17c4); +static_assert(offsetof(Entity_Player, _isHeldItemVisible) == 0x17d8); +static_assert(offsetof(Entity_Player, _playerForms) == 0x17dc); +static_assert(offsetof(Entity_Player, _playerFormsRewarded) == 0x181c); static_assert(offsetof(Entity_Player, _postLevelInitFinished) == 0x1824); static_assert(offsetof(Entity_Player, _canShoot) == 0x1825); -static_assert(offsetof(Entity_Player, _footprintColor1) == 0x1828); -static_assert(offsetof(Entity_Player, _footprintColor2) == 0x1854); static_assert(offsetof(Entity_Player, _itemHoldCooldown) == 0x1884); -static_assert(offsetof(Entity_Player, _ponyCharge) == 0x1888); -static_assert(offsetof(Entity_Player, _planCKillCountdown) == 0x188c); +static_assert(offsetof(Entity_Player, _brittleBonesUpgrades) == 0x1890); static_assert(offsetof(Entity_Player, _headColor) == 0x1894); static_assert(offsetof(Entity_Player, _bodyColor) == 0x1898); -static_assert(offsetof(Entity_Player, _epiphoraCharge) == 0x18a4); -static_assert(offsetof(Entity_Player, _deadEyeCharges) == 0x18b0); -static_assert(offsetof(Entity_Player, _deadEyeMisses) == 0x18b4); -static_assert(offsetof(Entity_Player, _mawOfTheVoidChargeTimer) == 0x18bc); -static_assert(offsetof(Entity_Player, _imExcitedSpeedupCountdown) == 0x18e8); -static_assert(offsetof(Entity_Player, _megaBlastDuration) == 0x18f4); -static_assert(offsetof(Entity_Player, _peeBurstCooldown) == 0x18f8); -static_assert(offsetof(Entity_Player, _maxPeeBurstCooldown) == 0x18fc); -static_assert(offsetof(Entity_Player, _bladderCharge) == 0x1900); -static_assert(offsetof(Entity_Player, _maxBladderCharge) == 0x1904); -static_assert(offsetof(Entity_Player, _isUrethraBlocked) == 0x1908); -static_assert(offsetof(Entity_Player, _nextUrethraBlockFrame) == 0x190c); +static_assert(offsetof(Entity_Player, _strengthMaxHearts) == 0x18a0); +static_assert(offsetof(Entity_Player, _coopBabyBuffTimers) == 0x18c0); static_assert(offsetof(Entity_Player, _friendBallEnemy) == 0x1910); -static_assert(offsetof(Entity_Player, _purityState) == 0x192c); -static_assert(offsetof(Entity_Player, _immaculateConceptionState) == 0x1930); -static_assert(offsetof(Entity_Player, _cambionConceptionState) == 0x1934); -static_assert(offsetof(Entity_Player, _conceptionFamiliarFlags) == 0x1938); -static_assert(offsetof(Entity_Player, _d8DamageModifier) == 0x193c); -static_assert(offsetof(Entity_Player, _d8SpeedModifier) == 0x1940); -static_assert(offsetof(Entity_Player, _d8RangeModifier) == 0x1944); -static_assert(offsetof(Entity_Player, _d8FireDelayModifier) == 0x1948); static_assert(offsetof(Entity_Player, _goldenHearts) == 0x194c); +static_assert(offsetof(Entity_Player, _bodyAngle) == 0x1ae4); +static_assert(offsetof(Entity_Player, _flashCountdown) == 0x1ae8); static_assert(offsetof(Entity_Player, _babySkin) == 0x1aec); -static_assert(offsetof(Entity_Player, _movingBoxContents) == 0x1d7c); +static_assert(offsetof(Entity_Player, _hasBabyRoomShield) == 0x1b10); +static_assert(offsetof(Entity_Player, _moveToTarget) == 0x1b1c); +static_assert(offsetof(Entity_Player, _delayedSfxId) == 0x1b24); +static_assert(offsetof(Entity_Player, _delayedSfxVolume) == 0x1b28); +static_assert(offsetof(Entity_Player, _delayedSfxDelay) == 0x1b2c); +static_assert(offsetof(Entity_Player, _delayedSfxFrameDelay) == 0x1b30); static_assert(offsetof(Entity_Player, _boneHearts) == 0x1d88); -static_assert(offsetof(Entity_Player, _boneHeartsMask) == 0x1d8c); -static_assert(offsetof(Entity_Player, _hallowedGroundCountdown) == 0x1d90); +static_assert(offsetof(Entity_Player, _damageMultiplierStacks) == 0x1d94); +static_assert(offsetof(Entity_Player, _lastDamageMultiplierStacks) == 0x1d96); static_assert(offsetof(Entity_Player, _subPlayer) == 0x1d98); +static_assert(offsetof(Entity_Player, _forgottenBody) == 0x1d9c); static_assert(offsetof(Entity_Player, _brokenHearts) == 0x1da0); static_assert(offsetof(Entity_Player, _rottenHearts) == 0x1da4); static_assert(offsetof(Entity_Player, _effectiveSoulCharge) == 0x1da8); static_assert(offsetof(Entity_Player, _effectiveBloodCharge) == 0x1dac); -static_assert(offsetof(Entity_Player, _urnSouls) == 0x1dd0); static_assert(offsetof(Entity_Player, _numGigaBombs) == 0x1dd4); +static_assert(offsetof(Entity_Player, _pendingWisps) == 0x1ddc); static_assert(offsetof(Entity_Player, _history) == 0x1dec); static_assert(offsetof(Entity_Player, _inventory) == 0x1e00); static_assert(offsetof(Entity_Player, _afterImageFrames) == 0x1e54); static_assert(offsetof(Entity_Player, _twinPlayer) == 0x1e68); static_assert(offsetof(Entity_Player, _backupPlayer) == 0x1e6c); +static_assert(offsetof(Entity_Player, _heightVelocity) == 0x1e70); static_assert(offsetof(Entity_Player, _redStewBonusDuration) == 0x1e74); +static_assert(offsetof(Entity_Player, _salvationEffect) == 0x1e80); static_assert(offsetof(Entity_Player, _marsUnk1) == 0x1e8c); static_assert(offsetof(Entity_Player, _marsCooldown) == 0x1e90); static_assert(offsetof(Entity_Player, _marsUnk2) == 0x1e94); static_assert(offsetof(Entity_Player, _marsUnkBool) == 0x1e98); static_assert(offsetof(Entity_Player, _marsLastTapDirection) == 0x1e9c); static_assert(offsetof(Entity_Player, _marsTapFrames) == 0x1ea0); +static_assert(offsetof(Entity_Player, _poisonDamageFrames) == 0x1ea8); static_assert(offsetof(Entity_Player, _rockBottomMoveSpeed) == 0x1eb0); static_assert(offsetof(Entity_Player, _rockBottomMaxFireDelay) == 0x1eb4); static_assert(offsetof(Entity_Player, _rockBottomDamage) == 0x1eb8); static_assert(offsetof(Entity_Player, _rockBottomTearRange) == 0x1ebc); static_assert(offsetof(Entity_Player, _rockBottomShotSpeed) == 0x1ec0); static_assert(offsetof(Entity_Player, _rockBottomLuck) == 0x1ec4); +static_assert(offsetof(Entity_Player, _reverseEmpressMaxHearts) == 0x1ecc); +static_assert(offsetof(Entity_Player, _reverseChariotMoveCooldown) == 0x1ed0); +static_assert(offsetof(Entity_Player, _reverseSunBoneHearts) == 0x1ed4); static_assert(offsetof(Entity_Player, _revelationChargeTimer) == 0x1edc); static_assert(offsetof(Entity_Player, _montezumaChargeTimer) == 0x1ee0); +static_assert(offsetof(Entity_Player, _montezumaLaser) == 0x1ee4); +static_assert(offsetof(Entity_Player, _jupiterCharge) == 0x1ee8); +static_assert(offsetof(Entity_Player, _holyMantleStacks) == 0x1eec); +static_assert(offsetof(Entity_Player, _ductTapeMode) == 0x1ef0); static_assert(offsetof(Entity_Player, _maggyHealthDrainCooldown) == 0x1ef4); static_assert(offsetof(Entity_Player, _maggySwingCooldown) == 0x1ef8); +static_assert(offsetof(Entity_Player, _jellyBellyBounceTimer) == 0x1efc); +static_assert(offsetof(Entity_Player, _forgottenBodyRoomIdx) == 0x1f08); +static_assert(offsetof(Entity_Player, _forgottenBodyPos) == 0x1f0c); +static_assert(offsetof(Entity_Player, _echoChamberItems) == 0x1f18); static_assert(offsetof(Entity_Player, _suplexState) == 0x1f2c); static_assert(offsetof(Entity_Player, _suplexAimCountdown) == 0x1f30); static_assert(offsetof(Entity_Player, _suplexTargetPos) == 0x1f34); @@ -2721,27 +2761,48 @@ static_assert(offsetof(Entity_Player, _suplexLandPos) == 0x1f3c); static_assert(offsetof(Entity_Player, _bagOfCraftingContent) == 0x1f44); static_assert(offsetof(Entity_Player, _bagOfCraftingOutput) == 0x1f4c); static_assert(offsetof(Entity_Player, _poopMana) == 0x1f54); -static_assert(offsetof(Entity_Player, _eveSumptoriumCharge) == 0x1f7c); -static_assert(offsetof(Entity_Player, _itemWispsList) == 0x1f80); +static_assert(offsetof(Entity_Player, _poopSpellQueue) == 0x1f58); +static_assert(offsetof(Entity_Player, _bagOfCraftingHoldFrames) == 0x1f78); +static_assert(offsetof(Entity_Player, _forgottenBHeight) == 0x1f88); +static_assert(offsetof(Entity_Player, _forgottenBHeightVelocity) == 0x1f8c); +static_assert(offsetof(Entity_Player, _itemCards) == 0x1fa4); +static_assert(offsetof(Entity_Player, _roomTemporaryCollectibles) == 0x1fb0); static_assert(offsetof(Entity_Player, _modelingClayEffect) == 0x1fb8); static_assert(offsetof(Entity_Player, _keepersSackBonus) == 0x1fbc); +static_assert(offsetof(Entity_Player, _darkEsau) == 0x1fc0); +static_assert(offsetof(Entity_Player, _isLevelStartPending) == 0x1fc4); +static_assert(offsetof(Entity_Player, _extraCollectibleCounts) == 0x1fd4); static_assert(offsetof(Entity_Player, _darkArtsBlastPending) == 0x2004); static_assert(offsetof(Entity_Player, _darkArtsDamage) == 0x2008); static_assert(offsetof(Entity_Player, _darkArtsLastSnare) == 0x200c); +static_assert(offsetof(Entity_Player, _grantedCollectibleCountdown) == 0x2024); +static_assert(offsetof(Entity_Player, _grantedCollectibleFlags) == 0x2028); static_assert(offsetof(Entity_Player, _hasCurseMistEffect) == 0x202c); static_assert(offsetof(Entity_Player, _consumablesBackup) == 0x2030); +static_assert(offsetof(Entity_Player, _curseMistFamiliars) == 0x2050); +static_assert(offsetof(Entity_Player, _curseMistRedHearts) == 0x205c); +static_assert(offsetof(Entity_Player, _curseMistPocketSlots) == 0x2060); +static_assert(offsetof(Entity_Player, _curseMistTrinkets) == 0x2080); +static_assert(offsetof(Entity_Player, _minecartOffset) == 0x2088); static_assert(offsetof(Entity_Player, _wildCardItemType) == 0x2090); static_assert(offsetof(Entity_Player, _wildCardItem) == 0x2094); +static_assert(offsetof(Entity_Player, _wildCardVarData) == 0x2098); static_assert(offsetof(Entity_Player, _samsonBerserkCharge) == 0x209c); static_assert(offsetof(Entity_Player, _ibsCharge) == 0x20a0); static_assert(offsetof(Entity_Player, _isCoopGhost) == 0x20a9); +static_assert(offsetof(Entity_Player, _ghostPocketSlots) == 0x20ac); +static_assert(offsetof(Entity_Player, _ghostTrinkets) == 0x20cc); static_assert(offsetof(Entity_Player, _playerHUD) == 0x20d4); +static_assert(offsetof(Entity_Player, _greedResetCollectibles) == 0x20dc); static_assert(offsetof(Entity_Player, _hasUnlistedRestoreState) == 0x20e8); static_assert(offsetof(Entity_Player, _unlistedRestoreState) == 0x20ec); static_assert(offsetof(Entity_Player, _replacedPlayer) == 0x26c8); struct Entity_Projectile { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -2755,110 +2816,98 @@ struct Entity_Projectile { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; float _height; // Planetoid Blow resets it to -23; BACKSPLIT children copy it (Entity_Projectile::Update 00654686) float _fallingSpeed; // Planetoid shot/Blow set 0 (ENTITY_SWARMER 00518e20) float _fallingAccel; // setter 00444c90; Planetoid -.095/-.085, BACKSPLIT children -.04 - uint8_t _pad_0x41c[0x10]; + float _damage; // Lua EntityProjectile.Damage 0085e360 returns this+0x41c + float _scale; // Lua EntityProjectile.Scale (folded Entity_Tear::Scale 00557cd0) returns this+0x420; AddScale 0085e320 adds to it; Init sets 1.0; Update multiplies shadow size by it + float _homingStrength; // Lua EntityProjectile.HomingStrength (folded Entity_Tear::BaseScale 0060ccb0) returns this+0x424; Init 00652b90 sets 1.0 + float _curvingStrength; // Lua EntityProjectile.CurvingStrength 004d3060 returns this+0x428; Init 00652b90 sets 0.015 float _acceleration; // setter 004aad70; ACCELERATE multiplies velocity by it a tick (00659a62) float _orbitDistance; // orbit target distance R in the ORBIT_CW/CCW steering (Planetoid 80, Blow 0) uint8_t _pad_0x434[0x4]; uint64_t _projectileFlags; - uint8_t _pad_0x440[0x8]; + bool _isRenderedAtGround; // ? Entity_Projectile::Render 0065cb60: when set, subtracts _height from _posOffset.y before rendering and adds it back after; ctor/Init zero it, no writer found + uint8_t _pad_0x441[0x3]; + int _animKey; // Entity_Projectile::Update 00653070 caches the animation it last played (size index 0..12, or 100/200/.../1000 per variant) and re-plays only when it changes; Init 00652b90 sets -1 to force the first play int _wiggleFrameOffset; uint8_t _pad_0x44c[0x4]; uint64_t _changeFlags; - uint8_t _pad_0x458[0x4]; + float _changeVelocity; // Lua EntityProjectile.ChangeVelocity (folded Entity_Tear::Rotation 0060ccc0) returns this+0x458; Init zeroes it int _changeTimeout; }; +static_assert(offsetof(Entity_Projectile, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Projectile, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Projectile, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Projectile, _index) == 0x20); static_assert(offsetof(Entity_Projectile, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Projectile, _type) == 0x28); @@ -2870,82 +2919,79 @@ static_assert(offsetof(Entity_Projectile, _sprite) == 0x48); static_assert(offsetof(Entity_Projectile, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Projectile, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Projectile, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Projectile, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Projectile, _flags) == 0x168); -static_assert(offsetof(Entity_Projectile, _valid) == 0x170); +static_assert(offsetof(Entity_Projectile, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Projectile, _visible) == 0x171); static_assert(offsetof(Entity_Projectile, _exists) == 0x172); static_assert(offsetof(Entity_Projectile, _dead) == 0x173); -static_assert(offsetof(Entity_Projectile, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Projectile, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Projectile, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Projectile, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Projectile, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Projectile, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Projectile, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Projectile, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Projectile, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Projectile, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Projectile, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Projectile, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Projectile, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Projectile, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Projectile, _color) == 0x1b8); static_assert(offsetof(Entity_Projectile, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Projectile, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Projectile, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Projectile, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Projectile, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Projectile, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Projectile, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Projectile, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Projectile, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Projectile, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Projectile, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Projectile, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Projectile, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Projectile, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Projectile, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Projectile, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Projectile, _mass) == 0x2d4); -static_assert(offsetof(Entity_Projectile, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Projectile, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Projectile, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Projectile, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Projectile, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Projectile, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Projectile, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Projectile, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Projectile, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Projectile, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Projectile, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Projectile, _charmSource) == 0x240); +static_assert(offsetof(Entity_Projectile, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Projectile, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Projectile, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Projectile, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Projectile, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Projectile, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Projectile, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Projectile, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Projectile, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Projectile, _config) == 0x330); static_assert(offsetof(Entity_Projectile, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Projectile, _pos) == 0x33c); -static_assert(offsetof(Entity_Projectile, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Projectile, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Projectile, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Projectile, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Projectile, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Projectile, _velocity) == 0x360); +static_assert(offsetof(Entity_Projectile, _baseFriction) == 0x368); static_assert(offsetof(Entity_Projectile, _friction) == 0x36c); -static_assert(offsetof(Entity_Projectile, _size) == 0x370); -static_assert(offsetof(Entity_Projectile, _health) == 0x380); -static_assert(offsetof(Entity_Projectile, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Projectile, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Projectile, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Projectile, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Projectile, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Projectile, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Projectile, _mass) == 0x37c); +static_assert(offsetof(Entity_Projectile, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Projectile, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Projectile, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Projectile, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Projectile, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Projectile, _parent) == 0x3bc); static_assert(offsetof(Entity_Projectile, _child) == 0x3c0); static_assert(offsetof(Entity_Projectile, _target) == 0x3c4); static_assert(offsetof(Entity_Projectile, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Projectile, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Projectile, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Projectile, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Projectile, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Projectile, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Projectile, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Projectile, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Projectile, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Projectile, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Projectile, _height) == 0x410); static_assert(offsetof(Entity_Projectile, _fallingSpeed) == 0x414); static_assert(offsetof(Entity_Projectile, _fallingAccel) == 0x418); +static_assert(offsetof(Entity_Projectile, _damage) == 0x41c); +static_assert(offsetof(Entity_Projectile, _scale) == 0x420); +static_assert(offsetof(Entity_Projectile, _homingStrength) == 0x424); +static_assert(offsetof(Entity_Projectile, _curvingStrength) == 0x428); static_assert(offsetof(Entity_Projectile, _acceleration) == 0x42c); static_assert(offsetof(Entity_Projectile, _orbitDistance) == 0x430); static_assert(offsetof(Entity_Projectile, _projectileFlags) == 0x438); +static_assert(offsetof(Entity_Projectile, _isRenderedAtGround) == 0x440); +static_assert(offsetof(Entity_Projectile, _animKey) == 0x444); static_assert(offsetof(Entity_Projectile, _wiggleFrameOffset) == 0x448); static_assert(offsetof(Entity_Projectile, _changeFlags) == 0x450); +static_assert(offsetof(Entity_Projectile, _changeVelocity) == 0x458); static_assert(offsetof(Entity_Projectile, _changeTimeout) == 0x45c); struct Entity_Slot { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -2959,95 +3005,78 @@ struct Entity_Slot { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it }; +static_assert(offsetof(Entity_Slot, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Slot, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Slot, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Slot, _index) == 0x20); static_assert(offsetof(Entity_Slot, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Slot, _type) == 0x28); @@ -3059,73 +3088,63 @@ static_assert(offsetof(Entity_Slot, _sprite) == 0x48); static_assert(offsetof(Entity_Slot, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Slot, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Slot, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Slot, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Slot, _flags) == 0x168); -static_assert(offsetof(Entity_Slot, _valid) == 0x170); +static_assert(offsetof(Entity_Slot, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Slot, _visible) == 0x171); static_assert(offsetof(Entity_Slot, _exists) == 0x172); static_assert(offsetof(Entity_Slot, _dead) == 0x173); -static_assert(offsetof(Entity_Slot, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Slot, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Slot, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Slot, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Slot, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Slot, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Slot, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Slot, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Slot, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Slot, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Slot, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Slot, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Slot, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Slot, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Slot, _color) == 0x1b8); static_assert(offsetof(Entity_Slot, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Slot, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Slot, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Slot, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Slot, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Slot, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Slot, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Slot, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Slot, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Slot, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Slot, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Slot, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Slot, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Slot, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Slot, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Slot, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Slot, _mass) == 0x2d4); -static_assert(offsetof(Entity_Slot, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Slot, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Slot, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Slot, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Slot, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Slot, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Slot, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Slot, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Slot, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Slot, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Slot, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Slot, _charmSource) == 0x240); +static_assert(offsetof(Entity_Slot, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Slot, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Slot, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Slot, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Slot, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Slot, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Slot, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Slot, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Slot, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Slot, _config) == 0x330); static_assert(offsetof(Entity_Slot, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Slot, _pos) == 0x33c); -static_assert(offsetof(Entity_Slot, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Slot, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Slot, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Slot, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Slot, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Slot, _velocity) == 0x360); +static_assert(offsetof(Entity_Slot, _baseFriction) == 0x368); static_assert(offsetof(Entity_Slot, _friction) == 0x36c); -static_assert(offsetof(Entity_Slot, _size) == 0x370); -static_assert(offsetof(Entity_Slot, _health) == 0x380); -static_assert(offsetof(Entity_Slot, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Slot, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Slot, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Slot, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Slot, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Slot, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Slot, _mass) == 0x37c); +static_assert(offsetof(Entity_Slot, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Slot, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Slot, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Slot, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Slot, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Slot, _parent) == 0x3bc); static_assert(offsetof(Entity_Slot, _child) == 0x3c0); static_assert(offsetof(Entity_Slot, _target) == 0x3c4); static_assert(offsetof(Entity_Slot, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Slot, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Slot, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Slot, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Slot, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Slot, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Slot, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Slot, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Slot, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Slot, _luaBridgeRef) == 0x408); struct Entity_Tear { // : Entity (flattened) - uint8_t _pad_0x0[0x20]; + uint8_t _pad_0x0[0x8]; + uint8_t _damageEvents[0xc]; // vector_DamageEvent; damage queued this frame: Entity::TakeDamage 006ace60 pushes {float dmg, pad, uint64 flags @+8, EntityRef @+0x10} (FUN_006b7db0); Entity::Update 006ae820 walks begin 0x8..end 0xc in 0x38-byte steps subtracting dmg from _health, then clears (0xc=0x8) + float _pendingDamage; // Entity::TakeDamage 006ace60 adds the damage (in_ECX[5] += dmg); Lua Entity.HasMortalDamage 006ad340 returns _health <= this+0x14; Entity::Update 006ae820 zeroes it + uint64_t _pendingDamageFlags; // Entity::TakeDamage 006ace60 ORs DamageFlags lo/hi into 0x18/0x1c; Entity::Update 006ae820 zeroes both; Hornfel_UpdateAI 004b92e0 tests &4 (explosion) uint32_t _index; // Lua Entity.Index getter (folded as PathFinder::GetGridIndex 00456370) returns this+0x20 uint32_t _collisionIndex; // EntityList::rebuild_sublists 00419e70 assigns a running index to this+0x24 for each entity with _entityCollisionClass!=0 uint32_t _type; @@ -3139,118 +3158,102 @@ struct Entity_Tear { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x13]; - float _shadowSize; - uint8_t _pad_0x160[0x8]; - uint64_t _flags; - bool _valid; + uint8_t _pad_0x149[0x17]; + Vector _shadowOffset; // Entity::RenderShadowLayer 006b2000 and Entity_Player::Render 0078ca00 add this+0x160/0x164 to _pos before the 0.65 shadow-layer transform; ctor 006a8290 zeroes + uint8_t _pad_0x168[0x9]; bool _visible; bool _exists; bool _dead; - uint8_t _pad_0x174[0x3]; - bool _removedByFactory; - uint8_t _pad_0x178[0xc]; - int _entityGridCollisionClass; + bool _isKillOnTouch; // ? Entity_NPC::HandleCollision 006cd410 calls Kill (vtable+0x24) when set; Fly AI 00506bd0 damages itself every 4 frames when set; boss AIs (Duke, Widow, Monstro...) set it on spawned flies after clearing FLAG_APPEAR + bool _isInterpolating; // Entity::Interpolate 006b0eb0 (and Knife/Tear/NPC/Projectile Interpolate) set +0x175=1 before re-running Update; Manager::Update 00954cd0 clears it; Entity_Knife::Update / Entity_Laser::UpdateHits skip hit logic while set; Entity::Init 006a93a0 clears it + uint8_t _pad_0x176[0x2]; + uint8_t _collisionPoints[0x10]; // vector_Vector; Entity::SetSize 006ac2a0 clears it (0x17c=0x178) and pushes numGridCollisionPoints ellipse points (std::vector::_Emplace_reallocate, cap 0x180); LoadEntityConfig 006a98b0 picks GridCollisionClass from its size int _entityCollisionClass; - uint8_t _pad_0x18c[0x2]; - uint16_t _entityExtraDataPtrUpperBytes; - bool _collidesWithGrid; - uint8_t _pad_0x191[0x1]; - uint16_t _entityExtraDataPtrLowerBytes; - uint8_t _pad_0x194[0x18]; - uint8_t _colorParams[0x38]; // vector_ColorParams + bool _collidesWithEntity; // ? EntityList::rebuild_sublists 00419e70 clears it for every entity each frame; ENTITY_WRATH 00475110 / ENTITY_POKY 00521ab0 test !_collidesWithGrid && !this (no setter found in the C) + uint8_t _pad_0x18d[0x7]; + Vector _gridCollisionVelocity; // Entity::CollideWithGrid 006a9c90 copies _velocity (0x360/0x364) into 0x194/0x198 when it hits a wall and sets _collidesWithGrid (0x190)=1 + Vector _gridCollisionNormal; // Entity::CollideWithGrid 006a9c90 writes (+-1,0)/(0,+-1) or the summed contact normal to 0x19c/0x1a0 and pushes velocity along it; Brownie/Dingle AIs use pos + normal*200 + Vector _renderPosition; // Entity::Render 006b10f0 stores the floored screen position (pos+posOffset world->screen + offset arg) at 0x1a4/0x1a8 and passes &this+0x1a4 to ANM2::Render; ctor zeroes it; Entity_Player::Render 0078b640 does the same + uint8_t _pad_0x1ac[0xc]; + ColorMod _color; // Entity::SetColor 006b2fa0 copies the ColorMod straight into 0x1b8..0x1e0 when duration<1 (else pushes ColorParams into the 0x1ac vector); ctor 006a8290 inits tint 1,1,1,1 rest 0 ColorMod _splatColor; // Lua getter Entity::SplatColor returns this+0x1e4 - int _fireDamageCountdown; - int _damageCountdown; - int _freezeCountdown; - int _poisonCountdown; - int _slowingCountdown; - int _charmedCountdown; - int _confusionCountdown; - int _midasFreezeCountdown; - int _fearCountdown; - int _burnCountdown; - int _bossStatusEffectCooldown; - int _shrinkCountdown; - uint8_t _pad_0x240[0x38]; - float _poisonDamage; - float _burnDamage; - uint8_t _pad_0x280[0x30]; - float _depthOffset; - uint8_t _pad_0x2b4[0x20]; - float _mass; - uint8_t _pad_0x2d8[0x8]; - int _poisonDamageTimer; - int _burnDamageTimer; - int _bleedingCountdown; - uint8_t _pad_0x2ec[0x4]; - int _magnetizedCountdown; - int _baitedCountdown; - int _knockbackCountdown; - int _weaknessCountdown; - int _iceCountdown; - int _brimstoneMarkCountdown; - Vector _knockbackDirection; - uint8_t _pad_0x310[0xc]; - int _pauseTimer; - uint8_t _pad_0x320[0xc]; + uint8_t _pad_0x210[0x30]; + EntityRef _charmSource; // Entity::AddCharmed 006ad870 copies the source EntityRef (type,variant,..,flags 0x260,entity 0x264) into 0x240..0x264; ctor zeroes it like an EntityRef (ints, zero Vectors at +0x10/+0x18) + EntityRef _entityRef2; // ? ctor 006a8290 inits 0x268..0x28c exactly like the 0x240 EntityRef (4 ints 0, zero Vectors at 0x278/0x280, 2 ints 0); Entity_Player::TakeDamage 007729d0 / Update test its entity (+0x24 = 0x28c) == this. zhl _poisonDamage 0x278/_burnDamage 0x27c sit inside it and look wrong + EntityRef _entityRef3; // ? ctor 006a8290 inits 0x290..0x2b4 like the 0x240 EntityRef (zero Vectors at 0x2a0/0x2a8); zhl _depthOffset 0x2b0 sits inside it (the real DepthOffset is 0x358) + EntityRef _entityRef4; // ? ctor 006a8290 inits 0x2b8..0x2dc like the 0x240 EntityRef (zero Vectors at 0x2c8/0x2d0, ctor writes 'this->_mass' = zero-Vector y); zhl _mass 0x2d4 sits inside it (the real Mass is 0x37c) + uint8_t _pad_0x2e0[0x30]; + uint8_t _iceFrozenEffect[0x4]; // EntityPtr; ? Entity::Update 006ae820 Removes (vtable+0x28) the entity in 0x310 once flag bit 51 (ICE_FROZEN, hi 0x80000) is gone; Entity::ClearReferences 006acb60 removes and releases it + Vector _pausePosition; // Entity_NPC::Update 006c4b30: while _pauseTimer>0 it latches _pos into 0x314/0x318 (if zero) and pins _pos to it + uint8_t _pad_0x31c[0x4]; + float _poisonTickDamage; // Entity::AddPoison 006ad500 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage(this+0x320, 0x8000..) and resets it to 2.0 when poison ends; CopyStatusEffects 006a8a20 copies it + float _burnTickDamage; // Entity::AddBurn 006ae280 stores max(old, damage); Entity::Update 006ae820 deals it via TakeDamage and resets it to 2.0 when burn ends; CopyStatusEffects 006a8a20 copies it + int _spawnFrame; // Lua Entity.FrameCount 006a9c10 returns game frame - this+0x328 int _spawnGridIndex; - uint8_t _pad_0x330[0x4]; + uint32_t _config; // EntityConfig_Entity* // Entity::LoadEntityConfig 006a98b0 stores the EntityConfig_Entity* here; Entity_Player::Update 00782af0 resets _mass (0x37c) from config+0x44 (mass); NPC AIs spawn_gibs(config+0x60 gibFlags) Vector _targetPosition; - Vector _pos; - uint8_t _pad_0x344[0x8]; - Vector _posOffset; + uint8_t _pad_0x33c[0x8]; + Vector _preInterpolatePos; // Entity::Interpolate 006b0eb0 (and the NPC/Tear/Projectile overrides) saves _pos here before advancing it half a step + uint8_t _pad_0x34c[0x8]; int _renderZOffset; - uint8_t _pad_0x358[0x4]; + float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - Vector _velocity; - uint8_t _pad_0x368[0x4]; + uint8_t _pad_0x360[0x8]; + float _baseFriction; // Entity::LoadEntityConfig 006a98b0 copies EntityConfig friction (+0x4c) here (1.0 without config); Entity_NPC::Update 006c4b30 restores _friction (0x36c) from it after Appear/regen float _friction; // Lua Entity.Friction via binder 0087d5d0: getter 008be110 FUN_0085c050 (lua_pushnumber), setter 008be170 luaL_checknumber -> *(float*) - float _size; - uint8_t _pad_0x374[0xc]; - float _health; - uint8_t _pad_0x384[0x4]; - float _collisionDamage; - uint8_t _pad_0x38c[0x10]; - float _speedMultiplier; - uint8_t _pad_0x3a0[0x10]; - bool _isInvicible; - uint8_t _pad_0x3b1[0x3]; - float _shrinkStatus1; - float _shrinkStatus2; + uint8_t _pad_0x370[0x4]; + Vector _sizeMulti; // Lua Entity.SizeMulti 0085dd40 returns 0x374/0x378; Entity::SetSize 006ac2a0 stores the X/Y multipliers there + float _mass; // Lua Entity.Mass getter 00431520 returns float this+0x37c (REPENTOGON/zhl_fields put _mass at 0x2d4: wrong in this exe); ai_umbilical_baby 00431be0 uses 900/(mass+50); Entity::LoadEntityConfig 006a98b0 initialises it from config+0x44 + uint8_t _pad_0x380[0x4]; + float _maxHitPoints; // Lua Entity.MaxHitPoints 00417360 returns this+0x384 (900); LoadEntityConfig 006a98b0 = baseHP + stage*stageHP; HasFullHealth/AddHealth clamp _health to it + uint8_t _pad_0x388[0x4]; + Vector _prevPosition; // Entity::PreUpdate 006ae7d0 copies _pos into 0x38c/0x390; Entity::Update 006ae820 uses pos - this+0x38c as the frame's displacement + Vector _prevVelocity; // Entity::PreUpdate 006ae7d0 copies _velocity into 0x394/0x398 + uint8_t _pad_0x39c[0x4]; + float _prevUpdateTime; // Entity::Update 006ae820 sets 0x3a0 = 0x3a4 then 0x3a4 += _speedMultiplier (unless flag 0x4000); Entity::GetIntervalTicks 006ac760 and the 'GetHitPointsLost' 00435db0 helper return (int)0x3a4-(int)0x3a0 ticks elapsed + float _updateTime; // Entity::Update 006ae820 adds _speedMultiplier to it each update (time-scaled frame counter); AIs subtract (int)0x3a4-(int)0x3a0 from their cooldowns + uint8_t _pad_0x3a8[0x14]; uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // EntityPtr - uint8_t _spawnerEntity[0xc]; // EntityPtr - uint8_t _minecart[0x8]; // EntityPtr + uint8_t _spawnerEntity[0x4]; // EntityPtr + uint8_t _entityPtrReferrers[0xc]; // std_multiset_uint; Entity::ClearReferences 006acb60 walks the tree at 0x3cc (head node new(0x14), size 0x3d0) nulling every EntityPtr* stored in it; EntityPtr assignments go through std::multiset::insert/erase + uint8_t _hitEffect[0x4]; // EntityPtr; ? Entity::TakeDamage 006ace60 Removes the old one and stores a freshly spawned effect 1000.160 in in_ECX[0xf6]; ClearReferences 006acb60 releases it uint8_t _dropRNG[0x10]; // RNG uint32_t _initSeed; - uint8_t _pad_0x3f0[0x18]; + int _holdCountdown; // Entity_NPC::hold_set 006b5de0 sets max(it, ticks) with the spot in 0x3f4 (Emergency Contact); Entity::Update 006ae820 decrements it; NPC::Update 006c4b30 kills friction and pins velocity while >0 + Vector _holdPosition; // Entity_NPC::hold_set 006b5de0 writes the spot to 0x3f4/0x3f8; Entity_NPC::Update 006c4b30 assigns it while _holdCountdown>0 + int _pitfallState; // Entity_Bomb::Update 006a24d0: !=0 slows it and 1->2 when the anim ends then removes; Entity_Player::GetDeathAnimName 007828f0 picks "HoleDeath" when != 0; NpcAI::ENTITY_PITFALL uses it + uint8_t _pad_0x400[0x8]; uint32_t _luaBridgeRef; // LuaBridgeRef* // Lua Entity.GetData 006b5e60 lazily allocates {lua_State,luaL_ref} into this+0x408; ctor 006a8290 nulls it uint8_t _pad_0x40c[0x4]; float _height; // Lua EntityTear.Height getter 00431750 returns this+0x410 float _fallingSpeed; // Lua EntityTear.FallingSpeed getter 00456440 returns this+0x414 float _fallingAccel; // Lua EntityTear.FallingAcceleration getter 00435e50 returns this+0x418 float _homingFriction; - float _fScale; - float _baseScale; - BitSet128 _tearFlags; + uint8_t _pad_0x420[0x18]; int _waitFrames; Vector _continueVelocity; - uint8_t _hitList[0xc]; // std_vector_uint - int _tearIdx; - float _baseDamage; - float _rotation; - int _scaleAnimNum; + uint8_t _pad_0x444[0x1c]; float _knockbackMultiplier; float _deadEyeIntensity; // Entity_Tear::SetDeadEyeIntensity 00679e80 writes this+0x464 bool _multidimensionalTouched; // Entity_Familiar::Update 0061da10 (Multidimensional Baby) reads tear+0x468 via 0060cd60, sets it via 0060cd70 before Entity_Tear::MakeMultidimensionalCopy 0067a190 (which copies it) bool _prismTouched; // Entity_Familiar::Update 0061da10 (Angelic Prism) skips tears with +0x469 set (0060cd80) and sets it on the split copies (0060cd90) - uint8_t _pad_0x46a[0xe]; + bool _isFireSoundPending; // Entity_Tear::Init 006660a0 sets it to 1; Entity_Tear::Update 006670f0 calls play_fire_sound() once and clears it + uint8_t _pad_0x46b[0x1]; + short _popBounceCount; // Entity_Tear::Update 006670f0 increments it on both tears on a tear-tear bounce, HandleCollision 00673660 increments it when TEAR_POP (bit 58, mask 0xc345b0) is set; Update keeps bouncing only while < 9; Init zeroes it + uint8_t _pad_0x46e[0x2]; + int _hitCount; // Entity_Tear::HandleCollision 00673660 tests ==0 for first-hit effects then increments it on every enemy hit; Init zeroes it + uint32_t _deathFlags; // Entity_Tear::Update 006670f0 ORs a reason into it whenever it sets _dead (+0x173): 1 grid hit, 2 grid collision type 4, 4 hit the floor, 0x10 damage depleted, 0x20, 0x40 timeout/forced die; tests ==4 for the hydro-bounce revive; Init zeroes it uint32_t _stickTarget; // Entity* // Lua EntityTear.StickTarget via binder 00880880: getter 008be4b0 UserdataPtr Entity key c8297a, setter stores pointer Vector _stickDiff; // Lua EntityTear.StickDiff via binder 00880710: getter 008be370 UserdataValue 8-byte copy int _stickTimer; // Lua EntityTear.StickTimer via binder 008805a0: getter 008be2b0 FUN_0085bfd0 signed dword, setter checkinteger dword - uint8_t _pad_0x488[0x24]; + uint8_t _techZeroLaser[0x4]; // EntityPtr; Entity_Tear::Update 006670f0 (TEAR_LASER bit 57, mask 0xc345a0): Entity_Laser::ShootAngle result stored here, repositioned between the tears, Remove()d (vtable+0x28) when the linked tear dies or >350 apart; ClearReferences 006666c0 removes it + uint8_t _techZeroTarget[0x4]; // EntityPtr; Entity_Tear::Update 006670f0 (TEAR_LASER bit 57): nearest other tear (QueryRadius, type 2) whose +0x48c is not this; laser +0x488 spans to it; Interpolate 00679400 reads it; ClearReferences 006666c0 resets it + uint8_t _laserShotLaser[0x4]; // EntityPtr; Entity_Tear::Update 006670f0 (TEAR_LASERSHOT bit 60, mask 0xc345d0) spawns a laser via Entity_Laser::ShootAngle along the tear's (continue)velocity and keeps it here; without the flag it is Remove()d; ClearReferences 006666c0 removes it + uint8_t _linkPrev[0x4]; // EntityPtr; Entity_Tear::apply_link_spring_forces 0067aaf0 springs toward +0x494 and +0x498 (rest length 10); link setter 0067ae30 joins prev/next; ClearReferences 006666c0 relinks prev<->next (EntityPtr set 0067dac0) when both are tears + uint8_t _linkNext[0x4]; // EntityPtr; see _linkPrev: apply_link_spring_forces 0067aaf0, 0067ae30, ClearReferences 006666c0; Init 006660a0 resets both + uint8_t _attachedEffect[0x10]; // EntityPtr; ? Entity_Tear::Update 006670f0 spawns (Game::Spawn) an entity for several tear-flag cases into +0x49c, sets its parent/color and scales it with _fScale every frame; ClearReferences 006666c0 Remove()s it ANM2 _tearHaloANM2; // Entity_Tear::SetTearFlags 00676150 loads gfx/TearHalo.anm2 into this+0x4ac ANM2 _tearEffectANM2; // Entity_Tear::SetTearFlags 00676150 loads LittleHorn/Mysterious/DarkMatter/FireMind/JacobsLadder TearEffect anm2s into this+0x5c0 ANM2 _deadEyeANM2; // Entity_Tear::SetDeadEyeIntensity 00679e80 loads gfx/DeadEyeTearEffect.anm2 into this+0x6d4 @@ -3258,9 +3261,15 @@ struct Entity_Tear { // : Entity (flattened) uint8_t _pad_0x7e9[0x3]; Vector _posDisplacement; Vector _parentOffset; // Lua EntityTear.ParentOffset via binder 00880710: getter 008be370 UserdataValue 8-byte copy - uint8_t _pad_0x7fc[0x24]; + int _holdTimer; // Entity_Tear::Update 006670f0: while >0 counts down, pins the tear to parent(+0x3bc) pos + +0x800 with zero velocity and bobs height ±0.5 per 15 frames; on expiry restores velocity from +0x808; Interpolate 00679400 does the same pin + Vector _holdOffset; // Entity_Tear::Update 006670f0 / Interpolate 00679400 set pos = parent pos + this+0x800/+0x804 while _holdTimer (+0x7fc) > 0; Init zeroes it + Vector _holdVelocity; // Entity_Tear::Update 006670f0 copies +0x808/+0x80c into velocity when _holdTimer (+0x7fc) reaches 0 + uint8_t _pad_0x810[0x10]; float _tearRange; // Entity_Player::FireTear 00790af0 copies player _tearrange (+0x1480) to tear+0x820; Entity_Tear::Init 006660a0 sets 260.0; Update compares it to +0x3a4 }; +static_assert(offsetof(Entity_Tear, _damageEvents) == 0x8); +static_assert(offsetof(Entity_Tear, _pendingDamage) == 0x14); +static_assert(offsetof(Entity_Tear, _pendingDamageFlags) == 0x18); static_assert(offsetof(Entity_Tear, _index) == 0x20); static_assert(offsetof(Entity_Tear, _collisionIndex) == 0x24); static_assert(offsetof(Entity_Tear, _type) == 0x28); @@ -3272,97 +3281,89 @@ static_assert(offsetof(Entity_Tear, _sprite) == 0x48); static_assert(offsetof(Entity_Tear, _spriteOffset) == 0xdc); static_assert(offsetof(Entity_Tear, _spriteScale) == 0xe4); static_assert(offsetof(Entity_Tear, _isFlipX) == 0x148); -static_assert(offsetof(Entity_Tear, _shadowSize) == 0x15c); -static_assert(offsetof(Entity_Tear, _flags) == 0x168); -static_assert(offsetof(Entity_Tear, _valid) == 0x170); +static_assert(offsetof(Entity_Tear, _shadowOffset) == 0x160); static_assert(offsetof(Entity_Tear, _visible) == 0x171); static_assert(offsetof(Entity_Tear, _exists) == 0x172); static_assert(offsetof(Entity_Tear, _dead) == 0x173); -static_assert(offsetof(Entity_Tear, _removedByFactory) == 0x177); -static_assert(offsetof(Entity_Tear, _entityGridCollisionClass) == 0x184); +static_assert(offsetof(Entity_Tear, _isKillOnTouch) == 0x174); +static_assert(offsetof(Entity_Tear, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Tear, _collisionPoints) == 0x178); static_assert(offsetof(Entity_Tear, _entityCollisionClass) == 0x188); -static_assert(offsetof(Entity_Tear, _entityExtraDataPtrUpperBytes) == 0x18e); -static_assert(offsetof(Entity_Tear, _collidesWithGrid) == 0x190); -static_assert(offsetof(Entity_Tear, _entityExtraDataPtrLowerBytes) == 0x192); -static_assert(offsetof(Entity_Tear, _colorParams) == 0x1ac); +static_assert(offsetof(Entity_Tear, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Tear, _gridCollisionVelocity) == 0x194); +static_assert(offsetof(Entity_Tear, _gridCollisionNormal) == 0x19c); +static_assert(offsetof(Entity_Tear, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity_Tear, _color) == 0x1b8); static_assert(offsetof(Entity_Tear, _splatColor) == 0x1e4); -static_assert(offsetof(Entity_Tear, _fireDamageCountdown) == 0x210); -static_assert(offsetof(Entity_Tear, _damageCountdown) == 0x214); -static_assert(offsetof(Entity_Tear, _freezeCountdown) == 0x218); -static_assert(offsetof(Entity_Tear, _poisonCountdown) == 0x21c); -static_assert(offsetof(Entity_Tear, _slowingCountdown) == 0x220); -static_assert(offsetof(Entity_Tear, _charmedCountdown) == 0x224); -static_assert(offsetof(Entity_Tear, _confusionCountdown) == 0x228); -static_assert(offsetof(Entity_Tear, _midasFreezeCountdown) == 0x22c); -static_assert(offsetof(Entity_Tear, _fearCountdown) == 0x230); -static_assert(offsetof(Entity_Tear, _burnCountdown) == 0x234); -static_assert(offsetof(Entity_Tear, _bossStatusEffectCooldown) == 0x238); -static_assert(offsetof(Entity_Tear, _shrinkCountdown) == 0x23c); -static_assert(offsetof(Entity_Tear, _poisonDamage) == 0x278); -static_assert(offsetof(Entity_Tear, _burnDamage) == 0x27c); -static_assert(offsetof(Entity_Tear, _depthOffset) == 0x2b0); -static_assert(offsetof(Entity_Tear, _mass) == 0x2d4); -static_assert(offsetof(Entity_Tear, _poisonDamageTimer) == 0x2e0); -static_assert(offsetof(Entity_Tear, _burnDamageTimer) == 0x2e4); -static_assert(offsetof(Entity_Tear, _bleedingCountdown) == 0x2e8); -static_assert(offsetof(Entity_Tear, _magnetizedCountdown) == 0x2f0); -static_assert(offsetof(Entity_Tear, _baitedCountdown) == 0x2f4); -static_assert(offsetof(Entity_Tear, _knockbackCountdown) == 0x2f8); -static_assert(offsetof(Entity_Tear, _weaknessCountdown) == 0x2fc); -static_assert(offsetof(Entity_Tear, _iceCountdown) == 0x300); -static_assert(offsetof(Entity_Tear, _brimstoneMarkCountdown) == 0x304); -static_assert(offsetof(Entity_Tear, _knockbackDirection) == 0x308); -static_assert(offsetof(Entity_Tear, _pauseTimer) == 0x31c); +static_assert(offsetof(Entity_Tear, _charmSource) == 0x240); +static_assert(offsetof(Entity_Tear, _entityRef2) == 0x268); +static_assert(offsetof(Entity_Tear, _entityRef3) == 0x290); +static_assert(offsetof(Entity_Tear, _entityRef4) == 0x2b8); +static_assert(offsetof(Entity_Tear, _iceFrozenEffect) == 0x310); +static_assert(offsetof(Entity_Tear, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Tear, _poisonTickDamage) == 0x320); +static_assert(offsetof(Entity_Tear, _burnTickDamage) == 0x324); +static_assert(offsetof(Entity_Tear, _spawnFrame) == 0x328); static_assert(offsetof(Entity_Tear, _spawnGridIndex) == 0x32c); +static_assert(offsetof(Entity_Tear, _config) == 0x330); static_assert(offsetof(Entity_Tear, _targetPosition) == 0x334); -static_assert(offsetof(Entity_Tear, _pos) == 0x33c); -static_assert(offsetof(Entity_Tear, _posOffset) == 0x34c); +static_assert(offsetof(Entity_Tear, _preInterpolatePos) == 0x344); static_assert(offsetof(Entity_Tear, _renderZOffset) == 0x354); +static_assert(offsetof(Entity_Tear, _renderDepthOffset) == 0x358); static_assert(offsetof(Entity_Tear, _sortingLayer) == 0x35c); -static_assert(offsetof(Entity_Tear, _velocity) == 0x360); +static_assert(offsetof(Entity_Tear, _baseFriction) == 0x368); static_assert(offsetof(Entity_Tear, _friction) == 0x36c); -static_assert(offsetof(Entity_Tear, _size) == 0x370); -static_assert(offsetof(Entity_Tear, _health) == 0x380); -static_assert(offsetof(Entity_Tear, _collisionDamage) == 0x388); -static_assert(offsetof(Entity_Tear, _speedMultiplier) == 0x39c); -static_assert(offsetof(Entity_Tear, _isInvicible) == 0x3b0); -static_assert(offsetof(Entity_Tear, _shrinkStatus1) == 0x3b4); -static_assert(offsetof(Entity_Tear, _shrinkStatus2) == 0x3b8); +static_assert(offsetof(Entity_Tear, _sizeMulti) == 0x374); +static_assert(offsetof(Entity_Tear, _mass) == 0x37c); +static_assert(offsetof(Entity_Tear, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Tear, _prevPosition) == 0x38c); +static_assert(offsetof(Entity_Tear, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Tear, _prevUpdateTime) == 0x3a0); +static_assert(offsetof(Entity_Tear, _updateTime) == 0x3a4); static_assert(offsetof(Entity_Tear, _parent) == 0x3bc); static_assert(offsetof(Entity_Tear, _child) == 0x3c0); static_assert(offsetof(Entity_Tear, _target) == 0x3c4); static_assert(offsetof(Entity_Tear, _spawnerEntity) == 0x3c8); -static_assert(offsetof(Entity_Tear, _minecart) == 0x3d4); +static_assert(offsetof(Entity_Tear, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Tear, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Tear, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Tear, _initSeed) == 0x3ec); +static_assert(offsetof(Entity_Tear, _holdCountdown) == 0x3f0); +static_assert(offsetof(Entity_Tear, _holdPosition) == 0x3f4); +static_assert(offsetof(Entity_Tear, _pitfallState) == 0x3fc); static_assert(offsetof(Entity_Tear, _luaBridgeRef) == 0x408); static_assert(offsetof(Entity_Tear, _height) == 0x410); static_assert(offsetof(Entity_Tear, _fallingSpeed) == 0x414); static_assert(offsetof(Entity_Tear, _fallingAccel) == 0x418); static_assert(offsetof(Entity_Tear, _homingFriction) == 0x41c); -static_assert(offsetof(Entity_Tear, _fScale) == 0x420); -static_assert(offsetof(Entity_Tear, _baseScale) == 0x424); -static_assert(offsetof(Entity_Tear, _tearFlags) == 0x428); static_assert(offsetof(Entity_Tear, _waitFrames) == 0x438); static_assert(offsetof(Entity_Tear, _continueVelocity) == 0x43c); -static_assert(offsetof(Entity_Tear, _hitList) == 0x444); -static_assert(offsetof(Entity_Tear, _tearIdx) == 0x450); -static_assert(offsetof(Entity_Tear, _baseDamage) == 0x454); -static_assert(offsetof(Entity_Tear, _rotation) == 0x458); -static_assert(offsetof(Entity_Tear, _scaleAnimNum) == 0x45c); static_assert(offsetof(Entity_Tear, _knockbackMultiplier) == 0x460); static_assert(offsetof(Entity_Tear, _deadEyeIntensity) == 0x464); static_assert(offsetof(Entity_Tear, _multidimensionalTouched) == 0x468); static_assert(offsetof(Entity_Tear, _prismTouched) == 0x469); +static_assert(offsetof(Entity_Tear, _isFireSoundPending) == 0x46a); +static_assert(offsetof(Entity_Tear, _popBounceCount) == 0x46c); +static_assert(offsetof(Entity_Tear, _hitCount) == 0x470); +static_assert(offsetof(Entity_Tear, _deathFlags) == 0x474); static_assert(offsetof(Entity_Tear, _stickTarget) == 0x478); static_assert(offsetof(Entity_Tear, _stickDiff) == 0x47c); static_assert(offsetof(Entity_Tear, _stickTimer) == 0x484); +static_assert(offsetof(Entity_Tear, _techZeroLaser) == 0x488); +static_assert(offsetof(Entity_Tear, _techZeroTarget) == 0x48c); +static_assert(offsetof(Entity_Tear, _laserShotLaser) == 0x490); +static_assert(offsetof(Entity_Tear, _linkPrev) == 0x494); +static_assert(offsetof(Entity_Tear, _linkNext) == 0x498); +static_assert(offsetof(Entity_Tear, _attachedEffect) == 0x49c); static_assert(offsetof(Entity_Tear, _tearHaloANM2) == 0x4ac); static_assert(offsetof(Entity_Tear, _tearEffectANM2) == 0x5c0); static_assert(offsetof(Entity_Tear, _deadEyeANM2) == 0x6d4); static_assert(offsetof(Entity_Tear, _canTriggerStreakEnd) == 0x7e8); static_assert(offsetof(Entity_Tear, _posDisplacement) == 0x7ec); static_assert(offsetof(Entity_Tear, _parentOffset) == 0x7f4); +static_assert(offsetof(Entity_Tear, _holdTimer) == 0x7fc); +static_assert(offsetof(Entity_Tear, _holdOffset) == 0x800); +static_assert(offsetof(Entity_Tear, _holdVelocity) == 0x808); static_assert(offsetof(Entity_Tear, _tearRange) == 0x820); struct Font { @@ -3454,22 +3455,6 @@ struct PlayerManager { static_assert(offsetof(PlayerManager, _playerList) == 0x0); static_assert(offsetof(PlayerManager, _rng) == 0xb8); -struct Seeds { - bool _isCustomRun; // 006b83d0 (Lua Seeds:IsCustomRun binding, misnamed Room::IsInitialized) returns *(byte*)this; 009e9290 ctor / 009e9bc0 Reset clear byte 0 - uint8_t _pad_0x1[0x3]; - uint32_t _gameStartSeed; // 00436140 Lua GetStartSeed returns [this+4] ("Game Start Seed was not set" if 0); 009eb880 set_start_seed writes it; 0085e180 ClearStartSeed zeroes it - uint8_t _rng[0x48]; // RNG; 006ef890 Lua GetNextSeed steps xorshift seed this+8 with shifts +0xc/+0x10/+0x14; ctor inits 0xaa17414f,5,9,7; set_start_seed seeds it from start seed - uint32_t _playerInitSeed; - uint32_t _seedEffects; // void* // std::set head ptr (new vs REPENTOGON): 009e9290 ctor allocs 0x14-byte tree head at this+0x54; 00685e70 ClearSeedEffects erases tree this+0x54 then count +0x58=0 - int _seedEffectsCount; // 0085e1b0 Lua CountSeedEffects returns this+0x58; ClearSeedEffects zeroes it -}; -static_assert(offsetof(Seeds, _isCustomRun) == 0x0); -static_assert(offsetof(Seeds, _gameStartSeed) == 0x4); -static_assert(offsetof(Seeds, _rng) == 0x8); -static_assert(offsetof(Seeds, _playerInitSeed) == 0x50); -static_assert(offsetof(Seeds, _seedEffects) == 0x54); -static_assert(offsetof(Seeds, _seedEffectsCount) == 0x58); - struct HUD { uint8_t _pad_0x0[0x3778]; ANM2 _chargeBarSprite; // HUD::LoadGraphics 009a1a30 loads gfx/ui/ui_chargebar.anm2; ctor 006f2060 (PlayerHUD 0x6dc x8 + 2 Font = 0x20 below REPENTOGON) @@ -3548,6 +3533,64 @@ static_assert(offsetof(Minimap, _iconsSprite) == 0x500); static_assert(offsetof(Minimap, _shakeDuration) == 0x61c); static_assert(offsetof(Minimap, _shakeOffset) == 0x620); +struct RoomDescriptor { + int32_t GridIndex; + int32_t SafeGridIndex; + int32_t ListIndex; + uint8_t _pad_0xc[0x4]; + uint32_t Data; // RoomConfig_Room* + uint32_t OverrideData; // RoomConfig_Room* + int32_t AllowedDoors; + uint8_t _pad_0x1c[0x20]; + int32_t DisplayFlags; + int32_t VisitedCount; + int32_t Flags; + uint8_t _pad_0x48[0x2]; + int16_t ClearCount; + uint8_t _pad_0x4c[0x4]; + int16_t PoopCount; + uint8_t _pad_0x52[0x2]; + int32_t PitsCount; + int32_t DecorationSeed; + int32_t SpawnSeed; + int32_t AwardSeed; + uint8_t _pad_0x64[0x48]; + int16_t ShopItemIdx; + int16_t ShopItemDiscountIdx; + int32_t DeliriumDistance; + int32_t Group; // RoomDescriptor::constructor 006ef590 sets +0xb4 = -1; operator_assign 007387d0 copies it as last dword (stride 0xb8); Level::GetRandomRoomIndex 00740860 only picks rooms whose +0xb4 is -1 or equals the current room's +}; +static_assert(offsetof(RoomDescriptor, GridIndex) == 0x0); +static_assert(offsetof(RoomDescriptor, SafeGridIndex) == 0x4); +static_assert(offsetof(RoomDescriptor, ListIndex) == 0x8); +static_assert(offsetof(RoomDescriptor, Data) == 0x10); +static_assert(offsetof(RoomDescriptor, OverrideData) == 0x14); +static_assert(offsetof(RoomDescriptor, AllowedDoors) == 0x18); +static_assert(offsetof(RoomDescriptor, DisplayFlags) == 0x3c); +static_assert(offsetof(RoomDescriptor, VisitedCount) == 0x40); +static_assert(offsetof(RoomDescriptor, Flags) == 0x44); +static_assert(offsetof(RoomDescriptor, ClearCount) == 0x4a); +static_assert(offsetof(RoomDescriptor, PoopCount) == 0x50); +static_assert(offsetof(RoomDescriptor, PitsCount) == 0x54); +static_assert(offsetof(RoomDescriptor, DecorationSeed) == 0x58); +static_assert(offsetof(RoomDescriptor, SpawnSeed) == 0x5c); +static_assert(offsetof(RoomDescriptor, AwardSeed) == 0x60); +static_assert(offsetof(RoomDescriptor, ShopItemIdx) == 0xac); +static_assert(offsetof(RoomDescriptor, ShopItemDiscountIdx) == 0xae); +static_assert(offsetof(RoomDescriptor, DeliriumDistance) == 0xb0); +static_assert(offsetof(RoomDescriptor, Group) == 0xb4); + +struct KColor { + float _red; + float _green; + float _blue; + float _alpha; +}; +static_assert(offsetof(KColor, _red) == 0x0); +static_assert(offsetof(KColor, _green) == 0x4); +static_assert(offsetof(KColor, _blue) == 0x8); +static_assert(offsetof(KColor, _alpha) == 0xc); + struct Game { uint32_t _stage; // Level:GetStage binding (0040c3a0) returns *this; Game:GetLevel (00424530) returns this, so Level*==Game* uint32_t _stageType; // Level:GetStageType (004073c0) returns this+4; Level::IsAltStage (0042a2c0) tests it !=0 @@ -3555,7 +3598,10 @@ struct Game { bool _devilRoomDisabled; // Level::IsDevilRoomDisabled (007e9250) reads, Level::DisableDevilRoom (007e9260) sets byte this+9=1 uint8_t _pad_0xa[0x2]; uint32_t _curses; // Level::GetCurses (00748490) ORs this+0xc with forced curses; Level::RemoveCurses (00748bc0) clears bits in it - uint8_t _pad_0x10[0x182bc]; + uint8_t _pad_0x10[0x4]; + RoomDescriptor _roomList[527]; // Level*==Game*: Level::GetRoomByIdx 00740bc0 returns this+0x14+n*0xb8, n < 0x20f + int _roomMap[507]; // Level*==Game*: Level::GetRoomByIdx 00740bc0 indexes this+0x17adc+(dimension*0xa9+idx)*4 + uint32_t _currentRoomMap; // int* // Level*==Game*: Level::ChangeRoom 0073fc80 sets it to this+0x17adc+dimension*0x2a4 uint32_t _nbRooms; // Level::GetRoomCount (0056ff80) returns it; Level::GetRoomByIdx (00740bc0) loops rooms up to it uint32_t _startingRoomIdx; // Level::GetStartingRoomIndex (00505c70) returns it uint8_t _generationRNG[0x10]; // RNG; Game ctor (006f1020) inits RNG (seed 0xaa17414f, shifts 5/9/7); Level::Init (00744940) seeds+steps it; used by Level::place_special_rooms/generate_dungeon/generate_mineshaft @@ -3577,20 +3623,16 @@ struct Game { uint8_t _pad_0x18338[0x38]; uint32_t _greedModeTreasureRoomIdx; // level gen (0074399a etc.) sets it to 0x55; ItemPool::get_pool_from_room_entities (007ebe20): greed mode treasure room != this idx -> boss pool int _greedWavesClearedWithoutRedHeartDamage; // Room::SpawnGreedModeWave (00816910) increments it, extra wave every 3; Level::SetRedHeartDamage (0074b5b0) zeroes it (REPENTOGON Level had 0x18204) - uint8_t _pad_0x18378[0x24]; + uint8_t _ventricleRazorPortals[24]; // Level*==Game*: FUN_0074a280 writes 2 x 0xc portal records (Ventricle Razor, UseActiveItem case 0x18c) + uint8_t _pad_0x18390[0xc]; uint32_t _levelStateFlags; // Level::GetStateFlag (004f88f0)/SetStateFlag (00428a80) test/set bit in this+0x1839c uint8_t _pad_0x183a0[0x4]; uint8_t _myosotisPickups[0x56c]; // vector_EntitySaveState; Room::Update (00802980) if non-empty calls FUN_00752830 on it then checks trinket 0x89 (Myosotis); ctor zeroes 0x183a4..0x183ac uint8_t _roomConfig[0x1e30]; // RoomConfig; Game ctor builds 0x25 RoomConfigStage at it; Level::ForceHorsemanBoss (007481d0) and FUN_00745b70 call RoomConfig::GetRoomByStageTypeAndVariant with ECX=Game+0x18910 ItemPool _itemPool; - uint8_t _pad_0x1aee4[0x8c]; - uint8_t _bossPool[0x8cc]; // BossPool - uint8_t _roomTransition[0x23c]; // RoomTransition - uint8_t _stageTransition[0x30]; // StageTransition + uint8_t _pad_0x1aee4[0xbc4]; PlayerManager _playerManager; - uint8_t _pad_0x1bb64[0x20]; - Seeds _seedEffects; - uint8_t _pad_0x1bbe0[0x454]; + uint8_t _pad_0x1bb64[0x4d0]; uint8_t _itemOverlay[0x14ec]; // ItemOverlay uint8_t _gameOver[0x130]; // GameOver; Game::Render (006fbc10) calls GameOver::Render (00998880) with ECX=Game+0x1d520; ctor builds it after ItemOverlay uint8_t _leaderboard[0x3b4]; // Leaderboard; Game::Update (006fadc0) calls Leaderboard::Update (00857450) with ECX=Game+0x1d650; ctor calls its ctor 00856f70 there @@ -3599,44 +3641,57 @@ struct Game { uint8_t _pauseScreen[0x1458]; // PauseScreen; Game ctor calls PauseScreen::constructor (009b5320) on Game+0x23a74; Game::Update/Render test state dword there and render it when !=0 uint8_t _revivePlayerMenu[0x1000]; // RevivePlayerMenu; Game::LoadConfigXmls (006f4740) calls RevivePlayerMenu::Init (008ef560) with ECX=Game+0x24ecc; Game::Render calls 008efe10 on it (not in REPENTOGON) Minimap _minimap; // HUD::Render (009a3eb0) calls Minimap::Render with ECX=Game+0x25ecc; LoadConfigXmls calls Minimap::Init on it; 8 Minimap::Refresh calls on it - uint8_t _pad_0x264f4[0x4]; + int _freezeFrames; // Game::Update 006fadc0 decrements it while >0 and returns right after HUD::PostUpdate (no game update); Game::IsPaused 006fd350 returns 1 while >0; reset_run_state 006f43b0 zeroes it int _frameCount; int _timeCounter; // Lua Game.TimeCounter via binder 008952b0: getter 008c2850 FUN_0085bfd0 signed dword, setter dword int _bossRushParTime; int _blueWombParTime; - uint8_t _pad_0x26508[0x4]; + int _screenShakeTimer; // Lua Game:ShakeScreen 00703670 writes the timeout; Game::Update 006fadc0 counts down, zeroes _screenShakeOffset at 0; Camera::update_follow 009446e0 scales shake by timer/11 Vector _screenShakeOffset; - uint8_t _pad_0x26514[0x20]; - bool _triggerWindowResize; - uint8_t _pad_0x26535[0xf]; - uint32_t _debugFlags; - uint64_t _gameStateFlags; - uint8_t _pad_0x26550[0x4]; + int _darknessTimeout; // Lua Game:Darken 00440ee0 writes param 2; Game::Update 006fadc0: while >0 decrement and raise +0x26518 by 1/21, else lower it by 1/30 + float _darknessModifier; // Game::GetDarknessModifier 00440610 returns it; Game::Update 006fadc0 ramps it 0..1 by _darknessTimeout; renderer uses 1 - _darknessStrength*it*0.96 + float _darknessStrength; // Lua Game:Darken 00440ee0 writes param 1; multiplied with _darknessModifier in Room::render_darkness_overlay 00825de0 + uint8_t _giantBookClickerImage[8]; // image handle (+0 ptr, +4 owner): Game::Render 006fbc10 loads gfx/ui/giantbook/GiantBook_Clicker.png into it when null; ~Game 006f3060 releases it + int _bloomTimer; // Game::SetBloom 00703830 sets it = Time; Game::Update 006fadc0 counts it down; Game::Render 006fbc10 bloom pass while >0, intensity sin(1-|t-dur/2|/(dur/2)) + int _bloomDuration; // Game::SetBloom 00703830 sets it = Time; Game::Render 006fbc10 uses it as the total for the bloom curve + float _bloomStrength; // Game::SetBloom 00703830 stores the XMM2 Strength; Game::Render 006fbc10 multiplies the bloom curve by it + uint8_t _pad_0x26534[0x4]; + int _hallucinationTimer; // Lua Game:ShowHallucination 007059f0 sets it; HasHallucination 004a5d00 returns >0; Game::Update 006fadc0 counts it down; Game::Render 006fbc10 draws the effect while >0 + int _hallucinationDuration; // ShowHallucination 007059f0 sets it with the timer; Game::Render 006fbc10 fades by (timer - duration + 20) + bool _isRoomSnapshotTaken; // ? Game::Render 006fbc10 renders into render target DAT_00c797a4 30 frames after room entry (or 1 in 3 by room seed when already set) and sets it to 1; ResetState 006f4520 clears it + uint8_t _pad_0x26541[0x13]; int _lastDevilRoomStage; - int _treasureRoomsVisited; - int _planetariumsVisited; + uint8_t _pad_0x26558[0x8]; int _stagesWithoutHeartsPicked; int _stagesWithoutDamage; int _devilRoomDeals; int _donationModGreed; int _donationModAngel; - int _shopVisits; - uint8_t _pad_0x26578[0x8]; - uint32_t _entityFactory; // EntityFactory* + uint8_t _pad_0x26574[0x10]; uint32_t _challenge; - bool _isRerun; - bool _isDebug; - uint8_t _pad_0x2658a[0x3e]; - uint8_t _ambush[0x68]; // Ambush - uint8_t _dailyChallenge[0xb4]; // DailyChallenge - uint8_t _scoreSheet[0x90]; // ScoreSheet + uint8_t _pad_0x26588[0x4]; + KColor _fadeInColor; // Lua Game:Fadein 006f5210 copies a KColor (5 dwords 0x2658c..0x2659c), alpha +0xc (0x26598) set 1.0; Game::Update 006fadc0 lowers alpha by _fadeSpeed; Render 006fbc10 draws the quad while alpha > 0 + uint8_t _pad_0x2659c[0x4]; + bool _isFadeInIconShown; // ? Fadein 006f5210 param 2 / FUN_00707ad0 sets 1; Game::Render 006fbc10 calls FUN_009522b0 (frame%16 animated icon) during the fade-in + uint8_t _pad_0x265a1[0x3]; + KColor _fadeOutColor; // Lua Game:Fadeout 006f5290 copies the KColor to 0x265a4..0x265b4 and adds speed to its alpha (0x265b0); Game::Update 006fadc0 raises alpha to 1 then acts on _fadeOutTarget + uint8_t _pad_0x265b4[0x4]; + float _fadeSpeed; // Fadein 006f5210 / Fadeout 006f5290 store the speed; Game::Update 006fadc0 steps the fade alphas by it + int _fadeOutTarget; // Game::Fadeout 006f5290 stores the target (<= 0xb, "Invalid target specified to Game::Fadeout()"); Game::Update 006fadc0 switches on it when the fade completes + int _framesSinceRoomTransition; // Game::Update 006fadc0 increments it each normal frame and zeroes it while a RoomTransition is active; FUN_00708350 returns true while < 8; ResetState/ctor zero it + uint8_t _pad_0x265c4[0x4]; + uint8_t _ambush[0x1ac]; // Ambush int _victoryLap; - uint8_t _genericPrompt[0x248]; // GenericPrompt + uint8_t _pad_0x26778[0x248]; int _lastLevelWithoutHalfHp; uint8_t _pad_0x269c4[0x4]; uint32_t _difficulty; int _lastLevelWithDamage; - uint8_t _pad_0x269d0[0x19]; + uint8_t _pad_0x269d0[0x4]; + uint8_t _encounteredBosses[12]; // std::vector<{int type, int variant}>: Lua Game:AddEncounteredBoss 00703470 pushes (8-byte stride 0x269d4/d8/dc), HasEncounteredBoss 00703510 / GetNumEncounteredBosses 0085e370 scan it + int _pixelationTimer; // Lua Game:AddPixelation 00753cc0 sets it to max(cur, arg); Game::Update 006fadc0 counts it down; Room::Render 0080f200 pixelation while >0 + int _pixelationDuration; // ? AddPixelation 00753cc0 writes the same max value; read by Room::Render 0080f200 as the total + bool _isInstantFadeIn; // Console::RunCommand (restart branch, FUN_00685ee0) sets 1 after Manager::RestartGame; Fadein 006f5210 / FUN_00707ad0 then start alpha at 1e-5 instead of 1.0; Game::Update 006fadc0 clears it when the fade ends bool _isStartingFromState; // FUN_00959720 sets 1 around Game::restore_game_state..LuaEngine::PostGameStart then 0; Player::AddSoulHearts (00758d00) skips while set; reset_run_state zeroes bool _isStoringGlowingHourglassState; // Game::save_rewind_state (00705ee0) sets 1 while storing the slot, 0 after, and bails if already set bool _isRestoringGlowingHourglassState; // Entity_Player::RestoreGameState (007ae4b0) branches on it; save_rewind_state bails if set @@ -3663,6 +3718,9 @@ static_assert(offsetof(Game, _stageType) == 0x4); static_assert(offsetof(Game, _bossChallenge) == 0x8); static_assert(offsetof(Game, _devilRoomDisabled) == 0x9); static_assert(offsetof(Game, _curses) == 0xc); +static_assert(offsetof(Game, _roomList) == 0x14); +static_assert(offsetof(Game, _roomMap) == 0x17adc); +static_assert(offsetof(Game, _currentRoomMap) == 0x182c8); static_assert(offsetof(Game, _nbRooms) == 0x182cc); static_assert(offsetof(Game, _startingRoomIdx) == 0x182d0); static_assert(offsetof(Game, _generationRNG) == 0x182d4); @@ -3680,15 +3738,12 @@ static_assert(offsetof(Game, _dungeonPlacementSeed) == 0x1832c); static_assert(offsetof(Game, _greedModeWave) == 0x18334); static_assert(offsetof(Game, _greedModeTreasureRoomIdx) == 0x18370); static_assert(offsetof(Game, _greedWavesClearedWithoutRedHeartDamage) == 0x18374); +static_assert(offsetof(Game, _ventricleRazorPortals) == 0x18378); static_assert(offsetof(Game, _levelStateFlags) == 0x1839c); static_assert(offsetof(Game, _myosotisPickups) == 0x183a4); static_assert(offsetof(Game, _roomConfig) == 0x18910); static_assert(offsetof(Game, _itemPool) == 0x1a740); -static_assert(offsetof(Game, _bossPool) == 0x1af70); -static_assert(offsetof(Game, _roomTransition) == 0x1b83c); -static_assert(offsetof(Game, _stageTransition) == 0x1ba78); static_assert(offsetof(Game, _playerManager) == 0x1baa8); -static_assert(offsetof(Game, _seedEffects) == 0x1bb84); static_assert(offsetof(Game, _itemOverlay) == 0x1c034); static_assert(offsetof(Game, _gameOver) == 0x1d520); static_assert(offsetof(Game, _leaderboard) == 0x1d650); @@ -3696,35 +3751,45 @@ static_assert(offsetof(Game, _hud) == 0x1da04); static_assert(offsetof(Game, _pauseScreen) == 0x23a74); static_assert(offsetof(Game, _revivePlayerMenu) == 0x24ecc); static_assert(offsetof(Game, _minimap) == 0x25ecc); +static_assert(offsetof(Game, _freezeFrames) == 0x264f4); static_assert(offsetof(Game, _frameCount) == 0x264f8); static_assert(offsetof(Game, _timeCounter) == 0x264fc); static_assert(offsetof(Game, _bossRushParTime) == 0x26500); static_assert(offsetof(Game, _blueWombParTime) == 0x26504); +static_assert(offsetof(Game, _screenShakeTimer) == 0x26508); static_assert(offsetof(Game, _screenShakeOffset) == 0x2650c); -static_assert(offsetof(Game, _triggerWindowResize) == 0x26534); -static_assert(offsetof(Game, _debugFlags) == 0x26544); -static_assert(offsetof(Game, _gameStateFlags) == 0x26548); +static_assert(offsetof(Game, _darknessTimeout) == 0x26514); +static_assert(offsetof(Game, _darknessModifier) == 0x26518); +static_assert(offsetof(Game, _darknessStrength) == 0x2651c); +static_assert(offsetof(Game, _giantBookClickerImage) == 0x26520); +static_assert(offsetof(Game, _bloomTimer) == 0x26528); +static_assert(offsetof(Game, _bloomDuration) == 0x2652c); +static_assert(offsetof(Game, _bloomStrength) == 0x26530); +static_assert(offsetof(Game, _hallucinationTimer) == 0x26538); +static_assert(offsetof(Game, _hallucinationDuration) == 0x2653c); +static_assert(offsetof(Game, _isRoomSnapshotTaken) == 0x26540); static_assert(offsetof(Game, _lastDevilRoomStage) == 0x26554); -static_assert(offsetof(Game, _treasureRoomsVisited) == 0x26558); -static_assert(offsetof(Game, _planetariumsVisited) == 0x2655c); static_assert(offsetof(Game, _stagesWithoutHeartsPicked) == 0x26560); static_assert(offsetof(Game, _stagesWithoutDamage) == 0x26564); static_assert(offsetof(Game, _devilRoomDeals) == 0x26568); static_assert(offsetof(Game, _donationModGreed) == 0x2656c); static_assert(offsetof(Game, _donationModAngel) == 0x26570); -static_assert(offsetof(Game, _shopVisits) == 0x26574); -static_assert(offsetof(Game, _entityFactory) == 0x26580); static_assert(offsetof(Game, _challenge) == 0x26584); -static_assert(offsetof(Game, _isRerun) == 0x26588); -static_assert(offsetof(Game, _isDebug) == 0x26589); +static_assert(offsetof(Game, _fadeInColor) == 0x2658c); +static_assert(offsetof(Game, _isFadeInIconShown) == 0x265a0); +static_assert(offsetof(Game, _fadeOutColor) == 0x265a4); +static_assert(offsetof(Game, _fadeSpeed) == 0x265b8); +static_assert(offsetof(Game, _fadeOutTarget) == 0x265bc); +static_assert(offsetof(Game, _framesSinceRoomTransition) == 0x265c0); static_assert(offsetof(Game, _ambush) == 0x265c8); -static_assert(offsetof(Game, _dailyChallenge) == 0x26630); -static_assert(offsetof(Game, _scoreSheet) == 0x266e4); static_assert(offsetof(Game, _victoryLap) == 0x26774); -static_assert(offsetof(Game, _genericPrompt) == 0x26778); static_assert(offsetof(Game, _lastLevelWithoutHalfHp) == 0x269c0); static_assert(offsetof(Game, _difficulty) == 0x269c8); static_assert(offsetof(Game, _lastLevelWithDamage) == 0x269cc); +static_assert(offsetof(Game, _encounteredBosses) == 0x269d4); +static_assert(offsetof(Game, _pixelationTimer) == 0x269e0); +static_assert(offsetof(Game, _pixelationDuration) == 0x269e4); +static_assert(offsetof(Game, _isInstantFadeIn) == 0x269e8); static_assert(offsetof(Game, _isStartingFromState) == 0x269e9); static_assert(offsetof(Game, _isStoringGlowingHourglassState) == 0x269ea); static_assert(offsetof(Game, _isRestoringGlowingHourglassState) == 0x269eb); @@ -3769,7 +3834,7 @@ struct GridEntity { int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3777,7 +3842,6 @@ struct GridEntity { static_assert(offsetof(GridEntity, _desc) == 0x4); static_assert(offsetof(GridEntity, _varData) == 0x18); static_assert(offsetof(GridEntity, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity, _rng) == 0x2c); static_assert(offsetof(GridEntity, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity, _sprite) == 0x40); @@ -3788,7 +3852,7 @@ struct GridEntity_Decoration { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3796,7 +3860,6 @@ struct GridEntity_Decoration { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Decoration, _desc) == 0x4); static_assert(offsetof(GridEntity_Decoration, _varData) == 0x18); static_assert(offsetof(GridEntity_Decoration, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Decoration, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Decoration, _rng) == 0x2c); static_assert(offsetof(GridEntity_Decoration, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Decoration, _sprite) == 0x40); @@ -3807,7 +3870,7 @@ struct GridEntity_Door { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; uint8_t _sprite[0x94]; // ANM2 @@ -3821,8 +3884,7 @@ struct GridEntity_Door { // : GridEntity (flattened) ANM2 _extraSprite; bool _isExtraVisible; // Lua GridEntityDoor.ExtraVisible via binder 0088be50: getter 008c0c10 pushboolean(byte), setter toboolean -> bool bool _isBusted; - uint8_t _pad_0x392[0x2]; - int _targetRoomIdx; + uint8_t _pad_0x392[0x6]; uint32_t _previousState; uint32_t _previousVariant; uint8_t _pad_0x3a0[0x4]; @@ -3834,7 +3896,6 @@ struct GridEntity_Door { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Door, _desc) == 0x4); static_assert(offsetof(GridEntity_Door, _varData) == 0x18); static_assert(offsetof(GridEntity_Door, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Door, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Door, _rng) == 0x2c); static_assert(offsetof(GridEntity_Door, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Door, _sprite) == 0x40); @@ -3846,7 +3907,6 @@ static_assert(offsetof(GridEntity_Door, _direction) == 0x164); static_assert(offsetof(GridEntity_Door, _extraSprite) == 0x27c); static_assert(offsetof(GridEntity_Door, _isExtraVisible) == 0x390); static_assert(offsetof(GridEntity_Door, _isBusted) == 0x391); -static_assert(offsetof(GridEntity_Door, _targetRoomIdx) == 0x394); static_assert(offsetof(GridEntity_Door, _previousState) == 0x398); static_assert(offsetof(GridEntity_Door, _previousVariant) == 0x39c); static_assert(offsetof(GridEntity_Door, _openAnimation) == 0x3a4); @@ -3860,7 +3920,7 @@ struct GridEntity_Fire { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3868,7 +3928,6 @@ struct GridEntity_Fire { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Fire, _desc) == 0x4); static_assert(offsetof(GridEntity_Fire, _varData) == 0x18); static_assert(offsetof(GridEntity_Fire, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Fire, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Fire, _rng) == 0x2c); static_assert(offsetof(GridEntity_Fire, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Fire, _sprite) == 0x40); @@ -3879,7 +3938,7 @@ struct GridEntity_Gravity { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3887,7 +3946,6 @@ struct GridEntity_Gravity { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Gravity, _desc) == 0x4); static_assert(offsetof(GridEntity_Gravity, _varData) == 0x18); static_assert(offsetof(GridEntity_Gravity, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Gravity, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Gravity, _rng) == 0x2c); static_assert(offsetof(GridEntity_Gravity, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Gravity, _sprite) == 0x40); @@ -3898,7 +3956,7 @@ struct GridEntity_Lock { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3906,7 +3964,6 @@ struct GridEntity_Lock { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Lock, _desc) == 0x4); static_assert(offsetof(GridEntity_Lock, _varData) == 0x18); static_assert(offsetof(GridEntity_Lock, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Lock, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Lock, _rng) == 0x2c); static_assert(offsetof(GridEntity_Lock, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Lock, _sprite) == 0x40); @@ -3917,7 +3974,7 @@ struct GridEntity_Pit { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3926,7 +3983,6 @@ struct GridEntity_Pit { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Pit, _desc) == 0x4); static_assert(offsetof(GridEntity_Pit, _varData) == 0x18); static_assert(offsetof(GridEntity_Pit, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Pit, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Pit, _rng) == 0x2c); static_assert(offsetof(GridEntity_Pit, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Pit, _sprite) == 0x40); @@ -3938,7 +3994,7 @@ struct GridEntity_Poop { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3949,7 +4005,6 @@ struct GridEntity_Poop { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Poop, _desc) == 0x4); static_assert(offsetof(GridEntity_Poop, _varData) == 0x18); static_assert(offsetof(GridEntity_Poop, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Poop, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Poop, _rng) == 0x2c); static_assert(offsetof(GridEntity_Poop, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Poop, _sprite) == 0x40); @@ -3963,7 +4018,7 @@ struct GridEntity_PressurePlate { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3974,7 +4029,6 @@ struct GridEntity_PressurePlate { // : GridEntity (flattened) static_assert(offsetof(GridEntity_PressurePlate, _desc) == 0x4); static_assert(offsetof(GridEntity_PressurePlate, _varData) == 0x18); static_assert(offsetof(GridEntity_PressurePlate, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_PressurePlate, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_PressurePlate, _rng) == 0x2c); static_assert(offsetof(GridEntity_PressurePlate, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_PressurePlate, _sprite) == 0x40); @@ -3988,7 +4042,7 @@ struct GridEntity_Rock { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3999,7 +4053,6 @@ struct GridEntity_Rock { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Rock, _desc) == 0x4); static_assert(offsetof(GridEntity_Rock, _varData) == 0x18); static_assert(offsetof(GridEntity_Rock, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Rock, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Rock, _rng) == 0x2c); static_assert(offsetof(GridEntity_Rock, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Rock, _sprite) == 0x40); @@ -4013,7 +4066,7 @@ struct GridEntity_Spikes { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4022,7 +4075,6 @@ struct GridEntity_Spikes { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Spikes, _desc) == 0x4); static_assert(offsetof(GridEntity_Spikes, _varData) == 0x18); static_assert(offsetof(GridEntity_Spikes, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Spikes, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Spikes, _rng) == 0x2c); static_assert(offsetof(GridEntity_Spikes, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Spikes, _sprite) == 0x40); @@ -4034,7 +4086,7 @@ struct GridEntity_Stairs { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4042,7 +4094,6 @@ struct GridEntity_Stairs { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Stairs, _desc) == 0x4); static_assert(offsetof(GridEntity_Stairs, _varData) == 0x18); static_assert(offsetof(GridEntity_Stairs, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Stairs, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Stairs, _rng) == 0x2c); static_assert(offsetof(GridEntity_Stairs, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Stairs, _sprite) == 0x40); @@ -4053,7 +4104,7 @@ struct GridEntity_Statue { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4061,7 +4112,6 @@ struct GridEntity_Statue { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Statue, _desc) == 0x4); static_assert(offsetof(GridEntity_Statue, _varData) == 0x18); static_assert(offsetof(GridEntity_Statue, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Statue, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Statue, _rng) == 0x2c); static_assert(offsetof(GridEntity_Statue, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Statue, _sprite) == 0x40); @@ -4072,7 +4122,7 @@ struct GridEntity_TNT { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4081,7 +4131,6 @@ struct GridEntity_TNT { // : GridEntity (flattened) static_assert(offsetof(GridEntity_TNT, _desc) == 0x4); static_assert(offsetof(GridEntity_TNT, _varData) == 0x18); static_assert(offsetof(GridEntity_TNT, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_TNT, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_TNT, _rng) == 0x2c); static_assert(offsetof(GridEntity_TNT, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_TNT, _sprite) == 0x40); @@ -4093,7 +4142,7 @@ struct GridEntity_Teleporter { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4101,7 +4150,6 @@ struct GridEntity_Teleporter { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Teleporter, _desc) == 0x4); static_assert(offsetof(GridEntity_Teleporter, _varData) == 0x18); static_assert(offsetof(GridEntity_Teleporter, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Teleporter, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Teleporter, _rng) == 0x2c); static_assert(offsetof(GridEntity_Teleporter, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Teleporter, _sprite) == 0x40); @@ -4112,7 +4160,7 @@ struct GridEntity_TrapDoor { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4120,7 +4168,6 @@ struct GridEntity_TrapDoor { // : GridEntity (flattened) static_assert(offsetof(GridEntity_TrapDoor, _desc) == 0x4); static_assert(offsetof(GridEntity_TrapDoor, _varData) == 0x18); static_assert(offsetof(GridEntity_TrapDoor, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_TrapDoor, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_TrapDoor, _rng) == 0x2c); static_assert(offsetof(GridEntity_TrapDoor, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_TrapDoor, _sprite) == 0x40); @@ -4131,7 +4178,7 @@ struct GridEntity_Wall { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4139,7 +4186,6 @@ struct GridEntity_Wall { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Wall, _desc) == 0x4); static_assert(offsetof(GridEntity_Wall, _varData) == 0x18); static_assert(offsetof(GridEntity_Wall, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Wall, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Wall, _rng) == 0x2c); static_assert(offsetof(GridEntity_Wall, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Wall, _sprite) == 0x40); @@ -4150,7 +4196,7 @@ struct GridEntity_Web { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint32_t _spawnFrame; + uint8_t _pad_0x28[0x4]; uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4158,7 +4204,6 @@ struct GridEntity_Web { // : GridEntity (flattened) static_assert(offsetof(GridEntity_Web, _desc) == 0x4); static_assert(offsetof(GridEntity_Web, _varData) == 0x18); static_assert(offsetof(GridEntity_Web, _gridIndex) == 0x24); -static_assert(offsetof(GridEntity_Web, _spawnFrame) == 0x28); static_assert(offsetof(GridEntity_Web, _rng) == 0x2c); static_assert(offsetof(GridEntity_Web, _collisionClass) == 0x3c); static_assert(offsetof(GridEntity_Web, _sprite) == 0x40); @@ -4172,8 +4217,7 @@ static_assert(offsetof(ItemConfig, _collectibleNameMap) == 0x3c); struct ItemConfig_Card { int id; int achievementId; - uint8_t name[0x18]; // std_string - uint8_t desc[0x18]; // std_string + uint8_t name[0x30]; // std_string uint8_t hudAnim[0x18]; // std_string bool greedModeAllowed; uint8_t _pad_0x51[0x3]; @@ -4188,7 +4232,6 @@ struct ItemConfig_Card { static_assert(offsetof(ItemConfig_Card, id) == 0x0); static_assert(offsetof(ItemConfig_Card, achievementId) == 0x4); static_assert(offsetof(ItemConfig_Card, name) == 0x8); -static_assert(offsetof(ItemConfig_Card, desc) == 0x20); static_assert(offsetof(ItemConfig_Card, hudAnim) == 0x38); static_assert(offsetof(ItemConfig_Card, greedModeAllowed) == 0x50); static_assert(offsetof(ItemConfig_Card, pickupSubtype) == 0x54); @@ -4222,8 +4265,7 @@ static_assert(offsetof(ItemConfig_Costume, overwriteColor) == 0x28); struct ItemConfig_Item { int type; int id; - uint8_t name[0x18]; // std_string - uint8_t desc[0x18]; // std_string + uint8_t name[0x30]; // std_string uint8_t gfxFilename[0x18]; // std_string int achievementId; int cacheFlags; @@ -4256,7 +4298,6 @@ struct ItemConfig_Item { static_assert(offsetof(ItemConfig_Item, type) == 0x0); static_assert(offsetof(ItemConfig_Item, id) == 0x4); static_assert(offsetof(ItemConfig_Item, name) == 0x8); -static_assert(offsetof(ItemConfig_Item, desc) == 0x20); static_assert(offsetof(ItemConfig_Item, gfxFilename) == 0x38); static_assert(offsetof(ItemConfig_Item, achievementId) == 0x50); static_assert(offsetof(ItemConfig_Item, cacheFlags) == 0x54); @@ -4287,13 +4328,12 @@ static_assert(offsetof(ItemConfig_Item, _initCharge) == 0xc8); struct ItemConfig_Pill { int id; int achievementId; - uint8_t name[0x18]; // std_string - uint8_t desc[0x18]; // std_string + uint8_t name[0x30]; // std_string bool greedModeAllowed; uint8_t _pad_0x39[0x3]; uint32_t announcerVoice; uint32_t announcerVoiceSuper; - uint32_t announcerVoiceDelay; + uint8_t _pad_0x44[0x4]; uint32_t mimicCharge; uint8_t effectClass; uint8_t effectSubClass; @@ -4301,42 +4341,35 @@ struct ItemConfig_Pill { static_assert(offsetof(ItemConfig_Pill, id) == 0x0); static_assert(offsetof(ItemConfig_Pill, achievementId) == 0x4); static_assert(offsetof(ItemConfig_Pill, name) == 0x8); -static_assert(offsetof(ItemConfig_Pill, desc) == 0x20); static_assert(offsetof(ItemConfig_Pill, greedModeAllowed) == 0x38); static_assert(offsetof(ItemConfig_Pill, announcerVoice) == 0x3c); static_assert(offsetof(ItemConfig_Pill, announcerVoiceSuper) == 0x40); -static_assert(offsetof(ItemConfig_Pill, announcerVoiceDelay) == 0x44); static_assert(offsetof(ItemConfig_Pill, mimicCharge) == 0x48); static_assert(offsetof(ItemConfig_Pill, effectClass) == 0x4c); static_assert(offsetof(ItemConfig_Pill, effectSubClass) == 0x4d); -struct KColor { - float _red; - float _green; - float _blue; - float _alpha; -}; -static_assert(offsetof(KColor, _red) == 0x0); -static_assert(offsetof(KColor, _green) == 0x4); -static_assert(offsetof(KColor, _blue) == 0x8); -static_assert(offsetof(KColor, _alpha) == 0xc); - struct Level { uint32_t _stage; // Level:GetStage binding (0040c3a0) returns *this uint32_t _stageType; // Level:GetStageType (004073c0) returns this+4; Level::IsAltStage (0042a2c0) - uint8_t _pad_0x8[0x8]; + uint8_t _pad_0x8[0x4]; + uint32_t _curses; // Level::generate_dungeon 00740e10 ORs this+0xc with Game+0x26550 and Seeds::GetForcedCurses (Game._curses at the same offset; Level*==Game*) bool _isHeartPicked; bool _isCanSeeEverything; - uint8_t _pad_0x12[0x182ba]; + uint8_t _pad_0x12[0x2]; + RoomDescriptor _roomList[527]; // Level::GetRoomByIdx 00740bc0 returns this+0x14+n*0xb8 for n = roomMap[...] < 0x20f; QueryRoomTypeIndex 007484c0 reads ->Data (+0x10 = 0x24), +0xc (0x20), +0xb4 (0xc8) per 0xb8 stride + int _roomMap[507]; // Level::GetRoomByIdx 00740bc0 reads this+0x17adc+(dimension*0xa9+idx)*4 as the _roomList index (3 dimensions x 169) + uint32_t _currentRoomMap; // int* // Level::ChangeRoom 0073fc80 / Init 00744940 set it to &_roomMap[dimension*0xa9] (this+0x17adc+dim*0x2a4) int _roomCount; int _startingRoomIndex; - uint8_t _pad_0x182d4[0x10]; + uint8_t _generationRNG[0x10]; // RNG; Level::generate_dungeon 00740e10 / Init 00744940 seed+step the RNG at 0x182d4..0x182e0 (Game._generationRNG) uint8_t _devilAngelRoomRNG[0x10]; // RNG; Level:GetDevilAngelRoomRNG (007537f0) returns this+0x182e4 (not in REPENTOGON) float _angelRoomChance; // Level::GetAngelRoomChance (007e9270)/AddAngelRoomChance (0065cf00) (not in REPENTOGON) - uint8_t _pad_0x182f8[0xc]; + uint8_t _pad_0x182f8[0x8]; + uint32_t _room; // Room* // Level::ChangeRoom 0073fc80 / RestoreGameState 007475b0 use it as the current Room (Game._room, Level::GetCurrentRoom 00407480) int _currentRoomIndex; int _previousRoomIndex; - uint8_t _pad_0x1830c[0x8]; + int _currentDimensionIdx; // Level::GetRoomByIdx 00740bc0 uses it as default dimension; ChangeRoom 0073fc80 sets it with _currentRoomMap (Game._currentDimensionIdx) + int _lastRoomDimensionIdx; // Level::ChangeRoom 0073fc80 / Init 00744940 write it (Game._lastRoomDimensionIdx) int _lastBossRoomListIndex; int _leaveDoor; int _enterDoor; @@ -4347,19 +4380,28 @@ struct Level { int _greedModeWave; uint8_t _pad_0x18338[0x3c]; uint32_t _greedwavesclearedwithoutredheartdamage; // Room::SpawnGreedModeWave (00816910) increments; Level::SetRedHeartDamage (0074b5b0) zeroes (REPENTOGON said 0x18204, +0x170) - uint8_t _pad_0x18378[0x24]; + uint8_t _ventricleRazorPortals[24]; // 2 x {int roomIdx, int gridIdx, bool}: FUN_0074a280 ("PortalIdx is bigger than 2!") stores _currentRoomIndex/arg/flag at this+0x18378+i*0xc, called from UseActiveItem case 0x18c (Ventricle Razor); Init 00744940 / ChangeRoom (Beast room) reset roomIdx to -99999 + uint8_t _pad_0x18390[0xc]; uint32_t _levelStateFlag; // Level::GetStateFlag (004f88f0)/SetStateFlag (00428a80) bitset at this+0x1839c (REPENTOGON Level said 0x1822c, +0x170) }; static_assert(offsetof(Level, _stage) == 0x0); static_assert(offsetof(Level, _stageType) == 0x4); +static_assert(offsetof(Level, _curses) == 0xc); static_assert(offsetof(Level, _isHeartPicked) == 0x10); static_assert(offsetof(Level, _isCanSeeEverything) == 0x11); +static_assert(offsetof(Level, _roomList) == 0x14); +static_assert(offsetof(Level, _roomMap) == 0x17adc); +static_assert(offsetof(Level, _currentRoomMap) == 0x182c8); static_assert(offsetof(Level, _roomCount) == 0x182cc); static_assert(offsetof(Level, _startingRoomIndex) == 0x182d0); +static_assert(offsetof(Level, _generationRNG) == 0x182d4); static_assert(offsetof(Level, _devilAngelRoomRNG) == 0x182e4); static_assert(offsetof(Level, _angelRoomChance) == 0x182f4); +static_assert(offsetof(Level, _room) == 0x18300); static_assert(offsetof(Level, _currentRoomIndex) == 0x18304); static_assert(offsetof(Level, _previousRoomIndex) == 0x18308); +static_assert(offsetof(Level, _currentDimensionIdx) == 0x1830c); +static_assert(offsetof(Level, _lastRoomDimensionIdx) == 0x18310); static_assert(offsetof(Level, _lastBossRoomListIndex) == 0x18314); static_assert(offsetof(Level, _leaveDoor) == 0x18318); static_assert(offsetof(Level, _enterDoor) == 0x1831c); @@ -4367,6 +4409,7 @@ static_assert(offsetof(Level, _dungeonReturnRoomIndex) == 0x18328); static_assert(offsetof(Level, _dungeonPlacementSeed) == 0x1832c); static_assert(offsetof(Level, _greedModeWave) == 0x18334); static_assert(offsetof(Level, _greedwavesclearedwithoutredheartdamage) == 0x18374); +static_assert(offsetof(Level, _ventricleRazorPortals) == 0x18378); static_assert(offsetof(Level, _levelStateFlag) == 0x1839c); struct OptionsConfig { @@ -4515,6 +4558,22 @@ static_assert(offsetof(OptionsConfig, _eosCrossplay) == 0xc0); static_assert(offsetof(OptionsConfig, _acceptedPublicBeta_VERSION) == 0xc4); static_assert(offsetof(OptionsConfig, _acceptedDataCollectionDisclaimer) == 0xc5); +struct Seeds { + bool _isCustomRun; // 006b83d0 (Lua Seeds:IsCustomRun binding, misnamed Room::IsInitialized) returns *(byte*)this; 009e9290 ctor / 009e9bc0 Reset clear byte 0 + uint8_t _pad_0x1[0x3]; + uint32_t _gameStartSeed; // 00436140 Lua GetStartSeed returns [this+4] ("Game Start Seed was not set" if 0); 009eb880 set_start_seed writes it; 0085e180 ClearStartSeed zeroes it + uint8_t _rng[0x48]; // RNG; 006ef890 Lua GetNextSeed steps xorshift seed this+8 with shifts +0xc/+0x10/+0x14; ctor inits 0xaa17414f,5,9,7; set_start_seed seeds it from start seed + uint32_t _playerInitSeed; + uint32_t _seedEffects; // void* // std::set head ptr (new vs REPENTOGON): 009e9290 ctor allocs 0x14-byte tree head at this+0x54; 00685e70 ClearSeedEffects erases tree this+0x54 then count +0x58=0 + int _seedEffectsCount; // 0085e1b0 Lua CountSeedEffects returns this+0x58; ClearSeedEffects zeroes it +}; +static_assert(offsetof(Seeds, _isCustomRun) == 0x0); +static_assert(offsetof(Seeds, _gameStartSeed) == 0x4); +static_assert(offsetof(Seeds, _rng) == 0x8); +static_assert(offsetof(Seeds, _playerInitSeed) == 0x50); +static_assert(offsetof(Seeds, _seedEffects) == 0x54); +static_assert(offsetof(Seeds, _seedEffectsCount) == 0x58); + struct Manager { uint8_t _pad_0x0[0x8]; int _state; // 00954cd0 Manager::Update switch(this+8), saves prev to +0xc; 009595e0 IsGameplayInputActive tests ==2 (in game); ctor 00950610 zeroes it @@ -4918,6 +4977,20 @@ static_assert(offsetof(ProjectileParams, ChangeTimeout) == 0x8c); static_assert(offsetof(ProjectileParams, DepthOffset) == 0x90); static_assert(offsetof(ProjectileParams, Variant) == 0x94); +struct TemporaryEffects { + uint32_t _cacheFlags; // new vs REPENTOGON: 00930220 AddEffect / 009303f0 RemoveEffect OR ItemConfig_Item cacheFlags (+0x54) into *this + uint8_t _effects[0xc]; // vector_TemporaryEffect; 007537a0 Lua GetEffectsList returns this+4; 00930220 AddEffect/009303f0 RemoveEffect walk this[1]..this[2] stride 0x10, push/erase + bool _shouldEvaluateCache; // 00930220 AddEffect / 009303f0 RemoveEffect / 009306c0 ClearEffects set byte this+0x10 = 1 after any change + bool _disabled; // 00930220 AddEffect, 009303f0 RemoveEffect, 00930680 HasNullEffect, 009306c0 ClearEffects all bail out if byte this+0x11 != 0 + uint8_t _pad_0x12[0x2]; + uint32_t _player; // Entity_Player* // 00930220 AddEffect: Entity_Player::AddCostume(this[5],...) ; RemoveEffect: this[5]==0 -> Room::TriggerEffectRemoved else Entity_Player::trigger_collectible_effect_removed +}; +static_assert(offsetof(TemporaryEffects, _cacheFlags) == 0x0); +static_assert(offsetof(TemporaryEffects, _effects) == 0x4); +static_assert(offsetof(TemporaryEffects, _shouldEvaluateCache) == 0x10); +static_assert(offsetof(TemporaryEffects, _disabled) == 0x11); +static_assert(offsetof(TemporaryEffects, _player) == 0x14); + struct Room { uint8_t _pad_0x0[0x4]; uint32_t _descriptor; // RoomDescriptor* // Room::GetDecorationSeed 004aae80 returns (this+4)->+0x58 (DecorationSeed); GetRoomShape 0042a270 reads (this+4)->Data->+0x48 @@ -4926,34 +4999,37 @@ struct Room { uint32_t _gridHeight; Vector _topLeftPos; Vector _bottomRightPos; - uint8_t _pad_0x24[0x740]; + uint32_t _gridEntities[448]; // GridEntity* // Room::SpawnGridEntity 007ebca0 deletes/stores the new GridEntity at this+0x24+idx*4; CheckLine 007f0df0 bounds idx <= 0x1bf (REPENTOGON says [0x1BF]; 0x24+0x700 = 0x724 = _doors) + uint32_t _doors[8]; // GridEntity_Door* // Room::GetDoor 00436020 returns this+0x724+slot*4 (slot -1..7); TrySpawnDevilRoomDoor 007f83b0 / MakeDoor 007eea90 use it + int _doorGridPositions[8]; // Camera::constructor 009428d0 converts room+0x744+enterDoor*4 to a position with gridWidth (x%w*40+40, x/w*40+120); Room::UpdateRedKey 008271e0 spawns outlines at the same index int _tintedRockIdx; int _dungeonRockIdx; - uint8_t _pad_0x76c[0xa80]; - int _roomClearDelay; - uint8_t _pad_0x11f0[0x8]; - uint32_t _Camera; // Camera* + int _gridPaths[448]; // Lua Room:GetGridPath 004565c0 / SetGridPath 0042a290 read/write this+0x76c+idx*4 for idx < 0x1c0; SetGridPath 004565e0 only overwrites values < 951 + uint8_t _pad_0xe6c[0x390]; Vector _renderSurfaceTopLeft; Vector _renderScrollOffset; bool _redHeartDamage; - uint8_t _pad_0x120d[0xb]; - uint8_t _entityList[0xa4]; // EntityList + uint8_t _pad_0x120d[0x3]; + uint32_t _brokenWatchState; // Room::GetBrokenWatchState 0081edd0 returns it (2 in challenge 0x16); SetBrokenWatchState 0081edf0 writes it then calls time_scale_update 007ea2d0 + uint8_t _pad_0x1214[0xa8]; int _renderMode; - uint8_t _pad_0x12c0[0x358]; - uint8_t _fxLayers[0x598]; // FXLayers + uint8_t _pad_0x12c0[0x8f0]; uint32_t _bossId; int _secondBossID; uint8_t _pad_0x1bb8[0x10]; uint8_t _backdrop[0x150]; // Backdrop; Room::LoadBackdropGraphics 007f1380 calls Backdrop::Init(room+0x1bc8); Backdrop::Init writes backdropId at +0x150 = room+0x1d18 (Lua GetBackdropType 004cdd20) int _backdropType; - uint8_t _pad_0x1d1c[0x534c]; + uint8_t _pad_0x1d1c[0x5124]; + ANM2 _lightSprite; // ctor 007e9400 ANM2::constructor; lighting helper 00806c20 (called by Room::render_lighting 0080ea80, ZHL-misnamed Game::Render) plays Light/flame/sparks and sets its _scale (+0x9c = 0x6edc/0x6ee0) per light source; render_player_light 0080bd20 / render_grid_entity_light 0080c810 render it + uint8_t _pad_0x6f54[0x114]; int _shopLevel; - uint8_t _pad_0x706c[0x4]; + int _shopRestockTimer; // Room::TriggerRestock 00815800 sets 30; Room::Update 00802980 counts it down and calls ShopRestockPartial at 0 (then -1); on_leave 007efa50 flushes it the same way uint8_t _shopItemDeque[0x1b9]; // deque_ShopRestockDesc; Room::constructor 007e9400 builds a std::deque (proxy new(8), 5 dwords 0x7070..0x7080); Room::TriggerRestock 00815800 / ShopRestockPartial 008158a0 use 0x7074..0x7080 bool _hasTriggerPressurePlates; uint8_t _pad_0x722a[0x2]; int _slowdownDuration; // Lua Room:HasSlowDown 00456710 (0 < this+0x722c) / SetSlowDown 00456720 (max); Room::Update 00802980 decrements it; REPENTOGON 0x7220 is wrong/shifted +0xc - uint8_t _pad_0x7230[0xc]; + uint8_t _pad_0x7230[0x4]; + uint8_t _pendingGridRemovals[8]; // std::set (ctor 007e9400 head node 0x14 bytes); Room::Update 00802980 destroys the grid entity at every index in it, then clears it; filled by Room::Init 007f2800 int _greedWaveTimer; // Room::UpdateGreedWave 00801ee0: greed only, decrements, clamps to 0x13, calls SpawnGreedModeWave at 0 float _waterAmount; // Room::HasWater 008208c0 and render_water_shader 00821950 read it; rain init 00824350 requires >0 KColor _waterColor; // ctor 007e9400 KColor::SetFromARGB(-1) at 0x7244; render_water_shader 00821950 lerps 0x7244 -> 0x726c @@ -4972,9 +5048,12 @@ struct Room { uint8_t _pad_0x72a2[0x2]; ColorMod _floorColor; // Lua Room:SetFloorColor 007e91b0 copies 0x2c bytes to 0x72a4; ctor 007e9400 inits it ColorMod _wallColor; // Lua Room:SetWallColor 007e91f0 copies 0x2c bytes to 0x72d0; ctor 007e9400 inits it - uint8_t _pad_0x72fc[0x14]; + uint8_t _pad_0x72fc[0xc]; + uint8_t _litGridIndices[8]; // ? std::set (ctor 007e9400 head node); Room::render_lighting 0080ea80 clears it each frame, lighting helper 00806c20 looks entities' grid index up in it before drawing their light TemporaryEffects _temporaryEffects; // ctor 007e9400 inits 0x7310..0x7324 in TemporaryEffects layout (vector +4, 2 bools +0x10, player +0x14); getter 004360d0 returns this+0x7310, its callers then call TemporaryEffects::AddCollectibleEffect - uint8_t _pad_0x7328[0x12c]; + uint8_t _outputGroupGridIndices[80]; // std::set[10] (ctor 007e9400 vector ctor 8 x 10); Room::TriggerOutput 00823080 calls GridEntity::trigger_output on every grid index in set[group] + uint8_t _outputGroupCallbacks[120]; // std::vector[10] (ctor 007e9400 vector ctor 0xc x 10); Room::TriggerOutput 00823080 calls each function in vector[group] + uint8_t _pad_0x73f0[0x64]; int _numRainSpawners; // rain init 00824350 zeroes it, then fills spawner array 0x73f4 (stride 0x18) and increments it; Room::update_ambient_sounds 00800500 reads it float _rainIntensity; // rain init 00824350 sets 1.0; Room::update_ambient_sounds 00800500 reads it bool _isRainStopped; // Lua Room:StopRain 005784d0 sets 1; rain init 00824350 clears it; Room::update_ambient_spawns 00824800 / NpcAI::ENTITY_RAINMAKER 00578a70 read it (REPENTOGON lacks this) @@ -4982,7 +5061,7 @@ struct Room { Vector _waterCurrent; // Lua Room:GetWaterCurrent 00505c50 returns this+0x7460/0x7464; Room::Init 007f2800 sets it from table 0xc5d0e8 uint8_t _railManager[0x2d8]; // RailManager; ctor 007e9400 writes this to +0x7468 (RailManager._room) and builds its ANM2; Room::Render passes ECX=room+0x7468 to RailManager::Render 009e2f20; rail byte grid at +0x746c float _lavaIntensity; // Lua Room:GetLavaIntensity 007120c0 returns this+0x7740 - uint8_t _pad_0x7744[0x150]; + uint8_t _redDoorOutlines[0x150]; // EntityPtr; ctor 007e9400 builds 8 EntityPtr (ctor 0042a020 / dtor 00579700 multiset erase); Room::UpdateRedKey 008271e0 spawns effect 1000.154 per free door slot and stores it with multiset insert, clears them without Red Key bool _isPickupVisionInvalid; // Lua Room:InvalidatePickupVision 005b16c0 sets this+0x7894 = 1 (REPENTOGON lacks this) }; static_assert(offsetof(Room, _descriptor) == 0x4); @@ -4991,24 +5070,28 @@ static_assert(offsetof(Room, _gridWidth) == 0xc); static_assert(offsetof(Room, _gridHeight) == 0x10); static_assert(offsetof(Room, _topLeftPos) == 0x14); static_assert(offsetof(Room, _bottomRightPos) == 0x1c); +static_assert(offsetof(Room, _gridEntities) == 0x24); +static_assert(offsetof(Room, _doors) == 0x724); +static_assert(offsetof(Room, _doorGridPositions) == 0x744); static_assert(offsetof(Room, _tintedRockIdx) == 0x764); static_assert(offsetof(Room, _dungeonRockIdx) == 0x768); -static_assert(offsetof(Room, _roomClearDelay) == 0x11ec); -static_assert(offsetof(Room, _Camera) == 0x11f8); +static_assert(offsetof(Room, _gridPaths) == 0x76c); static_assert(offsetof(Room, _renderSurfaceTopLeft) == 0x11fc); static_assert(offsetof(Room, _renderScrollOffset) == 0x1204); static_assert(offsetof(Room, _redHeartDamage) == 0x120c); -static_assert(offsetof(Room, _entityList) == 0x1218); +static_assert(offsetof(Room, _brokenWatchState) == 0x1210); static_assert(offsetof(Room, _renderMode) == 0x12bc); -static_assert(offsetof(Room, _fxLayers) == 0x1618); static_assert(offsetof(Room, _bossId) == 0x1bb0); static_assert(offsetof(Room, _secondBossID) == 0x1bb4); static_assert(offsetof(Room, _backdrop) == 0x1bc8); static_assert(offsetof(Room, _backdropType) == 0x1d18); +static_assert(offsetof(Room, _lightSprite) == 0x6e40); static_assert(offsetof(Room, _shopLevel) == 0x7068); +static_assert(offsetof(Room, _shopRestockTimer) == 0x706c); static_assert(offsetof(Room, _shopItemDeque) == 0x7070); static_assert(offsetof(Room, _hasTriggerPressurePlates) == 0x7229); static_assert(offsetof(Room, _slowdownDuration) == 0x722c); +static_assert(offsetof(Room, _pendingGridRemovals) == 0x7234); static_assert(offsetof(Room, _greedWaveTimer) == 0x723c); static_assert(offsetof(Room, _waterAmount) == 0x7240); static_assert(offsetof(Room, _waterColor) == 0x7244); @@ -5021,75 +5104,19 @@ static_assert(offsetof(Room, _isFirstEnemyDead) == 0x72a0); static_assert(offsetof(Room, _pacifist) == 0x72a1); static_assert(offsetof(Room, _floorColor) == 0x72a4); static_assert(offsetof(Room, _wallColor) == 0x72d0); +static_assert(offsetof(Room, _litGridIndices) == 0x7308); static_assert(offsetof(Room, _temporaryEffects) == 0x7310); +static_assert(offsetof(Room, _outputGroupGridIndices) == 0x7328); +static_assert(offsetof(Room, _outputGroupCallbacks) == 0x7378); static_assert(offsetof(Room, _numRainSpawners) == 0x7454); static_assert(offsetof(Room, _rainIntensity) == 0x7458); static_assert(offsetof(Room, _isRainStopped) == 0x745c); static_assert(offsetof(Room, _waterCurrent) == 0x7460); static_assert(offsetof(Room, _railManager) == 0x7468); static_assert(offsetof(Room, _lavaIntensity) == 0x7740); +static_assert(offsetof(Room, _redDoorOutlines) == 0x7744); static_assert(offsetof(Room, _isPickupVisionInvalid) == 0x7894); -struct RoomDescriptor { - int32_t GridIndex; - int32_t SafeGridIndex; - int32_t ListIndex; - int32_t Dimension; - uint32_t Data; // RoomConfig_Room* - uint32_t OverrideData; // RoomConfig_Room* - int32_t AllowedDoors; - uint8_t _pad_0x1c[0x20]; - int32_t DisplayFlags; - int32_t VisitedCount; - int32_t Flags; - int16_t TotalMoneySpent; - int16_t ClearCount; - int32_t GreedSubType; - int16_t PoopCount; - int16_t TKeeperCoinSpawns; - int32_t PitsCount; - int32_t DecorationSeed; - int32_t SpawnSeed; - int32_t AwardSeed; - uint32_t BossDeathSeed; - uint8_t SavedGridEntities[0xc]; // vector_GridEntityDesc - uint8_t SavedEntities[0xc]; // vector_EntitySaveState - uint8_t RestrictedGridIndexes[0x8]; // std_set_int - uint8_t SavedEffects[0x24]; // vector_EntitySaveState - int16_t ShopItemIdx; - int16_t ShopItemDiscountIdx; - int32_t DeliriumDistance; - int32_t Group; // RoomDescriptor::constructor 006ef590 sets +0xb4 = -1; operator_assign 007387d0 copies it as last dword (stride 0xb8); Level::GetRandomRoomIndex 00740860 only picks rooms whose +0xb4 is -1 or equals the current room's -}; -static_assert(offsetof(RoomDescriptor, GridIndex) == 0x0); -static_assert(offsetof(RoomDescriptor, SafeGridIndex) == 0x4); -static_assert(offsetof(RoomDescriptor, ListIndex) == 0x8); -static_assert(offsetof(RoomDescriptor, Dimension) == 0xc); -static_assert(offsetof(RoomDescriptor, Data) == 0x10); -static_assert(offsetof(RoomDescriptor, OverrideData) == 0x14); -static_assert(offsetof(RoomDescriptor, AllowedDoors) == 0x18); -static_assert(offsetof(RoomDescriptor, DisplayFlags) == 0x3c); -static_assert(offsetof(RoomDescriptor, VisitedCount) == 0x40); -static_assert(offsetof(RoomDescriptor, Flags) == 0x44); -static_assert(offsetof(RoomDescriptor, TotalMoneySpent) == 0x48); -static_assert(offsetof(RoomDescriptor, ClearCount) == 0x4a); -static_assert(offsetof(RoomDescriptor, GreedSubType) == 0x4c); -static_assert(offsetof(RoomDescriptor, PoopCount) == 0x50); -static_assert(offsetof(RoomDescriptor, TKeeperCoinSpawns) == 0x52); -static_assert(offsetof(RoomDescriptor, PitsCount) == 0x54); -static_assert(offsetof(RoomDescriptor, DecorationSeed) == 0x58); -static_assert(offsetof(RoomDescriptor, SpawnSeed) == 0x5c); -static_assert(offsetof(RoomDescriptor, AwardSeed) == 0x60); -static_assert(offsetof(RoomDescriptor, BossDeathSeed) == 0x64); -static_assert(offsetof(RoomDescriptor, SavedGridEntities) == 0x68); -static_assert(offsetof(RoomDescriptor, SavedEntities) == 0x74); -static_assert(offsetof(RoomDescriptor, RestrictedGridIndexes) == 0x80); -static_assert(offsetof(RoomDescriptor, SavedEffects) == 0x88); -static_assert(offsetof(RoomDescriptor, ShopItemIdx) == 0xac); -static_assert(offsetof(RoomDescriptor, ShopItemDiscountIdx) == 0xae); -static_assert(offsetof(RoomDescriptor, DeliriumDistance) == 0xb0); -static_assert(offsetof(RoomDescriptor, Group) == 0xb4); - struct RoomEntry { int _type; // Lua Entry.Type via binder 0088df10: getter 008c1c30 FUN_0085bfd0 signed dword, setter dword uint16_t _variant; // Lua Entry.Variant via binder 0088e090: getter 008c1cf0 MOV DX,word -> FUN_0085c010 (MOVZX), setter stores 16-bit @@ -5118,8 +5145,7 @@ struct TearParams { int _tearVariant; int _bombVariant; ColorMod _tearColor; - int _unused; - BitSet128 _flags; + uint8_t _pad_0x34[0x14]; float _tearDamage; float _tearScale; float _tearHeight; @@ -5127,8 +5153,6 @@ struct TearParams { static_assert(offsetof(TearParams, _tearVariant) == 0x0); static_assert(offsetof(TearParams, _bombVariant) == 0x4); static_assert(offsetof(TearParams, _tearColor) == 0x8); -static_assert(offsetof(TearParams, _unused) == 0x34); -static_assert(offsetof(TearParams, _flags) == 0x38); static_assert(offsetof(TearParams, _tearDamage) == 0x48); static_assert(offsetof(TearParams, _tearScale) == 0x4c); static_assert(offsetof(TearParams, _tearHeight) == 0x50); diff --git a/zhl_fields.tsv b/zhl_fields.tsv index f4ef9fa..0b17257 100644 --- a/zhl_fields.tsv +++ b/zhl_fields.tsv @@ -39,11 +39,9 @@ SteamCloudFile base KAGE_Filesys_FileStream Weapon_Brimstone base Weapon Weapon_MonstrosLung base Weapon ActiveItemDesc 0x0 int _item -ActiveItemDesc 0x4 int _unk ActiveItemDesc 0x8 int _charge ActiveItemDesc 0xc int _batteryCharge ActiveItemDesc 0x10 int _subCharge -ActiveItemDesc 0x14 int _timeRechargeCooldown ActiveItemDesc 0x18 int _partialCharge ActiveItemDesc 0x1c int _varData Entity 0x28 unsigned int _type @@ -52,69 +50,20 @@ Entity 0x30 unsigned int _subtype Entity 0x34 unsigned int _spawnerType Entity 0x38 unsigned int _spawnerVariant Entity 0x48 ANM2 _sprite -Entity 0x15c float _shadowSize -Entity 0x168 unsigned long long _flags -Entity 0x170 bool _valid Entity 0x171 bool _visible Entity 0x172 bool _exists Entity 0x173 bool _dead -Entity 0x177 bool _removedByFactory -Entity 0x184 int _entityGridCollisionClass Entity 0x188 int _entityCollisionClass -Entity 0x18e unsigned short _entityExtraDataPtrUpperBytes -Entity 0x190 bool _collidesWithGrid -Entity 0x192 unsigned short _entityExtraDataPtrLowerBytes -Entity 0x1ac vector_ColorParams _colorParams -Entity 0x210 int _fireDamageCountdown -Entity 0x214 int _damageCountdown -Entity 0x218 int _freezeCountdown -Entity 0x21c int _poisonCountdown -Entity 0x220 int _slowingCountdown -Entity 0x224 int _charmedCountdown -Entity 0x228 int _confusionCountdown -Entity 0x22c int _midasFreezeCountdown -Entity 0x230 int _fearCountdown -Entity 0x234 int _burnCountdown -Entity 0x238 int _bossStatusEffectCooldown -Entity 0x23c int _shrinkCountdown -Entity 0x278 float _poisonDamage -Entity 0x27c float _burnDamage -Entity 0x2b0 float _depthOffset -Entity 0x2d4 float _mass -Entity 0x2e0 int _poisonDamageTimer -Entity 0x2e4 int _burnDamageTimer -Entity 0x2e8 int _bleedingCountdown -Entity 0x2f0 int _magnetizedCountdown -Entity 0x2f4 int _baitedCountdown -Entity 0x2f8 int _knockbackCountdown -Entity 0x2fc int _weaknessCountdown -Entity 0x300 int _iceCountdown -Entity 0x304 int _brimstoneMarkCountdown -Entity 0x308 Vector _knockbackDirection -Entity 0x31c int _pauseTimer -Entity 0x33c Vector _pos -Entity 0x34c Vector _posOffset -Entity 0x360 Vector _velocity -Entity 0x370 float _size -Entity 0x380 float _health -Entity 0x388 float _collisionDamage -Entity 0x39c float _speedMultiplier -Entity 0x3b0 bool _isInvicible -Entity 0x3b4 float _shrinkStatus1 -Entity 0x3b8 float _shrinkStatus2 Entity 0x3bc EntityPtr _parent Entity 0x3c0 EntityPtr _child Entity 0x3c4 EntityPtr _target Entity 0x3c8 EntityPtr _spawnerEntity -Entity 0x3d4 EntityPtr _minecart Entity 0x3dc RNG _dropRNG Entity 0x3ec uint32_t _initSeed Entity_Effect 0x450 int _state Entity_Effect 0x45c int _timeout Entity_Effect 0x460 int _lifespan Entity_Familiar 0x410 Entity_Player* _player -Entity_Familiar 0x5f8 int _moveDelayNum -Entity_Familiar 0x5fc NPCAI_Pathfinder _pathfinder Entity_Familiar 0xd74 bool _isFollower Entity_Familiar 0xd75 bool _isDelayed Entity_Familiar 0xd88 int _state @@ -127,10 +76,7 @@ Entity_Laser 0x45e bool _shrink Entity_Laser 0x464 HomingLaser _homingLaser Entity_Laser 0x4d0 float _maxDistance Entity_Laser 0x4d4 uint32_t _homingType -Entity_Laser 0x4e0 float _scale Entity_Laser 0x4e4 bool _disableFollowParent -Entity_Laser 0x500 bool _multidimensionalTouched -Entity_Laser 0x514 bool _prismTouched Entity_Laser 0x515 bool _oneHit Entity_NPC 0x410 int _stateFrame Entity_NPC 0x414 NPCAI_Pathfinder _pathfinder @@ -141,22 +87,10 @@ Entity_NPC 0xbb0 Vector _v1 Entity_NPC 0xbb8 Vector _v2 Entity_NPC 0xbc0 int _i1 Entity_NPC 0xbc4 int _i2 -Entity_NPC 0xbc8 uint32_t _deliriumBossType -Entity_NPC 0xbcc uint32_t _deliriumBossVariant -Entity_NPC 0xbd0 uint16_t _deliriumTransformationTimer -Entity_NPC 0xbd2 uint8_t _deliriumRemainingAttacks -Entity_NPC 0xbd3 uint8_t _deliriumState -Entity_NPC 0xbd8 uint32_t _deliriumAttackID -Entity_NPC 0xbdc uint8_t _deliriumAttackAngle -Entity_NPC 0xbe0 uint32_t _deliriumCycleID -Entity_NPC 0xc3d bool _isBoss -Entity_NPC 0xc40 float _shieldStrength -Entity_NPC 0xc74 uint16_t _championRegenTimer Entity_NPC 0xc78 int _bosscoloridx Entity_Pickup 0x534 int _price Entity_Pickup 0x540 int _timeout Entity_Player 0x1340 int _maxHearts -Entity_Player 0x1344 int _redHearts Entity_Player 0x1348 int _eternalHearts Entity_Player 0x134c int _soulHearts Entity_Player 0x1350 int _blackHearts @@ -167,123 +101,49 @@ Entity_Player 0x1364 int _numBombs Entity_Player 0x1368 int _numCoins Entity_Player 0x13bc int _damageCooldown Entity_Player 0x13c0 int _playerType -Entity_Player 0x140c Entity_Effect* _markedTarget -Entity_Player 0x1410 Entity* _heldEntity -Entity_Player 0x1458 Entity_Laser* _megaBlastLaser -Entity_Player 0x145c int _rUaWizardTimer Entity_Player 0x1460 float _maxfiredelay Entity_Player 0x1464 float _shotspeed Entity_Player 0x1470 float _damage Entity_Player 0x1474 float _tearheight -Entity_Player 0x1478 float _tearfallspeed -Entity_Player 0x147c float _tearfallaccel Entity_Player 0x1480 float _tearrange Entity_Player 0x14c4 ColorMod _laserColor -Entity_Player 0x1508 TemporaryEffects _temporaryeffects -Entity_Player 0x1520 int _speedModifier -Entity_Player 0x1524 int _fireDelayModifier -Entity_Player 0x1528 int _damageModifier Entity_Player 0x152c int _tearRangeModifier Entity_Player 0x1568 float _movespeed Entity_Player 0x156c float _luck Entity_Player 0x1570 bool _canFly -Entity_Player 0x1574 uint32_t _cacheFlags -Entity_Player 0x1578 int8_t _tearDisplacement -Entity_Player 0x157c float _tearPoisonDamage -Entity_Player 0x1604 int _itemStateCooldown -Entity_Player 0x1608 uint32_t _vampireCharmKills -Entity_Player 0x1610 int _bombPlaceDelay -Entity_Player 0x1614 int _forgottenSwapFormCooldown Entity_Player 0x1618 int _controllerIndex -Entity_Player 0x161c int _playerIndex -Entity_Player 0x1624 int _moveDirection Entity_Player 0x1628 int _headDirection Entity_Player 0x1825 bool _canShoot -Entity_Player 0x1828 ColorMod _footprintColor1 -Entity_Player 0x1854 ColorMod _footprintColor2 -Entity_Player 0x1888 int _ponyCharge -Entity_Player 0x188c int _planCKillCountdown -Entity_Player 0x18a4 int _epiphoraCharge -Entity_Player 0x18b0 uint32_t _deadEyeCharges -Entity_Player 0x18b4 uint32_t _deadEyeMisses -Entity_Player 0x18bc uint32_t _mawOfTheVoidChargeTimer -Entity_Player 0x18e8 uint32_t _imExcitedSpeedupCountdown -Entity_Player 0x18f4 int _megaBlastDuration -Entity_Player 0x18f8 int _peeBurstCooldown -Entity_Player 0x18fc int _maxPeeBurstCooldown -Entity_Player 0x1900 int _bladderCharge -Entity_Player 0x1904 int _maxBladderCharge -Entity_Player 0x1908 bool _isUrethraBlocked -Entity_Player 0x190c int _nextUrethraBlockFrame Entity_Player 0x1910 EntityDesc _friendBallEnemy -Entity_Player 0x192c int _purityState -Entity_Player 0x1930 int _immaculateConceptionState -Entity_Player 0x1934 int _cambionConceptionState -Entity_Player 0x1938 uint32_t _conceptionFamiliarFlags -Entity_Player 0x193c float _d8DamageModifier -Entity_Player 0x1940 float _d8SpeedModifier -Entity_Player 0x1944 float _d8RangeModifier -Entity_Player 0x1948 float _d8FireDelayModifier Entity_Player 0x194c int _goldenHearts Entity_Player 0x1aec int _babySkin -Entity_Player 0x1d7c vector_EntitySaveState _movingBoxContents Entity_Player 0x1d88 int _boneHearts -Entity_Player 0x1d8c int _boneHeartsMask -Entity_Player 0x1d90 int _hallowedGroundCountdown Entity_Player 0x1da0 int _brokenHearts Entity_Player 0x1da4 int _rottenHearts -Entity_Player 0x1dd0 uint32_t _urnSouls Entity_Player 0x1dd4 int _numGigaBombs Entity_Player 0x1f54 int _poopMana -Entity_Player 0x1f7c int _eveSumptoriumCharge -Entity_Player 0x1f80 std_map_int_int _itemWispsList Entity_Player 0x1fb8 int _modelingClayEffect Entity_Player 0x20a9 bool _isCoopGhost Entity_Tear 0x41c float _homingFriction -Entity_Tear 0x420 float _fScale -Entity_Tear 0x424 float _baseScale -Entity_Tear 0x428 BitSet128 _tearFlags Entity_Tear 0x438 int _waitFrames Entity_Tear 0x43c Vector _continueVelocity -Entity_Tear 0x444 std_vector_uint _hitList -Entity_Tear 0x450 int _tearIdx -Entity_Tear 0x454 float _baseDamage -Entity_Tear 0x458 float _rotation -Entity_Tear 0x45c int _scaleAnimNum Entity_Tear 0x460 float _knockbackMultiplier Game 0x1a740 ItemPool _itemPool -Game 0x1af70 BossPool _bossPool -Game 0x1b83c RoomTransition _roomTransition -Game 0x1ba78 StageTransition _stageTransition Game 0x1baa8 PlayerManager _playerManager -Game 0x1bb84 Seeds _seedEffects Game 0x1c034 ItemOverlay _itemOverlay Game 0x1da04 HUD _hud Game 0x264f8 int _frameCount Game 0x2650c Vector _screenShakeOffset -Game 0x26534 bool _triggerWindowResize -Game 0x26544 unsigned int _debugFlags -Game 0x26548 uint64_t _gameStateFlags Game 0x26554 int _lastDevilRoomStage -Game 0x26558 int _treasureRoomsVisited -Game 0x2655c int _planetariumsVisited Game 0x2656c int _donationModGreed Game 0x26570 int _donationModAngel -Game 0x26574 int _shopVisits -Game 0x26580 EntityFactory* _entityFactory Game 0x26584 unsigned int _challenge -Game 0x26588 bool _isRerun -Game 0x26589 bool _isDebug Game 0x265c8 Ambush _ambush -Game 0x26630 DailyChallenge _dailyChallenge -Game 0x266e4 ScoreSheet _scoreSheet -Game 0x26778 GenericPrompt _genericPrompt Game 0x269c0 int _lastLevelWithoutHalfHp Game 0x269c8 uint32_t _difficulty Game 0x269cc int _lastLevelWithDamage GridEntity 0x4 GridEntityDesc _desc GridEntity 0x24 unsigned int _gridIndex -GridEntity 0x28 unsigned int _spawnFrame GridEntity 0x2c RNG _rng GridEntity 0x3c int _collisionClass GridEntity 0x40 ANM2 _sprite @@ -296,14 +156,12 @@ GridEntityDesc 0x14 int _varData GridEntityDesc 0x18 bool _initialized GridEntityDesc 0x1c unsigned int _variableSeed GridEntity_Door 0x27c ANM2 _extraSprite -GridEntity_Door 0x394 int _targetRoomIdx GridEntity_Door 0x398 uint32_t _previousState GridEntity_Door 0x39c uint32_t _previousVariant HUD 0x54cc bool _isVisible ItemConfig_Card 0x0 int id ItemConfig_Card 0x4 int achievementId ItemConfig_Card 0x8 std_string name -ItemConfig_Card 0x20 std_string desc ItemConfig_Card 0x38 std_string hudAnim ItemConfig_Card 0x50 bool greedModeAllowed ItemConfig_Card 0x54 unsigned int pickupSubtype @@ -322,7 +180,6 @@ ItemConfig_Costume 0x28 bool overwriteColor ItemConfig_Item 0x0 int type ItemConfig_Item 0x4 int id ItemConfig_Item 0x8 std_string name -ItemConfig_Item 0x20 std_string desc ItemConfig_Item 0x38 std_string gfxFilename ItemConfig_Item 0x50 int achievementId ItemConfig_Item 0x54 int cacheFlags @@ -351,11 +208,9 @@ ItemConfig_Item 0xc4 int craftingQuality ItemConfig_Pill 0x0 int id ItemConfig_Pill 0x4 int achievementId ItemConfig_Pill 0x8 std_string name -ItemConfig_Pill 0x20 std_string desc ItemConfig_Pill 0x38 bool greedModeAllowed ItemConfig_Pill 0x3c unsigned int announcerVoice ItemConfig_Pill 0x40 unsigned int announcerVoiceSuper -ItemConfig_Pill 0x44 unsigned int announcerVoiceDelay ItemConfig_Pill 0x48 unsigned int mimicCharge ItemConfig_Pill 0x4c uint8_t effectClass ItemConfig_Pill 0x4d uint8_t effectSubClass @@ -390,37 +245,24 @@ ProjectileParams 0x94 uint32_t Variant QueueItemData 0x0 ItemConfig_Item* _item QueueItemData 0x4 int _charge Room 0x10 uint32_t _gridHeight -Room 0x11ec int _roomClearDelay -Room 0x11f8 Camera* _Camera Room 0x1bb0 uint32_t _bossId Room 0x1204 Vector _renderScrollOffset Room 0x120c bool _redHeartDamage -Room 0x1218 EntityList _entityList -Room 0x1618 FXLayers _fxLayers RoomDescriptor 0x0 int32_t GridIndex RoomDescriptor 0x4 int32_t SafeGridIndex RoomDescriptor 0x8 int32_t ListIndex -RoomDescriptor 0xc int32_t Dimension RoomDescriptor 0x10 RoomConfig_Room* Data RoomDescriptor 0x14 RoomConfig_Room* OverrideData RoomDescriptor 0x18 int32_t AllowedDoors RoomDescriptor 0x3c int32_t DisplayFlags RoomDescriptor 0x40 int32_t VisitedCount RoomDescriptor 0x44 int32_t Flags -RoomDescriptor 0x48 int16_t TotalMoneySpent RoomDescriptor 0x4a int16_t ClearCount -RoomDescriptor 0x4c int32_t GreedSubType RoomDescriptor 0x50 int16_t PoopCount -RoomDescriptor 0x52 int16_t TKeeperCoinSpawns RoomDescriptor 0x54 int32_t PitsCount RoomDescriptor 0x58 int32_t DecorationSeed RoomDescriptor 0x5c int32_t SpawnSeed RoomDescriptor 0x60 int32_t AwardSeed -RoomDescriptor 0x64 uint32_t BossDeathSeed -RoomDescriptor 0x68 vector_GridEntityDesc SavedGridEntities -RoomDescriptor 0x74 vector_EntitySaveState SavedEntities -RoomDescriptor 0x80 std_set_int RestrictedGridIndexes -RoomDescriptor 0x88 vector_EntitySaveState SavedEffects RoomDescriptor 0xac int16_t ShopItemIdx RoomDescriptor 0xae int16_t ShopItemDiscountIdx RoomDescriptor 0xb0 int32_t DeliriumDistance @@ -428,8 +270,6 @@ Seeds 0x50 unsigned int _playerInitSeed TearParams 0x0 int _tearVariant TearParams 0x4 int _bombVariant TearParams 0x8 ColorMod _tearColor -TearParams 0x34 int _unused -TearParams 0x38 BitSet128 _flags TearParams 0x48 float _tearDamage TearParams 0x4c float _tearScale TearParams 0x50 float _tearHeight