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
+2
-56
@@ -82,18 +82,7 @@ constexpr int HIT_FLASH_DIVISOR = 3;
|
||||
constexpr int HIT_FLASH_MIN = 1;
|
||||
constexpr int HIT_FLASH_MAX = 6;
|
||||
constexpr int SOUND_FIREDEATH_HISS = 43;
|
||||
constexpr int COLLECTIBLE_BLACK_POWDER = 420;
|
||||
constexpr float POSITION_LIMIT = 10000;
|
||||
// The extra fire Black Powder makes a fireplace burst with.
|
||||
constexpr int FIREPLACE_NORMAL = 0;
|
||||
constexpr int FIREPLACE_RED = 1;
|
||||
constexpr int FIREPLACE_MOVEABLE = 10;
|
||||
// The Lua callback a removal runs (MC_POST_ENTITY_REMOVE).
|
||||
constexpr int LUA_CALLBACK_POST_ENTITY_REMOVE = 67;
|
||||
// The online stats a kill counts toward (kills, boss kills, and kills as a co-op ghost).
|
||||
constexpr uint32_t STAT_KILLS = 17;
|
||||
constexpr uint32_t STAT_BOSS_KILLS = 20;
|
||||
constexpr uint32_t STAT_GHOST_BOSS_KILLS = 21;
|
||||
// The debug flags PostRender draws for: entity positions, collision shapes and grid collision points.
|
||||
constexpr uint32_t DEBUG_ENTITY_POSITIONS = 1 << 0;
|
||||
constexpr uint32_t DEBUG_HITSPHERES = 1 << 5;
|
||||
@@ -1164,35 +1153,6 @@ bool Entity::IsValidTarget(Entity* other)
|
||||
return type != ENTITY_RING_OF_FLIES || other->type != ENTITY_RING_OF_FLIES;
|
||||
}
|
||||
|
||||
// 006ac920 Kills it once: counts the kill for the player behind the source, bursts it, and runs the Lua callback.
|
||||
void Entity::Kill(const EntityRef& source)
|
||||
{
|
||||
if (isDead) return;
|
||||
isDead = true;
|
||||
|
||||
Entity* killer = source.entity ? source.entity->GetPlayerAncestor() : nullptr;
|
||||
bool isScored = type > ENTITY_PROJECTILE && type != ENTITY_EFFECT;
|
||||
if (killer && type == ENTITY_FIREPLACE)
|
||||
{
|
||||
bool isPowderable = variant == FIREPLACE_NORMAL || variant == FIREPLACE_RED || variant == FIREPLACE_MOVEABLE;
|
||||
if (static_cast<Entity_Player*>(killer)->HasCollectible(COLLECTIBLE_BLACK_POWDER) &&
|
||||
isPowderable)
|
||||
reconstruction_missing("Entity::Kill 006ac920: Black Powder's fireplace blast (BombExplosionEffects)");
|
||||
}
|
||||
else if (killer && isScored)
|
||||
{
|
||||
Entity_Player* player = static_cast<Entity_Player*>(killer);
|
||||
Player_stats_add(&g_game->onlinePlayerStats, STAT_KILLS, player, 1);
|
||||
if (IsBoss())
|
||||
{
|
||||
Player_stats_add(&g_game->onlinePlayerStats, STAT_BOSS_KILLS, player, 1);
|
||||
if (player->isCoopGhost) Player_stats_add(&g_game->onlinePlayerStats, STAT_GHOST_BOSS_KILLS, player, 1);
|
||||
}
|
||||
}
|
||||
if (!IsBoss() && type != ENTITY_FAMILIAR) BloodExplode();
|
||||
static_cast<LuaEngine*>(g_luaEngine)->PostEntityKill(this);
|
||||
}
|
||||
|
||||
// 006acb00 Takes it out of the game: it stops existing and counts as dead, and Lua forgets it.
|
||||
void Entity::Remove()
|
||||
{
|
||||
@@ -1226,11 +1186,9 @@ void Entity::ClearReferences()
|
||||
}
|
||||
|
||||
// 00866060 Runs MC_POST_ENTITY_REMOVE for it, which also lets Lua forget it.
|
||||
void Entity::ReleaseLuaRef(Entity*)
|
||||
void Entity::ReleaseLuaRef(Entity* entity)
|
||||
{
|
||||
LuaEngine& lua = *static_cast<LuaEngine*>(g_luaEngine);
|
||||
if (lua.enabledCallbacks[LUA_CALLBACK_POST_ENTITY_REMOVE])
|
||||
reconstruction_missing("Entity::ReleaseLuaRef 00866060: MC_POST_ENTITY_REMOVE");
|
||||
lua_engine_get().PostEntityRemove(entity);
|
||||
}
|
||||
|
||||
// 006b6af0 Where its sprite's null layer sits from its position, scaled, flipped and turned with the sprite, or zero
|
||||
@@ -1284,12 +1242,6 @@ void Entity::convert_shot_for_enemy_owner(Entity*)
|
||||
reconstruction_missing("Entity::convert_shot_for_enemy_owner 0064bb70");
|
||||
}
|
||||
|
||||
// 006ace60
|
||||
bool Entity::TakeDamage(float, uint64_t, const EntityRef&, int)
|
||||
{
|
||||
reconstruction_missing("Entity::TakeDamage 006ace60");
|
||||
}
|
||||
|
||||
// 006ad350
|
||||
int Entity::apply_second_hand_duration(int, const EntityRef&)
|
||||
{
|
||||
@@ -1356,12 +1308,6 @@ void Entity::RemoveStatusEffects()
|
||||
reconstruction_missing("Entity::RemoveStatusEffects 006ae630");
|
||||
}
|
||||
|
||||
// 006b45c0
|
||||
void Entity::BloodExplode()
|
||||
{
|
||||
reconstruction_missing("Entity::BloodExplode 006b45c0");
|
||||
}
|
||||
|
||||
// 006b5c10
|
||||
void Entity::AddShrink(const EntityRef&, int, bool)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user