Battle: spawn 3 monitors at most

This commit is contained in:
James R 2023-06-14 20:37:58 -07:00
parent 6f2befabc9
commit 9f3bee528a
2 changed files with 8 additions and 1 deletions

View file

@ -435,6 +435,7 @@ void K_RunPaperItemSpawners(void)
mobj_t *spotList[MAXITEM]; mobj_t *spotList[MAXITEM];
UINT8 spotMap[MAXITEM]; UINT8 spotMap[MAXITEM];
UINT8 spotCount = 0, spotBackup = 0, spotAvailable = 0; UINT8 spotCount = 0, spotBackup = 0, spotAvailable = 0;
UINT8 monitorsSpawned = 0;
for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next)
{ {
@ -458,6 +459,10 @@ void K_RunPaperItemSpawners(void)
spotMap[spotAvailable] = spotCount; spotMap[spotAvailable] = spotCount;
spotAvailable++; spotAvailable++;
} }
else
{
monitorsSpawned++;
}
spotList[spotCount] = mo; spotList[spotCount] = mo;
spotCount++; spotCount++;
@ -484,7 +489,7 @@ void K_RunPaperItemSpawners(void)
//CONS_Printf("leveltime = %d ", leveltime); //CONS_Printf("leveltime = %d ", leveltime);
if (spotAvailable > 0) if (spotAvailable > 0 && monitorsSpawned < BATTLE_MONITOR_SPAWN_LIMIT)
{ {
const UINT8 r = spotMap[P_RandomKey(PR_ITEM_ROULETTE, spotAvailable)]; const UINT8 r = spotMap[P_RandomKey(PR_ITEM_ROULETTE, spotAvailable)];

View file

@ -12,6 +12,8 @@ extern "C" {
#define BATTLE_DESPAWN_TIME (15*TICRATE) #define BATTLE_DESPAWN_TIME (15*TICRATE)
#define BATTLE_POWERUP_TIME (20*TICRATE) #define BATTLE_POWERUP_TIME (20*TICRATE)
#define BATTLE_MONITOR_SPAWN_LIMIT (3)
extern struct battleovertime extern struct battleovertime
{ {
UINT16 enabled; ///< Has this been initalized yet? UINT16 enabled; ///< Has this been initalized yet?