Curation round 20: player update, costumes and render, Missing No., the last actives and cards, familiars, Pin, the Frail, Wormwood and the Heretic, Dross to Gehenna, effects and the devil room purchase, champion colours, the quit path, save fields, shared vector helpers

This commit is contained in:
shweet committed 2026-11-22 00:33:35 -05:00
1 parent ee863e70e6
commit 8dbeb1bc4a
168 files changed
+15682 -2399

No files matched your search

+46 -3
View File
@@ -1,6 +1,7 @@
#pragma once
#include "entity.h"
#include "sfx_manager.h"
#include <array>
#include <memory>
#include <span>
@@ -36,6 +37,14 @@ template <void (*UPDATE)(Entity_Effect&)> EffectUpdateEnd effect_finishing(Entit
return EFFECT_UPDATE_FINISH;
}
// Redemption's states: waiting while its player holds an item up, succeeded, failed.
enum RedemptionState
{
REDEMPTION_WAITING = 1,
REDEMPTION_SUCCESS,
REDEMPTION_FAIL
};
// The pulling effect's subtypes: the purple, the grey pulsing and the red pulsing champion's.
constexpr int PULLING_PURPLE = 0;
constexpr int PULLING_GREY = 1;
@@ -118,6 +127,7 @@ enum EffectVariant : int
EFFECT_SHOCKWAVE_RANDOM = 73,
EFFECT_ISAACS_CARPET = 74,
EFFECT_DICE_FLOOR = 76,
EFFECT_LARGE_BLOOD_EXPLOSION = 77,
EFFECT_PLAYER_CREEP_LEMON_PARTY = 78,
EFFECT_TEAR_POOF_SMALL = 79,
EFFECT_TEAR_POOF_VERYSMALL = 80,
@@ -226,6 +236,7 @@ enum EffectVariant : int
EFFECT_DOGMA_ORB = 172,
EFFECT_CRACKED_ORB_POOF = 173,
EFFECT_SHOP_SPIKES = 174,
EFFECT_ENEMY_SOUL = 179,
EFFECT_LAVA_SPAWNER = 181,
EFFECT_BIG_KNIFE = 182,
EFFECT_MOTHER_SHOCKWAVE = 183,
@@ -248,7 +259,8 @@ enum EffectVariant : int
// 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 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.
// hazard, floor, beam, item, portal, blast, soul, Mother and shot files, and a few the player's and weapons' files
// hold) or to entity_effect_combat.h (blood, gibs, poofs, explosions). Any other variant stops.
struct Entity_Effect : Entity
{
@@ -302,6 +314,17 @@ struct Entity_Effect : Entity
void setup_loot_preview(void* lootQueue);
};
// The most pickups a pickup ghost shows.
constexpr int PICKUP_GHOST_SLOTS = 4;
// Construction and destruction (005d2300, 005d23a0) are the defaults.
// The pickups a pickup ghost (Guppy's Eye's look into a chest) shows, which setup_loot_preview fills.
struct PickupGhostData : Entity_Effect::ExtraData
{
std::array<ANM2, PICKUP_GHOST_SLOTS> sprites;
int count = 0;
};
// 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();
@@ -311,20 +334,40 @@ std::span<const EffectBehaviour> spike_effect_behaviours();
std::span<const EffectBehaviour> boss_effect_behaviours();
std::span<const EffectBehaviour> alt_effect_behaviours();
std::span<const EffectBehaviour> item_effect_behaviours();
std::span<const EffectBehaviour> portal_effect_behaviours();
std::span<const EffectBehaviour> blast_effect_behaviours();
std::span<const EffectBehaviour> soul_effect_behaviours();
std::span<const EffectBehaviour> mother_effect_behaviours();
std::span<const EffectBehaviour> shot_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).
// Plays a sound through the seeds' fart override (SoundEffects::PlayWithFartOverride).
void effect_sound_play(int sound, SoundPlay play = {});
// FUN_007ab0e0: whether a player is free to step into a light or a portal: no extra or item animation playing, unless
// carrying their twin.
bool is_player_free(Entity_Player& player);
// The tear flags an effect carries in its variant data.
TearFlags effect_tear_flags(const Entity_Effect& effect);
// FUN_0060dae0: whether the Siren may charm a familiar.
struct Entity_Familiar;
bool is_familiar_charmable(Entity_Familiar& familiar);
// Sets a layer to draw additively (BlendMode::SetMode 2), or normally (1).
void layer_additive_set(LayerState& layer);
void layer_normal_set(LayerState& layer);
// The degrees of a full turn.
constexpr float DEGREES_PER_TURN = 360;
float angle_wrapped(float angle);
float angle_approach(float current, float target, float maxStep);
void vector_lerp(Vector& v, Vector target, float t);
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)