Maelstrom: Adjust the number of asteroids in deathmatch mode (thanks Clara!)

From b85464190ac289bcc723729df7b2c01c5d30fa10 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 22 Apr 2026 07:31:50 -0700
Subject: [PATCH] Adjust the number of asteroids in deathmatch mode (thanks
 Clara!)

We want fewer asteroids, which we accomplish by creating medium rocks instead of large rocks, and we want more steel asteroids, because they're fun.
---
 game/game.cpp | 17 ++++++++++++-----
 game/make.cpp | 31 +++++++++++++++++++++++++++++++
 game/make.h   |  1 +
 3 files changed, 44 insertions(+), 5 deletions(-)

diff --git a/game/game.cpp b/game/game.cpp
index c80ed379..36aa1612 100644
--- a/game/game.cpp
+++ b/game/game.cpp
@@ -1528,10 +1528,6 @@ GamePanelDelegate::StartNextWave()
 
 	NewRoids = FastRandom(temp) + (gWave / 5) + 3;
 
-	/* Use fewer asteroids in deathmatch mode */
-	if (gGameInfo.IsDeathmatch())
-		NewRoids /= 2;
-
 	/* -- Kill any existing sprites */
 	while (gNumSprites > 0)
 		delete gSprites[gNumSprites-1];
@@ -1559,11 +1555,22 @@ GamePanelDelegate::StartNextWave()
 		x = FastRandom(GAME_WIDTH) * SCALE_FACTOR;
 		y = 0;
 
-		randval = FastRandom(10);
+		if (gGameInfo.IsDeathmatch()) {
+			// Always have at least one rock, but also more steel asteroids
+			if (i == 0) {
+				randval = 1;
+			} else {
+				randval = FastRandom(2);
+			}
+		} else {
+			randval = FastRandom(10);
+		}
 
 		/* -- See what kind of asteroid to make */
 		if (randval == 0)
 			MakeSteelRoid(x, y);
+		else if (gGameInfo.IsDeathmatch())
+			MakeMediumRock(x, y);
 		else
 			MakeLargeRock(x, y);
 	}
diff --git a/game/make.cpp b/game/make.cpp
index e21de2f4..e656aa15 100644
--- a/game/make.cpp
+++ b/game/make.cpp
@@ -345,6 +345,37 @@ void MakeHoming(void)
 }	/* -- MakeHoming */
 
 
+/* ----------------------------------------------------------------- */
+/* -- Create a medium rock */
+
+void MakeMediumRock(int x, int y)
+{
+	int	newsprite, xVel, yVel, phaseFreq, rx;
+
+	rx = (VEL_FACTOR + (gWave / 6)) * (SCALE_FACTOR);
+
+	xVel = yVel = 0;
+	while (xVel == 0)
+		xVel = FastRandom(rx) - (rx / 2);
+	if (xVel > 0)
+		xVel += (0 * SCALE_FACTOR);
+	else
+		xVel -= (0 * SCALE_FACTOR);
+
+	while (yVel == 0)
+		yVel = FastRandom(rx) - (rx / 2);
+	if (yVel > 0)
+		yVel += (0 * SCALE_FACTOR);
+	else
+		yVel -= (0 * SCALE_FACTOR);
+
+	phaseFreq = (FastRandom(3) + 2);
+
+	newsprite = gNumSprites;
+	gSprites[newsprite] = new MediumRock(x, y, xVel, yVel, phaseFreq);
+}	/* -- MakeLargeRock */
+
+
 /* ----------------------------------------------------------------- */
 /* -- Create a large rock */
 
diff --git a/game/make.h b/game/make.h
index 570a3229..85c89d76 100644
--- a/game/make.h
+++ b/game/make.h
@@ -20,6 +20,7 @@
 */
 
 // Functions from make.cc
+extern	void	MakeMediumRock(int x, int y);
 extern	void	MakeLargeRock(int x, int y);
 extern	void	MakeSteelRoid(int x, int y);
 extern	void	MakeMultiplier(void);