From 91fa93b4482315f60c743e5e5d021bbc746d9eb8 Mon Sep 17 00:00:00 2001 From: onpon4 Date: Sat, 28 Feb 2015 08:36:04 -0500 Subject: [PATCH] Reduced charger's max charge, make it fire when it reaches max. The original charge cannon is so overpowered it's ridiculous. The strongest weapon in the game, unlimited ammo, and the only setback it has is that you need to charge it a bit. The lack of balance obsoletes the laser weapon, which is fine, but it also obsoletes homing missile weapons, *including* ones that are newer and more expensive than the charge cannon! Now, it's much more balanced. You actually need to shoot the thing before it hits max (or have your target in sight when it does), rather than being able to just hold the button at max forever and release when optimal like you previously could. Basically, the charge cannon is still the weapon which does the most damage, but it's now much harder to use. Incidentally, not only should homing missiles be a sensible option now, even the laser cannon has a place after the charge cannon becomes available. --- src/player.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/player.cpp b/src/player.cpp index 4de3fc1..dd3b9d4 100644 --- a/src/player.cpp +++ b/src/player.cpp @@ -18,6 +18,7 @@ along with this program. If not, see . #include "Starfighter.h" object player; +bool charger_fired = false; /* Initialises the player for a new game. @@ -118,13 +119,23 @@ void doPlayer() { if (engine.keyState[KEY_ALTFIRE] && !(engine.keyState[KEY_FIRE])) { - limitCharAdd(&player.ammo[1], 1, 0, 200); + if (!charger_fired) + { + player.ammo[1] += 1; + if (player.ammo[1] >= 125) + { + fireBullet(&player, 1); + player.ammo[1] = 0; + charger_fired = true; + } + } } else { if (player.ammo[1] > 0) fireBullet(&player, 1); player.ammo[1] = 0; + charger_fired = false; } }