Curation round 14: console and Lua API, effects, lasers, enemies, eleven bosses, the Depths and Mom, status effects, the playable characters

This commit is contained in:
shweet committed 2026-11-20 19:04:41 -05:00
1 parent 8ae02a8422
commit 6e3da161fc
138 files changed
+16754 -6825

No files matched your search

+75 -3
View File
@@ -3,6 +3,7 @@
#include "entity.h"
#include <array>
#include <memory>
#include <span>
#include <vector>
// The effect variant that spawns a boss, which counts as the boss until it does.
@@ -16,6 +17,25 @@ enum EffectUpdateEnd
EFFECT_UPDATE_RETURN
};
struct Entity_Effect;
// What a variant runs beside Entity_Effect's shared Init, Update and Render: its part of Init (after the shared start,
// before LoadGraphics), its frame (between Update's shared start and end) and its draw. A missing one keeps the default.
struct EffectBehaviour
{
int variant = -1;
void (*init)(Entity_Effect&) = nullptr;
EffectUpdateEnd (*update)(Entity_Effect&) = nullptr;
void (*render)(Entity_Effect&, const Vector&) = nullptr;
};
// An update that always goes on to Update's shared end.
template <void (*UPDATE)(Entity_Effect&)> EffectUpdateEnd effect_finishing(Entity_Effect& effect)
{
UPDATE(effect);
return EFFECT_UPDATE_FINISH;
}
// The effect variants several files name (Lua's EffectVariant).
enum EffectVariant : int
{
@@ -24,7 +44,9 @@ enum EffectVariant : int
EFFECT_FLY_EXPLOSION = 3,
EFFECT_ROCK_PARTICLE = 4,
EFFECT_BLOOD_PARTICLE = 5,
EFFECT_DEVIL = 6,
EFFECT_BLOOD_SPLAT = 7,
EFFECT_ANGEL = 9,
EFFECT_BULLET_POOF = 11,
EFFECT_TEAR_POOF_A = 12,
EFFECT_TEAR_POOF_B = 13,
@@ -33,6 +55,7 @@ enum EffectVariant : int
EFFECT_TINY_BUG = 21,
EFFECT_CREEP_RED = 22,
EFFECT_CREEP_GREEN = 23,
EFFECT_CREEP_YELLOW = 24,
EFFECT_CREEP_WHITE = 25,
EFFECT_CREEP_BLACK = 26,
EFFECT_WOOD_PARTICLE = 27,
@@ -45,17 +68,25 @@ enum EffectVariant : int
EFFECT_POOP_EXPLOSION = 43,
EFFECT_PLAYER_CREEP_RED = 46,
EFFECT_HEART = 49,
EFFECT_LASER_IMPACT = 50,
EFFECT_HOT_BOMB_FIRE = 51,
EFFECT_PLAYER_CREEP_GREEN = 53,
EFFECT_CREEP_BROWN = 56,
EFFECT_PULLING_EFFECT = 57,
EFFECT_POOP_PARTICLE = 58,
EFFECT_DUST_CLOUD = 59,
EFFECT_SHOCKWAVE = 61,
EFFECT_ROCK_EXPLOSION = 62,
EFFECT_WORM = 63,
EFFECT_BEETLE = 64,
EFFECT_WISP = 65,
EFFECT_EMBER_PARTICLE = 66,
EFFECT_SHOCKWAVE_DIRECTIONAL = 67,
EFFECT_WALL_BUG = 68,
EFFECT_BLOOD_DROP = 70,
EFFECT_BRIMSTONE_SWIRL = 71,
EFFECT_CRACKWAVE = 72,
EFFECT_SHOCKWAVE_RANDOM = 73,
EFFECT_ISAACS_CARPET = 74,
EFFECT_DICE_FLOOR = 76,
EFFECT_TEAR_POOF_SMALL = 79,
@@ -65,31 +96,47 @@ enum EffectVariant : int
EFFECT_PENTAGRAM_BLACKPOWDER = 93,
EFFECT_CREEP_SLIPPERY_BROWN = 94,
EFFECT_WATER_SPLASH = 99,
EFFECT_ENEMY_BRIMSTONE_SWIRL = 110,
EFFECT_HAEMO_TRAIL = 111,
EFFECT_HALLOWED_GROUND = 112,
EFFECT_BRIMSTONE_BALL = 113,
EFFECT_FORGOTTEN_CHAIN = 114,
EFFECT_BROKEN_SHOVEL_SHADOW = 115,
EFFECT_FORGOTTEN_SOUL = 117,
EFFECT_DIRT_PATCH = 116,
EFFECT_SMALL_ROCKET = 118,
EFFECT_SPAWNER = 120,
EFFECT_LIGHT = 121,
EFFECT_BIG_HORN_HOLE_HELPER = 122,
EFFECT_TAR_BUBBLE = 124,
EFFECT_BIG_HORN_HAND = 125,
EFFECT_TECH_DOT = 126,
EFFECT_BIG_SPLASH = 132,
EFFECT_PEDESTAL_RIPPLE = 134,
EFFECT_GRID_ENTITY_PROJECTILE_HELPER = 136,
EFFECT_BACKDROP_DECORATION = 140,
EFFECT_SMOKE_CLOUD = 141,
EFFECT_ENEMY_GHOST = 144,
EFFECT_ROCK_POOF = 145,
EFFECT_DIRT_PILE = 146,
EFFECT_FIRE_JET = 147,
EFFECT_DOOR_OUTLINE = 154,
EFFECT_CREEP_SLIPPERY_BROWN_GROWING = 155,
EFFECT_TALL_LADDER = 156,
EFFECT_TADPOLE = 158,
EFFECT_LIL_GHOST = 159,
EFFECT_COLOSTOMIA_PUDDLE = 168,
EFFECT_PORTAL_TELEPORT = 161,
EFFECT_ANIMA_CHAIN = 193
EFFECT_ANIMA_CHAIN = 193,
EFFECT_GENERIC_TRACER = 198
};
// Construction and destruction (005cd9f0, 005cd960) are the defaults, the extra data shared with its other holders.
// Field accessors (00435e60, 00435eb0, 004d7770, 005784c0, 0060ce20) are the public fields.
// An effect (Lua's EntityEffect): a visual or a hazard such as creep, a poof or a light beam, with its timeout, its
// fall, the per-variant data it keeps and the extra data some variants share.
// Init, Update and Render run the shared parts here and hand each variant to entity_effect_ambient.h (ambient and
// environment effects, creep) or entity_effect_combat.h (blood, gibs, poofs, explosions). Any other variant stops.
// Init, Update and Render run the shared parts here and hand each variant to its group's behaviour table (the ambient,
// hazard, floor and beam files) or to entity_effect_combat.h (blood, gibs, poofs, explosions). Any other variant stops.
struct Entity_Effect : Entity
{
@@ -143,3 +190,28 @@ struct Entity_Effect : Entity
static Entity_Effect* CreateLootPreview(void* lootlist, const Vector& pos, Entity* owner, Entity_Effect* effect);
void setup_loot_preview(void* lootQueue);
};
// The groups of variants Entity_Effect hands out by table (entity_effect_<group>.cpp).
std::span<const EffectBehaviour> ambient_effect_behaviours();
std::span<const EffectBehaviour> hazard_effect_behaviours();
std::span<const EffectBehaviour> floor_effect_behaviours();
std::span<const EffectBehaviour> beam_effect_behaviours();
// The frame the plain poofs share: the sprite turned by the effect's rotation (mirrored unless flipped), the effect
// gone once its animation ends.
EffectUpdateEnd effect_poof_update(Entity_Effect& effect);
// Sets a layer to draw additively (BlendMode::SetMode 2).
void layer_additive_set(LayerState& layer);
// The degrees of a full turn.
constexpr float DEGREES_PER_TURN = 360;
float angle_approach(float current, float target, float maxStep);
float lerp_clamped(float value, float inFirst, float inLast, float outFirst, float outLast);
// A color tinted, with no colorize or offset (Color::Reset and SetTint).
constexpr ColorMod tint_color_make(float red, float green, float blue, float alpha)
{
return {{red, green, blue, alpha}, {0, 0, 0, 0}, {0, 0, 0}};
}