Curation round 9: floors and walls, room transitions, collision, the first enemies, saving, damage, pickups
Seven agents took over the backdrop's floor and wall rendering, room transitions (StartRoomTransition, on_leave, room_enter), grid collision with tear hits and decal baking, Entity_NPC's core with the AI dispatch and the first enemies (flies, Gaper, Pooter, Clotty, Horf, Dip, Spider), the run's save, player damage, PlayerManager::Update, ShowName, pickups, slots and the common effects. Integration added LuaEngine::PostNewLevel/PostNewRoom, one shared lua_callback_check (4 copies merged) and the enemy type range the original checks. Under gdb a run draws its rooms with floors and walls, walks between rooms, fights Gapers with contact damage and the damage flash, and collects pickups. Next: tears hitting enemies, pathfinding, item pedestals, death. 2891 functions taken over. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
69a354f843
commit
48933cd312
59 files changed
+13387
-6056
No files matched your search
+65
-12
@@ -146,6 +146,30 @@ constexpr std::array<int, 6> BLOOD_ANIMATION_VARIANTS = {TEAR_BLOOD, TE
|
||||
constexpr std::array<int, 6> STONE_ANIMATION_VARIANTS = {TEAR_STONE, TEAR_BOOGER, TEAR_EGG,
|
||||
TEAR_RAZOR, TEAR_BONE, TEAR_SPORE};
|
||||
|
||||
// The halo of a glowing tear, and the tear effects in the order SetTearFlags picks them: the flag that shows each and
|
||||
// its sprite. Rift's tears show Little Horn's effect tinted.
|
||||
constexpr const char* TEAR_HALO_ANM2 = "gfx/TearHalo.anm2";
|
||||
constexpr ColorMod RIFT_EFFECT_COLOR = {{1, 0.7f, 0.7f, 1}, {0, 0, 0, 0}, {0, 0, 0}};
|
||||
// A render flag the creep, fire and dark matter effects and their first layer carry, read by nothing written yet.
|
||||
constexpr unsigned int TEAR_EFFECT_LAYERED = 1 << 12;
|
||||
|
||||
// A tear effect: the flag that shows it and its sprite.
|
||||
struct TearEffect
|
||||
{
|
||||
int flag = 0;
|
||||
const char* anm2 = nullptr;
|
||||
};
|
||||
|
||||
constexpr std::array<TearEffect, 7> TEAR_EFFECTS = {{
|
||||
{TEAR_HORN, "gfx/LittleHornTearEffect.anm2"},
|
||||
{TEAR_RIFT, "gfx/LittleHornTearEffect.anm2"},
|
||||
{TEAR_LIGHT_FROM_HEAVEN, "gfx/HolyLightTearEffect.anm2"},
|
||||
{TEAR_JACOBS, "gfx/JacobsLadderTearEffect.anm2"},
|
||||
{TEAR_MYSTERIOUS_LIQUID_CREEP, "gfx/MysteriousTearEffect.anm2"},
|
||||
{TEAR_BURN, "gfx/FireMindTearEffect.anm2"},
|
||||
{TEAR_DARK_MATTER_FLAG, "gfx/DarkMatterTearEffect.anm2"},
|
||||
}};
|
||||
|
||||
// The splash a dying tear leaves: its poof and its sound.
|
||||
struct TearSplash
|
||||
{
|
||||
@@ -209,12 +233,6 @@ static bool is_crawlspace()
|
||||
return g_game->room->roomType == ROOM_DUNGEON;
|
||||
}
|
||||
|
||||
// Stops where a mod has a function for one of the tear's Lua callbacks, which LuaEngine does not run yet.
|
||||
static void lua_callback_check(int callback, const char* name)
|
||||
{
|
||||
if (static_cast<LuaEngine*>(g_luaEngine)->enabledCallbacks[callback]) reconstruction_missing(name);
|
||||
}
|
||||
|
||||
// Whether the player is another machine's in an online game, whose shots the game fades.
|
||||
static bool is_remote_player(Entity_Player* player)
|
||||
{
|
||||
@@ -726,6 +744,47 @@ void Entity_Tear::SetScale(float scale)
|
||||
ResetSpriteScale();
|
||||
}
|
||||
|
||||
// Loads the tear effect the first of its flags calls for and plays it: Little Horn's additive (tinted for Rift's
|
||||
// tears), Holy Light's and Jacob's Ladder's first layer additive, and the creep, fire and dark matter drawn behind.
|
||||
static void tear_effect_load(ANM2& effect, const TearFlags& flags)
|
||||
{
|
||||
auto shown = std::find_if(TEAR_EFFECTS.begin(), TEAR_EFFECTS.end(),
|
||||
[&flags](const TearEffect& candidate) { return flags[candidate.flag]; });
|
||||
if (shown == TEAR_EFFECTS.end()) return;
|
||||
|
||||
effect.Load(shown->anm2, GRAPHICS_LOAD);
|
||||
switch (shown->flag)
|
||||
{
|
||||
case TEAR_HORN:
|
||||
case TEAR_RIFT:
|
||||
for (int i = 0; i < (int)effect.layerStates.size(); i++)
|
||||
{
|
||||
layer_additive_set(effect, i);
|
||||
if (shown->flag == TEAR_RIFT) effect.GetLayer(i)->color = RIFT_EFFECT_COLOR;
|
||||
}
|
||||
break;
|
||||
case TEAR_LIGHT_FROM_HEAVEN:
|
||||
case TEAR_JACOBS: layer_additive_set(effect, 0); break;
|
||||
default:
|
||||
effect.bitflags |= TEAR_EFFECT_LAYERED | TEAR_EFFECT_BEHIND;
|
||||
effect.GetLayer(0)->bitflags = TEAR_EFFECT_LAYERED;
|
||||
if (shown->flag == TEAR_MYSTERIOUS_LIQUID_CREEP) layer_additive_set(effect, 1);
|
||||
}
|
||||
effect.Play("Idle");
|
||||
}
|
||||
|
||||
// 00676150 Sets the tear flags, loading what they show the first time: a glowing tear's halo, and its one effect.
|
||||
void Entity_Tear::SetTearFlags(TearFlags flags)
|
||||
{
|
||||
if (flags[TEAR_GLOW] && !tearHaloANM2.isLoaded)
|
||||
{
|
||||
tearHaloANM2.Load(TEAR_HALO_ANM2, GRAPHICS_LOAD);
|
||||
tearHaloANM2.Play("Idle");
|
||||
}
|
||||
if (!tearEffectANM2.isLoaded) tear_effect_load(tearEffectANM2, flags);
|
||||
tearFlags = flags;
|
||||
}
|
||||
|
||||
// 00676be0 Applies what its flags do when it dies, splitting it or chaining lightning. A tear without flags does
|
||||
// nothing.
|
||||
void Entity_Tear::apply_death_flag_effects(Entity*)
|
||||
@@ -902,12 +961,6 @@ void Entity_Tear::update_wiggle()
|
||||
reconstruction_missing("Entity_Tear::update_wiggle 00666ba0");
|
||||
}
|
||||
|
||||
// 00676150
|
||||
void Entity_Tear::SetTearFlags(TearFlags)
|
||||
{
|
||||
reconstruction_missing("Entity_Tear::SetTearFlags 00676150");
|
||||
}
|
||||
|
||||
// 00678080
|
||||
void Entity_Tear::fire_split_projectiles(bool)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user