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

+292 -18
View File
@@ -1,4 +1,5 @@
#include "entity_pickup.h"
#include "entity_bomb.h"
#include "entity_effect.h"
#include "entity_npc.h"
#include "entity_player.h"
@@ -9,6 +10,8 @@
#include "manager.h"
#include "npc_ai.h"
#include "room.h"
#include "room_grid.h"
#include "room_transition.h"
#include "sfx_manager.h"
#include <algorithm>
#include <array>
@@ -24,7 +27,6 @@ constexpr float LOOT_ANGLE_SCALE = 3.14f;
constexpr std::array<int, 3> LOCKED_CHESTS = {PICKUP_LOCKEDCHEST, PICKUP_ETERNALCHEST, PICKUP_OLDCHEST};
constexpr std::array<int, 4> GOLDEN_CHESTS = {PICKUP_LOCKEDCHEST, PICKUP_BOMBCHEST, PICKUP_ETERNALCHEST,
PICKUP_MEGACHEST};
constexpr std::array<int, 4> UNWRITTEN_LOOT = {PICKUP_REDCHEST, PICKUP_MOMSCHEST, PICKUP_OLDCHEST, PICKUP_GRAB_BAG};
constexpr int EVENT_LOCKED_CHESTS_OPENED = 198;
constexpr float CHEST_VANISH_VOLUME = 0.7f;
constexpr float SPIKED_CHEST_DAMAGE = 1;
@@ -129,11 +131,61 @@ struct ChestDraw
std::array<RNG, CHEST_TRINKETS.size()> trinketRngs{};
std::array<bool, CHEST_TRINKETS.size()> isTrinketProc{};
LootList loot;
RNG daemonsTailRng{};
RNG* rng = nullptr;
Entity_Player* player = nullptr;
uint32_t poolFlags = 0;
bool isDaemonsTail = false;
bool isPokerChip = false;
bool isPokerDouble = false;
};
// The outcomes of an old chest, a red chest and a sack. A sack's outcome is its pickup's subtype and variant.
enum OldChestOutcome
{
OLD_OUTCOME_SOUL_HEARTS,
OLD_OUTCOME_TRINKETS,
OLD_OUTCOME_ITEM,
OLD_OUTCOME_ANGEL_ITEM
};
enum RedChestOutcome
{
RED_OUTCOME_ITEM,
RED_OUTCOME_TELEPORT,
RED_OUTCOME_SPIDERS,
RED_OUTCOME_TROLL_BOMB,
RED_OUTCOME_FLIES,
RED_OUTCOME_BLUE_SPIDERS,
RED_OUTCOME_SOUL_HEARTS,
RED_OUTCOME_BOMBS,
RED_OUTCOME_PILLS
};
constexpr int SACK_OUTCOME_SHIFT = 16;
constexpr int SACK_OUTCOME_MASK = 0xffff;
constexpr int SACK_BLACK = 2;
constexpr int SACK_BLACK_HEART = HEART_BLACK << SACK_OUTCOME_SHIFT | PICKUP_HEART;
constexpr int SACK_BONE_HEART = HEART_BONE << SACK_OUTCOME_SHIFT | PICKUP_HEART;
// What an old, red or Mom's chest gives beyond its outcomes: three trinkets, Left Hand's extra pickup (from two
// copies) or its spiders' ban (from three), the Red Key until Mom's chests' items are unlocked, the familiars and
// entities a red chest lets out, and the Poker Chip's banned item qualities.
constexpr int OLD_CHEST_TRINKETS = 3;
constexpr int OLD_CHEST_SOUL_HEARTS = 3;
constexpr int RED_CHEST_FAMILIARS = 3;
constexpr int LEFT_HAND_EXTRA = 2;
constexpr int LEFT_HAND_NO_SPIDERS = 3;
constexpr int ACHIEVEMENT_MOMS_CHEST_ITEMS = 415;
constexpr int FAMILIAR_BLUE_FLY = 43;
constexpr int FAMILIAR_BLUE_SPIDER = 73;
constexpr int RED_CHEST_TELEPORT = 1;
constexpr int RED_CHEST_BOMB_SUBTYPE = 3;
constexpr float RED_CHEST_SPIDER_STEP = 70;
constexpr float RED_CHEST_SPIDER_HEIGHT = -30;
constexpr uint32_t POKER_QUALITY_BANS = 0x1f0;
constexpr int POKER_TOP_QUALITY = 2;
constexpr std::array<uint32_t, 3> DAEMONS_TAIL_SHIFTS = {1, 5, 16};
constexpr std::array<uint32_t, 3> POKER_CHIP_SHIFTS = {1, 21, 20};
// Adds weight to an outcome, never below zero, or adds the outcome (inlined in the original).
void WeightedOutcomePicker::AddOutcomeWeight(int id, int weight)
{
@@ -184,6 +236,31 @@ static void loot_item_add(ChestDraw& draw, int pool)
draw.loot.entries.push_back({.subType = item, .type = ENTITY_PICKUP, .variant = PICKUP_COLLECTIBLE, .seed = seed});
}
// The Poker Chip's item (FUN_006ee640): a first draw (left in the pool) shows a quality, and the item drawn is of the
// next quality up (a quality 3 or 4 its own), the first when none is.
static void loot_poker_item_add(ChestDraw& draw, int pool, int fallbackPool)
{
uint32_t seed = draw.rng->Next();
ItemPool& itemPool = g_game->itemPool;
int first =
itemPool.GetCollectible((ItemPoolType)pool, draw.rng->Next(), draw.poolFlags | POOL_FLAG_NO_DECREASE, 0, 0);
int quality = g_manager->itemConfig.GetCollectible(first)->quality;
int target = quality > POKER_TOP_QUALITY ? quality : quality + 1;
uint32_t flags = ~(POOL_FLAG_BAN_QUALITY_0 << target) & (draw.poolFlags | POKER_QUALITY_BANS);
int item = itemPool.GetCollectible((ItemPoolType)pool, draw.rng->Next(), flags, 0, fallbackPool);
if (item == COLLECTIBLE_BREAKFAST) item = first;
draw.loot.entries.push_back({.subType = item, .type = ENTITY_PICKUP, .variant = PICKUP_COLLECTIBLE, .seed = seed});
}
// The Poker Chip doubles a chest's pickups, or half the time trades them for an attack fly.
static int poker_chip_count(ChestDraw& draw, int count)
{
if (!draw.isPokerChip) return count;
if (draw.isPokerDouble && count != 0) return count * 2;
draw.loot.entries.push_back({.type = ENTITY_ATTACKFLY, .seed = draw.rng->Next()});
return 0;
}
// Rolls each bonus trinket for the first player holding it (a Lazarus twin's own copy counts for globally shared
// ones): one in five passes Child's Heart under Daemon's Tail, then one, two or three copies add their pickup a
// third, two thirds or every time.
@@ -240,16 +317,20 @@ static void chest_pickups_add(ChestDraw& draw, int count, bool isGilded)
WeightedOutcomePicker picker;
int heartWeight = draw.isDaemonsTail ? 4 : 20;
if (isGilded)
picker.outcomes = {{CHEST_PICKUP_COINS, 25}, {CHEST_PICKUP_HEART, heartWeight}, {CHEST_PICKUP_KEY, 10},
{CHEST_PICKUP_BOMB, 20}, {CHEST_PICKUP_PILL, 5}, {CHEST_PICKUP_CARD, 5},
{CHEST_PICKUP_RUNE, 5}, {CHEST_PICKUP_TRINKET, 5}, {CHEST_PICKUP_BATTERY, 5}};
picker.outcomes = {{CHEST_PICKUP_COINS, 25}, {CHEST_PICKUP_HEART, heartWeight},
{CHEST_PICKUP_KEY, 10}, {CHEST_PICKUP_BOMB, 20},
{CHEST_PICKUP_PILL, 5}, {CHEST_PICKUP_CARD, 5},
{CHEST_PICKUP_RUNE, 5}, {CHEST_PICKUP_TRINKET, 5},
{CHEST_PICKUP_BATTERY, 5}};
else
picker.outcomes = {{CHEST_PICKUP_COINS, 35}, {CHEST_PICKUP_HEART, heartWeight}, {CHEST_PICKUP_KEY, 15},
picker.outcomes = {{CHEST_PICKUP_COINS, 35},
{CHEST_PICKUP_HEART, heartWeight},
{CHEST_PICKUP_KEY, 15},
{CHEST_PICKUP_BOMB, 30}};
constexpr std::array<int, 9> PICKUP_VARIANTS = {PICKUP_COIN, PICKUP_HEART, PICKUP_KEY,
PICKUP_BOMB, PICKUP_PILL, PICKUP_TAROTCARD,
PICKUP_TAROTCARD, PICKUP_TRINKET, PICKUP_LIL_BATTERY};
constexpr std::array<int, 9> PICKUP_VARIANTS = {PICKUP_COIN, PICKUP_HEART, PICKUP_KEY,
PICKUP_BOMB, PICKUP_PILL, PICKUP_TAROTCARD,
PICKUP_TAROTCARD, PICKUP_TRINKET, PICKUP_LIL_BATTERY};
for (; count > 0; count--)
{
int outcome = outcome_draw(picker, *draw.rng);
@@ -325,14 +406,16 @@ static void chest_loot_draw(ChestDraw& draw, int variant)
loot_add(draw, PICKUP_TAROTCARD);
break;
case CHEST_OUTCOME_ITEM:
loot_item_add(draw, POOL_GOLDEN_CHEST);
if (!draw.isPokerChip) loot_item_add(draw, POOL_GOLDEN_CHEST);
else loot_poker_item_add(draw, POOL_GOLDEN_CHEST, variant == PICKUP_ETERNALCHEST ? POOL_ANGEL : 0);
break;
default:
{
int roll = isGolden ? GOLDEN_PICKUP_COUNT_ROLL : PICKUP_COUNT_ROLL;
int count = std::max(PICKUP_COUNT_MIN, (int)draw.rng->RandomInt(roll));
chest_trinket_pickup_add(draw, CHEST_TRINKET_PRECEDENCE.size());
chest_pickups_add(draw, chest_pickup_count_grow(draw, count), outcome == CHEST_OUTCOME_GILDED_PICKUPS);
count = poker_chip_count(draw, chest_pickup_count_grow(draw, count));
chest_pickups_add(draw, count, outcome == CHEST_OUTCOME_GILDED_PICKUPS);
}
}
}
@@ -351,23 +434,171 @@ static void wooden_chest_loot_draw(ChestDraw& draw)
count++;
chest_trinket_pickup_add(draw, WOODEN_CHEST_TRINKETS);
if (g_game->playerManager.FirstCollectibleOwner(COLLECTIBLE_MOMS_KEY, LAZARUS_SHARE_CHECK)) count *= 2;
if (draw.isPokerChip && poker_chip_count(draw, count) == 0) return;
if (draw.isPokerChip) count *= 2;
int outcome = outcome_draw(picker, *draw.rng);
if (outcome == WOODEN_OUTCOME_ITEM && draw.isPokerChip) return loot_poker_item_add(draw, POOL_WOODEN_CHEST, 0);
if (outcome == WOODEN_OUTCOME_ITEM) return loot_item_add(draw, POOL_WOODEN_CHEST);
for (; count > 0; count--) loot_add(draw, outcome == WOODEN_OUTCOME_CARDS ? PICKUP_TAROTCARD : PICKUP_PILL);
}
// An old chest's loot: soul hearts, three trinkets, an old chest's item, or rarely an angel room's.
static void old_chest_loot_draw(ChestDraw& draw)
{
WeightedOutcomePicker picker;
picker.outcomes = {{OLD_OUTCOME_SOUL_HEARTS, draw.isDaemonsTail ? 9 : 43},
{OLD_OUTCOME_TRINKETS, 42},
{OLD_OUTCOME_ITEM, 10},
{OLD_OUTCOME_ANGEL_ITEM, 5}};
switch (outcome_draw(picker, *draw.rng))
{
case OLD_OUTCOME_SOUL_HEARTS:
for (int i = (int)draw.rng->RandomInt(OLD_CHEST_SOUL_HEARTS) + 1; i > 0; i--)
loot_add(draw, PICKUP_HEART, HEART_SOUL);
break;
case OLD_OUTCOME_TRINKETS:
for (int i = 0; i < OLD_CHEST_TRINKETS; i++) loot_add(draw, PICKUP_TRINKET);
break;
case OLD_OUTCOME_ITEM:
loot_item_add(draw, POOL_OLD_CHEST);
break;
case OLD_OUTCOME_ANGEL_ITEM:
loot_item_add(draw, POOL_ANGEL);
break;
}
}
// Adds an entity that is no pickup to a chest's loot, seeded by the next draw.
static void loot_entity_add(ChestDraw& draw, int type, int variant)
{
draw.loot.entries.push_back({.type = type, .variant = variant, .seed = draw.rng->Next()});
}
// A red chest's loot: a devil item on the Chest's first room, else a red chest's item, a teleport to the devil room
// (not from the devil room or Genesis), spiders (unless three Left Hands), a Mega Troll Bomb, blue flies or spiders,
// soul hearts, troll bombs or pills. Two Left Hands add a pill or a soul heart.
static void red_chest_loot_draw(ChestDraw& draw, bool isChestFloor)
{
Game& game = *g_game;
if (isChestFloor && game.startingRoomIdx == game.currentRoomIdx)
{
uint32_t seed = draw.rng->Next();
int item = game.itemPool.GetCollectible(POOL_DEVIL, draw.rng->Next(),
draw.poolFlags | POOL_FLAG_BAN_DEVIL_SACRIFICE, 0, 0);
draw.loot.entries.push_back(
{.subType = item, .type = ENTITY_PICKUP, .variant = PICKUP_COLLECTIBLE, .seed = seed});
return;
}
int leftHands = draw.player ? draw.player->GetTrinketMultiplier(TRINKET_LEFT_HAND) : 0;
WeightedOutcomePicker picker;
picker.outcomes = {{RED_OUTCOME_ITEM, 10}};
if (game.currentRoomIdx != ROOM_DEVIL_IDX && game.currentRoomIdx != ROOM_GENESIS_IDX)
picker.AddOutcomeWeight(RED_OUTCOME_TELEPORT, 5);
if (!draw.player || leftHands < LEFT_HAND_NO_SPIDERS) picker.AddOutcomeWeight(RED_OUTCOME_SPIDERS, 13);
picker.AddOutcomeWeight(RED_OUTCOME_TROLL_BOMB, 13);
picker.AddOutcomeWeight(RED_OUTCOME_FLIES, 7);
picker.AddOutcomeWeight(RED_OUTCOME_BLUE_SPIDERS, 7);
picker.AddOutcomeWeight(RED_OUTCOME_SOUL_HEARTS, draw.isDaemonsTail ? 3 : 15);
picker.AddOutcomeWeight(RED_OUTCOME_BOMBS, 15);
picker.AddOutcomeWeight(RED_OUTCOME_PILLS, 15);
int outcome = outcome_draw(picker, *draw.rng);
switch (outcome)
{
case RED_OUTCOME_ITEM:
loot_item_add(draw, POOL_RED_CHEST);
break;
case RED_OUTCOME_TELEPORT:
draw.loot.entries.push_back({.variant = RED_CHEST_TELEPORT});
break;
case RED_OUTCOME_SPIDERS:
loot_entity_add(draw, ENTITY_SPIDER, 0);
loot_entity_add(draw, ENTITY_SPIDER, 0);
break;
case RED_OUTCOME_TROLL_BOMB:
loot_entity_add(draw, ENTITY_BOMB, BOMB_SUPERTROLL);
break;
case RED_OUTCOME_FLIES:
case RED_OUTCOME_BLUE_SPIDERS:
for (int i = 0; i < RED_CHEST_FAMILIARS; i++)
loot_entity_add(draw, ENTITY_FAMILIAR,
outcome == RED_OUTCOME_FLIES ? FAMILIAR_BLUE_FLY : FAMILIAR_BLUE_SPIDER);
break;
case RED_OUTCOME_SOUL_HEARTS:
{
loot_add(draw, PICKUP_HEART, HEART_SOUL);
bool isSecond = draw.rng->RandomInt(2) == 0 &&
(!draw.isDaemonsTail || draw.daemonsTailRng.RandomInt(DAEMONS_TAIL_ODDS) == 0);
if (isSecond) loot_add(draw, PICKUP_HEART, HEART_SOUL);
break;
}
case RED_OUTCOME_BOMBS:
loot_add(draw, PICKUP_BOMB, RED_CHEST_BOMB_SUBTYPE);
loot_add(draw, PICKUP_BOMB, RED_CHEST_BOMB_SUBTYPE);
break;
case RED_OUTCOME_PILLS:
loot_add(draw, PICKUP_PILL);
loot_add(draw, PICKUP_PILL);
break;
}
if (!draw.player || leftHands < LEFT_HAND_EXTRA) return;
bool isPill = (draw.rng->Next() & 1) == 0;
loot_add(draw, isPill ? PICKUP_PILL : PICKUP_HEART, HEART_SOUL);
}
// A sack's loot: two or three pickups, bombs, keys, coins, batteries or cards, or from a black sack bombs, pills and a
// black or bone heart (one heart at most).
static void sack_loot_draw(ChestDraw& draw, int subtype)
{
WeightedOutcomePicker picker;
if (subtype == SACK_BLACK)
picker.outcomes = {{PICKUP_BOMB, 15}, {SACK_BLACK_HEART, 10}, {SACK_BONE_HEART, 5}, {PICKUP_PILL, 15}};
else
picker.outcomes = {
{PICKUP_BOMB, 15}, {PICKUP_KEY, 20}, {PICKUP_COIN, 15}, {PICKUP_LIL_BATTERY, 4}, {PICKUP_TAROTCARD, 4}};
for (int count = (int)draw.rng->RandomInt(2) + 2; count > 0; count--)
{
int outcome = outcome_draw(picker, *draw.rng);
int variant = outcome & SACK_OUTCOME_MASK;
draw.rng->Next();
loot_add(draw, variant, outcome >> SACK_OUTCOME_SHIFT);
if (subtype != SACK_BLACK || variant != PICKUP_HEART) continue;
picker.AddOutcomeWeight(SACK_BLACK_HEART, -10);
picker.AddOutcomeWeight(SACK_BONE_HEART, -5);
}
}
// Mom's chest's loot: a Mom's chest item, the Red Key until those are unlocked (outside a daily or debug run).
static void moms_chest_loot_draw(ChestDraw& draw)
{
bool isLocked = !g_manager->persistentGameData.achievements[ACHIEVEMENT_MOMS_CHEST_ITEMS] &&
(g_manager->state != MANAGER_STATE_GAME || (g_game->dailyChallenge._id == 0 && !g_game->isDebug));
if (!isLocked) return loot_item_add(draw, POOL_MOMS_CHEST);
uint32_t seed = draw.rng->Next();
draw.loot.entries.push_back(
{.subType = COLLECTIBLE_RED_KEY, .type = ENTITY_PICKUP, .variant = PICKUP_COLLECTIBLE, .seed = seed});
}
// 006dae40 What the chest gives, drawn from its RNG, or from a copy with POOL_DRAW_PEEK, which also leaves the items
// in their pools. An eternal chest gives nothing a quarter of the time (and stays). Ace of Spades, Safety Cap,
// Match Stick, Child's Heart and Rusted Key may add their pickups, and in the Chest every chest gives a treasure item.
// Red, old and Mom's chests, sacks and Poker Chip stop the game until reached.
// Old chests give hearts, trinkets or items, red chests also teleports and enemies, Mom's chests their item, sacks
// pickups, and the Poker Chip doubles a chest's pickups or trades them for an attack fly, and raises its items'
// quality.
LootList Entity_Pickup::GetChestLoot(PoolDraw draw, Entity_Player* player)
{
ChestDraw chest;
RNG peek = dropRNG;
chest.rng = draw == POOL_DRAW_TAKE ? &dropRNG : &peek;
chest.player = player;
chest.poolFlags = draw == POOL_DRAW_TAKE ? 0 : POOL_FLAG_NO_DECREASE;
chest.isDaemonsTail = g_game->playerManager.AnyoneHasTrinket(TRINKET_DAEMONS_TAIL);
chest.daemonsTailRng = {dropRNG._seed, DAEMONS_TAIL_SHIFTS[0], DAEMONS_TAIL_SHIFTS[1], DAEMONS_TAIL_SHIFTS[2]};
for (size_t index = 0; index < CHEST_TRINKETS.size(); index++)
chest.trinketRngs[index].SetSeed(dropRNG._seed, CHEST_TRINKETS[index].shiftIndex);
@@ -380,11 +611,18 @@ LootList Entity_Pickup::GetChestLoot(PoolDraw draw, Entity_Player* player)
bool isChestFloor = !game.IsGreedMode() && game.stage == STAGE_DARK_ROOM && !isDeathmatch;
bool isPokerChip = isDeathmatch ? player && player->HasTrinket(TRINKET_POKER_CHIP)
: game.playerManager.AnyoneHasTrinket(TRINKET_POKER_CHIP);
if (isPokerChip) reconstruction_missing("Entity_Pickup::GetChestLoot 006dae40 (Poker Chip)");
if (std::ranges::count(UNWRITTEN_LOOT, variant) > 0)
reconstruction_missing("Entity_Pickup::GetChestLoot 006dae40 (red, old and Mom's chests and sacks)");
if (isPokerChip)
{
RNG poker = {chest.rng->_seed, POKER_CHIP_SHIFTS[0], POKER_CHIP_SHIFTS[1], POKER_CHIP_SHIFTS[2]};
chest.isPokerChip = true;
chest.isPokerDouble = (poker.Next() & 1) == 0;
}
if (variant == PICKUP_WOODENCHEST) wooden_chest_loot_draw(chest);
else if (variant == PICKUP_REDCHEST) red_chest_loot_draw(chest, isChestFloor);
else if (variant == PICKUP_MOMSCHEST) moms_chest_loot_draw(chest);
else if (variant == PICKUP_OLDCHEST) old_chest_loot_draw(chest);
else if (variant == PICKUP_GRAB_BAG) sack_loot_draw(chest, subtype);
else if (!isChestFloor) chest_loot_draw(chest, variant);
else
{
@@ -451,6 +689,40 @@ bool Entity_Pickup::TryOpenChest(Entity_Player* player)
return true;
}
// What a red chest lets out that is no ordinary spawn: a teleport to the devil room, spiders (the first thrown halfway
// to the player), blue flies and blue spiders. Whether the entry was spawned here.
static bool red_chest_entry_spawn(Entity_Pickup& chest, const LootEntry& entry, Entity_Player& player, bool isFirst)
{
if (entry.type == 0 && entry.variant == RED_CHEST_TELEPORT)
{
Game& game = *g_game;
game.InitializeDevilAngelRoom(false, false);
game.leaveDoor = -1;
game.StartRoomTransition({.player = &player, .animation = TRANSITION_TELEPORT, .roomIndex = ROOM_DEVIL_IDX});
return true;
}
if (entry.type == ENTITY_SPIDER)
{
Vector target{};
if (isFirst)
{
// The player's NPC target fields (0x144c, 0x1450) are not known yet and taken as empty.
Entity* aim = player.darkArtsLastSnare ? player.darkArtsLastSnare->GetLastParent() : &player;
Vector halfway = vector_scale(vector_add(aim->pos, chest.pos), 0.5f);
target = room_free_pickup_position_find({.position = halfway, .step = RED_CHEST_SPIDER_STEP});
}
Entity_NPC::ThrowSpider(chest.pos, &chest, target, false, RED_CHEST_SPIDER_HEIGHT);
return true;
}
if (entry.type != ENTITY_FAMILIAR) return false;
if (entry.variant == FAMILIAR_BLUE_FLY) player.AddBlueFlies(1, chest.pos, nullptr);
else if (entry.variant == FAMILIAR_BLUE_SPIDER)
reconstruction_missing(
"Entity_Pickup::TryOpenChest 006e6e40: a red chest's blue spiders (spawn_blue_spider 00638e30)");
return true;
}
// Spawns what a chest gives: the first item turns the chest into its pedestal (a pay to play look for those) and
// more stand beside it, pickups and enemies fly out from a spot beside the chest (a Mega Chest's slower at first),
// enemies placed towards the player, and chests come out smaller. Red chests' spiders, flies and teleports stop the
@@ -468,8 +740,10 @@ void Entity_Pickup::chest_loot_spawn(const LootList& loot, Entity_Player& player
{
Entity_Pickup* item = this;
if (variant == PICKUP_COLLECTIBLE)
item = static_cast<Entity_Pickup*>(g_game->Spawn({.position = pos, .subType = entry.subType,
.type = ENTITY_PICKUP, .variant = PICKUP_COLLECTIBLE,
item = static_cast<Entity_Pickup*>(g_game->Spawn({.position = pos,
.subType = entry.subType,
.type = ENTITY_PICKUP,
.variant = PICKUP_COLLECTIBLE,
.seed = entry.seed}));
else Morph(ENTITY_PICKUP, PICKUP_COLLECTIBLE, entry.subType, false, false, false);
if (item->variant == PICKUP_COLLECTIBLE)
@@ -482,8 +756,8 @@ void Entity_Pickup::chest_loot_spawn(const LootList& loot, Entity_Player& player
isPushing = true;
continue;
}
if (entry.type != ENTITY_PICKUP)
reconstruction_missing("Entity_Pickup::TryOpenChest 006e6e40 (a red chest's spiders, flies or teleport)");
if (entry.type != ENTITY_PICKUP && red_chest_entry_spawn(*this, entry, player, &entry == &loot.entries.front()))
continue;
float speed = variant == PICKUP_MEGACHEST
? std::min(1.0f, (float)spawned * MEGA_CHEST_SPEED_STEP + MEGA_CHEST_SPEED_BASE)