Curation round 17: Theora and Vorbis cutscene videos, Ludovico, Epic and Dr. Fetus, Tractor Beam and Eye of the Occult, familiars and blue spiders, fortune teller and restock, the Bag of Crafting and four tainted characters, ten enemies, water and the ultra secret door, Isaac, ???, the Lamb and Hush
This commit is contained in:
1 parent
e9de039d0f
commit
024cb12016
133 files changed
+13325
-2520
No files matched your search
+110
-22
@@ -1,6 +1,7 @@
|
||||
#include "entity_npc.h"
|
||||
#include "boss_ai.h"
|
||||
#include "boss_death.h"
|
||||
#include "entity_bomb.h"
|
||||
#include "entity_config.h"
|
||||
#include "entity_effect.h"
|
||||
#include "entity_familiar.h"
|
||||
@@ -42,15 +43,34 @@ constexpr int APPEAR_OVERLAY_KEPT_TYPE = 266;
|
||||
constexpr int APPEAR_SOUND_TYPE_A = 401;
|
||||
constexpr int APPEAR_SOUND_TYPE_B = 403;
|
||||
constexpr std::array<int, 4> APPEAR_EVENT_TYPES = {404, 912, 913, 917};
|
||||
constexpr std::array<int, 8> DEATH_EVENT_TYPES = {102, 900, 907, 908, 912, 913, 915, 921};
|
||||
constexpr std::array<int, 9> FLUSH_TYPES = {217, 220, 223, 261, 402, 870, 871, 872, 914};
|
||||
constexpr int FLUSH_PROP_TYPE = 237;
|
||||
constexpr int FLUSH_PROP_VARIANT = 2;
|
||||
constexpr int FLUSH_RENDER_Z = 5000;
|
||||
|
||||
// The bosses' death events: Isaac's cry, Baby Plum's last ring, Singe's blast, Mother's slam and Clutch's explosions.
|
||||
constexpr int ISAAC_DEATH_CRY_FRAME = 17;
|
||||
constexpr float ISAAC_DEATH_CRY_VOLUME = 2;
|
||||
constexpr float PLUM_RING_FALL = 0.099f;
|
||||
constexpr float PLUM_RING_SPEED = 6;
|
||||
constexpr float PLUM_RING_SHOTS = 10;
|
||||
constexpr float SINGE_BLAST_DAMAGE = 80;
|
||||
constexpr float SINGE_BLAST_REACH = 1.5f;
|
||||
constexpr int MOTHER_SLAM_VARIANT = 10;
|
||||
constexpr int MOTHER_SLAM_SHAKE = 20;
|
||||
constexpr float MOTHER_SLAM_PITCH = 0.5f;
|
||||
constexpr int CLUTCH_BLAST_SUBTYPE = 3;
|
||||
constexpr float CLUTCH_BLAST_RAISE = -20;
|
||||
constexpr float CLUTCH_BLAST_SCALE = 1.5f;
|
||||
constexpr float CLUTCH_BLAST_DAMAGE = 80;
|
||||
constexpr float CLUTCH_BLAST_VOLUME = 1.25f;
|
||||
constexpr float CLUTCH_PITCH = 0.9f;
|
||||
constexpr float CLUTCH_PITCH_SPREAD = 0.2f;
|
||||
constexpr int CLUTCH_BLAST_SHAKE = 14;
|
||||
constexpr float CLUTCH_BLAST_SPIN = 360;
|
||||
constexpr int ENTITY_FORWARD_NONE = 45;
|
||||
constexpr int ENTITY_FORWARD_DOWN_A = 262;
|
||||
constexpr int ENTITY_FORWARD_DOWN_B = 263;
|
||||
constexpr int DEATH_HEAD_LAYER_TYPE = 405;
|
||||
constexpr int DEATH_NO_BURST_FIRST = 74;
|
||||
constexpr int DEATH_NO_BURST_LAST = 76;
|
||||
constexpr int MULLIGAN_VARIANT_FLEEING = 2;
|
||||
@@ -459,14 +479,25 @@ static int line_cell_collision(Room& room, int column, int row)
|
||||
return path >= GRID_PATH_SOLID ? COLLISION_SOLID : COLLISION_NONE;
|
||||
}
|
||||
|
||||
// Whether a blast stops at a cell: walls (but an unlocked lock or a door) and solid blocks.
|
||||
static bool line_cell_is_blast_wall(Room& room, int cellIndex)
|
||||
{
|
||||
uint32_t collision = room.GetGridCollision(cellIndex);
|
||||
bool isKnown = cellIndex >= 0 && cellIndex < ROOM_GRID_CELLS;
|
||||
GridEntity* grid = isKnown ? room.gridEntities[cellIndex] : nullptr;
|
||||
if (collision == COLLISION_NONE) return false;
|
||||
if (!grid) return collision == COLLISION_WALL;
|
||||
if (grid->type == GRID_ROCKB) return true;
|
||||
if (grid->type == GRID_LOCK && g_game->playerManager.AnyoneHasTrinket(TRINKET_BROKEN_PADLOCK)) return false;
|
||||
return grid->type != GRID_DOOR && collision == COLLISION_WALL;
|
||||
}
|
||||
|
||||
// 007f0df0 Whether a line from start to end is clear, walked in steps of 10: mode 0 checks a 10 wide band for grid
|
||||
// collision and for more than 8 cells walked past their grid path threshold, mode 1 the same on the line's own cells,
|
||||
// mode 3 the band for shots (which fly over pits). The other modes, crushable rocks and the stop position are left
|
||||
// to come.
|
||||
// mode 2 the line's own cells for what stops a blast, mode 3 the band for shots (which fly over pits). Crushable
|
||||
// rocks and the stop position are left to come.
|
||||
bool room_check_line(const Vector& start, const Vector& end, int mode, int gridPathThreshold)
|
||||
{
|
||||
if (mode != LINE_MODE_GROUND && mode != LINE_MODE_CELL && mode != LINE_MODE_PROJECTILE)
|
||||
reconstruction_missing("Room::CheckLine 007f0df0: the single cell modes");
|
||||
|
||||
Room& room = *g_game->room;
|
||||
Vector step = vector_sub(start, end);
|
||||
@@ -488,6 +519,15 @@ bool room_check_line(const Vector& start, const Vector& end, int mode, int gridP
|
||||
for (float walked = 0; walked < length; walked += LINE_STEP)
|
||||
{
|
||||
at = vector_sub(at, step);
|
||||
if (mode == LINE_MODE_EXPLOSION)
|
||||
{
|
||||
int column = cellOf(at.x, GRID_CELL);
|
||||
int row = cellOf(at.y, GRID_TOP);
|
||||
bool isInside = column >= 0 && column < room.gridWidth && row >= 0 && row < room.gridHeight;
|
||||
int cellIndex = isInside ? row * room.gridWidth + column : -1;
|
||||
if (line_cell_is_blast_wall(room, cellIndex)) return false;
|
||||
continue;
|
||||
}
|
||||
if (mode == LINE_MODE_CELL)
|
||||
{
|
||||
int column = cellOf(at.x, GRID_CELL);
|
||||
@@ -1489,6 +1529,66 @@ void Entity_NPC::appear_init()
|
||||
if (IsBoss() && !parent) game_encountered_boss_add(type, variant);
|
||||
}
|
||||
|
||||
// Rag Man keeps its head through its death only if the head shows on the frame it died on.
|
||||
static void death_head_layer_keep(ANM2& sprite)
|
||||
{
|
||||
LayerState* head = sprite.GetLayer("Head");
|
||||
if (!head) return;
|
||||
const AnimationFrame* frame = sprite.animState.GetLayerFrame(head->layerData ? head->layerData->id : -1);
|
||||
head->isVisible = frame && frame->isVisible;
|
||||
}
|
||||
|
||||
// Part of 006c4b30: what the bosses with death events do as they die: Isaac's cry, Baby Plum's spit and last ring,
|
||||
// Reap Creep losing its overlay, Singe's blast, Mother's slam, Clutch's explosions and Gideon's own.
|
||||
static void death_events_update(Entity_NPC& npc)
|
||||
{
|
||||
switch (npc.type)
|
||||
{
|
||||
case ENTITY_ISAAC:
|
||||
if (npc.variant != ISAAC_FORM_HUSH && npc.stateFrame == ISAAC_DEATH_CRY_FRAME)
|
||||
npc.PlaySound(SOUND_SUPERHOLY, ISAAC_DEATH_CRY_VOLUME, 2, false, 1);
|
||||
return;
|
||||
case ENTITY_BABY_PLUM:
|
||||
{
|
||||
if (npc.sprite.IsEventTriggered("Shoot")) npc_sound_play(SOUND_MEAT_JUMPS, 1, 2, 1);
|
||||
if (!npc.sprite.IsFinished() || !npc.isDead) return;
|
||||
ProjectileParams params;
|
||||
params.fallingAccelModifier -= PLUM_RING_FALL;
|
||||
return npc.FireProjectiles(npc.pos, vector_make(PLUM_RING_SPEED, PLUM_RING_SHOTS), PROJECTILES_RING, params);
|
||||
}
|
||||
case ENTITY_GIDEON:
|
||||
return NpcHelper::gideon_update_death(&npc);
|
||||
case ENTITY_REAP_CREEP:
|
||||
if (npc.sprite.overlayAnimState.animData) npc.sprite.RemoveOverlay();
|
||||
return;
|
||||
case ENTITY_SINGE:
|
||||
if (npc.sprite.IsFinished() && npc.isDead)
|
||||
explosion_effects({.position = npc.pos, .source = &npc, .damage = SINGE_BLAST_DAMAGE,
|
||||
.radiusMultiplier = SINGE_BLAST_REACH});
|
||||
return;
|
||||
case ENTITY_MIN_MIN:
|
||||
if (npc.sprite.IsEventTriggered("Shoot") && npc.sprite.GetNullFrame("BloodGuide"))
|
||||
reconstruction_missing("Entity_NPC::Update 006c4b30: Min-Min's death bursts");
|
||||
return;
|
||||
case ENTITY_MOTHER:
|
||||
if (npc.variant != MOTHER_SLAM_VARIANT || !npc.sprite.IsEventTriggered("Shoot")) return;
|
||||
game_shake_screen(MOTHER_SLAM_SHAKE);
|
||||
return npc.PlaySound(SOUND_DEATH_REVERSE, 1, 2, false, MOTHER_SLAM_PITCH);
|
||||
case ENTITY_CLUTCH:
|
||||
{
|
||||
if (!npc.sprite.IsEventTriggered("Explosion")) return;
|
||||
Entity* blast = spawn_at(ENTITY_EFFECT, EFFECT_ENEMY_GHOST, CLUTCH_BLAST_SUBTYPE, npc.pos, nullptr);
|
||||
blast->posOffset = vector_make(0, CLUTCH_BLAST_RAISE);
|
||||
blast->sprite.rotation = random_unit() * CLUTCH_BLAST_SPIN;
|
||||
blast->sprite.scale = vector_make(CLUTCH_BLAST_SCALE, CLUTCH_BLAST_SCALE);
|
||||
blast->SetCollisionDamage(CLUTCH_BLAST_DAMAGE);
|
||||
blast->Update();
|
||||
npc_sound_play(SOUND_DEMON_HIT, CLUTCH_BLAST_VOLUME, 2, random_unit() * CLUTCH_PITCH_SPREAD + CLUTCH_PITCH);
|
||||
return game_shake_screen(CLUTCH_BLAST_SHAKE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Part of 006c4b30: a boss or Chub dying through its death animations, which ends it (trigger_kill_item_effects).
|
||||
void Entity_NPC::death_animation_update()
|
||||
{
|
||||
@@ -1497,8 +1597,7 @@ void Entity_NPC::death_animation_update()
|
||||
friction *= APPEAR_FRICTION;
|
||||
if (stateFrame == 0) death_animation_start();
|
||||
stateFrame++;
|
||||
if (std::ranges::find(DEATH_EVENT_TYPES, type) != DEATH_EVENT_TYPES.end())
|
||||
reconstruction_missing("Entity_NPC::Update 006c4b30: a boss's death animation events");
|
||||
death_events_update(*this);
|
||||
|
||||
if (const NullFrame* bloodGuide = sprite.GetNullFrame("BloodGuide")) npc_blood_guide_update(*this, *bloodGuide);
|
||||
if (type == ENTITY_HUSH && sprite.IsEventTriggered("ash"))
|
||||
@@ -1526,8 +1625,9 @@ void Entity_NPC::death_animation_start()
|
||||
|
||||
if (sprite.GetAnimationData("Death"))
|
||||
{
|
||||
if (type == ENTITY_BIG_HORN || type == DEATH_HEAD_LAYER_TYPE)
|
||||
reconstruction_missing("Entity_NPC::Update 006c4b30: Big Horn's and its kin's death animations");
|
||||
if (type == ENTITY_BIG_HORN)
|
||||
return reconstruction_missing("Entity_NPC::Update 006c4b30: Big Horn's death animations");
|
||||
if (type == ENTITY_RAG_MAN) death_head_layer_keep(sprite);
|
||||
sprite.Play("Death");
|
||||
return;
|
||||
}
|
||||
@@ -2689,18 +2789,6 @@ void Entity_NPC::render_overlay(const Vector&, bool)
|
||||
reconstruction_missing("Entity_NPC::render_overlay 004e9b10");
|
||||
}
|
||||
|
||||
// 00548f30
|
||||
int Entity_NPC::FindTargetPit(const Vector&, const Vector&, uint32_t)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::FindTargetPit 00548f30");
|
||||
}
|
||||
|
||||
// 0055cef0
|
||||
Entity_NPC* Entity_NPC::ThrowStrider(const Vector&, Entity*, const Vector&)
|
||||
{
|
||||
reconstruction_missing("Entity_NPC::ThrowStrider 0055cef0");
|
||||
}
|
||||
|
||||
// 0059bed0
|
||||
void Entity_NPC::RenderSegmentLink(const Vector&, bool)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user