From 9f3bee528a395edf9218dda41c9f16065adb6f9d Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 14 Jun 2023 20:37:58 -0700 Subject: [PATCH 1/4] Battle: spawn 3 monitors at most --- src/k_battle.c | 7 ++++++- src/k_battle.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/k_battle.c b/src/k_battle.c index 7c6dd7d09..5010052e5 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -435,6 +435,7 @@ void K_RunPaperItemSpawners(void) mobj_t *spotList[MAXITEM]; UINT8 spotMap[MAXITEM]; UINT8 spotCount = 0, spotBackup = 0, spotAvailable = 0; + UINT8 monitorsSpawned = 0; for (th = thlist[THINK_MOBJ].next; th != &thlist[THINK_MOBJ]; th = th->next) { @@ -458,6 +459,10 @@ void K_RunPaperItemSpawners(void) spotMap[spotAvailable] = spotCount; spotAvailable++; } + else + { + monitorsSpawned++; + } spotList[spotCount] = mo; spotCount++; @@ -484,7 +489,7 @@ void K_RunPaperItemSpawners(void) //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)]; diff --git a/src/k_battle.h b/src/k_battle.h index bd15f8b55..716124f72 100644 --- a/src/k_battle.h +++ b/src/k_battle.h @@ -12,6 +12,8 @@ extern "C" { #define BATTLE_DESPAWN_TIME (15*TICRATE) #define BATTLE_POWERUP_TIME (20*TICRATE) +#define BATTLE_MONITOR_SPAWN_LIMIT (3) + extern struct battleovertime { UINT16 enabled; ///< Has this been initalized yet? From 17da46eda5aaf3bd2efba925b25f69a5565e9623 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 14 Jun 2023 21:04:55 -0700 Subject: [PATCH 2/4] K_PointLimitForGametype: Battle, each player is worth 4 PTS, reduced from 5 --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index ed58a5b19..71b20c1d1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -12195,7 +12195,7 @@ UINT32 K_PointLimitForGametype(void) { if (D_IsPlayerHumanAndGaming(i)) { - ptsCap += 5; + ptsCap += 4; } } } From 5546f7e7a7e4c61aa8e33518f9326a3ad48fb440 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 14 Jun 2023 21:18:57 -0700 Subject: [PATCH 3/4] Battle: spawn sphere boxes even less frequently, 2x -> 16x --- src/k_battle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_battle.c b/src/k_battle.c index 5010052e5..572c72943 100644 --- a/src/k_battle.c +++ b/src/k_battle.c @@ -503,7 +503,7 @@ void K_RunPaperItemSpawners(void) spotMap[i] = i; } - if ((gametyperules & GTR_SPHERES) && IsOnInterval(2 * interval)) + if ((gametyperules & GTR_SPHERES) && IsOnInterval(16 * interval)) { spotBackup = spotCount; for (i = 0; i < pcount; i++) From 427ab444711c8c70a1959c8ff8823538072b21b0 Mon Sep 17 00:00:00 2001 From: James R Date: Wed, 14 Jun 2023 22:03:01 -0700 Subject: [PATCH 4/4] Add setspheres command --- src/d_netcmd.c | 16 ++++++++++++++++ src/m_cheat.c | 8 ++++++++ src/m_cheat.h | 2 ++ 3 files changed, 26 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index b58334da6..823099cf6 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1118,6 +1118,7 @@ void D_RegisterClientCommands(void) COM_AddCommand("noclip", Command_CheatNoClip_f); COM_AddCommand("god", Command_CheatGod_f); COM_AddCommand("setrings", Command_Setrings_f); + COM_AddCommand("setspheres", Command_Setspheres_f); COM_AddCommand("setlives", Command_Setlives_f); COM_AddCommand("setscore", Command_Setscore_f); COM_AddCommand("devmode", Command_Devmode_f); @@ -2094,6 +2095,10 @@ void D_Cheat(INT32 playernum, INT32 cheat, ...) case CHEAT_RESPAWNAT: COPY(WRITEINT32, INT32); break; + + case CHEAT_SPHERES: + COPY(WRITEINT16, int); + break; } #undef COPY @@ -6242,6 +6247,17 @@ static void Got_Cheat(UINT8 **cp, INT32 playernum) break; } + case CHEAT_SPHERES: { + INT16 spheres = READINT16(*cp); + + // P_GivePlayerSpheres does value clamping + player->spheres = 0; + P_GivePlayerSpheres(player, spheres); + + CV_CheaterWarning(targetPlayer, va("spheres = %d", spheres)); + break; + } + case NUMBER_OF_CHEATS: break; } diff --git a/src/m_cheat.c b/src/m_cheat.c index 17e85e775..0db6a5b9b 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -560,6 +560,14 @@ void Command_Setrings_f(void) D_Cheat(consoleplayer, CHEAT_RINGS, atoi(COM_Argv(1))); } +void Command_Setspheres_f(void) +{ + REQUIRE_CHEATS; + REQUIRE_INLEVEL; + + D_Cheat(consoleplayer, CHEAT_SPHERES, atoi(COM_Argv(1))); +} + void Command_Setlives_f(void) { REQUIRE_CHEATS; diff --git a/src/m_cheat.h b/src/m_cheat.h index bf7fc79be..835832500 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -40,6 +40,7 @@ typedef enum { CHEAT_ANGLE, CHEAT_RESPAWNAT, CHEAT_GIVEPOWERUP, + CHEAT_SPHERES, NUMBER_OF_CHEATS } cheat_t; @@ -75,6 +76,7 @@ void Command_CheatNoClip_f(void); void Command_CheatGod_f(void); void Command_Savecheckpoint_f(void); void Command_Setrings_f(void); +void Command_Setspheres_f(void); void Command_Setlives_f(void); void Command_Setscore_f(void); void Command_Devmode_f(void);