Curation round 15: restart and mods, Brimstone and Tech X, room gaps, eight bosses, the Womb and Mom's Heart, the Forgotten and tainted starts, alt path enemies and exits

This commit is contained in:
shweet committed 2026-11-20 20:54:59 -05:00
1 parent 6e3da161fc
commit 78a2680134
128 files changed
+13196 -2933

No files matched your search

+55 -6
View File
@@ -2,6 +2,7 @@
#include "entity_effect_combat.h"
#include "entity_list.h"
#include "entity_player.h"
#include "entity_player_forgotten.h"
#include "game.h"
#include "kage_graphics.h"
#include "log.h"
@@ -9,6 +10,7 @@
#include "manager.h"
#include "room.h"
#include "sfx_manager.h"
#include "mines.h"
#include <algorithm>
#include <array>
#include <cmath>
@@ -51,13 +53,52 @@ static bool is_listed(const std::array<int, N>& list, int value)
return std::find(list.begin(), list.end(), value) != list.end();
}
// A timer's callback, how many frames apart it runs and how many more times. None runs once, then it goes.
struct TimerData : Entity_Effect::ExtraData
{
void (*callback)(Entity_Effect* timer) = nullptr;
uint32_t delay = 1;
int times = 1;
};
// The timer part of 005cdb20 (Init): a timer is invisible, never overwritten, and has nothing to run yet.
static void timer_init(Entity_Effect& timer)
{
timer.isVisible = false;
timer.extraData = std::make_shared<TimerData>();
timer.AddEntityFlags(FLAG_DONT_OVERWRITE);
}
// The timer part of 005d4380 (Update): runs the callback every delay frames of its life until its times run out, then
// removes itself. Without a callback it goes at once.
// A delay of 0 divided by zero in the original. Here it runs every frame.
static EffectUpdateEnd timer_update(Entity_Effect& timer)
{
auto& data = static_cast<TimerData&>(*timer.extraData);
if (!data.callback)
{
timer.Remove();
return EFFECT_UPDATE_RETURN;
}
if (data.delay && (uint32_t)timer.FrameCount() % data.delay != 0) return EFFECT_UPDATE_FINISH;
data.callback(&timer);
if (data.times > 0) data.times--;
if (data.times != 0) return EFFECT_UPDATE_FINISH;
timer.Remove();
return EFFECT_UPDATE_RETURN;
}
constexpr EffectBehaviour TIMER_BEHAVIOURS[] = {{EFFECT_TIMER, timer_init, timer_update}};
// The behaviour of a variant one of the groups hands out, indexed once by variant, or none.
static const EffectBehaviour* behaviour_find(int variant)
{
static const std::array<EffectBehaviour, EFFECT_VARIANT_LIMIT> TABLE = [] {
std::array<EffectBehaviour, EFFECT_VARIANT_LIMIT> table{};
for (auto group : {ambient_effect_behaviours(), hazard_effect_behaviours(), floor_effect_behaviours(),
beam_effect_behaviours()})
beam_effect_behaviours(), player_effect_behaviours(), mines_effect_behaviours(),
std::span<const EffectBehaviour>(TIMER_BEHAVIOURS)})
for (const EffectBehaviour& behaviour : group) table[behaviour.variant] = behaviour;
return table;
}();
@@ -185,7 +226,7 @@ void Entity_Effect::Init(int entityType, int entityVariant, int entitySubType, u
if (behaviour->init) behaviour->init(*this);
}
else if (is_combat_effect(variant)) combat_effect_init(*this);
else reconstruction_missing("Entity_Effect::Init 005cdb20: this effect variant");
else if (variant < EFFECT_VARIANT_LIMIT) reconstruction_missing("Entity_Effect::Init 005cdb20: this effect variant");
if (!isExists) return;
sprite.LoadGraphics();
@@ -241,7 +282,7 @@ void Entity_Effect::Update()
if (behaviour->update) end = behaviour->update(*this);
}
else if (is_combat_effect(variant)) end = combat_effect_update(*this);
else reconstruction_missing("Entity_Effect::Update 005d4380: this effect variant");
else if (variant < EFFECT_VARIANT_LIMIT) reconstruction_missing("Entity_Effect::Update 005d4380: this effect variant");
if (end == EFFECT_UPDATE_RETURN) return;
if (timeout > 0 && --timeout < 1) isDead = true;
@@ -347,10 +388,18 @@ void Entity_Effect::moonlight_timer_callback(int)
reconstruction_missing("Entity_Effect::moonlight_timer_callback 006073f0");
}
// 0060af00
Entity_Effect* Entity_Effect::CreateTimer(void*, uint32_t, uint32_t, bool)
// 0060af00 Spawns a timer running a callback (taking the timer) every delay frames, times more times after the first
// (0 for once), kept across rooms when persistent.
Entity_Effect* Entity_Effect::CreateTimer(void* fn, uint32_t delay, uint32_t times, bool isPersistent)
{
reconstruction_missing("Entity_Effect::CreateTimer 0060af00");
auto* timer = static_cast<Entity_Effect*>(
g_game->Spawn({.type = ENTITY_EFFECT, .variant = EFFECT_TIMER, .seed = Random()}));
auto& data = static_cast<TimerData&>(*timer->extraData);
data.callback = reinterpret_cast<void (*)(Entity_Effect*)>(fn);
data.delay = delay;
data.times = (int)times;
if (isPersistent) timer->AddEntityFlags(FLAG_PERSISTENT);
return timer;
}
// 0060b0d0