Curation round 10: combat, pathfinding, death and game over, items and stats, room state, Continue, Lua callbacks

Seven agents took over tear and contact collision, NPC death with blood and gibs, champions, PathFinder, the Gaper's
kin, the player's death with the game over screen, item pedestals with collectible pickup, AddCollectible and
EvaluateItems, room state save and restore, GameState::read, pressure plates, fireplaces, entity lights, ambient
sounds, and one Lua callback enum with gated runners. Integration reconstructed Room::Update's loot preview and
Entity_NPC::UpdatePickupGhosts and replaced a leftover Sacred Orb stub that stopped every pedestal roll.
Under gdb: Gapers die with blood and gibs, a cleared room opens its doors, the treasure room's item is taken (banner,
costume, stats: a Magic Mushroom gives damage 3.5 -> 6.12 and a heart), death leads to the game over diary, and a saved
run is read back on the next boot with Continue offered. 3028 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 09:55:14 -05:00
1 parent 48933cd312
commit d8385e6c64
64 files changed
+8665 -3059

No files matched your search

+3 -18
View File
@@ -116,9 +116,6 @@ constexpr float STREAK_DAMAGE = 1;
constexpr uint64_t DAMAGE_INVINCIBLE = 1ull << 13;
constexpr int STREAK_DAMAGE_COUNTDOWN = 30;
constexpr int LUA_CALLBACK_POST_TEAR_INIT = 39;
constexpr int LUA_CALLBACK_POST_TEAR_UPDATE = 40;
constexpr int LUA_CALLBACK_POST_TEAR_RENDER = 41;
constexpr uint32_t GRAPHICS_PREMULTIPLIED_ALPHA = 4;
constexpr const char* GFUEL_NAIL_ANM2 = "gfx/promo/gfuel/bullet tear.anm2";
constexpr const char* GFUEL_NAIL_BLOOD_ANM2 = "gfx/promo/gfuel/missile.anm2";
@@ -331,7 +328,7 @@ void Entity_Tear::Init(int entityType, int entityVariant, int entitySubType, uin
sprite.Load(variant == TEAR_NAIL ? GFUEL_NAIL_ANM2 : GFUEL_NAIL_BLOOD_ANM2, GRAPHICS_LOAD);
layer_additive_set(sprite, variant == TEAR_NAIL ? 0 : 1);
}
lua_callback_check(LUA_CALLBACK_POST_TEAR_INIT, "LuaEngine::PostTearInit 008629c0");
lua_engine_get().PostTearInit(this);
}
// 006670f0 Flies the tear for a frame, or splashes and removes it once it has died. While held it bobs at its
@@ -370,7 +367,7 @@ void Entity_Tear::Update()
flight_update();
if (is_crawlspace() && !room.IsPositionInRoom(pos, CRAWLSPACE_ROOM_MARGIN)) Remove();
if (room.HasSlowDown()) SetColor(SLOWDOWN_COLOR, SLOWDOWN_COLOR_FRAMES, COLOR_PRIORITY_TOP, false, true);
lua_callback_check(LUA_CALLBACK_POST_TEAR_UPDATE, "LuaEngine::PostTearUpdate 00862aa0");
lua_engine_get().PostTearUpdate(this);
}
// Counts down a held tear, pinning it bobbing at its parent and updating it there. Whether it is still held.
@@ -624,7 +621,7 @@ void Entity_Tear::Render(const Vector& offset)
Entity::Render(offset);
if (tearEffectANM2.isLoaded && !isEffectBehind) tearEffectANM2.Render(draw);
if (deadEyeIntensity != 0) deadEyeANM2.Render(draw);
lua_callback_check(LUA_CALLBACK_POST_TEAR_RENDER, "LuaEngine::PostTearRender 00862b80");
lua_engine_get().PostTearRender(this, offset);
}
// 00675fa0 Sets the damage it deals, and the damage it started with.
@@ -664,18 +661,6 @@ void Entity_Tear::ClearReferences()
for (Entity* link = child; link && link->type == ENTITY_TEAR; link = link->child) link->Remove();
}
// 00673660 Lets a mod's MC_PRE_TEAR_COLLISION decide first, then ignores low collisions, a dead tear and its own
// player. Whether the collision is ignored.
bool Entity_Tear::HandleCollision(Entity* collider, bool isLow)
{
LuaResult result = static_cast<LuaEngine*>(g_luaEngine)->PreTearCollision(this, collider, isLow);
if (result != LUA_RESULT_NIL) return result == LUA_RESULT_TRUE;
if (!isLow || isDead) return false;
if (GetPlayerAncestor() == collider) return true;
if (collider->type == ENTITY_PLAYER && IsDescendantOf(collider)) return true;
reconstruction_missing("Entity_Tear::HandleCollision 00673660: the hit on what it collides with");
}
// 00665b00 The player at the end of its spawner chain, or none when that is not a player.
Entity_Player* Entity_Tear::GetRootPlayer()
{