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

+10 -13
View File
@@ -184,10 +184,8 @@ constexpr float COLOR_CHANNEL_MAX = 255;
// One world unit is 0.65 screen pixels. A glowing stain sits on whole pixels.
constexpr float WORLD_PER_PIXEL = 1.5384616f;
constexpr float HALF = 0.5f;
// The tear poofs' quarter turns, the ripple's small sizes and the poofs' layers.
constexpr float RIGHT_ANGLE = 90;
constexpr float RIPPLE_TINY_SCALE = 0.5f;
constexpr float RIPPLE_SMALL_SCALE = 0.75f;
constexpr float RIPPLE_TINY_GROWTH = 2;
@@ -311,7 +309,6 @@ constexpr float WORM_TEAR_RANGE = 5;
constexpr float WORM_STILL_SPEED_SQUARED = 1;
constexpr float HALF_TURN = 180;
constexpr float FULL_TURN = 360;
constexpr float SPRITE_UP = 90;
static CombatEffect variant_get(const Entity_Effect& effect)
@@ -333,9 +330,9 @@ bool is_combat_effect(int variant)
// normalize_angle_degrees 00682740: an angle wrapped into -180 to 180.
static float angle_wrap(float angle)
{
if (std::fabs(angle) > FULL_TURN) angle = std::fmod(angle, FULL_TURN);
if (angle > HALF_TURN) return angle - FULL_TURN;
if (angle < -HALF_TURN) return angle + FULL_TURN;
if (std::fabs(angle) > FULL_TURN_DEGREES) angle = std::fmod(angle, FULL_TURN_DEGREES);
if (angle > HALF_TURN) return angle - FULL_TURN_DEGREES;
if (angle < -HALF_TURN) return angle + FULL_TURN_DEGREES;
return angle;
}
@@ -439,7 +436,7 @@ static void poop_particle_init(Entity_Effect& effect)
{
effect.fallingAcceleration = PARTICLE_GRAVITY;
effect.height = PARTICLE_START_HEIGHT;
effect.sprite.GetLayer(0)->rotation = random_unit() * FULL_TURN;
effect.sprite.GetLayer(0)->rotation = random_unit() * FULL_TURN_DEGREES;
effect.sprite.Play(GIB_ANIMATIONS[Random() % GIB_ANIMATIONS.size()]);
effect.fallingSpeed = GIB_FALL - random_unit() * GIB_RISE_RANGE;
}
@@ -485,7 +482,7 @@ static void dust_cloud_init(Entity_Effect& effect)
int frame = clouds->length == 0 ? 0 : (int)(Random() % (uint32_t)clouds->length);
effect.sprite.SetFrame(clouds->name, frame);
effect.sprite.isFlipX = !(Random() & 1);
effect.sprite.rotation = random_unit() * FULL_TURN - HALF_TURN;
effect.sprite.rotation = random_unit() * FULL_TURN_DEGREES - HALF_TURN;
effect.sprite.scale = vector_make(DUST_SCALE, DUST_SCALE);
effect.renderZOffset = POOF_RENDER_Z;
if (effect.subtype == DUST_DARK) effect.sprite.color = {{1, 1, 1, 1}, {}, {DUST_DARKEN, DUST_DARKEN, DUST_DARKEN}};
@@ -519,7 +516,7 @@ static void worm_init(Entity_Effect& effect)
if (effect.subtype >= 0 && effect.subtype < (int)WORM_ANIMATIONS.size())
effect.sprite.Play(WORM_ANIMATIONS[effect.subtype]);
effect.rotation = angle_wrap(random_unit() * FULL_TURN);
effect.rotation = angle_wrap(random_unit() * FULL_TURN_DEGREES);
effect.sprite.rotation = effect.rotation;
effect.sortingLayer = SORTING_DOOR;
effect.fallingAcceleration = PARTICLE_GRAVITY;
@@ -552,11 +549,11 @@ void combat_effect_init(Entity_Effect& effect)
case CombatEffect::TEAR_POOF_B:
case CombatEffect::TEAR_POOF_SMALL:
case CombatEffect::TEAR_POOF_VERYSMALL:
effect.rotation = (float)(Random() & 3) * RIGHT_ANGLE;
effect.rotation = (float)(Random() & 3) * RIGHT_ANGLE_DEGREES;
effect.isUnknown176 = true;
break;
case CombatEffect::IMPACT:
effect.rotation = (float)(Random() & 3) * RIGHT_ANGLE;
effect.rotation = (float)(Random() & 3) * RIGHT_ANGLE_DEGREES;
effect.isUnknown176 = true;
sprite.isFlipX = !(Random() & 1);
break;
@@ -845,7 +842,7 @@ static void blood_particle_start(Entity_Effect& effect)
}
else
{
effect.sprite.GetLayer(0)->rotation = random_unit() * FULL_TURN;
effect.sprite.GetLayer(0)->rotation = random_unit() * FULL_TURN_DEGREES;
if (const char* animation = blood_particle_animation(effect)) effect.sprite.Play(animation);
effect.fallingSpeed = GIB_FALL - random_unit() * GIB_RISE_RANGE;
}
@@ -1151,7 +1148,7 @@ static void worm_grid_push(Entity_Effect& effect)
if (grid->type != GRID_PIT || room_grid_collision_at(effect.pos) == COLLISION_NONE) return;
effect.pos = effect.targetPosition;
effect.rotation = angle_wrap(random_unit() * FULL_TURN);
effect.rotation = angle_wrap(random_unit() * FULL_TURN_DEGREES);
if (room_grid_collision_at(effect.pos) == COLLISION_PIT) effect.pos = vector_add(effect.pos, random_direction());
}