Curation round 23 (code only): the Mods menu and HUD pieces, Dogma and the Beast, Visage, Hornfel and other bosses, enemies and Entity_NPC branches, player revivals and missing methods, the player's frame, familiars, lasers, weapons and bombs, shared constants folded (115 duplicates, 385 gaps)
This commit is contained in:
1 parent
b9405bfb31
commit
11c71fe041
208 files changed
+20487
-5741
No files matched your search
+41
-9
@@ -19,6 +19,8 @@
|
||||
#include "platform.h"
|
||||
#include "room.h"
|
||||
#include "room_render.h"
|
||||
#include "seeds.h"
|
||||
#include "entity_npc.h"
|
||||
#include "sfx_manager.h"
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
@@ -32,6 +34,12 @@ constexpr int ENTITY_SINS_FIRST = 46;
|
||||
constexpr int ENTITY_SINS_LAST = 52;
|
||||
constexpr int ENTITY_IGNORED_BY_TEARS = 291;
|
||||
constexpr int ENTITY_REFLECTING_ENEMY = 822;
|
||||
constexpr uint32_t REFLECT_ODDS = 5;
|
||||
constexpr uint32_t DELIRIUM_RAGE_MAX = 255;
|
||||
constexpr float TOOTH_CHIP_SPEED = 2;
|
||||
constexpr float TOOTH_CHIP_SPEED_RANGE = 3;
|
||||
// A black tooth's chips are its colour darkened to three tenths.
|
||||
constexpr ColorMod BLACK_TOOTH_SHADE = {{0.3f, 0.3f, 0.3f, 1}, {0, 0, 0, 0}, {0, 0, 0}};
|
||||
constexpr int ENTITY_SHIELDED_SPAWN = 832;
|
||||
constexpr int ENTITY_SHIELDED_PART = 889;
|
||||
constexpr int ENTITY_FACING_SHIELD = 903;
|
||||
@@ -81,8 +89,6 @@ constexpr uint32_t FROZEN_SHARD_EXTRA = 3;
|
||||
constexpr float FROZEN_SHARD_SPEED = 5;
|
||||
|
||||
// The sounds the combat code plays (Lua's SoundEffect).
|
||||
constexpr int SOUND_DEATH_BURST_BONE = 27;
|
||||
constexpr int SOUND_CHAIN_BREAK = 504;
|
||||
constexpr int BISHOP_HIT_DELAY = 10;
|
||||
constexpr float SOUND_LARGE_VOLUME = 1.25f;
|
||||
constexpr float SOUND_BABY_VOLUME = 1.8f;
|
||||
@@ -175,6 +181,7 @@ constexpr float DROP_SPIN_RANGE = 10;
|
||||
constexpr float DROP_ALPHA_MIN = 0.1f;
|
||||
constexpr float DROP_ALPHA_RANGE = 0.25f;
|
||||
constexpr float HUGE_GIB_SCALE_MIN = 2;
|
||||
constexpr float HUGE_GIB_THROW = 10;
|
||||
constexpr float HUGE_DROP_SCALE_RANGE = 2;
|
||||
constexpr float HUGE_DROP_SPEED = 4;
|
||||
constexpr int BURST_DROPS_MIN_GIBS = 6;
|
||||
@@ -641,7 +648,7 @@ void gibs_spawn(const GibSpawn& gibs)
|
||||
if (gibs.gibFlags & GIB_FLAG_HUGE)
|
||||
{
|
||||
if (g_game->room->IsBeastDungeon())
|
||||
reconstruction_missing("spawn_gibs 006b31b0: the Beast's huge gibs thrown up");
|
||||
gib->velocity.y += (-HUGE_GIB_THROW - random_unit() * HUGE_GIB_THROW) * gib->speedMultiplier;
|
||||
float scale = random_unit() + HUGE_GIB_SCALE_MIN;
|
||||
gib->AddEntityFlags(FLAG_EXTRA_GORE);
|
||||
gib->sprite.scale = vector_make(scale, scale);
|
||||
@@ -742,12 +749,18 @@ static TearContact tear_tear_contact(Entity_Tear& tear, Entity_Tear& other)
|
||||
}
|
||||
|
||||
// Part of 00673660: a Chaos Card kills any enemy it touches outright, passing the props and Dogma's and the Beast's
|
||||
// bodies.
|
||||
// bodies. Delirium only flies into a long rage, the card gone. The original also clears the top bits of his form's
|
||||
// age, which this reconstruction does not keep.
|
||||
static TearContact chaos_card_contact(Entity_Tear& tear, Entity& collider)
|
||||
{
|
||||
if (collider.type == ENTITY_GENERIC_PROP) return TEAR_CONTACT_PASS;
|
||||
if ((collider.type == ENTITY_DOGMA || collider.type == ENTITY_BEAST) && collider.variant == 0) return TEAR_CONTACT_PASS;
|
||||
if (collider.type == ENTITY_DELIRIUM) reconstruction_missing("Entity_Tear::HandleCollision 00673660: a Chaos Card hitting Delirium");
|
||||
if (collider.type == ENTITY_DELIRIUM)
|
||||
{
|
||||
tear.Remove();
|
||||
static_cast<Entity_NPC&>(collider).deliriumRageTimer = DELIRIUM_RAGE_MAX;
|
||||
return TEAR_CONTACT_PASS;
|
||||
}
|
||||
if (!collider.IsEnemy()) return TEAR_CONTACT_HIT;
|
||||
|
||||
collider.Kill(EntityRef(&tear));
|
||||
@@ -806,8 +819,18 @@ static TearContact tear_contact_get(Entity_Tear& tear, Entity& collider, Entity*
|
||||
}
|
||||
return TEAR_CONTACT_PASS;
|
||||
}
|
||||
if (!isExplosive && collider.type == ENTITY_REFLECTING_ENEMY)
|
||||
reconstruction_missing("Entity_Tear::HandleCollision 00673660: an enemy reflecting tears");
|
||||
if (!isExplosive && collider.type == ENTITY_REFLECTING_ENEMY &&
|
||||
static_cast<Entity_NPC&>(collider).state == NPC_STATE_SPECIAL)
|
||||
{
|
||||
RNG rng = rng_make(collider.initSeed + tear.initSeed, DEFAULT_SHIFT_INDEX);
|
||||
if (rng.RandomInt(REFLECT_ODDS) == 0)
|
||||
{
|
||||
Vector normal = vector_normalized(vector_sub(tear.pos, collider.pos));
|
||||
float along = vector_dot(normal, tear.velocity);
|
||||
if (along < 0) tear.velocity = vector_sub(tear.velocity, vector_scale(normal, along + along));
|
||||
return TEAR_CONTACT_PASS;
|
||||
}
|
||||
}
|
||||
|
||||
if (collider.type == ENTITY_PROJECTILE)
|
||||
{
|
||||
@@ -861,7 +884,7 @@ static void dead_eye_charge(Entity_Tear& tear, Entity& collider)
|
||||
}
|
||||
|
||||
// Part of 00673660: what a hit does beside its damage: a burning tear may turn explosive by luck, a piercing or
|
||||
// lasting tear pushes what it passes, and flies are knocked along.
|
||||
// lasting tear pushes what it passes, a tooth Ludovico chips teeth off a vulnerable enemy, and flies are knocked along.
|
||||
static void tear_hit_push(Entity_Tear& tear, Entity& collider, Entity* owner)
|
||||
{
|
||||
if (tear.tearFlags[TEAR_BURN] && collider.type != ENTITY_FIREPLACE)
|
||||
@@ -873,7 +896,16 @@ static void tear_hit_push(Entity_Tear& tear, Entity& collider, Entity* owner)
|
||||
}
|
||||
if ((tear.variant == TEAR_TOOTH || tear.variant == TEAR_BLACK_TOOTH) && tear.tearFlags[TEAR_LUDOVICO] &&
|
||||
collider.IsVulnerableEnemy(nullptr))
|
||||
reconstruction_missing("Entity_Tear::HandleCollision 00673660: a tooth Ludovico's particles");
|
||||
{
|
||||
ColorMod color = tear.sprite.color;
|
||||
if (tear.variant == TEAR_BLACK_TOOTH) color_multiply(color, BLACK_TOOTH_SHADE);
|
||||
game_particles_spawn({.color = color,
|
||||
.position = tear.pos,
|
||||
.height = tear.height,
|
||||
.speed = random_between(TOOTH_CHIP_SPEED, TOOTH_CHIP_SPEED_RANGE),
|
||||
.count = 1,
|
||||
.variant = EFFECT_TOOTH_PARTICLE});
|
||||
}
|
||||
|
||||
bool isPassing = tear.tearFlags[TEAR_PIERCING] || tear.tearFlags[TEAR_PERSISTENT];
|
||||
if ((isPassing || tear.tearFlags[TEAR_FETUS_FLAG]) && !collider.HasEntityFlags(FLAG_NO_PHYSICS_KNOCKBACK))
|
||||
|
||||
Reference in new issue
Block a user