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

+1 -55
View File
@@ -114,7 +114,7 @@ static int card_roll(uint32_t seed, int runeChance, bool isPlaying)
{
int card = ItemPool::GetCardEx((int)seed, CARD_SPECIAL_CHANCE, runeChance, runeChance, true);
RNG rng = rng_make(seed, ITEM_RNG_SHIFT);
return lua_callback_run_get_card(&rng, card, isPlaying, isPlaying, false);
return lua_engine_get().GetCard({.rng = &rng, .card = card, .isPlaying = isPlaying, .isRunes = isPlaying});
}
// Room methods the room's takeover has not declared yet.
@@ -1269,27 +1269,6 @@ void Entity_Player::RemoveCostume(ItemConfig_Item* item)
UpdateCostumes();
}
// 0075bf00 Lays the worn costumes over the player's layers by priority and recolors them for its skin. Only the case
// with no costumes and an unchanged skin color is reconstructed: the costume layout stops the game until reached.
void Entity_Player::UpdateCostumes()
{
static bool isUpdating = false;
if (variant == PLAYER_VARIANT_COOP_BABY || isUpdating) return;
if (!costumeSpriteDescs.empty())
reconstruction_missing("Entity_Player::UpdateCostumes 0075bf00 (laying out costumes)");
isUpdating = true;
EntityConfig_Player* playerConfig = g_manager->entityConfig.GetPlayer(playerType);
if (!playerConfig) log_printf(LOG_ASSERT, "Could not load config for player type %d\n", playerType);
costume_map_reset(-1);
int skinColor = playerConfig ? playerConfig->skinColor : -1;
if (headColor != skinColor || bodyColor != skinColor)
reconstruction_missing("Entity_Player::UpdateCostumes 0075bf00 (recoloring the skin)");
if (isCoopGhost) reset_body_sprite();
isUpdating = false;
}
// 007bebb0 Dresses the player in its character's skin: the challenge's or the config's spritesheet on every layer and
// the matching ghost layer, then the character's costume, the blindfold of characters that cannot shoot, the seeds'
// and dailies' costumes and the Hot Potato bomb. Co-op ghosts only get the ghost body. The name follows the character.
@@ -1410,39 +1389,6 @@ bool Entity_Player::is_dead_bird_kept()
return boneHearts + soulHearts + red <= (playerType == PLAYER_EVE ? 2 : 1);
}
// 00763570 Recomputes the stats the cache flags ask for from the character, its items, effects, trinkets, seeds and
// challenge, then lets mods change them. Only the skeleton is reconstructed: a player whose stats nothing changes keeps
// the base stats Init gave it. Any item, effect or character bonus stops the game until reached, as does the weapon a
// changed weapon type needs (Isaac::CreateWeapon is not taken over).
void Entity_Player::EvaluateItems()
{
if (!is_evaluation_plain())
reconstruction_missing("Entity_Player::EvaluateItems 00763570 (items, effects or bonuses)");
for (uint32_t flag = CACHE_DAMAGE; flag <= CACHE_PICKUP_VISION; flag <<= 1)
if (cacheFlags & flag) static_cast<LuaEngine*>(g_luaEngine)->EvaluateItems(this, (int)flag);
cacheFlags = 0;
}
// Whether nothing would change a player's base stats: Isaac with no items, effects, pills, Eden rolls, modifiers or
// D8 rolls, outside challenges, dailies and seeds.
bool Entity_Player::is_evaluation_plain()
{
Game& game = *g_game;
bool isOwningNothing = std::ranges::all_of(collectibleCounts, [](int count) { return count == 0; }) &&
std::ranges::all_of(activeItems, [](ActiveItemDesc& active) { return active.item == 0; }) &&
trinkets == std::array<uint32_t, TRINKET_SLOT_COUNT>{} && temporaryEffects.effects.empty() &&
std::ranges::all_of(pillEffectUses, [](int uses) { return uses == 0; });
bool isUnmodified = speedModifier == 0 && fireDelayModifier == 0 && damageModifier == 0 && tearRangeModifier == 0 &&
shotSpeedModifier == 0 && luckModifier == 0 && donateLuck == 0 && d8DamageModifier == 1 &&
d8FireDelayModifier == 1 && d8RangeModifier == 1 && d8SpeedModifier == 1 && edenDamage == 0 &&
edenSpeed == 0 && edenFireDelay == 0 && edenTearRange == 0 && edenShotSpeed == 0 &&
edenLuck == 0;
return playerType == PLAYER_ISAAC && variant == PLAYER_VARIANT_PLAYER && isOwningNothing && isUnmodified &&
!isCoopGhost && !hasCurseMistEffect && game.challenge == 0 && game.dailyChallenge._id == 0 &&
game.seedEffects.CountSeedEffects() == 0 && !game.deathmatchManager.is_active();
}
// 00757a40 Drops the entity links, then lets go of the weapons and the effects the player spawned.
void Entity_Player::ClearReferences()
{