From 8d104921728c3fb202f7483bc4ff5297832f9045 Mon Sep 17 00:00:00 2001 From: shweet Date: Sun, 25 Oct 2026 15:02:14 -0400 Subject: [PATCH] db/fields: 150 formerly bracketed REPENTOGON fields re-verified (2 moved, 2 not in this game) Co-Authored-By: Claude Opus 5.5 --- db/fields.tsv | 152 ++++ src/structs.hpp | 1785 ++++++++++++++++++++++++++++++++++++++--------- 2 files changed, 1595 insertions(+), 342 deletions(-) diff --git a/db/fields.tsv b/db/fields.tsv index 1e01932..a3f1710 100644 --- a/db/fields.tsv +++ b/db/fields.tsv @@ -1045,3 +1045,155 @@ Entity_Bomb 0x462 bool _hasCostumes Entity_Bomb::update_sparks 006a6f10 (costume # 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 +# +# REPENTOGON fields that had been kept only by bracketing, re-verified against this exe (3 subagents) +Entity_Player 0x1344 int _redHearts Lua EntityPlayer:GetHearts 00428b10 returns this+0x1344; AddHearts 00758a70 / AddMaxHearts 007588a0 clamp and add to it +Entity_Player 0x140c Entity_Effect* _markedTarget Entity_Familiar::TryAimAtMarkedTarget 006146e0 reads player+0x140c; GetTearMovementInheritance 007aaea0 tests HasCollectible(394 Marked) && it; release_weapons_and_effects 00757ac0 Removes it +Entity_Player 0x1410 Entity* _heldEntity ThrowHeldEntity 007d2470 (Lua) clears &this+0x1410; Render 0078ca00 draws the held entity's sprite (+0x48); TrapDoor/Stairs Update compare it with _twinPlayer 0x1e68 (Forgotten carrying the Soul) +Entity_Player 0x1458 Entity_Laser* _megaBlastLaser update_effects 00794e50: while _megaBlastDuration 0x18f4 > 15 and this is null, ShootAngle laser with timeout duration-15 and SetReference here; release_weapons_and_effects 00757ac0 Removes it +Entity_Player 0x145c int _rUaWizardTimer UsePill 007c4180 R U A Wizard case adds 900 (1800 horse pill); update_effects 00794e50 counts down; Weapon_Bone/SpiritSword::Fire test >0; Store/RestoreGameState slot 0x82 +Entity_Player 0x1478 float _tearfallspeed Lua field EntityPlayer.TearFallingSpeed = +0x1478; FireTear 00790af0 uses -it as tear falling speed +Entity_Player 0x147c float _tearfallaccel Lua field EntityPlayer.TearFallingAcceleration = +0x147c; FireTear 00790af0 copies it to the tear's _fallingAccel +Entity_Player 0x1508 TemporaryEffects _temporaryeffects Lua EntityPlayer:GetEffects 004361c0 returns this+0x1508; 120+ callers pass it to TemporaryEffects::Has/AddCollectibleEffect +Entity_Player 0x1520 int _speedModifier EvaluateItems 00763570 movespeed = (it + ...)*0.2 + ... (0 under Curse Mist/coop ghost); reroll_collectibles_on_damage 005c88a0 randomises it -1..1; Store/RestoreGameState slot 0x12 +Entity_Player 0x1524 int _fireDelayModifier EvaluateItems 00763570 fire-delay block reads it (0 under Curse Mist/coop ghost); reroll_collectibles_on_damage 005c88a0 randomises it -1..1 beside 0x1520/0x1528; Store/RestoreGameState slot 0x13 +Entity_Player 0x1528 int _damageModifier EvaluateItems 00763570 damage += it (0 under Curse Mist/coop ghost); reroll_collectibles_on_damage 005c88a0 randomises it -1..1; Store/RestoreGameState slot 0x14 +Entity_Player 0x1574 uint32_t _cacheFlags AddCacheFlags 00436160 (ZHL exact, Lua) ORs flags into this+0x1574; AddDeadEyeCharge 007c78b0 sets bit 1 before EvaluateItems +Entity_Player 0x1578 int8_t _tearDisplacement FireTear 00790af0 / FireBomb 007a0970 offset the shot by (char)it; Weapon_Bone::Fire negates it per shot (alternating eye); init_player_type_state 007cc200 swaps it with the sub player +Entity_Player 0x1604 int _itemStateCooldown ControlActiveItem 00791a40 tests it with _itemState; update_shooting 0077b020 counts it; SwapActiveItems/room_exit/active_used_post zero it +Entity_Player 0x1608 uint32_t _vampireCharmKills FUN_007d3350: with HasCollectible(62 Charm of the Vampire) ++ per kill, at >= 13 (8 in co-op) AddHearts(1) and subtracts 13; Store/RestoreGameState slot 0x21 +Entity_Player 0x1610 int _bombPlaceDelay update_bomb_input 00780f40: bombs placed only while <1, then set to 30 (1 with 517 Fast Bombs, 15 in some co-op mode) +Entity_Player 0x1614 int _forgottenSwapFormCooldown init_player_type_state 007cc200: The Forgotten/Soul (types 16/17) swap refused while >0, else set to 15; pockets_rotate 007a42b0 counts it down +Entity_Player 0x161c int _playerIndex Lua EntityPlayer:IsSubPlayer 00753ac0 returns it >>31 (index < 0); ctor 00753da0 inits -1; ConsumableCountChanged 007597e0 only when >= 0; EntityList/GetNearestTargetPlayer order players by it with -1 skipped +Entity_Player 0x1624 int _moveDirection Lua EntityPlayer:GetMovementDirection 004e4860 returns this+0x1624; update_body_animations 00779b40 sets -1/1/3... +Entity_Player 0x1828 ColorMod _footprintColor1 SetFootprintColor 007b98c0 (ZHL exact) writes the KColor into its offset[0..2] (0x1854 for the other foot); ctor inits tint 1.0; update_footprints 007b8cb0 draws with it +Entity_Player 0x1854 ColorMod _footprintColor2 SetFootprintColor 007b98c0 (ZHL exact) writes the KColor here when FUN_007b9940(0); update_footprints 007b8cb0 reads tint[3] and draws with it +Entity_Player 0x1888 int _ponyCharge UseActiveItem 005b39d0 case 181 White Pony (Pony shares) sets 60; HandleCollision 0078e1f0 damages while >0; update_effects 00794e50 counts it down to 0 +Entity_Player 0x188c int _planCKillCountdown UseActiveItem 005b39d0 Plan C case sets 300; update_effects 00794e50 counts it down; Store/RestoreGameState slot 0xf +Entity_Player 0x18a4 int _epiphoraCharge EvaluateItems 00763570: with HasCollectible(368 Epiphora) tears *= it/180+1; update_shooting 0077b020 ++ up to 180 while firing one direction, 0 otherwise +Entity_Player 0x18b0 uint32_t _deadEyeCharges Lua EntityPlayer:AddDeadEyeCharge 007c78b0 ++ while <8 and sets cache 1; ClearDeadEyeCharge 007c78e0 (ZHL exact) zeroes it; EvaluateItems damage *= it*0.125+1 +Entity_Player 0x18b4 uint32_t _deadEyeMisses ClearDeadEyeCharge 007c78e0 (ZHL exact) ++ and picks the 20/33/50% clear chance by 1/2/more; AddDeadEyeCharge 007c78b0 zeroes it +Entity_Player 0x18bc uint32_t _mawOfTheVoidChargeTimer update_shooting 0077b020 fires the Maw of the Void ring once > 150 and zeroes it; FUN_0075ea40 shows it as a charge bar (it*100/150) +Entity_Player 0x18e8 uint32_t _imExcitedSpeedupCountdown UsePill 007c4180 I'm Excited!!! case (Broken Watch state 2) sets (rand(2)+2)*900; update_effects 00794e50 counts it down; Store/RestoreGameState slot 0x10 +Entity_Player 0x18f4 int _megaBlastDuration UseActiveItem 005b39d0 Mega Blast case sets 450 (*1.5 with 356 Car Battery); update_effects 00794e50 counts it down while firing the laser 0x1458 and removes the costume at <1 +Entity_Player 0x18f8 int _peeBurstCooldown update_shooting 0077b020 counts it down against _maxPeeBurstCooldown 0x18fc; EvaluateItems tears *= it*5/max+1; update_effects blocks the Kidney Stone when >0 or urethra blocked 0x1908 +Entity_Player 0x18fc int _maxPeeBurstCooldown update_shooting 0077b020 sets 180 and compares _peeBurstCooldown against it-5; EvaluateItems 00763570 divides by it+1 +Entity_Player 0x1900 int _bladderCharge update_shooting 0077b020 bursts and zeroes it once >= _maxBladderCharge 0x1904; Update 00782af0 shows it/max; update_effects zeroes it +Entity_Player 0x1904 int _maxBladderCharge update_effects 00794e50 sets (rand+1)*30; update_shooting 0077b020 / Update 00782af0 compare _bladderCharge 0x1900 against it +Entity_Player 0x1908 bool _isUrethraBlocked update_effects 00794e50 sets/clears it at _nextUrethraBlockFrame 0x190c (Kidney Stone); update_shooting 0077b020 releases the stone when set and clears it +Entity_Player 0x190c int _nextUrethraBlockFrame update_shooting 0077b020 sets GetFrameCount-based frame + (rand+15)*30; update_effects 00794e50 blocks the urethra once GetFrameCount >= it +Entity_Player 0x192c int _purityState FUN_007c7c60 picks the gfx/characters/costumes/PurityGlow costume by it (0..3); EvaluateItems 00763570 tests 0/1/3 per stat; TakeDamage/Update reroll it; Store/RestoreGameState slot 0xd2 +Entity_Player 0x1930 int _immaculateConceptionState AddImmaculateConceptionCounter 007c8050 adds the argument to it and spawns by it/threshold; Store/RestoreGameState slot 0xd3 +Entity_Player 0x1934 int _cambionConceptionState GetCambionPregnancyLevel 007c90b0 reads it; TakeDamage 007729d0 ++; Store/RestoreGameState slot 0xd4 +Entity_Player 0x1938 uint32_t _conceptionFamiliarFlags AddImmaculateConceptionCounter 007c8050 / TakeDamage 007729d0 set a bit per conception familiar granted; GetCollectibleNum 00770ca0 counts set bits; Store/RestoreGameState slot 0xd5 +Entity_Player 0x193c float _d8DamageModifier UseActiveItem 005b39d0 D8 case rolls it and renormalises by (2-sum of 0x193c..0x1948)*0.25; EvaluateItems damage *= it; Store/RestoreGameState slot 0xd6 +Entity_Player 0x1940 float _d8SpeedModifier UseActiveItem 005b39d0 D8 case rolls it; EvaluateItems 00763570 movespeed *= it; Store/RestoreGameState slot 0xd7 +Entity_Player 0x1944 float _d8RangeModifier UseActiveItem 005b39d0 D8 case rolls it; EvaluateItems 00763570 range *= it; Store/RestoreGameState slot 0xd8 +Entity_Player 0x1948 float _d8FireDelayModifier UseActiveItem 005b39d0 D8 case rolls it; EvaluateItems 00763570 maxfiredelay = 30/(tears*it)-1; Store/RestoreGameState slot 0xd9 +Entity_Player 0x1d7c vector_EntitySaveState _movingBoxContents TryDecreaseGlowingHourglassUses 007b9e10: with HasCollectible(523 Moving Box) walks begin 0x1d7c..end 0x1d80 in 0x78-byte save states for pickup 5.100.422; UseActiveItem Moving Box case restores pickups from it; StoreGameState saves (end-begin)/0x78 +Entity_Player 0x1d8c int _boneHeartsMask Lua EntityPlayer:IsBoneHeart 007caaa0 tests bit (1<= 1; AddBoneHearts 007ca840 updates it +Entity_Player 0x1d90 int _hallowedGroundCountdown GridEntity_Poop::Update / NpcAI::ENTITY_POOP refresh it for players in the white-poop aura; update_effects 00794e50 counts it down; EvaluateItems tears *2.5 while set; TakeDamage tests >0 +Entity_Player 0x1dd0 uint32_t _urnSouls AddUrnSouls 007d3480 adds amount to it; Weapon_UrnOfSouls::Fire requires >0; PlayerHUD::RenderActiveItem draws it; Store/RestoreGameState slot 0x114 +Entity_Player 0x1f7c int _eveSumptoriumCharge update_shooting 0077b020: for Tainted Eve (type 26) ++ while charging, at >59 zeroes it and fires; FUN_0075ea40 shows it as a charge bar (it/60*100) +Entity_Player 0x1f80 std_map_int_int _itemWispsList HasCollectible 007706e0: when size 0x1f84 != 0, std::set find in the tree at 0x1f80 and node value (+0x14) >= 1 counts; RecomputeWispCollectibles 007d7740 rebuilds it from item wisps (3.237) keyed by subtype; ctor builds the head +Entity 0x15c float _shadowSize Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) +Entity 0x168 unsigned long long _flags Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it +Entity 0x170 bool _valid EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it +Entity 0x177 bool _removedByFactory EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 +Entity 0x184 int _entityGridCollisionClass Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config +Entity 0x190 bool _collidesWithGrid Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) +Entity 0x1ac vector_ColorParams _colorParams ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour +Entity 0x210 int _fireDamageCountdown Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it +Entity 0x214 int _damageCountdown Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e +Entity 0x218 int _freezeCountdown Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it +Entity 0x21c int _poisonCountdown Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 +Entity 0x220 int _slowingCountdown Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it +Entity 0x224 int _charmedCountdown Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) +Entity 0x228 int _confusionCountdown Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 +Entity 0x22c int _midasFreezeCountdown Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) +Entity 0x230 int _fearCountdown Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag +Entity 0x234 int _burnCountdown Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 +Entity 0x238 int _bossStatusEffectCooldown every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses +Entity 0x23c int _shrinkCountdown Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it +Entity 0x2e0 int _poisonDamageTimer Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 +Entity 0x2e4 int _burnDamageTimer Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 +Entity 0x2e8 int _bleedingCountdown Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it +Entity 0x2f0 int _magnetizedCountdown Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it +Entity 0x2f4 int _baitedCountdown Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it +Entity 0x2f8 int _knockbackCountdown Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 +Entity 0x2fc int _weaknessCountdown Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) +Entity 0x300 int _iceCountdown Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) +Entity 0x304 int _brimstoneMarkCountdown Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) +Entity 0x308 Vector _knockbackDirection Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) +Entity 0x31c int _pauseTimer Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it +Entity 0x33c Vector _pos Lua Entity.Position 00417290 returns this+0x33c/0x340 +Entity 0x34c Vector _posOffset Lua Entity.PositionOffset 00417310 returns this+0x34c +Entity 0x360 Vector _velocity Lua Entity.Velocity 004172d0 returns this+0x360/0x364 +Entity 0x370 float _size Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it +Entity 0x380 float _health Lua Entity.HitPoints 00417370 returns float this+0x380 +Entity 0x388 float _collisionDamage Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage +Entity 0x39c float _speedMultiplier Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 +Entity 0x3b0 bool _isInvicible Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 +Entity 0x3b4 float _shrinkStatus1 Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 +Entity 0x3b8 float _shrinkStatus2 Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 +Entity 0x3d4 EntityPtr _minecart Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it +Entity_Familiar 0x5f8 int _moveDelayNum Lua EntityFamiliar:MoveDelayed 00631050 uses +0x5f8 as the ring index into the Vector history at 0x418 ((idx+1)%delay), resetting it to 0 when refilling +Entity_Familiar 0x5fc NPCAI_Pathfinder _pathfinder Entity_Familiar::predict_player_movement 00650220 calls NPCAI_Pathfinder::SimulatePlayerMovement(this+0x5fc); FamiliarAI::bumbo 0062f7f0 calls NPCAI_Pathfinder::HasPathToPos on it +Entity_Laser 0x4e0 float _scale Entity_Laser::ResetSpriteScale 0097fc10 sets sprite scale and _size = it * config size; Entity_Laser::set_scale 0097fe50 writes +0x4e0; Entity_Laser::Init 0096f590 sets 1.0 +Entity_Laser 0x500 bool _multidimensionalTouched Lua EntityLaser:SetMultidimensionalTouched 005cd590 writes byte this+0x500; Entity_Laser::copy_from_parent 0096f070 copies it +Entity_Laser 0x514 bool _prismTouched Entity_Laser::update_laser 00973c60 only looks for an Angelic Prism (3.123) while +0x514==0 and sets +0x514=1 on the split child lasers it spawns (stored at 0x504..0x510); copy_from_parent 0096f070 copies it; Init 0096f590 zeroes it +Entity_NPC 0xbc8 uint32_t _deliriumBossType NpcAI::ENTITY_DELIRIUM 004a6500 picks a boss, logs 'Changed Delirium form to %d:%u.' with it and writes it into _type +Entity_NPC 0xbcc uint32_t _deliriumBossVariant NpcAI::ENTITY_DELIRIUM 004a6500 logs 'Changed Delirium form to %d:%u.' with it (second arg) and writes it into _variant +Entity_NPC 0xbd0 uint16_t _deliriumTransformationTimer NpcAI::ENTITY_DELIRIUM 004a6500: ushort countdown decremented in states 0x11/8, drives Game::ShowHallucination(timer*0.4*30), reset to random*0x1e between forms +Entity_NPC 0xbd2 uint8_t _deliriumRemainingAttacks NpcAI::ENTITY_DELIRIUM 004a6500 sets it to rand%3+2 on a new form, decrements per attack and leaves state 8 when 0 +Entity_NPC 0xbd3 uint8_t _deliriumState NpcAI::ENTITY_DELIRIUM 004a6500 byte state machine (0x10 pick form, 0x11 hallucination, 0x12) separate from _state 0xb64 +Entity_NPC 0xbd8 uint32_t _deliriumAttackID NpcHelper::delirium_fire_pattern 004a8b70 unpacks it (low byte = pattern, 0xff = random %0xb) and repacks it; ENTITY_DELIRIUM 004a6500 resets it to 0xff per form +Entity_NPC 0xbdc uint8_t _deliriumAttackAngle NpcHelper::delirium_fire_pattern 004a8b70 reads it as the pattern angle and stores (Random()%0xff)&0xff back; ENTITY_DELIRIUM 004a6500 zeroes it per form (written as a dword) +Entity_NPC 0xbe0 uint32_t _deliriumCycleID NpcAI::ENTITY_DELIRIUM 004a6500 keeps packed bitfields here (low 7 bits form cycle, (rand%600+300)<<15 timer) updated on every form change +Entity_NPC 0xc3d bool _isBoss Entity_NPC::IsBoss 006b8470 (vtable slot 19) is MOV AL,[ECX+0xc3d]; champion_init 006bb790 copies EntityConfig isBoss (+0x2c) into it +Entity_NPC 0xc40 float _shieldStrength Entity_NPC::champion_init 006bb790 copies EntityConfig shieldStrength (+0xe0); NpcAI::ENTITY_DELIRIUM 004a6500 sets it from lost health *80; ENTITY_ISAAC 00463100 sets 90 +Entity_NPC 0xc74 uint16_t _championRegenTimer Entity_NPC::Update 006c4b30: for champion colour 12 on death sets it to 1, revives at 10 HP, counts it up per HP lost shrinking/growing the sprite ('ReGenChamp' Globin anm2) and resets to 0 after 0x59 +Entity_Tear 0x420 float _fScale Lua EntityTear.Scale 00557cd0 returns this+0x420 +Entity_Tear 0x428 BitSet128 _tearFlags Lua EntityTear.TearFlags 004177c0 returns the 4 dwords 0x428..0x434 +Entity_Tear 0x444 std_vector_uint _hitList Entity_Tear::HandleCollision 00673660 does LEA ECX,[ESI+0x444] then EntityList::HitListContains 00431640 (binary search of GetHitListIndex) and sorted insert 00431570; ctor 00665cf0 zeroes 0x444..0x44c, Init 006660a0 sets end=begin +Entity_Tear 0x450 int _tearIdx Lua EntityTear.TearIndex 004aade0 returns this+0x450 +Entity_Tear 0x458 float _rotation Lua EntityTear.Rotation 0060ccc0 returns this+0x458 +Entity_Tear 0x45c int _scaleAnimNum Entity_Tear::ResetSpriteScale 00677780 recomputes the RegularTear%d/BloodTear%d anim number from scale and replays only when it differs from +0x45c; Entity_Tear::Init 006660a0 sets -1 +ActiveItemDesc 0x14 int _timeRechargeCooldown Entity_Player::ControlActiveItem (00791a40) sets desc+0x14 to 9/0xb/0xf after use, decrements it each frame for all 4 slots (player+0x1594 stride 0x20) and only advances a chargeType==1 (timed) item while it is < 1 +ActiveItemDesc 0x4 int _unk Entity_Player::AddCollectible (0075f0e0) writes player+0x1584+slot*0x20 alongside +0xc/+0x10/+0x18/+0x1c when installing an active; SwapActiveItems (007a4760) swaps it with slot 1 (+0x15a4); Store/RestoreGameState save it +Game 0x1af70 BossPool _bossPool Game ctor (006f1020) builds 0x25 x 0x3c BossPool_Pool at Game+0x1af70 (~Game destroys them); Level::place_special_rooms / generate_boss_room / TryInitializeExtraBossRoom call BossPool::GetBossId with ECX=Game+0x1af70 +Game 0x1b83c RoomTransition _roomTransition BossOverlay::update / FUN_00429570 call RoomTransition::Update with ECX=Game+0x1b83c; ctor builds the versus-screen ANM2 at +0x38 (0x1b874); Game::IsPaused / many AIs test its mode dword != 0 +Game 0x1ba78 StageTransition _stageTransition StageTransition::Update (0092f1c0) runs with this=Game+0x1ba78; Game::Update/Render/IsPaused and Entity_Player shooting/pocket-use test the state dword != 0 (PlayerManager::Update next to _roomTransition) +Game 0x1bb84 Seeds _seedEffects Lua Game:GetSeeds (0042a340) returns this+0x1bb84; ctor calls Seeds::constructor there; Seeds::AchievementUnlocksDisallowed called with ECX=Game+0x1bb84 +Game 0x26534 bool _triggerWindowResize window-size handler FUN_00954150 (width/height scale recompute) sets byte Game+0x26534=1; Game::Render (006fbc10) at entry calls FUN_007084c0 (render-surface rebuild) when set and clears it; ctor zeroes it +Game 0x26544 unsigned int _debugFlags console debug toggles: FUN_00685f10 sets bit n in Game+0x26544; Entity::PostRender bit 0 (entity positions), bit 5 hitspheres (Entity_Laser/Knife/Brimstone), bit 0xd render_debug_lua_memory (debug 14) +Game 0x26548 uint64_t _gameStateFlags Game::GetStateFlag (004217a0) tests bit in qword this+0x26548+(n>>6)*8; Level::place_special_rooms / GridEntity_Door::SetLocked / Entity_Slot::TakeDamage set bits there +Game 0x26558 int _treasureRoomsVisited Lua Game:GetTreasureRoomVisitCount (007383a0) returns this+0x26558, Lua AddTreasureRoomsVisited (007e9370) increments it; Room::Init (007f2800) increments it on entering a treasure room +Game 0x2655c int _planetariumsVisited Room::Init (007f2800) increments Game+0x2655c on first visit of room type 0x18 (planetarium); Game::GetPlanetariumChance (0074dbd0) tests it == 0; ResetState zeroes it; store_game_state saves it +Game 0x2657c int _shopVisits moved from 0x26574: Room::Init (007f2800 at 007f36f4) increments Game+0x2657c when room type == 2 (shop) and unlocks achievement 0x17b (School Bag) once >= 6 outside greed difficulties (matches REPENTOGON Lua AddShopVisits logic); 0x26574 is a slot coin countdown (reset to 10, decremented on CoinInsert) +Game 0x26580 EntityFactory* _entityFactory Game ctor stores EntityFactory::constructor result at Game+0x26580; Game::SpawnEx (006fe410) and ~20 spawners call EntityFactory::Create(*(Game+0x26580),...); ~Game frees it +Game 0x26588 bool _isRerun FUN_006f72f0 (start a game from saved start params, copies their Seeds) sets byte Game+0x26588=1, LoadConfigXmls clears it, store/restore_game_state save it; Game::StartDebug / Entity::AddCharmed require it == 0 next to Seeds::AchievementUnlocksDisallowed before achievement unlocks +Game 0x26589 bool _isDebug Game::StartDebug (006f7750) sets byte Game+0x26589=1; Entity::AddCharmed tests _dailyChallenge._id==0 && it==0 before unlocks +Game 0x26630 DailyChallenge _dailyChallenge Game::StartDailyChallenge(DailyChallenge*) (006f6dd0) copies _id/_seed/_isPractice/_specialDailyId into Game+0x26630/34/38/3c; Game::IsChallengeOrDaily (006dae20) tests +0x26630 != 0 +Game 0x266e4 ScoreSheet _scoreSheet Minimap::render_score_time (0098ef30, at 0098f62a) calls ScoreSheet::Calculate (009e5d90) with ECX=Game+0x266e4; Game::StartStageTransition passes Game+0x266e4 to FUN_009e5a30 +Game 0x26778 GenericPrompt _genericPrompt Game::LoadConfigXmls / ReloadStagesXmlOnLuaReset call GenericPrompt::Initialize(Game+0x26778); Game::Render calls GenericPrompt::Render and Room::SpawnClearAward GenericPrompt::Show on it +GridEntity 0x28 unsigned int _spawnFrame GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame +GridEntity_Door 0x394 int _targetRoomIdx Lua GridEntityDoor.TargetRoomIndex field+0x394; Room::update_door_transitions (007f01c0) and Entity_NPC::HandleCollision read door+0x394 and, when < -99, resolve it with Level::GetRoomByIdx for the target room's Dimension/GridIndex +ItemConfig_Card 0x20 std_string desc Lua Card.Description field+0x20 +ItemConfig_Item 0x20 std_string desc Lua Item.Description field+0x20 +ItemConfig_Pill 0x20 std_string desc ItemConfig::load_pocketitems_xml (0072cff0) parses the "description" attribute into a local std::string (72d42d, [ebp-0x58]) and std::string::assign's it to pill entry +0x20 (name at +0x8, Lua GreedModeAllowed at +0x38) +ItemConfig_Pill 0x44 unsigned int announcerVoiceDelay Lua PillEffect.AnnouncerDelay field+0x44 +Room 0x11ec int _roomClearDelay Room::KeepDoorsClosed (0085e0f0) sets this+0x11ec=10; Room::Update (00802980) resets it to 10 (20 in some boss rooms) while enemies/greed wave remain and otherwise counts it down; NPC AIs test it (< 9) as the room-clear countdown +Room 0x11f8 Camera* _Camera AIs call Camera::IsPosVisible / Camera::SetFocusPosition with *(Room+0x11f8) (NpcAI::ENTITY_ADVERSARY, ENTITY_DOGMA, ENTITY_SISTERS_VIS); FUN_00428a70 returns it +Room 0x1218 EntityList _entityList Lua Room:GetEntities (00428a50) returns this+0x1258 = EntityList+0x40 (_updateEL); ~157 callers run EntityList::QuerySublist on Room+0x1218 +Room 0x1618 FXLayers _fxLayers Room::LoadBackdropGraphics calls FXLayers::LoadConfig (00990a40) and Room::Render calls FXLayers::Render (009948f0) / render_veins with ECX=Room+0x1618 +RoomDescriptor 0x48 int16_t TotalMoneySpent FUN_007d8630 (player coin spend, Keeper's Sack) adds the amount to short (Room->_descriptor)+0x48 and unlocks achievement 0x246 once it exceeds 0x27; ctor zeroes it +RoomDescriptor 0x4c int32_t GreedSubType Level::generate_greed (0073e0a0) stores the chosen greed room subtype (4 or 0xb) in current desc+0x4c when 0, else reuses it as the RoomConfig::GetRandomRoom subtype; ctor zeroes it +RoomDescriptor 0x52 int16_t TKeeperCoinSpawns Entity_Pickup::Update (006bbdc0) for player type 0x21 (Tainted Keeper): if the room was visited before, stops at short desc+0x52 > 9, else rolls 1/(n+1) and increments it per enemy coin spawn +RoomDescriptor 0x64 uint32_t BossDeathSeed Room::TriggerBossDeath (007fec00, log "TriggerBossDeath: %d bosses remaining.") loads (Room->_descriptor)+0x64 at 007fed23 as the RNG seed for the last-boss-death reward (Game+0x265f4 overrides); ctor zeroes it +RoomDescriptor 0x68 vector_GridEntityDesc SavedGridEntities RoomDescriptor::constructor (006ef590) sizes the vector at +0x68/+0x6c/+0x70 to 0x1c0 (grid cells) x 0x20 GridEntityDesc, each with seed 0x16a9de81 at +0x10/+0x1c +RoomDescriptor 0x74 vector_EntitySaveState SavedEntities Room::RestoreState (007eff50) respawns each 0x78-byte EntitySaveState in desc+0x74..+0x78 via Game::SpawnEx + Entity_Pickup::RestoreState, then clears it +RoomDescriptor 0x80 std_set_int RestrictedGridIndexes ctor allocates a 0x14-byte std::set head at +0x80 (size +0x84); grid-bound enemies (NpcAI POKY/SPIKEBALL/STONEHEAD/CONSTANT_STONE_SHOOTER/BOMB_GRIMACE/GUTS) std::set::insert their _spawnGridIndex into current desc+0x80 on death; Room::Init find_node's it +RoomDescriptor 0x88 vector_EntitySaveState SavedEffects Game::spawn_bomb_crater (00703190) appends the crater effect's 0x78-byte save state to (Room->_descriptor)+0x88..+0x90, capped at 0x80 entries +RoomDescriptor 0xc int32_t Dimension ctor zeroes +0xc between ListIndex and Data; Room::update_door_transitions (007f01c0) / Entity_NPC::HandleCollision read the target desc+0xc as the dimension with its GridIndex; RoomTransition::ChangeRoom compares two descs' +0xc +TearParams 0x38 BitSet128 _flags Lua TearParams.TearFlags field+0x38; TearParams::constructor (005cd690) zeroes the 4 dwords 0x38..0x44 diff --git a/src/structs.hpp b/src/structs.hpp index 6af6b6e..b2ca0d7 100644 --- a/src/structs.hpp +++ b/src/structs.hpp @@ -93,18 +93,20 @@ static_assert(offsetof(ANM2, _bitflags) == 0x110); struct ActiveItemDesc { int _item; - uint8_t _pad_0x4[0x4]; + int _unk; // Entity_Player::AddCollectible (0075f0e0) writes player+0x1584+slot*0x20 alongside +0xc/+0x10/+0x18/+0x1c when installing an active; SwapActiveItems (007a4760) swaps it with slot 1 (+0x15a4); Store/RestoreGameState save it int _charge; int _batteryCharge; int _subCharge; - uint8_t _pad_0x14[0x4]; + int _timeRechargeCooldown; // Entity_Player::ControlActiveItem (00791a40) sets desc+0x14 to 9/0xb/0xf after use, decrements it each frame for all 4 slots (player+0x1594 stride 0x20) and only advances a chargeType==1 (timed) item while it is < 1 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); @@ -181,66 +183,98 @@ struct Entity { Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -264,50 +298,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity, _flags) == 0x168); +static_assert(offsetof(Entity, _valid) == 0x170); static_assert(offsetof(Entity, _visible) == 0x171); static_assert(offsetof(Entity, _exists) == 0x172); static_assert(offsetof(Entity, _dead) == 0x173); static_assert(offsetof(Entity, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity, _isInterpolating) == 0x175); +static_assert(offsetof(Entity, _removedByFactory) == 0x177); static_assert(offsetof(Entity, _collisionPoints) == 0x178); +static_assert(offsetof(Entity, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity, _collidesWithGrid) == 0x190); static_assert(offsetof(Entity, _gridCollisionVelocity) == 0x194); static_assert(offsetof(Entity, _gridCollisionNormal) == 0x19c); static_assert(offsetof(Entity, _renderPosition) == 0x1a4); +static_assert(offsetof(Entity, _colorParams) == 0x1ac); 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, _charmSource) == 0x240); static_assert(offsetof(Entity, _entityRef2) == 0x268); static_assert(offsetof(Entity, _entityRef3) == 0x290); static_assert(offsetof(Entity, _entityRef4) == 0x2b8); +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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity, _pausePosition) == 0x314); +static_assert(offsetof(Entity, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity, _mass) == 0x37c); +static_assert(offsetof(Entity, _health) == 0x380); static_assert(offsetof(Entity, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity, _collisionDamage) == 0x388); static_assert(offsetof(Entity, _prevPosition) == 0x38c); static_assert(offsetof(Entity, _prevVelocity) == 0x394); +static_assert(offsetof(Entity, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity, _updateTime) == 0x3a4); +static_assert(offsetof(Entity, _isInvicible) == 0x3b0); +static_assert(offsetof(Entity, _shrinkStatus1) == 0x3b4); +static_assert(offsetof(Entity, _shrinkStatus2) == 0x3b8); 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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity, _minecart) == 0x3d4); static_assert(offsetof(Entity, _hitEffect) == 0x3d8); static_assert(offsetof(Entity, _dropRNG) == 0x3dc); static_assert(offsetof(Entity, _initSeed) == 0x3ec); @@ -532,66 +607,98 @@ struct Entity_Bomb { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -641,50 +748,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Bomb, _flags) == 0x168); +static_assert(offsetof(Entity_Bomb, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Bomb, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Bomb, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Bomb, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Bomb, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Bomb, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Bomb, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Bomb, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Bomb, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Bomb, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Bomb, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Bomb, _mass) == 0x37c); +static_assert(offsetof(Entity_Bomb, _health) == 0x380); static_assert(offsetof(Entity_Bomb, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Bomb, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Bomb, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Bomb, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Bomb, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Bomb, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Bomb, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Bomb, _minecart) == 0x3d4); static_assert(offsetof(Entity_Bomb, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Bomb, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Bomb, _initSeed) == 0x3ec); @@ -734,66 +882,98 @@ struct Entity_Effect { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -835,50 +1015,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Effect, _flags) == 0x168); +static_assert(offsetof(Entity_Effect, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Effect, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Effect, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Effect, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Effect, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Effect, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Effect, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Effect, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Effect, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Effect, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Effect, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Effect, _mass) == 0x37c); +static_assert(offsetof(Entity_Effect, _health) == 0x380); static_assert(offsetof(Entity_Effect, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Effect, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Effect, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Effect, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Effect, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Effect, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Effect, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Effect, _minecart) == 0x3d4); static_assert(offsetof(Entity_Effect, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Effect, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Effect, _initSeed) == 0x3ec); @@ -900,6 +1121,32 @@ static_assert(offsetof(Entity_Effect, _parentOffset) == 0x468); static_assert(offsetof(Entity_Effect, _damageSource) == 0x470); static_assert(offsetof(Entity_Effect, _hitList) == 0x4a8); +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_Familiar { // : Entity (flattened) 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) @@ -918,66 +1165,98 @@ struct Entity_Familiar { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -989,7 +1268,10 @@ struct Entity_Familiar { // : Entity (flattened) uint8_t _pad_0x40c[0x4]; uint32_t _player; // Entity_Player* 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]; + uint8_t _pad_0x418[0x1e0]; + int _moveDelayNum; // Lua EntityFamiliar:MoveDelayed 00631050 uses +0x5f8 as the ring index into the Vector history at 0x418 ((idx+1)%delay), resetting it to 0 when refilling + NPCAI_Pathfinder _pathfinder; // Entity_Familiar::predict_player_movement 00650220 calls NPCAI_Pathfinder::SimulatePlayerMovement(this+0x5fc); FamiliarAI::bumbo 0062f7f0 calls NPCAI_Pathfinder::HasPathToPos on it + uint8_t _pad_0xd44[0x8]; 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,50 +1323,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Familiar, _flags) == 0x168); +static_assert(offsetof(Entity_Familiar, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Familiar, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Familiar, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Familiar, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Familiar, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Familiar, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Familiar, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Familiar, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Familiar, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Familiar, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Familiar, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Familiar, _mass) == 0x37c); +static_assert(offsetof(Entity_Familiar, _health) == 0x380); static_assert(offsetof(Entity_Familiar, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Familiar, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Familiar, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Familiar, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Familiar, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Familiar, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Familiar, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Familiar, _minecart) == 0x3d4); static_assert(offsetof(Entity_Familiar, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Familiar, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Familiar, _initSeed) == 0x3ec); @@ -1094,6 +1417,8 @@ 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, _sirenOriginalPlayer) == 0x414); +static_assert(offsetof(Entity_Familiar, _moveDelayNum) == 0x5f8); +static_assert(offsetof(Entity_Familiar, _pathfinder) == 0x5fc); static_assert(offsetof(Entity_Familiar, _fireCooldown) == 0xd4c); static_assert(offsetof(Entity_Familiar, _headFrameDelay) == 0xd50); static_assert(offsetof(Entity_Familiar, _moveDirection) == 0xd54); @@ -1145,66 +1470,98 @@ struct Entity_Knife { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -1259,50 +1616,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Knife, _flags) == 0x168); +static_assert(offsetof(Entity_Knife, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Knife, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Knife, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Knife, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Knife, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Knife, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Knife, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Knife, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Knife, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Knife, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Knife, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Knife, _mass) == 0x37c); +static_assert(offsetof(Entity_Knife, _health) == 0x380); static_assert(offsetof(Entity_Knife, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Knife, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Knife, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Knife, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Knife, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Knife, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Knife, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Knife, _minecart) == 0x3d4); static_assert(offsetof(Entity_Knife, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Knife, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Knife, _initSeed) == 0x3ec); @@ -1356,66 +1754,98 @@ struct Entity_Laser { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -1450,13 +1880,16 @@ struct Entity_Laser { // : Entity (flattened) float _maxDistance; uint32_t _homingType; Vector _endPoint; - uint8_t _pad_0x4e0[0x4]; + float _scale; // Entity_Laser::ResetSpriteScale 0097fc10 sets sprite scale and _size = it * config size; Entity_Laser::set_scale 0097fe50 writes +0x4e0; Entity_Laser::Init 0096f590 sets 1.0 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 _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[0x1d]; + uint8_t _pad_0x4f8[0x8]; + bool _multidimensionalTouched; // Lua EntityLaser:SetMultidimensionalTouched 005cd590 writes byte this+0x500; Entity_Laser::copy_from_parent 0096f070 copies it + uint8_t _pad_0x501[0x13]; + bool _prismTouched; // Entity_Laser::update_laser 00973c60 only looks for an Angelic Prism (3.123) while +0x514==0 and sets +0x514=1 on the split child lasers it spawns (stored at 0x504..0x510); copy_from_parent 0096f070 copies it; Init 0096f590 zeroes it bool _oneHit; bool _isGridHit; // Lua EntityLaser.GridHit via binder 00889050: getter 008bfeb0 pushboolean(byte), setter toboolean -> bool uint8_t _pad_0x517[0x1]; @@ -1486,50 +1919,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Laser, _flags) == 0x168); +static_assert(offsetof(Entity_Laser, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Laser, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Laser, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Laser, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Laser, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Laser, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Laser, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Laser, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Laser, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Laser, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Laser, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Laser, _mass) == 0x37c); +static_assert(offsetof(Entity_Laser, _health) == 0x380); static_assert(offsetof(Entity_Laser, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Laser, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Laser, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Laser, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Laser, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Laser, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Laser, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Laser, _minecart) == 0x3d4); static_assert(offsetof(Entity_Laser, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Laser, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Laser, _initSeed) == 0x3ec); @@ -1558,10 +2032,13 @@ 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); @@ -1574,32 +2051,6 @@ 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[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) @@ -1618,66 +2069,98 @@ struct Entity_NPC { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -1711,7 +2194,16 @@ struct Entity_NPC { // : Entity (flattened) Vector _v2; int _i1; int _i2; - uint8_t _pad_0xbc8[0x1c]; + uint32_t _deliriumBossType; // NpcAI::ENTITY_DELIRIUM 004a6500 picks a boss, logs 'Changed Delirium form to %d:%u.' with it and writes it into _type + uint32_t _deliriumBossVariant; // NpcAI::ENTITY_DELIRIUM 004a6500 logs 'Changed Delirium form to %d:%u.' with it (second arg) and writes it into _variant + uint16_t _deliriumTransformationTimer; // NpcAI::ENTITY_DELIRIUM 004a6500: ushort countdown decremented in states 0x11/8, drives Game::ShowHallucination(timer*0.4*30), reset to random*0x1e between forms + uint8_t _deliriumRemainingAttacks; // NpcAI::ENTITY_DELIRIUM 004a6500 sets it to rand%3+2 on a new form, decrements per attack and leaves state 8 when 0 + uint8_t _deliriumState; // NpcAI::ENTITY_DELIRIUM 004a6500 byte state machine (0x10 pick form, 0x11 hallucination, 0x12) separate from _state 0xb64 + uint8_t _pad_0xbd4[0x4]; + uint32_t _deliriumAttackID; // NpcHelper::delirium_fire_pattern 004a8b70 unpacks it (low byte = pattern, 0xff = random %0xb) and repacks it; ENTITY_DELIRIUM 004a6500 resets it to 0xff per form + uint8_t _deliriumAttackAngle; // NpcHelper::delirium_fire_pattern 004a8b70 reads it as the pattern angle and stores (Random()%0xff)&0xff back; ENTITY_DELIRIUM 004a6500 zeroes it per form (written as a dword) + uint8_t _pad_0xbdd[0x3]; + uint32_t _deliriumCycleID; // NpcAI::ENTITY_DELIRIUM 004a6500 keeps packed bitfields here (low 7 bits form cycle, (rand%600+300)<<15 timer) updated on every form change 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 @@ -1722,9 +2214,10 @@ struct Entity_NPC { // : Entity (flattened) 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 _isBoss; // Entity_NPC::IsBoss 006b8470 (vtable slot 19) is MOV AL,[ECX+0xc3d]; champion_init 006bb790 copies EntityConfig isBoss (+0x2c) into it 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]; + uint8_t _pad_0xc3f[0x1]; + float _shieldStrength; // Entity_NPC::champion_init 006bb790 copies EntityConfig shieldStrength (+0xe0); NpcAI::ENTITY_DELIRIUM 004a6500 sets it from lost health *80; ENTITY_ISAAC 00463100 sets 90 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 @@ -1735,7 +2228,7 @@ struct Entity_NPC { // : Entity (flattened) 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]; + uint16_t _championRegenTimer; // Entity_NPC::Update 006c4b30: for champion colour 12 on death sets it to 1, revives at 10 HP, counts it up per HP lost shrinking/growing the sprite ('ReGenChamp' Globin anm2) and resets to 0 after 0x59 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 @@ -1773,50 +2266,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_NPC, _flags) == 0x168); +static_assert(offsetof(Entity_NPC, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_NPC, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_NPC, _removedByFactory) == 0x177); static_assert(offsetof(Entity_NPC, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_NPC, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_NPC, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_NPC, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_NPC, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_NPC, _pausePosition) == 0x314); +static_assert(offsetof(Entity_NPC, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_NPC, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_NPC, _mass) == 0x37c); +static_assert(offsetof(Entity_NPC, _health) == 0x380); static_assert(offsetof(Entity_NPC, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_NPC, _collisionDamage) == 0x388); static_assert(offsetof(Entity_NPC, _prevPosition) == 0x38c); static_assert(offsetof(Entity_NPC, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_NPC, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_NPC, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_NPC, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_NPC, _minecart) == 0x3d4); static_assert(offsetof(Entity_NPC, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_NPC, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_NPC, _initSeed) == 0x3ec); @@ -1846,6 +2380,14 @@ 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, _deliriumCycleIDHigh) == 0xbe4); static_assert(offsetof(Entity_NPC, _deliriumEntity) == 0xbe8); static_assert(offsetof(Entity_NPC, _entityRef) == 0xbec); @@ -1856,7 +2398,9 @@ 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, _isBoss) == 0xc3d); static_assert(offsetof(Entity_NPC, _isUnreachableOnce) == 0xc3e); +static_assert(offsetof(Entity_NPC, _shieldStrength) == 0xc40); static_assert(offsetof(Entity_NPC, _shieldFrames) == 0xc44); static_assert(offsetof(Entity_NPC, _totalDamageTaken) == 0xc5c); static_assert(offsetof(Entity_NPC, _isBestiaryEncountered) == 0xc60); @@ -1865,6 +2409,7 @@ static_assert(offsetof(Entity_NPC, _championColorIdx) == 0xc64); 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, _championRegenTimer) == 0xc74); static_assert(offsetof(Entity_NPC, _championRegenCount) == 0xc76); static_assert(offsetof(Entity_NPC, _bosscoloridx) == 0xc78); static_assert(offsetof(Entity_NPC, _groupIdx) == 0xc7c); @@ -1905,66 +2450,98 @@ struct Entity_Pickup { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -2019,50 +2596,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Pickup, _flags) == 0x168); +static_assert(offsetof(Entity_Pickup, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Pickup, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Pickup, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Pickup, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Pickup, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Pickup, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Pickup, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Pickup, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Pickup, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Pickup, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Pickup, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Pickup, _mass) == 0x37c); +static_assert(offsetof(Entity_Pickup, _health) == 0x380); static_assert(offsetof(Entity_Pickup, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Pickup, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Pickup, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Pickup, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Pickup, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Pickup, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Pickup, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Pickup, _minecart) == 0x3d4); static_assert(offsetof(Entity_Pickup, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Pickup, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Pickup, _initSeed) == 0x3ec); @@ -2126,6 +2744,20 @@ struct PlayerCostumeMap { static_assert(offsetof(PlayerCostumeMap, _index) == 0x0); static_assert(offsetof(PlayerCostumeMap, _isBodyLayer) == 0xc); +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 Entity_Player { // : Entity (flattened) 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) @@ -2144,66 +2776,98 @@ struct Entity_Player { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -2231,7 +2895,7 @@ struct Entity_Player { // : Entity (flattened) 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; - uint8_t _pad_0x1344[0x4]; + int _redHearts; // Lua EntityPlayer:GetHearts 00428b10 returns this+0x1344; AddHearts 00758a70 / AddMaxHearts 007588a0 clamp and add to it int _eternalHearts; int _soulHearts; int _blackHearts; @@ -2270,16 +2934,22 @@ struct Entity_Player { // : Entity (flattened) int _playerType; 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]; + uint8_t _pad_0x13f0[0x1c]; + uint32_t _markedTarget; // Entity_Effect* // Entity_Familiar::TryAimAtMarkedTarget 006146e0 reads player+0x140c; GetTearMovementInheritance 007aaea0 tests HasCollectible(394 Marked) && it; release_weapons_and_effects 00757ac0 Removes it + uint32_t _heldEntity; // Entity* // ThrowHeldEntity 007d2470 (Lua) clears &this+0x1410; Render 0078ca00 draws the held entity's sprite (+0x48); TrapDoor/Stairs Update compare it with _twinPlayer 0x1e68 (Forgotten carrying the Soul) + uint8_t _pad_0x1414[0x1c]; int _tractorBeam; 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 + uint8_t _breathOfLifeEffect[0x14]; // 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 + uint32_t _megaBlastLaser; // Entity_Laser* // update_effects 00794e50: while _megaBlastDuration 0x18f4 > 15 and this is null, ShootAngle laser with timeout duration-15 and SetReference here; release_weapons_and_effects 00757ac0 Removes it + int _rUaWizardTimer; // UsePill 007c4180 R U A Wizard case adds 900 (1800 horse pill); update_effects 00794e50 counts down; Weapon_Bone/SpiritSword::Fire test >0; Store/RestoreGameState slot 0x82 float _maxfiredelay; float _shotspeed; uint8_t _pad_0x1468[0x8]; float _damage; float _tearheight; - uint8_t _pad_0x1478[0x8]; + float _tearfallspeed; // Lua field EntityPlayer.TearFallingSpeed = +0x1478; FireTear 00790af0 uses -it as tear falling speed + float _tearfallaccel; // Lua field EntityPlayer.TearFallingAcceleration = +0x147c; FireTear 00790af0 copies it to the tear's _fallingAccel float _tearrange; uint8_t _pad_0x1484[0x4]; BitSet128 _tearFlags; // Lua EntityPlayer.TearFlags via binder 00883ab0: getter 008be780 UserdataValue 16-byte copy @@ -2288,7 +2958,10 @@ struct Entity_Player { // : Entity (flattened) 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]; + TemporaryEffects _temporaryeffects; // Lua EntityPlayer:GetEffects 004361c0 returns this+0x1508; 120+ callers pass it to TemporaryEffects::Has/AddCollectibleEffect + int _speedModifier; // EvaluateItems 00763570 movespeed = (it + ...)*0.2 + ... (0 under Curse Mist/coop ghost); reroll_collectibles_on_damage 005c88a0 randomises it -1..1; Store/RestoreGameState slot 0x12 + int _fireDelayModifier; // EvaluateItems 00763570 fire-delay block reads it (0 under Curse Mist/coop ghost); reroll_collectibles_on_damage 005c88a0 randomises it -1..1 beside 0x1520/0x1528; Store/RestoreGameState slot 0x13 + int _damageModifier; // EvaluateItems 00763570 damage += it (0 under Curse Mist/coop ghost); reroll_collectibles_on_damage 005c88a0 randomises it -1..1; Store/RestoreGameState slot 0x14 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) @@ -2310,15 +2983,22 @@ struct Entity_Player { // : Entity (flattened) float _movespeed; float _luck; bool _canFly; - uint8_t _pad_0x1571[0xb]; + uint8_t _pad_0x1571[0x3]; + uint32_t _cacheFlags; // AddCacheFlags 00436160 (ZHL exact, Lua) ORs flags into this+0x1574; AddDeadEyeCharge 007c78b0 sets bit 1 before EvaluateItems + int8_t _tearDisplacement; // FireTear 00790af0 / FireBomb 007a0970 offset the shot by (char)it; Weapon_Bone::Fire negates it per shot (alternating eye); init_player_type_state 007cc200 swaps it with the sub player + uint8_t _pad_0x1579[0x3]; float _meleeDamage; // EvaluateItems' damage before weapon multipliers; the hug's 2x base (characters_9.md) 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; - uint8_t _pad_0x1604[0x14]; + int _itemStateCooldown; // ControlActiveItem 00791a40 tests it with _itemState; update_shooting 0077b020 counts it; SwapActiveItems/room_exit/active_used_post zero it + uint32_t _vampireCharmKills; // FUN_007d3350: with HasCollectible(62 Charm of the Vampire) ++ per kill, at >= 13 (8 in co-op) AddHearts(1) and subtracts 13; Store/RestoreGameState slot 0x21 + uint8_t _pad_0x160c[0x4]; + int _bombPlaceDelay; // update_bomb_input 00780f40: bombs placed only while <1, then set to 30 (1 with 517 Fast Bombs, 15 in some co-op mode) + int _forgottenSwapFormCooldown; // init_player_type_state 007cc200: The Forgotten/Soul (types 16/17) swap refused while >0, else set to 15; pockets_rotate 007a42b0 counts it down int _controllerIndex; - uint8_t _pad_0x161c[0x4]; + int _playerIndex; // Lua EntityPlayer:IsSubPlayer 00753ac0 returns it >>31 (index < 0); ctor 00753da0 inits -1; ConsumableCountChanged 007597e0 only when >= 0; EntityList/GetNearestTargetPlayer order players by it with -1 skipped int _glowingHourglassIndex; // ? ctor 00753da0 inits -1; UseActiveItem 005b39d0 / UseCard index GlowingHourglassState (+0x19d80 + it*0x5dc) with it when >= 0 - uint8_t _pad_0x1624[0x4]; + int _moveDirection; // Lua EntityPlayer:GetMovementDirection 004e4860 returns this+0x1624; update_body_animations 00779b40 sets -1/1/3... int _headDirection; int _fireDirection; Vector _aimDirection; @@ -2361,20 +3041,47 @@ struct Entity_Player { // : Entity (flattened) uint8_t _pad_0x1820[0x4]; bool _postLevelInitFinished; // InitPostLevelInitStats 007bc740 sets it to 1 at the end; PlayerManager::replace_player 009bee80 calls InitPostLevelInitStats when it is 0; level_start 007a4ba0 returns early when 0 bool _canShoot; - uint8_t _pad_0x1826[0x5e]; + uint8_t _pad_0x1826[0x2]; + ColorMod _footprintColor1; // SetFootprintColor 007b98c0 (ZHL exact) writes the KColor into its offset[0..2] (0x1854 for the other foot); ctor inits tint 1.0; update_footprints 007b8cb0 draws with it + ColorMod _footprintColor2; // SetFootprintColor 007b98c0 (ZHL exact) writes the KColor here when FUN_007b9940(0); update_footprints 007b8cb0 reads tint[3] and draws with it + uint8_t _pad_0x1880[0x4]; int _itemHoldCooldown; // Lua EntityPlayer.ItemHoldCooldown via binder 00884240: getter 008becf0 FUN_0085bfd0 signed dword, setter checkinteger dword - uint8_t _pad_0x1888[0x8]; + int _ponyCharge; // UseActiveItem 005b39d0 case 181 White Pony (Pony shares) sets 60; HandleCollision 0078e1f0 damages while >0; update_effects 00794e50 counts it down to 0 + int _planCKillCountdown; // UseActiveItem 005b39d0 Plan C case sets 300; update_effects 00794e50 counts it down; Store/RestoreGameState slot 0xf 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 uint8_t _pad_0x1892[0x2]; int _headColor; int _bodyColor; uint8_t _pad_0x189c[0x4]; 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 - uint8_t _pad_0x18a4[0x1c]; + int _epiphoraCharge; // EvaluateItems 00763570: with HasCollectible(368 Epiphora) tears *= it/180+1; update_shooting 0077b020 ++ up to 180 while firing one direction, 0 otherwise + uint8_t _pad_0x18a8[0x8]; + uint32_t _deadEyeCharges; // Lua EntityPlayer:AddDeadEyeCharge 007c78b0 ++ while <8 and sets cache 1; ClearDeadEyeCharge 007c78e0 (ZHL exact) zeroes it; EvaluateItems damage *= it*0.125+1 + uint32_t _deadEyeMisses; // ClearDeadEyeCharge 007c78e0 (ZHL exact) ++ and picks the 20/33/50% clear chance by 1/2/more; AddDeadEyeCharge 007c78b0 zeroes it + uint8_t _pad_0x18b8[0x4]; + uint32_t _mawOfTheVoidChargeTimer; // update_shooting 0077b020 fires the Maw of the Void ring once > 150 and zeroes it; FUN_0075ea40 shows it as a charge bar (it*100/150) 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 - uint8_t _pad_0x18e0[0x30]; + uint8_t _pad_0x18e0[0x8]; + uint32_t _imExcitedSpeedupCountdown; // UsePill 007c4180 I'm Excited!!! case (Broken Watch state 2) sets (rand(2)+2)*900; update_effects 00794e50 counts it down; Store/RestoreGameState slot 0x10 + uint8_t _pad_0x18ec[0x8]; + int _megaBlastDuration; // UseActiveItem 005b39d0 Mega Blast case sets 450 (*1.5 with 356 Car Battery); update_effects 00794e50 counts it down while firing the laser 0x1458 and removes the costume at <1 + int _peeBurstCooldown; // update_shooting 0077b020 counts it down against _maxPeeBurstCooldown 0x18fc; EvaluateItems tears *= it*5/max+1; update_effects blocks the Kidney Stone when >0 or urethra blocked 0x1908 + int _maxPeeBurstCooldown; // update_shooting 0077b020 sets 180 and compares _peeBurstCooldown against it-5; EvaluateItems 00763570 divides by it+1 + int _bladderCharge; // update_shooting 0077b020 bursts and zeroes it once >= _maxBladderCharge 0x1904; Update 00782af0 shows it/max; update_effects zeroes it + int _maxBladderCharge; // update_effects 00794e50 sets (rand+1)*30; update_shooting 0077b020 / Update 00782af0 compare _bladderCharge 0x1900 against it + bool _isUrethraBlocked; // update_effects 00794e50 sets/clears it at _nextUrethraBlockFrame 0x190c (Kidney Stone); update_shooting 0077b020 releases the stone when set and clears it + uint8_t _pad_0x1909[0x3]; + int _nextUrethraBlockFrame; // update_shooting 0077b020 sets GetFrameCount-based frame + (rand+15)*30; update_effects 00794e50 blocks the urethra once GetFrameCount >= it EntityDesc _friendBallEnemy; - uint8_t _pad_0x1929[0x23]; + uint8_t _pad_0x1929[0x3]; + int _purityState; // FUN_007c7c60 picks the gfx/characters/costumes/PurityGlow costume by it (0..3); EvaluateItems 00763570 tests 0/1/3 per stat; TakeDamage/Update reroll it; Store/RestoreGameState slot 0xd2 + int _immaculateConceptionState; // AddImmaculateConceptionCounter 007c8050 adds the argument to it and spawns by it/threshold; Store/RestoreGameState slot 0xd3 + int _cambionConceptionState; // GetCambionPregnancyLevel 007c90b0 reads it; TakeDamage 007729d0 ++; Store/RestoreGameState slot 0xd4 + uint32_t _conceptionFamiliarFlags; // AddImmaculateConceptionCounter 007c8050 / TakeDamage 007729d0 set a bit per conception familiar granted; GetCollectibleNum 00770ca0 counts set bits; Store/RestoreGameState slot 0xd5 + float _d8DamageModifier; // UseActiveItem 005b39d0 D8 case rolls it and renormalises by (2-sum of 0x193c..0x1948)*0.25; EvaluateItems damage *= it; Store/RestoreGameState slot 0xd6 + float _d8SpeedModifier; // UseActiveItem 005b39d0 D8 case rolls it; EvaluateItems 00763570 movespeed *= it; Store/RestoreGameState slot 0xd7 + float _d8RangeModifier; // UseActiveItem 005b39d0 D8 case rolls it; EvaluateItems 00763570 range *= it; Store/RestoreGameState slot 0xd8 + float _d8FireDelayModifier; // UseActiveItem 005b39d0 D8 case rolls it; EvaluateItems 00763570 maxfiredelay = 30/(tears*it)-1; Store/RestoreGameState slot 0xd9 int _goldenHearts; uint8_t _pad_0x1950[0x194]; 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 @@ -2388,9 +3095,11 @@ struct Entity_Player { // : Entity (flattened) 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]; + uint8_t _pad_0x1b34[0x248]; + uint8_t _movingBoxContents[0xc]; // vector_EntitySaveState; TryDecreaseGlowingHourglassUses 007b9e10: with HasCollectible(523 Moving Box) walks begin 0x1d7c..end 0x1d80 in 0x78-byte save states for pickup 5.100.422; UseActiveItem Moving Box case restores pickups from it; StoreGameState saves (end-begin)/0x78 int _boneHearts; - uint8_t _pad_0x1d8c[0x8]; + int _boneHeartsMask; // Lua EntityPlayer:IsBoneHeart 007caaa0 tests bit (1<= 1; AddBoneHearts 007ca840 updates it + int _hallowedGroundCountdown; // GridEntity_Poop::Update / NpcAI::ENTITY_POOP refresh it for players in the white-poop aura; update_effects 00794e50 counts it down; EvaluateItems tears *2.5 while set; TakeDamage tests >0 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; @@ -2399,7 +3108,8 @@ struct Entity_Player { // : Entity (flattened) int _rottenHearts; int _effectiveSoulCharge; int _effectiveBloodCharge; - uint8_t _pad_0x1db0[0x24]; + uint8_t _pad_0x1db0[0x20]; + uint32_t _urnSouls; // AddUrnSouls 007d3480 adds amount to it; Weapon_UrnOfSouls::Fire requires >0; PlayerHUD::RenderActiveItem draws it; Store/RestoreGameState slot 0x114 int _numGigaBombs; 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 @@ -2459,7 +3169,8 @@ struct Entity_Player { // : Entity (flattened) 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]; + int _eveSumptoriumCharge; // update_shooting 0077b020: for Tainted Eve (type 26) ++ while charging, at >59 zeroes it and fires; FUN_0075ea40 shows it as a charge bar (it/60*100) + uint8_t _itemWispsList[0x8]; // std_map_int_int; HasCollectible 007706e0: when size 0x1f84 != 0, std::set find in the tree at 0x1f80 and node value (+0x14) >= 1 counts; RecomputeWispCollectibles 007d7740 rebuilds it from item wisps (3.237) keyed by subtype; ctor builds the head 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]; @@ -2519,50 +3230,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Player, _flags) == 0x168); +static_assert(offsetof(Entity_Player, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Player, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Player, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Player, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Player, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Player, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Player, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Player, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Player, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Player, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Player, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Player, _mass) == 0x37c); +static_assert(offsetof(Entity_Player, _health) == 0x380); static_assert(offsetof(Entity_Player, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Player, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Player, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Player, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Player, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Player, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Player, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Player, _minecart) == 0x3d4); static_assert(offsetof(Entity_Player, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Player, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Player, _initSeed) == 0x3ec); @@ -2586,6 +3338,7 @@ 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); @@ -2619,12 +3372,18 @@ static_assert(offsetof(Entity_Player, _damageCooldown) == 0x13bc); static_assert(offsetof(Entity_Player, _playerType) == 0x13c0); static_assert(offsetof(Entity_Player, _name) == 0x13c4); static_assert(offsetof(Entity_Player, _weapons) == 0x13dc); +static_assert(offsetof(Entity_Player, _markedTarget) == 0x140c); +static_assert(offsetof(Entity_Player, _heldEntity) == 0x1410); static_assert(offsetof(Entity_Player, _tractorBeam) == 0x1430); static_assert(offsetof(Entity_Player, _breathOfLifeEffect) == 0x1444); +static_assert(offsetof(Entity_Player, _megaBlastLaser) == 0x1458); +static_assert(offsetof(Entity_Player, _rUaWizardTimer) == 0x145c); 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); @@ -2632,6 +3391,10 @@ static_assert(offsetof(Entity_Player, _laserColor) == 0x14c4); 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, _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, _tearRangeModifier) == 0x152c); static_assert(offsetof(Entity_Player, _shotSpeedModifier) == 0x1530); static_assert(offsetof(Entity_Player, _luckModifier) == 0x1534); @@ -2650,11 +3413,19 @@ 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, _glowingHourglassIndex) == 0x1620); +static_assert(offsetof(Entity_Player, _moveDirection) == 0x1624); static_assert(offsetof(Entity_Player, _headDirection) == 0x1628); static_assert(offsetof(Entity_Player, _fireDirection) == 0x162c); static_assert(offsetof(Entity_Player, _aimDirection) == 0x1630); @@ -2690,13 +3461,37 @@ 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, _strengthMaxHearts) == 0x18a0); +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, _coopBabyBuffTimers) == 0x18c0); +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, _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); @@ -2707,7 +3502,10 @@ 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, _movingBoxContents) == 0x1d7c); 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); @@ -2716,6 +3514,7 @@ 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); @@ -2763,6 +3562,8 @@ static_assert(offsetof(Entity_Player, _bagOfCraftingOutput) == 0x1f4c); static_assert(offsetof(Entity_Player, _poopMana) == 0x1f54); static_assert(offsetof(Entity_Player, _poopSpellQueue) == 0x1f58); static_assert(offsetof(Entity_Player, _bagOfCraftingHoldFrames) == 0x1f78); +static_assert(offsetof(Entity_Player, _eveSumptoriumCharge) == 0x1f7c); +static_assert(offsetof(Entity_Player, _itemWispsList) == 0x1f80); static_assert(offsetof(Entity_Player, _forgottenBHeight) == 0x1f88); static_assert(offsetof(Entity_Player, _forgottenBHeightVelocity) == 0x1f8c); static_assert(offsetof(Entity_Player, _itemCards) == 0x1fa4); @@ -2816,66 +3617,98 @@ struct Entity_Projectile { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -2919,50 +3752,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Projectile, _flags) == 0x168); +static_assert(offsetof(Entity_Projectile, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Projectile, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Projectile, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Projectile, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Projectile, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Projectile, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Projectile, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Projectile, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Projectile, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Projectile, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Projectile, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Projectile, _mass) == 0x37c); +static_assert(offsetof(Entity_Projectile, _health) == 0x380); static_assert(offsetof(Entity_Projectile, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Projectile, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Projectile, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Projectile, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Projectile, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Projectile, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Projectile, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Projectile, _minecart) == 0x3d4); static_assert(offsetof(Entity_Projectile, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Projectile, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Projectile, _initSeed) == 0x3ec); @@ -3005,66 +3879,98 @@ struct Entity_Slot { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -3088,50 +3994,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Slot, _flags) == 0x168); +static_assert(offsetof(Entity_Slot, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Slot, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Slot, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Slot, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Slot, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Slot, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Slot, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Slot, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Slot, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Slot, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Slot, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Slot, _mass) == 0x37c); +static_assert(offsetof(Entity_Slot, _health) == 0x380); static_assert(offsetof(Entity_Slot, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Slot, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Slot, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Slot, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Slot, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Slot, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Slot, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Slot, _minecart) == 0x3d4); static_assert(offsetof(Entity_Slot, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Slot, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Slot, _initSeed) == 0x3ec); @@ -3158,66 +4105,98 @@ struct Entity_Tear { // : Entity (flattened) Vector _spriteScale; uint8_t _pad_0xec[0x5c]; bool _isFlipX; - uint8_t _pad_0x149[0x17]; + uint8_t _pad_0x149[0x13]; + float _shadowSize; // Entity::LoadEntityConfig 006a98b0 stores EntityConfig shadowSize here (0.015625 without config) 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]; + uint64_t _flags; // Lua Entity.GetEntityFlags 00417420 returns this+0x168 (Add/Clear/HasEntityFlags use 0x168/0x16c); AddFreeze 006ad3c0 ORs FLAG_FREEZE 0x20 into it + bool _valid; // EntityList::AddEntity 00418500 skips if set, else pushes the entity and sets +0x170=1; EntityList::Update 004186c0 clears it when an entity stops existing; EntityFactory::Create 006f0090 picks a pool slot whose +0x170 is 0; ctor 006a8290 zeroes it bool _visible; bool _exists; bool _dead; 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 + uint8_t _pad_0x176[0x1]; + bool _removedByFactory; // EntityFactory::Create 006f0090 on 'Entity pool array %s is full, overwriting' sets byte [slot+0x177]=1 (0x6f0332), calls Remove (vt+0x28) and ClearReferences (vt+0x44), then clears it; Entity_Laser::ClearReferences 0097e800 only frees child lasers when set; Init 006a93a0 zeroes 0x176/0x177 + uint8_t _collisionPoints[0xc]; // 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 _entityGridCollisionClass; // Lua Entity.GridCollisionClass 00440eb0 returns this+0x184; LoadEntityConfig 006a98b0 assigns 0/3/5/6 from config int _entityCollisionClass; 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]; + uint8_t _pad_0x18d[0x3]; + bool _collidesWithGrid; // Lua Entity.CollidesWithGrid 00665a80 returns byte this+0x190 (400) + uint8_t _pad_0x191[0x3]; 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]; + uint8_t _colorParams[0xc]; // vector_ColorParams; ctor 006a8290 zeroes the 3-pointer vector at 0x1ac/0x1b0/0x1b4; Entity::SetColor 006b2fa0 pushes ColorParams here when duration>=1; Entity::Update 006ae820 walks 0x3c-byte elements, decrements duration @+0x34, erases expired ones and re-applies the colour 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 - uint8_t _pad_0x210[0x30]; + int _fireDamageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_FIRE (flags&2) returns 0 while in_ECX[0x84]>0, else sets it to 10; Entity::Update 006ae820 decrements it; Init 006a93a0 zeroes it + int _damageCountdown; // Entity::TakeDamage 006ace60: with DAMAGE_COUNTDOWN (flags&0x40) returns 0 while in_ECX[0x85]>0; Entity::Update 006ae820 decrements it; Entity_Familiar::HandleCollision 006261f0 only deals contact damage when <1 and Entity_Familiar::TakeDamage 0062cdc0 sets it to 0x1e + int _freezeCountdown; // Entity::AddFreeze 006ad3c0 adds duration (cap 0x78) and sets FLAG_FREEZE 0x20; Entity::Update 006ae820 decrements and clears 0x20 at 0; AddMidasFreeze 006adf40 also sets it + int _poisonCountdown; // Entity::AddPoison 006ad500 adds duration and sets FLAG_POISON 0x40; Entity::Update 006ae820 decrements, clearing 0x40 and resetting 0x320 to 2.0 at 0 + int _slowingCountdown; // Entity::AddSlowing 006ad750 adds duration and sets FLAG_SLOW 0x80; Entity::Update 006ae820 decrements it + int _charmedCountdown; // Entity::AddCharmed 006ad870 adds duration and sets FLAG_CHARM 0x100 (zeroes it when making the entity permanently friendly) + int _confusionCountdown; // Entity::AddConfusion 006add70 adds duration and sets FLAG_CONFUSION 0x200 + int _midasFreezeCountdown; // Entity::AddMidasFreeze 006adf40 only when it is 0: sets it and _freezeCountdown to duration and ORs 0x420 (FREEZE|MIDAS_FREEZE) + int _fearCountdown; // Entity::AddFear 006ae0a0 (Lua Entity:AddFear) adds duration to it under the usual boss-cooldown gate; Entity::Update 006ae820 handles it with the fear flag + int _burnCountdown; // Entity::AddBurn 006ae280 adds duration at raw +0x234 and zeroes 0x2e4 on a fresh burn; Entity::Update 006ae820 decrements it, clearing FLAG_BURN 0x1000 and resetting 0x324 to 2.0 at 0 + int _bossStatusEffectCooldown; // every Entity::Add* status function (AddFreeze 006ad3c0, AddBurn 006ae280 raw +0x238...) refuses while >0 unless ignoreBossStatusCooldown, and sets it to 0xf0 for bosses + int _shrinkCountdown; // Entity::AddShrink 006b5c10 adds duration and sets FLAG_SHRINK 0x1000000; Entity::Update 006ae820 decrements it 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]; + int _poisonDamageTimer; // Entity::AddPoison 006ad500 zeroes it on a fresh poison; Entity::Update 006ae820 increments raw +0x2e0 while FLAG_POISON 0x40 and deals TakeDamage(+0x320) when it %20 == 1 + int _burnDamageTimer; // Entity::AddBurn 006ae280 zeroes raw +0x2e4 on a fresh burn; Entity::Update 006ae820 increments it while FLAG_BURN 0x1000 and deals TakeDamage(+0x324) when it %20 == 1 + int _bleedingCountdown; // Entity::AddBleeding 006ae420 adds duration under the boss-cooldown gate and sets the bleed flag; Entity::Update 006ae820 decrements it + uint8_t _pad_0x2ec[0x4]; + int _magnetizedCountdown; // Entity::Update 006ae820 decrements it and clears FLAG_MAGNETIZED (bit 51, hi 0x80000) at 0; Init 006a93a0 zeroes it + int _baitedCountdown; // Entity::AddBaited 006b7560 adds duration and sets FLAG_BAITED (bit 52, hi 0x100000); Entity::Update 006ae820 decrements and clears it + int _knockbackCountdown; // Entity::AddKnockback 006b7a80 stores duration (scaled down by mass>10) and sets the knockback flags (hi 0x8000/0x18000); Entity::Update 006ae820 decrements and clears hi 0x18000 + int _weaknessCountdown; // Entity::AddWeakness 006b77d0 adds to [ESI+0x2fc] and sets FLAG_WEAKNESS (bit 54, OR [ESI+0x16c],0x400000) + int _iceCountdown; // Entity::AddIce 006b79d0 adds duration at raw +0x300; Entity::Update 006ae820 decrements and clears FLAG_ICE (bit 50, hi 0x40000) + int _brimstoneMarkCountdown; // Entity::AddBrimstoneMark 006b78d0 adds duration at raw +0x304; Entity::Update 006ae820 decrements and clears FLAG_BRIMSTONE_MARKED (bit 56, hi 0x1000000) + Vector _knockbackDirection; // Entity::AddKnockback 006b7a80 stores the push direction here (scaled by 10/mass for heavy entities) 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]; + int _pauseTimer; // Entity_NPC::Update 006c4b30: while >0 latches _pos into 0x314/0x318, pins _pos there, damps velocity 0.6 and decrements it; Init 006a93a0 zeroes it 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; 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; - uint8_t _pad_0x33c[0x8]; + Vector _pos; // Lua Entity.Position 00417290 returns this+0x33c/0x340 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]; + Vector _posOffset; // Lua Entity.PositionOffset 00417310 returns this+0x34c int _renderZOffset; float _renderDepthOffset; // Lua Entity.DepthOffset 00435d10 returns this+0x358 (zhl _depthOffset at 0x2b0 does not match this exe) int _sortingLayer; - uint8_t _pad_0x360[0x8]; + Vector _velocity; // Lua Entity.Velocity 004172d0 returns this+0x360/0x364 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*) - uint8_t _pad_0x370[0x4]; + float _size; // Lua Entity.Size 00871f90 returns float this+0x370; Entity::SetSize 006ac2a0 writes it 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 _health; // Lua Entity.HitPoints 00417370 returns float this+0x380 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]; + float _collisionDamage; // Lua Entity.CollisionDamage 005b1570 returns float this+0x388; LoadEntityConfig 006a98b0 copies config collisionDamage 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 _speedMultiplier; // Entity::Update 006ae820 adds it to the 0x3a4 update clock each frame and scales sprite playback speed by it; Entity::AddVelocity 00431450 uses it; Init 006a93a0 sets 1.0 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 _pad_0x3a8[0x8]; + bool _isInvicible; // Lua Entity.IsInvincible 005b1580 returns byte this+0x3b0 + uint8_t _pad_0x3b1[0x3]; + float _shrinkStatus1; // Entity::AddShrink 006b5c10 calls SetSize(config size * it); Entity::Update 006ae820 lerps it toward _shrinkStatus2; Init 006a93a0 sets 1.0 + float _shrinkStatus2; // Entity::AddShrink 006b5c10 sets the shrink target 0.333 here; Entity::Update 006ae820 lerps _shrinkStatus1 toward it; Init 006a93a0 sets 1.0 uint8_t _parent[0x4]; // EntityPtr uint8_t _child[0x4]; // EntityPtr uint8_t _target[0x4]; // 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 _entityPtrReferrers[0x8]; // 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 _minecart[0x4]; // EntityPtr; Entity::GiveMinecart 006b7be0 spawns a 965.0 minecart and stores it in this EntityPtr (multiset ref); ctor 006a8290 nulls it 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; @@ -3231,10 +4210,16 @@ struct Entity_Tear { // : Entity (flattened) float _fallingSpeed; // Lua EntityTear.FallingSpeed getter 00456440 returns this+0x414 float _fallingAccel; // Lua EntityTear.FallingAcceleration getter 00435e50 returns this+0x418 float _homingFriction; - uint8_t _pad_0x420[0x18]; + float _fScale; // Lua EntityTear.Scale 00557cd0 returns this+0x420 + uint8_t _pad_0x424[0x4]; + BitSet128 _tearFlags; // Lua EntityTear.TearFlags 004177c0 returns the 4 dwords 0x428..0x434 int _waitFrames; Vector _continueVelocity; - uint8_t _pad_0x444[0x1c]; + uint8_t _hitList[0xc]; // std_vector_uint; Entity_Tear::HandleCollision 00673660 does LEA ECX,[ESI+0x444] then EntityList::HitListContains 00431640 (binary search of GetHitListIndex) and sorted insert 00431570; ctor 00665cf0 zeroes 0x444..0x44c, Init 006660a0 sets end=begin + int _tearIdx; // Lua EntityTear.TearIndex 004aade0 returns this+0x450 + uint8_t _pad_0x454[0x4]; + float _rotation; // Lua EntityTear.Rotation 0060ccc0 returns this+0x458 + int _scaleAnimNum; // Entity_Tear::ResetSpriteScale 00677780 recomputes the RegularTear%d/BloodTear%d anim number from scale and replays only when it differs from +0x45c; Entity_Tear::Init 006660a0 sets -1 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) @@ -3281,50 +4266,91 @@ 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, _shadowOffset) == 0x160); +static_assert(offsetof(Entity_Tear, _flags) == 0x168); +static_assert(offsetof(Entity_Tear, _valid) == 0x170); 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, _isKillOnTouch) == 0x174); static_assert(offsetof(Entity_Tear, _isInterpolating) == 0x175); +static_assert(offsetof(Entity_Tear, _removedByFactory) == 0x177); static_assert(offsetof(Entity_Tear, _collisionPoints) == 0x178); +static_assert(offsetof(Entity_Tear, _entityGridCollisionClass) == 0x184); static_assert(offsetof(Entity_Tear, _entityCollisionClass) == 0x188); static_assert(offsetof(Entity_Tear, _collidesWithEntity) == 0x18c); +static_assert(offsetof(Entity_Tear, _collidesWithGrid) == 0x190); 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, _colorParams) == 0x1ac); 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, _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, _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, _iceFrozenEffect) == 0x310); static_assert(offsetof(Entity_Tear, _pausePosition) == 0x314); +static_assert(offsetof(Entity_Tear, _pauseTimer) == 0x31c); 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, _preInterpolatePos) == 0x344); +static_assert(offsetof(Entity_Tear, _posOffset) == 0x34c); 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, _sizeMulti) == 0x374); static_assert(offsetof(Entity_Tear, _mass) == 0x37c); +static_assert(offsetof(Entity_Tear, _health) == 0x380); static_assert(offsetof(Entity_Tear, _maxHitPoints) == 0x384); +static_assert(offsetof(Entity_Tear, _collisionDamage) == 0x388); static_assert(offsetof(Entity_Tear, _prevPosition) == 0x38c); static_assert(offsetof(Entity_Tear, _prevVelocity) == 0x394); +static_assert(offsetof(Entity_Tear, _speedMultiplier) == 0x39c); static_assert(offsetof(Entity_Tear, _prevUpdateTime) == 0x3a0); static_assert(offsetof(Entity_Tear, _updateTime) == 0x3a4); +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, _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, _entityPtrReferrers) == 0x3cc); +static_assert(offsetof(Entity_Tear, _minecart) == 0x3d4); static_assert(offsetof(Entity_Tear, _hitEffect) == 0x3d8); static_assert(offsetof(Entity_Tear, _dropRNG) == 0x3dc); static_assert(offsetof(Entity_Tear, _initSeed) == 0x3ec); @@ -3336,8 +4362,14 @@ 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, _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, _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); @@ -3537,7 +4569,7 @@ struct RoomDescriptor { int32_t GridIndex; int32_t SafeGridIndex; int32_t ListIndex; - uint8_t _pad_0xc[0x4]; + int32_t Dimension; // ctor zeroes +0xc between ListIndex and Data; Room::update_door_transitions (007f01c0) / Entity_NPC::HandleCollision read the target desc+0xc as the dimension with its GridIndex; RoomTransition::ChangeRoom compares two descs' +0xc uint32_t Data; // RoomConfig_Room* uint32_t OverrideData; // RoomConfig_Room* int32_t AllowedDoors; @@ -3545,16 +4577,20 @@ struct RoomDescriptor { int32_t DisplayFlags; int32_t VisitedCount; int32_t Flags; - uint8_t _pad_0x48[0x2]; + int16_t TotalMoneySpent; // FUN_007d8630 (player coin spend, Keeper's Sack) adds the amount to short (Room->_descriptor)+0x48 and unlocks achievement 0x246 once it exceeds 0x27; ctor zeroes it int16_t ClearCount; - uint8_t _pad_0x4c[0x4]; + int32_t GreedSubType; // Level::generate_greed (0073e0a0) stores the chosen greed room subtype (4 or 0xb) in current desc+0x4c when 0, else reuses it as the RoomConfig::GetRandomRoom subtype; ctor zeroes it int16_t PoopCount; - uint8_t _pad_0x52[0x2]; + int16_t TKeeperCoinSpawns; // Entity_Pickup::Update (006bbdc0) for player type 0x21 (Tainted Keeper): if the room was visited before, stops at short desc+0x52 > 9, else rolls 1/(n+1) and increments it per enemy coin spawn int32_t PitsCount; int32_t DecorationSeed; int32_t SpawnSeed; int32_t AwardSeed; - uint8_t _pad_0x64[0x48]; + uint32_t BossDeathSeed; // Room::TriggerBossDeath (007fec00, log "TriggerBossDeath: %d bosses remaining.") loads (Room->_descriptor)+0x64 at 007fed23 as the RNG seed for the last-boss-death reward (Game+0x265f4 overrides); ctor zeroes it + uint8_t SavedGridEntities[0xc]; // vector_GridEntityDesc; RoomDescriptor::constructor (006ef590) sizes the vector at +0x68/+0x6c/+0x70 to 0x1c0 (grid cells) x 0x20 GridEntityDesc, each with seed 0x16a9de81 at +0x10/+0x1c + uint8_t SavedEntities[0xc]; // vector_EntitySaveState; Room::RestoreState (007eff50) respawns each 0x78-byte EntitySaveState in desc+0x74..+0x78 via Game::SpawnEx + Entity_Pickup::RestoreState, then clears it + uint8_t RestrictedGridIndexes[0x8]; // std_set_int; ctor allocates a 0x14-byte std::set head at +0x80 (size +0x84); grid-bound enemies (NpcAI POKY/SPIKEBALL/STONEHEAD/CONSTANT_STONE_SHOOTER/BOMB_GRIMACE/GUTS) std::set::insert their _spawnGridIndex into current desc+0x80 on death; Room::Init find_node's it + uint8_t SavedEffects[0x24]; // vector_EntitySaveState; Game::spawn_bomb_crater (00703190) appends the crater effect's 0x78-byte save state to (Room->_descriptor)+0x88..+0x90, capped at 0x80 entries int16_t ShopItemIdx; int16_t ShopItemDiscountIdx; int32_t DeliriumDistance; @@ -3563,18 +4599,27 @@ struct RoomDescriptor { 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); @@ -3591,6 +4636,22 @@ static_assert(offsetof(KColor, _green) == 0x4); static_assert(offsetof(KColor, _blue) == 0x8); static_assert(offsetof(KColor, _alpha) == 0xc); +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 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 @@ -3630,9 +4691,14 @@ struct Game { 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[0xbc4]; + uint8_t _pad_0x1aee4[0x8c]; + uint8_t _bossPool[0x8cc]; // BossPool; Game ctor (006f1020) builds 0x25 x 0x3c BossPool_Pool at Game+0x1af70 (~Game destroys them); Level::place_special_rooms / generate_boss_room / TryInitializeExtraBossRoom call BossPool::GetBossId with ECX=Game+0x1af70 + uint8_t _roomTransition[0x23c]; // RoomTransition; BossOverlay::update / FUN_00429570 call RoomTransition::Update with ECX=Game+0x1b83c; ctor builds the versus-screen ANM2 at +0x38 (0x1b874); Game::IsPaused / many AIs test its mode dword != 0 + uint8_t _stageTransition[0x30]; // StageTransition; StageTransition::Update (0092f1c0) runs with this=Game+0x1ba78; Game::Update/Render/IsPaused and Entity_Player shooting/pocket-use test the state dword != 0 (PlayerManager::Update next to _roomTransition) PlayerManager _playerManager; - uint8_t _pad_0x1bb64[0x4d0]; + uint8_t _pad_0x1bb64[0x20]; + Seeds _seedEffects; // Lua Game:GetSeeds (0042a340) returns this+0x1bb84; ctor calls Seeds::constructor there; Seeds::AchievementUnlocksDisallowed called with ECX=Game+0x1bb84 + uint8_t _pad_0x1bbe0[0x454]; 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 @@ -3655,21 +4721,30 @@ struct Game { 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]; + bool _triggerWindowResize; // window-size handler FUN_00954150 (width/height scale recompute) sets byte Game+0x26534=1; Game::Render (006fbc10) at entry calls FUN_007084c0 (render-surface rebuild) when set and clears it; ctor zeroes it + uint8_t _pad_0x26535[0x3]; 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]; + uint8_t _pad_0x26541[0x3]; + uint32_t _debugFlags; // console debug toggles: FUN_00685f10 sets bit n in Game+0x26544; Entity::PostRender bit 0 (entity positions), bit 5 hitspheres (Entity_Laser/Knife/Brimstone), bit 0xd render_debug_lua_memory (debug 14) + uint64_t _gameStateFlags; // Game::GetStateFlag (004217a0) tests bit in qword this+0x26548+(n>>6)*8; Level::place_special_rooms / GridEntity_Door::SetLocked / Entity_Slot::TakeDamage set bits there + uint8_t _pad_0x26550[0x4]; int _lastDevilRoomStage; - uint8_t _pad_0x26558[0x8]; + int _treasureRoomsVisited; // Lua Game:GetTreasureRoomVisitCount (007383a0) returns this+0x26558, Lua AddTreasureRoomsVisited (007e9370) increments it; Room::Init (007f2800) increments it on entering a treasure room + int _planetariumsVisited; // Room::Init (007f2800) increments Game+0x2655c on first visit of room type 0x18 (planetarium); Game::GetPlanetariumChance (0074dbd0) tests it == 0; ResetState zeroes it; store_game_state saves it int _stagesWithoutHeartsPicked; int _stagesWithoutDamage; int _devilRoomDeals; int _donationModGreed; int _donationModAngel; - uint8_t _pad_0x26574[0x10]; + uint8_t _pad_0x26574[0x8]; + int _shopVisits; // moved from 0x26574: Room::Init (007f2800 at 007f36f4) increments Game+0x2657c when room type == 2 (shop) and unlocks achievement 0x17b (School Bag) once >= 6 outside greed difficulties (matches REPENTOGON Lua AddShopVisits logic); 0x26574 is a slot coin countdown (reset to 10, decremented on CoinInsert) + uint32_t _entityFactory; // EntityFactory* // Game ctor stores EntityFactory::constructor result at Game+0x26580; Game::SpawnEx (006fe410) and ~20 spawners call EntityFactory::Create(*(Game+0x26580),...); ~Game frees it uint32_t _challenge; - uint8_t _pad_0x26588[0x4]; + bool _isRerun; // FUN_006f72f0 (start a game from saved start params, copies their Seeds) sets byte Game+0x26588=1, LoadConfigXmls clears it, store/restore_game_state save it; Game::StartDebug / Entity::AddCharmed require it == 0 next to Seeds::AchievementUnlocksDisallowed before achievement unlocks + bool _isDebug; // Game::StartDebug (006f7750) sets byte Game+0x26589=1; Entity::AddCharmed tests _dailyChallenge._id==0 && it==0 before unlocks + uint8_t _pad_0x2658a[0x2]; 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 @@ -3680,9 +4755,11 @@ struct Game { 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 + uint8_t _ambush[0x68]; // Ambush + uint8_t _dailyChallenge[0xb4]; // DailyChallenge; Game::StartDailyChallenge(DailyChallenge*) (006f6dd0) copies _id/_seed/_isPractice/_specialDailyId into Game+0x26630/34/38/3c; Game::IsChallengeOrDaily (006dae20) tests +0x26630 != 0 + uint8_t _scoreSheet[0x90]; // ScoreSheet; Minimap::render_score_time (0098ef30, at 0098f62a) calls ScoreSheet::Calculate (009e5d90) with ECX=Game+0x266e4; Game::StartStageTransition passes Game+0x266e4 to FUN_009e5a30 int _victoryLap; - uint8_t _pad_0x26778[0x248]; + uint8_t _genericPrompt[0x248]; // GenericPrompt; Game::LoadConfigXmls / ReloadStagesXmlOnLuaReset call GenericPrompt::Initialize(Game+0x26778); Game::Render calls GenericPrompt::Render and Room::SpawnClearAward GenericPrompt::Show on it int _lastLevelWithoutHalfHp; uint8_t _pad_0x269c4[0x4]; uint32_t _difficulty; @@ -3743,7 +4820,11 @@ 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); @@ -3765,16 +4846,25 @@ 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, _triggerWindowResize) == 0x26534); static_assert(offsetof(Game, _hallucinationTimer) == 0x26538); static_assert(offsetof(Game, _hallucinationDuration) == 0x2653c); static_assert(offsetof(Game, _isRoomSnapshotTaken) == 0x26540); +static_assert(offsetof(Game, _debugFlags) == 0x26544); +static_assert(offsetof(Game, _gameStateFlags) == 0x26548); 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) == 0x2657c); +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); @@ -3782,7 +4872,10 @@ 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); @@ -3834,7 +4927,7 @@ struct GridEntity { int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3842,6 +4935,7 @@ 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); @@ -3852,7 +4946,7 @@ struct GridEntity_Decoration { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3860,6 +4954,7 @@ 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); @@ -3870,7 +4965,7 @@ struct GridEntity_Door { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; uint8_t _sprite[0x94]; // ANM2 @@ -3884,7 +4979,8 @@ 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[0x6]; + uint8_t _pad_0x392[0x2]; + int _targetRoomIdx; // Lua GridEntityDoor.TargetRoomIndex field+0x394; Room::update_door_transitions (007f01c0) and Entity_NPC::HandleCollision read door+0x394 and, when < -99, resolve it with Level::GetRoomByIdx for the target room's Dimension/GridIndex uint32_t _previousState; uint32_t _previousVariant; uint8_t _pad_0x3a0[0x4]; @@ -3896,6 +4992,7 @@ 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); @@ -3907,6 +5004,7 @@ 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); @@ -3920,7 +5018,7 @@ struct GridEntity_Fire { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3928,6 +5026,7 @@ 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); @@ -3938,7 +5037,7 @@ struct GridEntity_Gravity { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3946,6 +5045,7 @@ 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); @@ -3956,7 +5056,7 @@ struct GridEntity_Lock { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3964,6 +5064,7 @@ 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); @@ -3974,7 +5075,7 @@ struct GridEntity_Pit { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -3983,6 +5084,7 @@ 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); @@ -3994,7 +5096,7 @@ struct GridEntity_Poop { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4005,6 +5107,7 @@ 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); @@ -4018,7 +5121,7 @@ struct GridEntity_PressurePlate { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4029,6 +5132,7 @@ 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); @@ -4042,7 +5146,7 @@ struct GridEntity_Rock { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4053,6 +5157,7 @@ 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); @@ -4066,7 +5171,7 @@ struct GridEntity_Spikes { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4075,6 +5180,7 @@ 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); @@ -4086,7 +5192,7 @@ struct GridEntity_Stairs { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4094,6 +5200,7 @@ 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); @@ -4104,7 +5211,7 @@ struct GridEntity_Statue { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4112,6 +5219,7 @@ 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); @@ -4122,7 +5230,7 @@ struct GridEntity_TNT { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4131,6 +5239,7 @@ 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); @@ -4142,7 +5251,7 @@ struct GridEntity_Teleporter { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4150,6 +5259,7 @@ 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); @@ -4160,7 +5270,7 @@ struct GridEntity_TrapDoor { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4168,6 +5278,7 @@ 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); @@ -4178,7 +5289,7 @@ struct GridEntity_Wall { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4186,6 +5297,7 @@ 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); @@ -4196,7 +5308,7 @@ struct GridEntity_Web { // : GridEntity (flattened) int _varData; uint8_t _pad_0x1c[0x8]; uint32_t _gridIndex; - uint8_t _pad_0x28[0x4]; + uint32_t _spawnFrame; // GridEntity::Init (00709db0) sets this+0x28 = Game _frameCount (Game+0x264f8); GridEntity_TrapDoor::Update compares it with the room's entry frame uint8_t _rng[0x10]; // RNG int _collisionClass; ANM2 _sprite; @@ -4204,6 +5316,7 @@ 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); @@ -4217,7 +5330,8 @@ static_assert(offsetof(ItemConfig, _collectibleNameMap) == 0x3c); struct ItemConfig_Card { int id; int achievementId; - uint8_t name[0x30]; // std_string + uint8_t name[0x18]; // std_string + uint8_t desc[0x18]; // std_string; Lua Card.Description field+0x20 uint8_t hudAnim[0x18]; // std_string bool greedModeAllowed; uint8_t _pad_0x51[0x3]; @@ -4232,6 +5346,7 @@ 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); @@ -4265,7 +5380,8 @@ static_assert(offsetof(ItemConfig_Costume, overwriteColor) == 0x28); struct ItemConfig_Item { int type; int id; - uint8_t name[0x30]; // std_string + uint8_t name[0x18]; // std_string + uint8_t desc[0x18]; // std_string; Lua Item.Description field+0x20 uint8_t gfxFilename[0x18]; // std_string int achievementId; int cacheFlags; @@ -4298,6 +5414,7 @@ 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); @@ -4328,12 +5445,13 @@ static_assert(offsetof(ItemConfig_Item, _initCharge) == 0xc8); struct ItemConfig_Pill { int id; int achievementId; - uint8_t name[0x30]; // std_string + uint8_t name[0x18]; // std_string + uint8_t desc[0x18]; // std_string; ItemConfig::load_pocketitems_xml (0072cff0) parses the "description" attribute into a local std::string (72d42d, [ebp-0x58]) and std::string::assign's it to pill entry +0x20 (name at +0x8, Lua GreedModeAllowed at +0x38) bool greedModeAllowed; uint8_t _pad_0x39[0x3]; uint32_t announcerVoice; uint32_t announcerVoiceSuper; - uint8_t _pad_0x44[0x4]; + uint32_t announcerVoiceDelay; // Lua PillEffect.AnnouncerDelay field+0x44 uint32_t mimicCharge; uint8_t effectClass; uint8_t effectSubClass; @@ -4341,9 +5459,11 @@ 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); @@ -4558,22 +5678,6 @@ 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 @@ -4977,20 +6081,6 @@ 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 @@ -5005,15 +6095,20 @@ struct Room { int _tintedRockIdx; int _dungeonRockIdx; 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]; + uint8_t _pad_0xe6c[0x380]; + int _roomClearDelay; // Room::KeepDoorsClosed (0085e0f0) sets this+0x11ec=10; Room::Update (00802980) resets it to 10 (20 in some boss rooms) while enemies/greed wave remain and otherwise counts it down; NPC AIs test it (< 9) as the room-clear countdown + uint8_t _pad_0x11f0[0x8]; + uint32_t _Camera; // Camera* // AIs call Camera::IsPosVisible / Camera::SetFocusPosition with *(Room+0x11f8) (NpcAI::ENTITY_ADVERSARY, ENTITY_DOGMA, ENTITY_SISTERS_VIS); FUN_00428a70 returns it Vector _renderSurfaceTopLeft; Vector _renderScrollOffset; bool _redHeartDamage; 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]; + uint8_t _pad_0x1214[0x4]; + uint8_t _entityList[0xa4]; // EntityList; Lua Room:GetEntities (00428a50) returns this+0x1258 = EntityList+0x40 (_updateEL); ~157 callers run EntityList::QuerySublist on Room+0x1218 int _renderMode; - uint8_t _pad_0x12c0[0x8f0]; + uint8_t _pad_0x12c0[0x358]; + uint8_t _fxLayers[0x598]; // FXLayers; Room::LoadBackdropGraphics calls FXLayers::LoadConfig (00990a40) and Room::Render calls FXLayers::Render (009948f0) / render_veins with ECX=Room+0x1618 uint32_t _bossId; int _secondBossID; uint8_t _pad_0x1bb8[0x10]; @@ -5076,11 +6171,15 @@ static_assert(offsetof(Room, _doorGridPositions) == 0x744); static_assert(offsetof(Room, _tintedRockIdx) == 0x764); static_assert(offsetof(Room, _dungeonRockIdx) == 0x768); static_assert(offsetof(Room, _gridPaths) == 0x76c); +static_assert(offsetof(Room, _roomClearDelay) == 0x11ec); +static_assert(offsetof(Room, _Camera) == 0x11f8); static_assert(offsetof(Room, _renderSurfaceTopLeft) == 0x11fc); static_assert(offsetof(Room, _renderScrollOffset) == 0x1204); static_assert(offsetof(Room, _redHeartDamage) == 0x120c); static_assert(offsetof(Room, _brokenWatchState) == 0x1210); +static_assert(offsetof(Room, _entityList) == 0x1218); 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); @@ -5145,7 +6244,8 @@ struct TearParams { int _tearVariant; int _bombVariant; ColorMod _tearColor; - uint8_t _pad_0x34[0x14]; + uint8_t _pad_0x34[0x4]; + BitSet128 _flags; // Lua TearParams.TearFlags field+0x38; TearParams::constructor (005cd690) zeroes the 4 dwords 0x38..0x44 float _tearDamage; float _tearScale; float _tearHeight; @@ -5153,6 +6253,7 @@ struct TearParams { static_assert(offsetof(TearParams, _tearVariant) == 0x0); static_assert(offsetof(TearParams, _bombVariant) == 0x4); static_assert(offsetof(TearParams, _tearColor) == 0x8); +static_assert(offsetof(TearParams, _flags) == 0x38); static_assert(offsetof(TearParams, _tearDamage) == 0x48); static_assert(offsetof(TearParams, _tearScale) == 0x4c); static_assert(offsetof(TearParams, _tearHeight) == 0x50);