Curation round 21: rock drops, Boss Rush and room setup, Dross, Ashpit and Gehenna enemies, Book of Virtues wisps and Dream Catcher, the last familiars and effects, player damage branches, a Corpse floor and Abyss crash fix, shared constants (186 duplicates)

This commit is contained in:
shweet committed 2026-11-22 11:00:43 -05:00
1 parent 8dbeb1bc4a
commit 6a11163842
184 files changed
+16980 -1419

No files matched your search

+63 -14
View File
@@ -42,8 +42,24 @@ constexpr int ENTITY_FEAR_IMMUNE = 205;
constexpr int ENTITY_NO_DECOY_TYPE = 213;
constexpr uint32_t DOPLE_PICK_SHIFT = 11;
constexpr int ENTITY_UNREACHABLE_EXEMPT = 886;
constexpr int ENTITY_DEATH_SPARK_TYPE = 882;
constexpr int ENTITY_DAMAGE_NUMBERS_TYPE = 964;
// G-Fuel's explosions: past 1.5 the big one, which shakes the screen for 40 frames, else one of two small ones for
// 20, their sound pitched 0.9 to 1.1.
constexpr float GFUEL_BIG_SCALE = 1.5f;
constexpr std::string_view GFUEL_BIG_EXPLOSION_ANM2 = "gfx/promo/gfuel/effects/explosion_big.anm2";
constexpr std::array<std::string_view, 2> GFUEL_EXPLOSION_ANM2S = {"gfx/promo/gfuel/effects/explosion.anm2",
"gfx/promo/gfuel/effects/explosion2.anm2"};
constexpr float GFUEL_BLAST_PITCH = 0.9f;
constexpr float GFUEL_BLAST_PITCH_RANGE = 0.2f;
constexpr int GFUEL_BIG_BLAST_SHAKE = 40;
constexpr int GFUEL_BLAST_SHAKE = 20;
// The Dust's death flash, colored bright, and its puff, small and dark.
constexpr float DUST_FLASH_COLORIZE = 5;
constexpr int DUST_PUFF_SUBTYPE = 1;
constexpr float DUST_PUFF_SCALE = 0.6f;
constexpr float DUST_DEATH_VOLUME = 0.8f;
constexpr int APPEAR_OVERLAY_KEPT_TYPE = 266;
constexpr float BIG_HORN_APPEAR_VOLUME = 2;
constexpr std::array<int, 4> APPEAR_EVENT_TYPES = {404, 912, 913, 917};
@@ -118,8 +134,6 @@ struct LineCorner
float y;
};
constexpr std::array<LineCorner, 4> LINE_CORNERS = {{{-5, -5}, {-5, 5}, {5, 5}, {5, -5}}};
constexpr int GRID_PATH_PIT = 3000;
constexpr uint32_t GRID_PATH_BAND = 1000;
constexpr float SHIELD_SECOND = 30;
constexpr float SHIELD_BASE = 0.09f;
constexpr float SHIELD_FALLOFF = 0.18f;
@@ -162,7 +176,6 @@ enum DeathBurst : int
EFFECT_BURST_818 = 145
};
constexpr int ENTITY_SIREN_HELPER = 966;
constexpr int ENTITY_SHADOW_CHARGER = 23;
constexpr int ENTITY_ULTRA_GREED_DOOR = 889;
constexpr int SUCKER_VARIANT_BULB = 5;
@@ -199,7 +212,6 @@ constexpr int ACHIEVEMENT_REDIRECTS = 348;
constexpr uint32_t ROOM_CONFIG_FLAG_NO_CHAMPIONS = 1 << 2;
constexpr int GRID_CELL = 40;
constexpr float GRID_TOP = 120;
constexpr float HALF = 0.5f;
constexpr int SHIELD_FRAMES_DEFAULT = 120;
constexpr uint32_t DEBUG_QUICK_KILL = 1 << 9;
constexpr int BOSS_ID_NONE_EXCLUDED_FIRST = 46;
@@ -1986,12 +1998,46 @@ void Entity_NPC::ResetColor()
if (type == ENTITY_FROZEN_ENEMY) sprite.color = FROZEN_COLOR;
}
// 006b9450 A G-Fuel explosion at a position: a big one (past 1.5) or one of the two small ones, with its sound and a
// screen shake.
Entity* gfuel_explosion_spawn(const Vector& position, float scale)
{
Entity* explosion = spawn_at(ENTITY_EFFECT, EFFECT_POOF01, 0, position, nullptr);
bool isBig = scale > GFUEL_BIG_SCALE;
uint32_t pick = Random();
explosion->sprite.Load(isBig ? GFUEL_BIG_EXPLOSION_ANM2 : GFUEL_EXPLOSION_ANM2S[pick & 1], GRAPHICS_LOAD);
npc_sound_play(isBig ? SOUND_GFUEL_EXPLOSION_BIG : SOUND_GFUEL_EXPLOSION, 1, 2,
random_unit() * GFUEL_BLAST_PITCH_RANGE + GFUEL_BLAST_PITCH);
game_shake_screen(isBig ? GFUEL_BIG_BLAST_SHAKE : GFUEL_BLAST_SHAKE);
explosion->sprite.Play(explosion->sprite.GetDefaultAnimationName(), PLAY_FORCED);
explosion->Update();
return explosion;
}
// The Dust's death: a bright crater flash, a small dark puff and its sounds.
static void dust_death_spawn(Entity_NPC& npc)
{
Entity* flash = spawn_at(ENTITY_EFFECT, EFFECT_BOMB_CRATER, 0, npc.pos, nullptr);
std::fill_n(flash->sprite.color._colorize, 3, DUST_FLASH_COLORIZE);
flash->sprite.color._colorize[3] = 1;
flash->Update();
Entity* puff = spawn_at(ENTITY_EFFECT, EFFECT_POOF02, DUST_PUFF_SUBTYPE, npc.pos, &npc);
puff->sprite.scale = vector_make(DUST_PUFF_SCALE, DUST_PUFF_SCALE);
puff->sprite.isFlipX = (Random() & 1) == 0;
puff->Update();
npc.PlaySound(SOUND_GOODEATH, 1, 2, false, 1);
npc.PlaySound(SOUND_BLACK_POOF, DUST_DEATH_VOLUME, 2, false, 1);
}
// 006d4e00 Bursts it: a blood explosion its size (or a fly's, a spider's, a poop's), in its splat color, from its
// sprite's middle.
// sprite's middle, or a G-Fuel explosion. The Dust also flashes.
void Entity_NPC::PlayDeathEffects()
{
if (g_game->playerManager.GetGFuelCount() > 0)
reconstruction_missing("Entity_NPC::PlayDeathEffects 006d4e00: G-Fuel's explosion");
{
gfuel_explosion_spawn(pos, 1);
return;
}
Vector offset{};
const AnimationFrame* frame = sprite.animState.animData && (type != ENTITY_SCOURGE || variant != 10)
@@ -2016,8 +2062,7 @@ void Entity_NPC::PlayDeathEffects()
Entity* burstEffect = spawn_at(ENTITY_EFFECT, burst, 0, vector_add(pos, offset), nullptr);
burstEffect->SetColor(splatColor, -1, COLOR_PRIORITY_DEFAULT, false, true);
}
if (type == ENTITY_DEATH_SPARK_TYPE)
reconstruction_missing("Entity_NPC::PlayDeathEffects 006d4e00: the electric enemy's sparks");
if (type == ENTITY_DUST) dust_death_spawn(*this);
}
// Part of 006d4e00: the burst effect a dead NPC leaves: a poop's, a fly's, a spider's, a few special ones, else
@@ -2216,7 +2261,6 @@ constexpr ShotTurn SHOT_16 = {0.961f, 0.276f, 1};
constexpr ShotTurn SHOT_16_SLOW = {0.961f, 0.276f, 0.9f};
constexpr ShotTurn SHOT_24 = {0.914f, 0.407f, 1};
constexpr ShotTurn SHOT_24_SLOW = {0.914f, 0.407f, 0.9f};
constexpr float DIAGONAL = 0.70710677f;
constexpr float PROJECTILE_DEFAULT_FALL_SPEED = -3;
constexpr float PROJECTILE_DEFAULT_FALL_ACCEL = 0.1f;
constexpr float PROJECTILE_HEIGHT_LOW = -50;
@@ -2603,7 +2647,7 @@ void Entity_NPC::trigger_kill_item_effects()
kill_items_trigger();
g_game->room->isFirstEnemyDead = true;
// Room::record_killed_npc 00820d30 waits for Room to hold the list of killed enemies, which nothing reads yet.
room_killed_npc_record(*g_game->room, *this);
entityRef = nullptr;
aimTargetEffect = nullptr;
if (HasEntityFlags(FLAG_BRIMSTONE_MARKED) && HasEntityFlags(FLAG_EXTRA_GORE)) marked_status_spread();
@@ -2873,10 +2917,15 @@ bool Entity_NPC::CanReroll()
return !IsBoss() && !config->isBoss;
}
// 006d88b0
void Entity_NPC::TransferControl(Entity_NPC*)
// 006d88b0 Hands its controller to another NPC (none to drop it): the players steering it steer that one instead.
void Entity_NPC::TransferControl(Entity_NPC* target)
{
reconstruction_missing("Entity_NPC::TransferControl 006d88b0");
if (target == this) return;
if (controllerID != -1)
for (Entity_Player* player : g_game->playerManager.extraPlayers)
if (player->controllerIndex == controllerID && player->target.get() == this) player->target = target;
if (target) target->controllerID = controllerID;
controllerID = -1;
}
// 006d8b20 The aim target a controlled NPC steers. Without a controller and none shown yet, there is nothing to do.