Curation round 7: Game::Start, level generation, Room, Camera, the Entity hierarchy, Entity_Player, the run frame

Six agents took over Game::Start, Level::SetNextStage, BossPool, save_game_state, level generation to the first room
(place_special_rooms, RoomDescriptor, load_room), Room, Camera, Entity/EntityList/EntityRef with a curated skeleton of
every Entity_* subclass, Entity_Player, Game::Render, Manager::Update's run branch, RoomTransition, ItemInfoHUD and
StatHUD. Integration wrote FirstTrinketOwner and room_shape_get_door_grid_index (checked against the decompile for
every shape and slot) and folded the duplicated constants. A run now generates its floor, loads the start room and
draws the HUD (under gdb); Isaac renders correctly when drawn, the room itself waits for Room::Render.
2479 functions taken over.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
shweetandClaude Opus 5.5 committed 2026-11-20 05:33:11 -05:00
1 parent addd027977
commit b85591bdf4
146 files changed
+20124 -200863

No files matched your search

+180
View File
@@ -0,0 +1,180 @@
#pragma once
#include "entity.h"
#include "anm2.h"
#include <deque>
#include <vector>
// Construction and destruction (006b88e0, 006b8590) are the defaults, but for the pathfinder's owner the constructor
// sets. PathFinder::Init's reset waits for PathFinder's takeover.
// Field accessors (004567a0, 006a8230, 006b8480, 007e92b0) are the public fields.
// An enemy or other non-player character (Lua's EntityNPC): its AI state and counters, pathfinder, champion and boss
// colors, shields, Delirium's forms, and the player controlling it with Siren or a friendly ball.
struct Entity_NPC : Entity
{
ANM2 chargeBarSprite;
ANM2 statusEffectSprite;
NPCAI_Pathfinder pathfinder{};
std::deque<EntityPtr> entityDeque;
std::deque<Vector> vectorDeque1;
std::deque<Vector> vectorDeque2;
std::vector<DamageEvent> killDamageEvents;
std::vector<uint32_t> hitList;
std::vector<uint32_t> secondaryHitList;
ColorMod dirtColor = COLOR_DEFAULT;
ColorMod floorColor = COLOR_DEFAULT;
EntityPtr entityRef;
EntityPtr forcedTarget;
Entity* collisionEntity = nullptr;
Entity* deliriumEntity = nullptr;
Entity_Effect* pickupGhostsEntity = nullptr;
Entity_Player* sirenPlayerEntity = nullptr;
void* aimTargetEffect = nullptr;
uint64_t killDamageFlags = 0;
Vector confusionTargetPos{};
Vector controllerMovement{};
Vector forwardVector{};
Vector v1{};
Vector v2{};
float aiFloat = 0;
float championSpeed = 0;
float flickerAlpha = 0;
float hitPointsMulti = 0;
float killDamage = 0;
float scale = 0;
float scaleMulti = 0;
float shieldStrength = 0;
float totalDamageTaken = 0;
int aiCallPhase = 0;
int aiCounter = 0;
int appearFrames = 0;
int bosscoloridx = 0;
int championColorIdx = 0;
int championTimer = 0;
int collisionResult = 0;
int controllerID = 0;
int decoyTargetTimer = 0;
int flickerState = 0;
int flickerTimer = 0;
int forcedTargetTimer = 0;
int groupIdx = 0;
int i1 = 0;
int i2 = 0;
int lastGridIndex = 0;
int projectileCooldown = 0;
int projectileDelay = 0;
int savedState = 0;
int shieldFrames = 0;
int state = 0;
int stateFrame = 0;
uint32_t aiCallFlags = 0;
uint32_t deliriumAttackID = 0;
uint32_t deliriumBossType = 0;
uint32_t deliriumBossVariant = 0;
uint32_t deliriumCycleID = 0;
uint32_t deliriumCycleIDHigh = 0;
short championRegenCount = 0;
uint16_t championRegenTimer = 0;
uint16_t deliriumTransformationTimer = 0;
uint8_t deliriumAttackAngle = 0;
uint8_t deliriumRemainingAttacks = 0;
uint8_t deliriumState = 0;
bool isBestiaryEncountered = false;
bool isBoss = false;
bool isCanShutDoors = false;
bool isChampion = false;
bool isCollisionIsLow = false;
bool isUnreachableOnce = false;
Entity_NPC() { pathfinder._entity = this; }
void Init(int type, int variant, int subType, uint32_t initSeed) override;
void PreUpdate() override;
void Update() override;
void Interpolate() override;
void Render(const Vector& offset) override;
bool RenderShadowLayer(const Vector& offset) override;
bool TakeDamage(float damage, uint64_t damageFlags, const EntityRef& source, int damageCountdown) override;
void Kill(const EntityRef& source) override;
void Remove() override;
void ClearReferences() override;
bool CanShutDoors() override;
bool IsBoss() override;
bool TryThrow(const EntityRef& source, const Vector& direction, float force) override;
Vector GetForwardVector() override;
bool HandleCollision(Entity* collider, bool isLow) override;
void ResetColor() override;
void LoadEntityConfig() override;
Entity_NPC* ParentNPC();
Entity_NPC* ChildNPC();
void Hornfel_UpdateAI();
void Hornfel_UpdateFrame();
void update_physics();
void apply_velocity(char);
void update_move_direction_anim();
void SetMinecartPosVel(const Vector& pos, const Vector& vel);
void MinecartUpdateChild(Entity* child);
void UpdateCordChain(bool isHalfScale);
void render_overlay(const Vector& offset, bool isShadow);
static int FindTargetPit(const Vector& pos1, const Vector& pos2, uint32_t pitIndex);
static Entity_NPC* ThrowStrider(const Vector& pos, Entity* spawner, const Vector& targetPos);
void render_v1_layer_frames();
void RenderSegmentLink(const Vector& offset, bool isShadow);
void CreateBling();
void CreateGoldParticles(uint32_t count);
void set_entity_ptr_f54(Entity* entity);
void ResetPathFinderTarget();
void hold_set(int countdown, const Vector& position);
Entity_Effect* MakeSplat(float size);
Entity_Effect* MakeBloodCloud(const Vector& pos, const ColorMod& color);
bool TryForceTarget(Entity* target, int duration);
float compute_speed_multiplier();
void load_graphics(uint8_t);
void KillUnique();
Entity* GetPlayerTarget();
Vector CalcTargetPosition(float distanceLimit);
void UpdateDirtColor(uint8_t immediate);
static uint8_t Redirect(int* entityType, int* variant);
void Morph(int entityType, int variant, int subType, int championid);
void* shopkeeper_get_loot(void* outLoot, bool isShouldAdvance);
static Entity_NPC* ThrowSpider(const Vector& position, Entity* spawner, Vector targetPos, bool isBig,
float yOffset);
void update_frozen();
void fire_projectile_from_params(Entity_Projectile* projectile);
void SetBossColorIdx(int bossColorIdx, int unused);
void MakeChampion(uint32_t seed, int championColor, bool isInit);
void SetRef_bec(Entity* entity);
static void* QueryNPCsType(void* outList, int type, int variant);
static EntityList* QueryNPCsGroup(EntityList* outList, int groupIdx);
void* fireplace_get_loot(void* outLoot, bool isShouldAdvance);
bool CanBeDamagedFromVelocity(Vector velocity);
bool CanReroll();
void PlayDeathEffects();
void trigger_kill_item_effects();
void SetScale(float newScale);
void PlaySound(int id, float volume, int framedelay, uint8_t loop, float pitch);
int GetAliveEnemyCount();
uint32_t on_player_damaged();
void room_enter();
void spawn_damage_numbers();
void update_damage_history();
void update_blood_guide_gibs(float* nullFrame);
void ClearDequeRefs();
bool IsControllerActionPressed(int action);
bool IsControllerActionTriggered(int buttonAction);
Vector GetControllerInput(float deadzone);
Vector GetControllerMovementInput(float deadzone);
void TransferControl(Entity_NPC* target);
void SpawnControlTarget(int inputMode, float rotation);
void ClearChild();
Vector GetAimTargetPosition();
bool is_controller_input_idle();
void UpdateChargeBar(float start, float end, float value, bool isHideWhenFull);
void UpdateControllerMovement(bool isForceUpdate);
void UpdateChildEffectPosition(bool isPredictMovement);
uint8_t split(float damage, const EntityRef& source, bool isPlaySound);
void UpdatePickupGhosts();
void SetAimAngle(float angle);
static void render_debug(float*, int);
};