Curation round 25 (code only): the ultra horsemen and the Beast's background, the Scourge and Polty, the player's last gaps with the frame gate removed, game core, debug and daily, local co-op and player-controlled enemies, TMTRAINER, local versus, the vanilla Lua API, the special-daily fix, shared constants folded (60 duplicates, 10 offline gaps)

This commit is contained in:
shweet committed 2026-11-23 07:35:21 -05:00
1 parent 534339a496
commit 5c89798773
280 files changed
+14904 -5309

No files matched your search

+40 -22
View File
@@ -100,14 +100,6 @@ constexpr int ACHIEVEMENT_GOLD_PILLS = 603;
constexpr int ACHIEVEMENT_HORSE_PILLS = 606;
// The daily challenges that change what pools give.
constexpr uint32_t DAILY_TREASURE_LIST = 1;
constexpr uint32_t DAILY_ROTTEN_BOSSES = 16;
constexpr uint32_t DAILY_TREASURE_LIST_SHORT = 18;
constexpr uint32_t DAILY_EXPLOSIVE_PILLS = 41;
constexpr uint32_t DAILY_APPLE_BOSSES = 44;
constexpr uint32_t DAILY_TREASURE_RANDOM = 46;
constexpr uint32_t DAILY_TREASURE_FOUR = 50;
constexpr uint32_t DAILY_HOST_HAT = 52;
constexpr int DAILY_TREASURE_LIST_ITEMS[] = {37, 125, 106, 19, 190, 140, 220, 65, 42, 137, 250, 131, 209,
52, 256, 344, 223, 353, 371, 432, 366, 367, 563, 583, 614, 727};
constexpr int DAILY_TREASURE_LIST_SHORT_ITEMS[] = {282, 382, 210, 60, 338, 12, 121, 120, 71,
@@ -262,8 +254,8 @@ void ItemPool::Init(uint32_t startSeed, std::string_view path)
for (auto& pill : config.pillEffects)
{
if (!pill || (!pill->isGreedModeAllowed && g_game && g_game->IsGreedMode())) continue;
if (g_game && g_game->deathmatchManager.is_active())
reconstruction_missing("DeathmatchType pill ban, vtable slot 10");
if (g_game && g_game->deathmatchManager.is_active() && g_game->deathmatchManager.type->is_pill_banned(pill->id))
continue;
if (!is_unlocked(pill->achievementId)) continue;
effects.push_back(pill->id);
@@ -527,19 +519,19 @@ int ItemPool::GetCollectible(ItemPoolType poolType, uint32_t drawSeed, uint32_t
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;
if (daily == DAILY_TREASURE_RANDOM && poolType == POOL_TREASURE)
if (daily == SPECIAL_DAILY_SEPTEMBER_17 && poolType == POOL_BOSS) return COLLECTIBLE_APPLE;
if (daily == SPECIAL_DAILY_OCTOBER_6 && poolType == POOL_TREASURE)
return DAILY_TREASURE_RANDOM_ITEMS[dailyRng.RandomInt(
isBanActives ? DAILY_TREASURE_RANDOM_PASSIVES : std::size(DAILY_TREASURE_RANDOM_ITEMS))];
if (daily == DAILY_TREASURE_FOUR && poolType == POOL_TREASURE)
if (daily == SPECIAL_DAILY_DECEMBER_23 && poolType == POOL_TREASURE)
return DAILY_TREASURE_FOUR_ITEMS[dailyRng.RandomInt(std::size(DAILY_TREASURE_FOUR_ITEMS))];
RNG pickRng = rng_make(drawSeed, DRAW_SHIFT);
uint32_t listFlags = LIST_PICK_BLACKLIST | (isBanActives ? LIST_PICK_BAN_ACTIVES : 0);
std::span<const int> list;
if (daily == DAILY_ROTTEN_BOSSES && pool == POOL_BOSS) return COLLECTIBLE_ROTTEN_MEAT;
if (daily == DAILY_TREASURE_LIST && pool == POOL_TREASURE) list = DAILY_TREASURE_LIST_ITEMS;
if (daily == DAILY_TREASURE_LIST_SHORT && pool == POOL_TREASURE) list = DAILY_TREASURE_LIST_SHORT_ITEMS;
if (daily == SPECIAL_DAILY_THANKSGIVING && pool == POOL_BOSS) return COLLECTIBLE_ROTTEN_MEAT;
if (daily == SPECIAL_DAILY_NEW_YEAR && pool == POOL_TREASURE) list = DAILY_TREASURE_LIST_ITEMS;
if (daily == SPECIAL_DAILY_DECEMBER_6 && pool == POOL_TREASURE) list = DAILY_TREASURE_LIST_SHORT_ITEMS;
if (!list.empty())
if (int item = GetCollectibleFromList(list, pickRng.Next(), 0, listFlags)) return item;
@@ -585,7 +577,7 @@ int ItemPool::GetCollectible(ItemPoolType poolType, uint32_t drawSeed, uint32_t
if (rosaryMultiplier > 1 &&
(int)pickRng.RandomInt((uint32_t)items->totalWeight) < rosaryMultiplier * ROSARY_CHANCE_PER_MULTIPLIER)
result = COLLECTIBLE_ROSARY;
else if (result == COLLECTIBLE_PYROMANIAC && daily == DAILY_HOST_HAT)
else if (result == COLLECTIBLE_PYROMANIAC && daily == SPECIAL_DAILY_G_FUEL)
result = COLLECTIBLE_HOST_HAT;
}
@@ -915,7 +907,7 @@ int ItemPool::GetPillEffect(uint32_t pillColor, Entity_Player* player)
int effect = color < PILL_COLOR_SLOTS ? pillEffects[color] : PILL_EFFECT_NONE;
bool isFalsePhd = false;
if (g_game->dailyChallenge.specialDailyId == DAILY_EXPLOSIVE_PILLS) return PILLEFFECT_EXPLOSIVE_DIARRHEA;
if (g_game->dailyChallenge.specialDailyId == SPECIAL_DAILY_AUGUST_16) return PILLEFFECT_EXPLOSIVE_DIARRHEA;
if (player)
{
bool isPhd = player->HasCollectible(COLLECTIBLE_PHD) || player->HasCollectible(COLLECTIBLE_VIRGO) ||
@@ -983,8 +975,7 @@ int ItemPool::on_pill_used(int pillColor, uint32_t useSeed, uint32_t&)
for (auto& pill : config.pillEffects)
{
if (!pill || (!pill->isGreedModeAllowed && g_game->IsGreedMode())) continue;
if (g_game->deathmatchManager.is_active())
reconstruction_missing("ItemPool::on_pill_used 00736c30 (the deathmatch's pill ban)");
if (g_game->deathmatchManager.is_active() && g_game->deathmatchManager.type->is_pill_banned(pill->id)) continue;
if (is_unlocked(pill->achievementId) && !isHeld[pill->id]) candidates.push_back(pill->id);
}
@@ -993,10 +984,37 @@ int ItemPool::on_pill_used(int pillColor, uint32_t useSeed, uint32_t&)
return pillEffects[slot];
}
// (00734cc0) Takes the effects deathmatch bans out of the pill colors.
// 00734cc0 In a versus match, gives each pill color holding a banned effect another available effect no color holds,
// drawn from the pool's generator.
// The original reads past an empty list of effects left. Here the color keeps no effect (-1).
void ItemPool::remove_deathmatch_pill_effects()
{
reconstruction_missing("ItemPool::remove_deathmatch_pill_effects 00734cc0");
DeathmatchManager& versus = g_game->deathmatchManager;
if (!versus.is_active()) return;
std::vector<int> candidates;
for (auto& pill : g_manager->itemConfig.pillEffects)
{
if (!pill || !pill->IsAvailable()) continue;
bool isHeld = false;
for (int& effect : pillEffects)
{
if (effect != pill->id) continue;
isHeld = true;
if (versus.type->is_pill_banned(effect)) effect = -1;
}
if (!isHeld && !versus.type->is_pill_banned(pill->id)) candidates.push_back(pill->id);
}
for (int color = 1; color < PILL_COLOR_SLOTS; color++)
{
if (pillEffects[color] != -1) continue;
uint32_t roll = itemPoolRNG.Next();
if (candidates.empty()) continue;
auto pick = candidates.begin() + roll % candidates.size();
pillEffects[color] = *pick;
candidates.erase(pick);
}
}
// 00734870 A card from a seed as MC_GET_CARD leaves it: special cards one in 25 unless only runes, runes one in ten