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:
1 parent
ee863e70e6
commit
8dbeb1bc4a
168 files changed
+15682
-2399
No files matched your search
@@ -182,9 +182,9 @@ static void shockwave_update(Entity_Effect& wave)
|
||||
{
|
||||
if (wave.state < wave.timeout) wave.state = wave.timeout;
|
||||
float timeout = (float)wave.timeout;
|
||||
float radius = lerp_clamped(timeout, (float)wave.state, 0, wave.minRadius, wave.maxRadius);
|
||||
float arc = lerp_clamped(timeout * timeout, (float)(wave.state * wave.state), 0, SHOCKWAVE_ARC_WIDEST,
|
||||
SHOCKWAVE_ARC_NARROWEST);
|
||||
float radius = lerp_range(timeout, {(float)wave.state, 0, wave.minRadius, wave.maxRadius});
|
||||
float arc = lerp_range(timeout * timeout,
|
||||
{(float)(wave.state * wave.state), 0, SHOCKWAVE_ARC_WIDEST, SHOCKWAVE_ARC_NARROWEST});
|
||||
|
||||
if (wave.timeout % SHOCKWAVE_PERIOD == 0)
|
||||
{
|
||||
@@ -250,8 +250,8 @@ static float crackwave_wobble(Entity_Effect& wave, int frame)
|
||||
{
|
||||
Vector cell = g_game->room->GetGridPosition(wave.state);
|
||||
distance = vector_length(vector_sub(cell, wave.targetPosition));
|
||||
float turn = lerp_clamped(distance, CRACKWAVE_HOMING_NEAR, CRACKWAVE_HOMING_FAR,
|
||||
CRACKWAVE_HOMING_TURN_NEAR, CRACKWAVE_HOMING_TURN_FAR);
|
||||
float turn = lerp_range(distance, {CRACKWAVE_HOMING_NEAR, CRACKWAVE_HOMING_FAR,
|
||||
CRACKWAVE_HOMING_TURN_NEAR, CRACKWAVE_HOMING_TURN_FAR});
|
||||
wave.rotation =
|
||||
angle_approach(wave.rotation, vector_angle(vector_sub(cell, wave.targetPosition)), turn);
|
||||
if (room_grid_collision_at(cell) == 0 || wave.FrameCount() > CRACKWAVE_HOMING_FRAMES)
|
||||
@@ -259,7 +259,7 @@ static float crackwave_wobble(Entity_Effect& wave, int frame)
|
||||
}
|
||||
if (wave.FrameCount() <= CRACKWAVE_START_FRAMES) return 0;
|
||||
float wobble = random_unit() - 0.5f;
|
||||
return lerp_clamped(distance, CRACKWAVE_HOMING_NEAR, CRACKWAVE_HOMING_FAR, 0, 1) * CRACKWAVE_WOBBLE_SPAN *
|
||||
return lerp_range(distance, {CRACKWAVE_HOMING_NEAR, CRACKWAVE_HOMING_FAR, 0, 1}) * CRACKWAVE_WOBBLE_SPAN *
|
||||
wobble;
|
||||
}
|
||||
default: return 0;
|
||||
@@ -423,6 +423,73 @@ static void statue_update(Entity_Effect& statue)
|
||||
npc_sound_play(SOUND_ISAACDIES, 1, 2, player ? player->get_voice_pitch() : 1);
|
||||
}
|
||||
|
||||
// The fissure spawner (Ashpit) ripples the floor every 10 ticks and, every 150 frames over one more than its subtype's
|
||||
// third nibble, sends a fissure out at its first nibble's sixteenth of a turn, its second nibble's tenth plus one
|
||||
// tenth of 3 a frame. It goes once the room is clear (and its pressure plates done, or not about to).
|
||||
constexpr int FISSURE_RIPPLE_TICKS = 10;
|
||||
constexpr int FISSURE_PERIOD = 150;
|
||||
constexpr float FISSURE_TURNS = 16;
|
||||
constexpr float FISSURE_SPEED_STEP = 0.1f;
|
||||
constexpr float FISSURE_SPEED = 3;
|
||||
constexpr int FISSURE_PLATES_DELAY = 9;
|
||||
constexpr int NIBBLE_BITS = 4;
|
||||
constexpr uint32_t NIBBLE_MASK = 0xf;
|
||||
|
||||
// Part of 005cdb20 (Init's case 192) The fissure spawner is unseen.
|
||||
static void fissure_spawner_init(Entity_Effect& spawner)
|
||||
{
|
||||
spawner.isVisible = false;
|
||||
}
|
||||
|
||||
// Whether the fissure spawner's room is done: no enemies alive after its first frame and no pressure plates still
|
||||
// due to trigger.
|
||||
static bool is_fissure_room_done()
|
||||
{
|
||||
Room& room = *g_game->room;
|
||||
if (room.GetFrameCount() <= 1 || room.GetAliveEnemiesCount() > 0) return false;
|
||||
return !room.isTriggerPressurePlates || room.roomClearDelay < FISSURE_PLATES_DELAY;
|
||||
}
|
||||
|
||||
// A fissure from the spawner, on its way out at its aim (kept as its target position).
|
||||
static void fissure_send(Entity_Effect& spawner, Vector aim)
|
||||
{
|
||||
uint32_t seed = Random();
|
||||
Entity* fissure = g_game->Spawn(
|
||||
{.position = spawner.pos, .velocity = vector_scale(aim, FISSURE_SPEED), .type = ENTITY_FISSURE, .seed = seed});
|
||||
fissure->AddEntityFlags(FLAG_NO_REWARD);
|
||||
fissure->ClearEntityFlags(FLAG_APPEAR);
|
||||
fissure->targetPosition = aim;
|
||||
fissure->Update();
|
||||
}
|
||||
|
||||
// 005e5ace (Update's case 192) The fissure spawner ripples the floor and sends fissures out on its beat, and goes
|
||||
// (without Update's shared end) once its room is done.
|
||||
static EffectUpdateEnd fissure_spawner_update(Entity_Effect& spawner)
|
||||
{
|
||||
uint32_t subtype = (uint32_t)spawner.subtype;
|
||||
int period = FISSURE_PERIOD / (int)(((subtype >> (NIBBLE_BITS * 2)) & NIBBLE_MASK) + 1);
|
||||
if (spawner.GetIntervalTicks(FISSURE_RIPPLE_TICKS, 0) != 0)
|
||||
g_game
|
||||
->Spawn({.position = spawner.pos, .type = ENTITY_EFFECT, .variant = EFFECT_WATER_RIPPLE, .seed = Random()})
|
||||
->Update();
|
||||
if (is_fissure_room_done())
|
||||
{
|
||||
spawner.Remove();
|
||||
return EFFECT_UPDATE_RETURN;
|
||||
}
|
||||
|
||||
int ticks = spawner.update_ticks_get();
|
||||
for (int i = 0; i < ticks; i++)
|
||||
{
|
||||
if (++spawner.state < period) continue;
|
||||
spawner.state = 0;
|
||||
float angle = (float)(subtype & NIBBLE_MASK) * DEGREES_PER_TURN / FISSURE_TURNS;
|
||||
float speed = (float)((subtype >> NIBBLE_BITS) & NIBBLE_MASK) * FISSURE_SPEED_STEP + FISSURE_SPEED_STEP;
|
||||
fissure_send(spawner, vector_scale(vector_from_angle(angle), speed));
|
||||
}
|
||||
return EFFECT_UPDATE_FINISH;
|
||||
}
|
||||
|
||||
constexpr auto HAZARD_BEHAVIOURS = std::to_array<EffectBehaviour>({
|
||||
{EFFECT_DEVIL, nullptr, effect_finishing<statue_update>, nullptr},
|
||||
{EFFECT_ANGEL, nullptr, effect_finishing<statue_update>, nullptr},
|
||||
@@ -432,6 +499,7 @@ constexpr auto HAZARD_BEHAVIOURS = std::to_array<EffectBehaviour>({
|
||||
{EFFECT_CRACKWAVE, crackwave_init, effect_finishing<crackwave_update>, nullptr},
|
||||
{EFFECT_SHOCKWAVE_RANDOM, shockwave_random_init, effect_finishing<shockwave_random_update>, nullptr},
|
||||
{EFFECT_HALLOWED_GROUND, hallowed_ground_init, hallowed_ground_update, nullptr},
|
||||
{EFFECT_FISSURE_SPAWNER, fissure_spawner_init, fissure_spawner_update, nullptr},
|
||||
});
|
||||
|
||||
std::span<const EffectBehaviour> hazard_effect_behaviours()
|
||||
|
||||
Reference in new issue
Block a user