Curation round 11: effects, room clears, items, Continue, bombs, active items, the boss and Basement II
This commit is contained in:
1 parent
d8385e6c64
commit
698eeb74e9
74 files changed
+13965
-2078
No files matched your search
@@ -8,6 +8,7 @@
|
||||
#include "manager.h"
|
||||
#include "npc_ai.h"
|
||||
#include "room.h"
|
||||
#include "room_grid.h"
|
||||
#include <algorithm>
|
||||
#include <cstdio>
|
||||
#include <span>
|
||||
@@ -109,19 +110,6 @@ constexpr std::span<const AmbushEnemy> AMBUSH_VOID[] = {AMBUSH_BASEMENT, AMBUSH
|
||||
AMBUSH_WOMB, AMBUSH_BLUE_WOMB, AMBUSH_SHEOL,
|
||||
AMBUSH_CATHEDRAL, AMBUSH_DARK_ROOM, AMBUSH_CHEST};
|
||||
|
||||
// Where a pickup can go near a position, past the active entities or not.
|
||||
enum PickupSpot
|
||||
{
|
||||
SPOT_ANYWHERE,
|
||||
SPOT_AVOID_ACTIVE
|
||||
};
|
||||
|
||||
// A free spot near a position (Room::FindFreePickupSpawnPosition 00813520, which Room does not have yet).
|
||||
static Vector pickup_position_find(Vector, PickupSpot)
|
||||
{
|
||||
reconstruction_missing("Room::FindFreePickupSpawnPosition 00813520");
|
||||
}
|
||||
|
||||
static Entity* entity_spawn(int type, int variant, Vector position, uint32_t seed)
|
||||
{
|
||||
return g_game->Spawn({.position = position, .type = type, .variant = variant, .seed = seed});
|
||||
@@ -328,7 +316,7 @@ static Vector slot_position_get(Vector position)
|
||||
|
||||
if ((isFree(GRID_CELL_SIZE, 0) || isFree(-GRID_CELL_SIZE, 0)) && (isFree(0, GRID_CELL_SIZE) || isFree(0, -GRID_CELL_SIZE)))
|
||||
return position;
|
||||
return pickup_position_find(Room::GetCenterPos(), SPOT_AVOID_ACTIVE);
|
||||
return room_free_pickup_position_find({.position = Room::GetCenterPos(), .isAvoidActiveEntities = true});
|
||||
}
|
||||
|
||||
// A reward plate's reward, by a roll out of 100: a trapdoor (golden poop where none may open), golden poop, poop, an
|
||||
@@ -338,11 +326,11 @@ static void plate_reward_spawn(GridEntity& plate, RNG& rng)
|
||||
Room& room = *g_game->room;
|
||||
|
||||
grid_sound_play(SOUND_THUMBSUP);
|
||||
Vector position = pickup_position_find(plate.Position(), SPOT_AVOID_ACTIVE);
|
||||
Vector position = room_free_pickup_position_find({.position = plate.Position(), .isAvoidActiveEntities = true});
|
||||
int roll = (int)(rng.Next() % REWARD_ROLLS);
|
||||
auto pickupsSpawn = [&](int variant, uint32_t most) {
|
||||
for (int i = (int)rng.RandomInt(most) + 1; i > 0; i--)
|
||||
entity_spawn(ENTITY_PICKUP, variant, pickup_position_find(plate.Position(), SPOT_AVOID_ACTIVE), rng.Next());
|
||||
entity_spawn(ENTITY_PICKUP, variant, room_free_pickup_position_find({.position = plate.Position(), .isAvoidActiveEntities = true}), rng.Next());
|
||||
};
|
||||
|
||||
if (roll < ROLL_TRAPDOOR && g_game->CanSpawnTrapDoor())
|
||||
@@ -459,7 +447,7 @@ static void plate_ambush_spawn(GridEntity& plate, RNG& rng)
|
||||
for (int i = first; i < first + count; i++)
|
||||
{
|
||||
uint32_t seed = seeds.Next();
|
||||
Vector position = pickup_position_find(positions[(size_t)i % positions.size()], SPOT_ANYWHERE);
|
||||
Vector position = room_free_pickup_position_find({.position = positions[(size_t)i % positions.size()]});
|
||||
float angle = random_unit() * RANDOM_HALF_TURN;
|
||||
angle += angle;
|
||||
float distance = random_unit() * AMBUSH_SCATTER;
|
||||
|
||||
Reference in new issue
Block a user