Curation round 27 (code only): Weapon_Bone::Fire and the fetus tear (no offline gaps left), TakeDamage's interleaved hit order, 74 SetAnimation reset flags corrected, and a parity audit of every boss, every enemy, the rest of the player and tears, effects and familiars; one normalize_angle_degrees, IsTargetInAttackRange defaults (59 duplicates)

This commit is contained in:
shweet committed 2026-11-23 12:08:14 -05:00
1 parent cc77c923e8
commit e66baf4063
215 files changed
+2046 -1093

No files matched your search

+14 -29
View File
@@ -437,8 +437,8 @@ bool Entity_Player::TryRemoveTrinket(uint32_t trinketId)
// direction from a poof of blood with a squish.
void Entity_Player::spawn_lil_clot_familiars()
{
if (!HasTrinket(TRINKET_LIL_CLOT)) return;
int multiplier = GetTrinketMultiplier(TRINKET_LIL_CLOT);
if (multiplier == 0) return;
int clots = (int)std::ranges::count_if(g_game->room->entityList.updateEL, [this](Entity* entity)
{
@@ -785,15 +785,6 @@ void dice_bag_room_enter(Entity_Player& player)
sound_play(SOUND_SHELLGAME);
}
// A pickup a collectible's first pickup drops on a free spot near the player.
static void gain_pickup_drop(Entity_Player& player, const EntitySpawn& spawn)
{
EntitySpawn drop = spawn;
drop.position = room_free_pickup_position_find({.position = player.pos, .step = GAIN_PICKUP_STEP});
drop.type = ENTITY_PICKUP;
g_game->Spawn(drop);
}
// Divorce Papers' first pickup: a bone heart, and Mysterious Paper from the trinket pool once it is unlocked (or in a
// daily or debug run).
static void divorce_papers_gain(Entity_Player& player, RNG& rng)
@@ -805,16 +796,16 @@ static void divorce_papers_gain(Entity_Player& player, RNG& rng)
(g_manager->state == MANAGER_STATE_GAME && (game.dailyChallenge.id != 0 || game.isDebug));
if (!isAllowed || !game.itemPool.RemoveTrinket(TRINKET_MYSTERIOUS_PAPER)) return;
Vector position = room_free_pickup_position_find({.position = player.pos, .step = GAIN_PICKUP_STEP});
game.Spawn({.position = position, .subType = TRINKET_MYSTERIOUS_PAPER, .type = ENTITY_PICKUP,
game.Spawn({.position = position, .spawner = &player, .subType = TRINKET_MYSTERIOUS_PAPER, .type = ENTITY_PICKUP,
.variant = PICKUP_TRINKET, .seed = rng.Next()});
}
// Brittle Bones' first pickup: six bone hearts for the red hearts (and the Soul's) it takes, or a tears up for
// a coin or soul health player.
// Brittle Bones' first pickup: six bone hearts for the red hearts (and the Soul's) it takes, or a tears up (and the
// bone hearts anyway) for a coin or no health player.
static void brittle_bones_gain(Entity_Player& player)
{
HealthType health = player.GetHealthType();
if (health == HEALTH_COIN || health == HEALTH_SOUL)
if (health == HEALTH_COIN || health == HEALTH_NO_HEALTH)
{
player.brittleBonesUpgrades++;
player.cacheFlags |= CACHE_FIREDELAY;
@@ -863,13 +854,6 @@ static void booster_pack_gain(Entity_Player& player, RNG& rng)
}
}
// False PHD's first pickup: a pill, and every pill colour identified.
static void false_phd_gain(Entity_Player& player, RNG& rng)
{
gain_pickup_drop(player, {.spawner = &player, .variant = PICKUP_PILL, .seed = rng.Next()});
for (uint32_t color = 1; color < PILL_COLOR_SLOTS; color++) g_game->itemPool.IdentifyPill(color);
}
// TMTRAINER's first pickup: the music fades and every enemy (and versus player) still alive burns and freezes for a
// hundred seconds.
static void tmtrainer_gain(Entity_Player& player)
@@ -881,8 +865,9 @@ static void tmtrainer_gain(Entity_Player& player)
bool isVersus = g_game->deathmatchManager.is_active();
for (Entity* entity : entities)
{
bool isTarget = (isVersus && entity->type == ENTITY_PLAYER) || entity->IsEnemy();
if (!isTarget || entity->isDead || entity->type == ENTITY_FIREPLACE || entity->type == ENTITY_PITFALL)
bool isTarget = (isVersus && entity->type == ENTITY_PLAYER) ||
(entity->type >= ENTITY_FIRST_ENEMY && entity->type < ENTITY_EFFECT);
if (!isTarget || entity->isDead || entity->type == ENTITY_FIREPLACE || entity->type == ENTITY_SHOPKEEPER)
continue;
entity->bossStatusEffectCooldown = 0;
entity->CopyStatusEffects();
@@ -901,7 +886,7 @@ static bool is_pre_ascent_mom_room()
// The pickup effects of 0075f0e0 for Clear Rune's rune and the collectibles 367 on that do more than drop pickups:
// Mom's Box's Wooden Cross and Duct Tape, Tarot Cloth's card, Divorce Papers, Brittle Bones, the Broken Shovel, Luna's secret room,
// Saturnus' tears, the Booster Pack, False PHD, Dad's Note's ascent and TMTRAINER. Camo Undies only acts in versus.
// Saturnus' tears, the Booster Pack, Dad's Note's ascent and TMTRAINER. Camo Undies only acts in versus.
void late_collectible_gain(Entity_Player& player, int type, bool isFirstTime)
{
RNG& rng = player.GetCollectibleRNG(type);
@@ -951,9 +936,6 @@ void late_collectible_gain(Entity_Player& player, int type, bool isFirstTime)
case COLLECTIBLE_BOOSTER_PACK:
if (isFirstTime) booster_pack_gain(player, rng);
return;
case COLLECTIBLE_FALSE_PHD:
if (isFirstTime) false_phd_gain(player, rng);
return;
case COLLECTIBLE_DADS_NOTE:
if (is_pre_ascent_mom_room() && !g_game->IsAscent() && g_game->ascentTimer < 1) g_game->ascentTimer = 1;
return;
@@ -970,6 +952,7 @@ void purity_gain(Entity_Player& player)
player.temporaryEffects.AddCollectibleEffect(COLLECTIBLE_PURITY, true, 1);
player.AddCostume(g_manager->itemConfig.GetNullItem(NULLITEM_PURITY_GLOW), false);
player.update_purity_glow();
player.versus.purityHits = 0;
}
// A crown's glow following its condition: the effect and the glowing float come on together, or go together.
@@ -1287,8 +1270,8 @@ void Entity_Player::GetGlyphOfBalanceDrop(int* variant, int* subType)
drop.soul_heart_set();
}
// 00772530 Turns a golden Store Credit back into a plain one: the one held over the head, else each held (its costume
// and effects swapped), else each smelted one in the history. True when the held over one was changed.
// 00772530 Turns a golden Store Credit back into a plain one: the one held over the head, else the first held (its
// costume and effects swapped), else the first smelted one in the history. Whether one was changed.
bool Entity_Player::replace_trinket()
{
bool isMainPlayer = variant == PLAYER_VARIANT_PLAYER && !isCoopGhost;
@@ -1314,6 +1297,7 @@ bool Entity_Player::replace_trinket()
if (storeCredit->isAddCostumeOnPickup || !temporaryEffects.HasTrinketEffect(golden)) RemoveCostume(storeCredit);
TriggerTrinketAdded(TRINKET_STORE_CREDIT, false);
if (storeCredit->isAddCostumeOnPickup) AddCostume(storeCredit, false);
return true;
}
if (!isMainPlayer) return false;
@@ -1335,6 +1319,7 @@ bool Entity_Player::replace_trinket()
storeCredit->GetLocalizedName().c_str(), playerIndex, name.c_str(), TRINKET_STORE_CREDIT,
storeCredit->GetLocalizedName().c_str());
g_game->hud.mark_all_slots_dirty(HISTORY_KEEP_ICONS, HISTORY_KEEP_ITEMS);
return true;
}
return false;
}