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

+81
View File
@@ -2,6 +2,7 @@
#include "capsule.h"
#include "entity_effect.h"
#include "fx_layers.h"
#include "entity_player.h"
#include "game.h"
#include "npc_ai.h"
#include "npc_basement.h"
@@ -10,6 +11,7 @@
#include "sfx_manager.h"
#include <algorithm>
#include <array>
#include <cmath>
// The floor effects: splashes and ripples on the room's water, the tar's bubbles, the dirt piles and patches
// shovels and diggers leave, and the haemolacria trail's drops.
@@ -541,6 +543,84 @@ static void hole_helper_render(Entity_Effect& helper, const Vector& offset)
hole->isVisible = false;
}
// The Colostomia's puddle of poop: its bubbles rise within its BubbleGuide null (one frame in three while the null
// shows), and while it does it burns the grounded players standing on its drawn poop (Callus and Socks spare them) for
// 1, leaving them slippery with brown footprints. It ripples in time with the game and fades once its parent is gone.
constexpr float PUDDLE_GUIDE_ALPHA = 0.5f;
constexpr int PUDDLE_BUBBLE_ODDS = 3;
constexpr float PUDDLE_BUBBLE_SPREAD = 4;
constexpr float PUDDLE_SCREEN_SCALE = 0.65f;
constexpr float PUDDLE_TEXEL_ALPHA = 0.5f;
constexpr float PUDDLE_DAMAGE = 1;
constexpr int PUDDLE_HIT_COUNTDOWN = 30;
constexpr int PUDDLE_FADE_FRAMES = 15;
constexpr int PUDDLE_SORTING_Z = 2000;
constexpr std::string_view POOP_BUBBLE_SHEET = "gfx/effects/poop_bubble.png";
// Part of 005cdb20 (Init's case 168) The puddle lies on the floor over the creep and appears.
static void colostomia_puddle_init(Entity_Effect& puddle)
{
puddle.sortingLayer = SORTING_BACKGROUND;
puddle.renderZOffset = PUDDLE_SORTING_Z;
puddle.sprite.Play("Appear");
}
// A bubble of poop rising somewhere inside the puddle's guide.
static void colostomia_bubble(Entity_Effect& puddle, const NullFrame& guide)
{
Vector direction = random_direction();
Vector spot = vector_scale(direction, std::sqrt(random_unit()));
spot = vector_make(spot.x * guide.scale.x * PUDDLE_BUBBLE_SPREAD / PUDDLE_SCREEN_SCALE,
spot.y * guide.scale.y * PUDDLE_BUBBLE_SPREAD / PUDDLE_SCREEN_SCALE);
Entity* bubble = g_game->Spawn({.position = vector_add(puddle.pos, spot),
.type = ENTITY_EFFECT,
.variant = EFFECT_TAR_BUBBLE,
.seed = Random()});
bubble->parent = &puddle;
bubble->sprite.ReplaceSpritesheet(0, POOP_BUBBLE_SHEET);
bubble->sprite.LoadGraphics();
bubble->Update();
}
// Burns a grounded player standing on the puddle's drawn poop.
static void colostomia_player_burn(Entity_Effect& puddle, Entity_Player& player)
{
bool isGrounded = !player.isDead && player.entityCollisionClass != ENTCOLL_NONE &&
player.entityGridCollisionClass == GRIDCOLL_GROUND;
if (!isGrounded || player.HasTrinket(TRINKET_CALLUS) || player.HasCollectible(COLLECTIBLE_SOCKS)) return;
float distance = vector_length(vector_sub(player.pos, puddle.pos));
if (distance >= puddle.size * puddle.sprite.scale.x + player.size) return;
KColor texel = puddle.sprite.GetTexel({.renderPos = vector_scale(puddle.pos, PUDDLE_SCREEN_SCALE),
.sample = vector_scale(player.pos, PUDDLE_SCREEN_SCALE),
.alphaThreshold = PUDDLE_TEXEL_ALPHA,
.layerId = 0});
if (texel._alpha <= PUDDLE_TEXEL_ALPHA) return;
player.TakeDamage(PUDDLE_DAMAGE, DAMAGE_ACID, EntityRef(&puddle), PUDDLE_HIT_COUNTDOWN);
player.AddEntityFlags(FLAG_SLIPPERY_PHYSICS);
player.SetFootprintColor(texel, false);
}
// 005dc0ef (Update's case 168) The puddle idles once it has appeared, rippling with the game's frames, bubbles and
// burns while its guide shows, fades once its parent is gone, and disappears once dead.
static void colostomia_puddle_update(Entity_Effect& puddle)
{
const NullFrame* guide = puddle.sprite.GetNullFrame("BubbleGuide");
if (puddle.sprite.GetAnimation().starts_with("A") && puddle.sprite.IsFinished()) puddle.sprite.Play("Idle");
AnimationState& anim = puddle.sprite.animState;
if (anim.IsLoopingAnimation()) puddle.sprite.SetFrame((float)((int)g_game->frameCount % anim.GetAnimationLength()));
if (puddle.timeout < 0 && (!puddle.parent || puddle.parent->isDead)) puddle.timeout = PUDDLE_FADE_FRAMES;
if (guide && guide->color._tint[3] > PUDDLE_GUIDE_ALPHA)
{
if (random_below(PUDDLE_BUBBLE_ODDS) == 0) colostomia_bubble(puddle, *guide);
for (Entity_Player* player : g_game->playerManager.playerList) colostomia_player_burn(puddle, *player);
}
if (!puddle.isDead) return;
puddle.sprite.Play("Disappear");
if (puddle.sprite.IsFinished()) puddle.Remove();
}
constexpr auto FLOOR_BEHAVIOURS = std::to_array<EffectBehaviour>({
{EFFECT_WATER_SPLASH, water_splash_init, effect_finishing<water_splash_update>, nullptr},
{EFFECT_HAEMO_TRAIL, haemo_trail_init, effect_finishing<haemo_trail_update>, nullptr},
@@ -552,6 +632,7 @@ constexpr auto FLOOR_BEHAVIOURS = std::to_array<EffectBehaviour>({
{EFFECT_DIRT_PILE, dirt_pile_init, effect_finishing<dirt_pile_update>, nullptr},
{EFFECT_BIG_HORN_HOLE_HELPER, nullptr, effect_finishing<hole_helper_update>, hole_helper_render},
{EFFECT_BIG_HORN_HAND, big_horn_hand_init, big_horn_hand_update, nullptr},
{EFFECT_COLOSTOMIA_PUDDLE, colostomia_puddle_init, effect_finishing<colostomia_puddle_update>, nullptr},
});
std::span<const EffectBehaviour> floor_effect_behaviours()