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:
1 parent
48933cd312
commit
d8385e6c64
64 files changed
+8665
-3059
No files matched your search
+7
-6
@@ -132,7 +132,6 @@ constexpr int PILLEFFECT_FULL_HEALTH = 5;
|
||||
constexpr int PILLEFFECT_HEALTH_DOWN = 6;
|
||||
constexpr int PILLEFFECT_HEALTH_UP = 7;
|
||||
constexpr int PILLEFFECT_I_FOUND_PILLS = 8;
|
||||
constexpr int PILL_GET_COLOR_CALLBACK = 9;
|
||||
// The effect class each shuffled color slot must have, or -1 for any.
|
||||
constexpr int PILL_SLOT_CLASSES[PILL_COLOR_SLOTS - 1] = {3, 3, 3, 3, 2, 1, 0, -1, -1, 3, 2, 1, -1, -1};
|
||||
// PHD's good side of a bad pill (0x00b6a240), and False PHD's bad side of a good one (its jump table at 0x00734c40).
|
||||
@@ -539,7 +538,8 @@ int ItemPool::GetCollectible(ItemPoolType poolType, uint32_t drawSeed, uint32_t
|
||||
g_game->room->temporaryEffects.HasCollectibleEffect(COLLECTIBLE_CHAOS);
|
||||
int pool = isChaos ? get_chaos_pool(poolRng) : poolType;
|
||||
lastPool = pool;
|
||||
if (int item = (int)FUN_00865dc0(poolType, isDecrease, drawSeed)) return item;
|
||||
LuaCollectibleDraw luaDraw = {.poolType = poolType, .seed = drawSeed, .isDecrease = isDecrease};
|
||||
if (int item = lua_engine_get().PreGetCollectible(luaDraw)) return item;
|
||||
|
||||
RNG dailyRng = rng_make(drawSeed, DAILY_SHIFT);
|
||||
if (daily == DAILY_APPLE_BOSSES && poolType == POOL_BOSS) return COLLECTIBLE_APPLE;
|
||||
@@ -604,7 +604,8 @@ int ItemPool::GetCollectible(ItemPoolType poolType, uint32_t drawSeed, uint32_t
|
||||
result = COLLECTIBLE_HOST_HAT;
|
||||
}
|
||||
|
||||
int overridden = (int)FUN_00865f10(result, poolType, isDecrease, drawSeed);
|
||||
luaDraw.collectible = result;
|
||||
int overridden = lua_engine_get().PostGetCollectible(luaDraw);
|
||||
return overridden ? overridden : result;
|
||||
}
|
||||
|
||||
@@ -843,7 +844,7 @@ uint32_t ItemPool::GetTrinket(TrinketDraw draw)
|
||||
if (draw == TRINKET_DRAW_TAKE) numAvailableTrinkets--;
|
||||
trinket = trinketPoolItems[*found].id;
|
||||
}
|
||||
if (uint32_t overridden = FUN_008658c0(trinket, &trinketPoolRNG._seed)) return overridden;
|
||||
if (uint32_t overridden = lua_engine_get().GetTrinket((int)trinket, trinketPoolRNG)) return overridden;
|
||||
if (!g_manager->persistentGameData.Unlocked(ACHIEVEMENT_GOLDEN_TRINKETS)) return trinket;
|
||||
|
||||
bool isGolden = rng_make(rng._seed, GOLDEN_SHIFT).Next() % GOLDEN_TRINKET_ODDS == 0 ||
|
||||
@@ -896,7 +897,7 @@ int ItemPool::GetPill(uint32_t drawSeed)
|
||||
if (rng.Next() % PILL_HORSE_ODDS == 0 && g_manager->persistentGameData.Unlocked(ACHIEVEMENT_HORSE_PILLS))
|
||||
color |= PILL_HORSE;
|
||||
|
||||
int overridden = (int)FUN_00865c80(PILL_GET_COLOR_CALLBACK, drawSeed);
|
||||
int overridden = lua_engine_get().GetPillColor(drawSeed);
|
||||
return overridden ? overridden : color;
|
||||
}
|
||||
|
||||
@@ -936,7 +937,7 @@ int ItemPool::GetPillEffect(uint32_t pillColor, Entity_Player* player)
|
||||
effect = isFalsePhd ? PILLEFFECT_I_FOUND_PILLS : PILLEFFECT_HEALTH_UP;
|
||||
}
|
||||
|
||||
int overridden = static_cast<LuaEngine*>(g_luaEngine)->GetPillEffect(effect, color);
|
||||
int overridden = lua_engine_get().GetPillEffect(effect, color);
|
||||
return overridden != -1 ? overridden : effect;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user