Curation round 16: Mom's Knife and the bone club, sin minibosses and death rewards, slots and beggars, NPC rendering and twelve bosses, alt path visuals, the Forgotten's flight and tainted HUDs, Sheol and the Cathedral to the credits, familiars and transformations

This commit is contained in:
shweet committed 2026-11-20 22:44:36 -05:00
1 parent 76c594f9a0
commit e9de039d0f
151 files changed
+14996 -5208

No files matched your search

+1 -122
View File
@@ -32,7 +32,6 @@ constexpr int CHARGE_BAR_FRAMES = 100;
constexpr int ENTITY_FEAR_IMMUNE = 205;
constexpr int ENTITY_NO_DECOY_TYPE = 213;
constexpr int ENTITY_MOMS_HEART_PLAYER_PICK = 53;
constexpr int ENTITY_DEATH_REWARD_EXEMPT = 885;
constexpr int ENTITY_UNREACHABLE_EXEMPT = 886;
constexpr int ENTITY_FLICKER_TYPE = 252;
constexpr int ENTITY_DEATH_SPARK_TYPE = 882;
@@ -56,7 +55,6 @@ constexpr int DEATH_NO_BURST_FIRST = 74;
constexpr int DEATH_NO_BURST_LAST = 76;
constexpr int MULLIGAN_VARIANT_FLEEING = 2;
constexpr int CHALLENGE_KILL_CHARGE = 33;
constexpr int COLLECTIBLE_LIL_PORTAL_ID = 661;
constexpr std::string_view BIG_HORN_SPIT_EVENT = "Item";
constexpr std::string_view DIRT_LAYER = "dirt";
constexpr std::string_view HOLE_LAYER = "Hole";
@@ -97,10 +95,8 @@ constexpr float SHIELD_SECOND = 30;
constexpr float SHIELD_BASE = 0.09f;
constexpr float SHIELD_FALLOFF = 0.18f;
constexpr uint32_t BLACK_HEART_CHANCE = 5;
constexpr float EXORCIST_ROOM_MARGIN = -10;
constexpr int SOUND_POOP_DEATH = 237;
constexpr float POOP_DEATH_VOLUME = 0.9f;
constexpr uint32_t DEBUG_HEALTH_VALUES = 1 << 6;
constexpr uint64_t FLAG_FRIENDLY_BALL_DYING = 1ull << 60;
// The burst effects a dead NPC leaves besides blood (Lua's EffectVariant).
@@ -120,16 +116,11 @@ constexpr int SHADOW_CHARGER_SUBTYPE = 1;
constexpr int TYPE_NO_TICK_A = 274;
constexpr int TYPE_NO_TICK_B = 275;
constexpr int ENTITY_KEY_TEAR_A = 43;
constexpr int ENTITY_KEY_TEAR_B = 44;
// The items and seeds whose effects the NPC update reads, by Lua id.
constexpr int COLLECTIBLE_HOURGLASS_ID = 66;
constexpr int COLLECTIBLE_GAMEKID_ID = 93;
constexpr int COLLECTIBLE_CHAMPION_BELT_ID = 208;
constexpr int COLLECTIBLE_GIMPY_ID = 225;
constexpr int COLLECTIBLE_STOP_WATCH_ID = 232;
constexpr int COLLECTIBLE_INFESTATION_2_ID = 234;
constexpr int COLLECTIBLE_SOUL_ID = 335;
constexpr int COLLECTIBLE_TOXIC_SHOCK_ID = 350;
constexpr int COLLECTIBLE_BETRAYAL_ID = 391;
@@ -138,11 +129,7 @@ constexpr int COLLECTIBLE_MAW_OF_THE_VOID_ID = 408;
constexpr int COLLECTIBLE_JAR_OF_FLIES_ID = 434;
constexpr int COLLECTIBLE_CONTAGION_ID = 466;
constexpr int COLLECTIBLE_BROKEN_MODEM_ID = 514;
constexpr int COLLECTIBLE_SANGUINE_BOND_ID = 640;
constexpr int COLLECTIBLE_VASCULITIS_ID = 657;
constexpr int COLLECTIBLE_GUPPYS_EYE_ID = 665;
constexpr int COLLECTIBLE_BONE_SPURS_ID = 683;
constexpr int COLLECTIBLE_LIL_ABADDON_ID = 684;
constexpr int COLLECTIBLE_SALVATION_ID = 696;
constexpr int COLLECTIBLE_VANISHING_TWIN_ID = 697;
constexpr int TRINKET_PURPLE_HEART_ID = 5;
@@ -150,7 +137,6 @@ constexpr int TRINKET_TICK_ID = 53;
constexpr int TRINKET_SUPER_MAGNET_ID = 68;
constexpr int TRINKET_LIGHTER_ID = 135;
constexpr int TRINKET_ICE_CUBE_ID = 188;
constexpr int TRINKET_DEVILS_CROWN_ID = 185;
constexpr int NULLITEM_DAMOCLES_WEAKNESS = 64;
constexpr int CHALLENGE_BEANS = 30;
@@ -434,7 +420,7 @@ bool game_is_hard_mode()
}
// 00703470 Remembers a boss as met this run, but for the ones the boss list leaves out.
static void game_encountered_boss_add(int bossType, int bossVariant)
void game_encountered_boss_add(int bossType, int bossVariant)
{
std::vector<BossId>& bosses = g_game->encounteredBosses;
auto isSame = [&](const BossId& boss) {
@@ -2451,61 +2437,6 @@ void Entity_NPC::fire_projectile_from_params(Entity_Projectile* projectile)
projectile->apply_spawn_flags({this, flags, scale, isChampion ? championColorIdx : -1});
}
// The NPC types with their own interpolation or drawing, which the generic steps below do not cover.
constexpr std::array<int, 6> INTERPOLATE_SPECIAL_TYPES = {62, 815, 830, 831, 881, 915};
constexpr std::array<int, 21> RENDER_SPECIAL_TYPES = {273, 411, 807, 810, 815, 816, 835, 865, 881, 886, 893,
906, 909, 910, 912, 920, 921, 950, 951, 964, 965};
// 006d2b50 Moves it the interpolation's half step (Entity::Interpolate), runs its AI's interpolation call, and moves
// the effect it aims with.
void Entity_NPC::Interpolate()
{
if (pauseTimer != 0) return;
if (type == ENTITY_MINECART) minecart_interpolate(*this);
else Entity::Interpolate();
if (aiCallFlags & AI_CALL_INTERPOLATE) ai_call(AI_PHASE_INTERPOLATE);
UpdateChildEffectPosition(true);
bool isHeld = HasEntityFlags(FLAG_FREEZE | FLAG_HELD) || holdCountdown > 0;
bool isStill = isHeld || state == NPC_STATE_APPEAR || state == NPC_STATE_DEATH || state == NPC_STATE_UNIQUE_DEATH;
if (!isStill && std::ranges::find(INTERPOLATE_SPECIAL_TYPES, type) != INTERPOLATE_SPECIAL_TYPES.end())
reconstruction_missing("Entity_NPC::Interpolate 006d2b50: a jumping enemy's height");
if (type == ENTITY_HEART && variant == 1 && entityRef && entityRef->IsEnemy())
{
Entity* partner = entityRef;
targetPosition = vector_sub(partner->pos, pos);
partner->targetPosition = vector_scale(targetPosition, -1);
}
}
// 006d2e50 Draws it (Entity::Render) and, in the normal and above water passes, the status effect it suffers on its
// OverlayEffect null.
void Entity_NPC::Render(const Vector& offset)
{
if (type == ENTITY_MINECART && variant == 0 && child) return;
bool isLinked = (type == ENTITY_LARRYJR && variant == 3 && child) || (type == ENTITY_POOP && entityRef);
if (minecart || isLinked || std::ranges::find(RENDER_SPECIAL_TYPES, type) != RENDER_SPECIAL_TYPES.end())
reconstruction_missing("Entity_NPC::Render 006d2e50: a special enemy's drawing");
if (spawnerEntity && spawnerEntity->type == ENTITY_PLAYER && g_manager->netplayManager.is_online())
reconstruction_missing("Entity_NPC::Render 006d2e50: a remote player's faded enemy");
if (championColorIdx == CHAMPION_SIZE_PULSE)
reconstruction_missing("Entity_NPC::Render 006d2e50: the size pulsing champion");
Entity::Render(offset);
if (!isVisible)
renderPosition = vector_add(render_position_get(vector_add(pos, posOffset), RENDER_SNAPPED), offset);
lua_engine_get().PostNPCRender(this, offset);
RenderMode renderMode = g_game->room->entityList.renderMode;
if (renderMode != RENDER_NORMAL && renderMode != RENDER_WATER_ABOVE) return;
status_overlay_render(offset);
if (g_game->playerManager.FirstCollectibleOwner(COLLECTIBLE_SPIDER_MOD_ID, LAZARUS_SHARE_CHECK) && isVisible &&
IsActiveEnemy(DEAD_EXCLUDED))
reconstruction_missing("Entity_NPC::Render 006d2e50: Spider Mod's health bar");
if (HasEntityFlags(FLAG_PERSISTENT | FLAG_FRIENDLY_BALL_DYING) && (g_game->debugFlags & DEBUG_HEALTH_VALUES))
reconstruction_missing("Entity_NPC::Render 006d2e50: the debug health text");
}
// Part of 006d2e50: the status effect sprite drawn on the OverlayEffect null, once on a shared body.
void Entity_NPC::status_overlay_render(const Vector& offset)
{
@@ -2645,52 +2576,6 @@ void Entity_NPC::trigger_kill_item_effects()
lua_engine_get().PostNPCDeath(this);
}
// 006bbdc0 The rewards a dead enemy gives its killers: the damage flags' and Gimpy's drops, the familiars' and
// items' on-kill effects, Keeper's and the bosses' coins, the soul hearts of Sanguine Bond and the like. None of them
// happens without its item or flag, which is all this covers yet.
void Entity_NPC::trigger_death_rewards()
{
bool isRewarded = Entity::is_enemy_type(type) && type != ENTITY_FIREPLACE && type != ENTITY_SHOPKEEPER &&
type != ENTITY_MOVABLE_TNT && !(type == ENTITY_DEATH_REWARD_EXEMPT && variant == 10) &&
type != ENTITY_FROZEN_ENEMY && type != ENTITY_MINECART && type != ENTITY_POOP;
if (!isRewarded) return;
if (DoesEntityShareStatus() && parent && type != ENTITY_LARRYJR && type != ENTITY_BUTTLICKER) return;
PlayerManager& players = g_game->playerManager;
auto isFamiliarKill = [](const DamageEvent& event) {
return event.source.type == ENTITY_FAMILIAR || event.source.type == ENTITY_BLOOD_PUPPY ||
(event.source.type == ENTITY_TEAR &&
(event.source.variant == ENTITY_KEY_TEAR_A || event.source.variant == ENTITY_KEY_TEAR_B));
};
bool isRewardItem = players.FirstCollectibleOwner(COLLECTIBLE_GIMPY_ID, LAZARUS_SHARE_CHECK) ||
(killDamageFlags & ((uint64_t)DAMAGE_SPAWN_RED_HEART | DAMAGE_SPAWN_COIN |
DAMAGE_SPAWN_BLACK_HEART | DAMAGE_SPAWN_CARD | DAMAGE_SPAWN_RUNE)) ||
std::ranges::any_of(killDamageEvents, isFamiliarKill) ||
players.RandomCollectibleOwner(COLLECTIBLE_INFESTATION_2_ID, initSeed, nullptr) ||
players.RandomCollectibleOwner(COLLECTIBLE_BONE_SPURS_ID, initSeed, nullptr) ||
players.RandomCollectibleOwner(COLLECTIBLE_LIL_ABADDON_ID, initSeed, nullptr) ||
players.RandomTrinketOwner(TRINKET_DEVILS_CROWN_ID, initSeed, nullptr) ||
players.FirstCollectibleOwner(COLLECTIBLE_VASCULITIS_ID, LAZARUS_SHARE_CHECK);
if (!HasEntityFlags(FLAG_NO_REWARD) && isRewardItem)
reconstruction_missing("Entity_NPC::trigger_death_rewards 006bbdc0: the kill's item and flag rewards");
if (!CanShutDoors()) return;
if (g_game->room->isExorcistActive && g_game->room->IsPositionInRoom(pos, EXORCIST_ROOM_MARGIN))
reconstruction_missing("Entity_NPC::trigger_death_rewards 006bbdc0: the Exorcist's souls");
if (g_game->room->IsPositionInRoom(pos, EXORCIST_ROOM_MARGIN))
for (Entity_Player* player : players.playerList)
if (player->variant == 0 && player->HasCollectible(COLLECTIBLE_LIL_PORTAL_ID))
reconstruction_missing("Entity_NPC::trigger_death_rewards 006bbdc0: Lil Portal's growth");
for (Entity_Player* player : players.playerList)
{
bool isLiving = player->variant == 0 && !player->isCoopGhost;
if (isLiving && player->playerType == PLAYER_MAGDALENE_B)
reconstruction_missing("Entity_NPC::trigger_death_rewards 006bbdc0: Tainted Magdalene's hearts");
if (player->variant == 0 && player->HasCollectible(COLLECTIBLE_SANGUINE_BOND_ID))
reconstruction_missing("Entity_NPC::trigger_death_rewards 006bbdc0: the soul drops");
}
}
// 00447770 Its parent, which only NPCs are.
Entity_NPC* Entity_NPC::ParentNPC()
{
@@ -2816,12 +2701,6 @@ Entity_NPC* Entity_NPC::ThrowStrider(const Vector&, Entity*, const Vector&)
reconstruction_missing("Entity_NPC::ThrowStrider 0055cef0");
}
// 00565680
void Entity_NPC::render_v1_layer_frames()
{
reconstruction_missing("Entity_NPC::render_v1_layer_frames 00565680");
}
// 0059bed0
void Entity_NPC::RenderSegmentLink(const Vector&, bool)
{