Tweaked the way the laser is handled.

The tweak causes you to be able to fire the laser for more time,
but the difference is subtle (112 frames instead of 100 frames).
This commit is contained in:
onpon4 2016-11-25 14:20:36 -05:00
parent 1be0fd1164
commit 5b4fa64360
3 changed files with 8 additions and 12 deletions

View File

@ -1252,7 +1252,7 @@ static void game_doPlayer()
ship_fireBullet(&player, 1);
if (!engine.cheatAmmo)
player.ammo[1] += 2;
player.ammo[1] += 1;
if (player.ammo[1] >= 100)
{
@ -1981,8 +1981,8 @@ static void game_doHud()
if (player.shield < 1)
return;
if ((!engine.keyState[KEY_ALTFIRE]) && (player.weaponType[1] == W_LASER) && (engine.eventTimer % 8 == 1))
LIMIT_ADD(player.ammo[1], -1, 1, 255);
if ((player.weaponType[1] == W_LASER) && (engine.eventTimer % 8 == 1))
LIMIT_ADD(player.ammo[1], -1, 0, 200);
if ((engine.eventTimer < 30) && (player.shield <= engine.lowShield))
return;

View File

@ -1213,9 +1213,5 @@ void mission_showFinishedScreen()
}
}
// Stop people from "selling" Laser ammo as rockets.
if (player.weaponType[1] == W_LASER)
player.ammo[1] = 1;
audio_haltMusic();
}

View File

@ -45,17 +45,17 @@ Fill in later...
*/
void ship_fireBullet(Object *ship, int weaponIndex)
{
int y = (ship->image[0]->h) / 5;
Object *theWeapon = &weapons[ship->weaponType[weaponIndex]];
if (ship->reload[weaponIndex] > 0)
return;
int y = (ship->image[0]->h) / 5;
// Remove some ammo from the player
if ((ship == &player) && (player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
if ((ship == &player) && (player.weaponType[weaponIndex] != W_LASER) &&
(player.ammo[weaponIndex] > 0) && (!engine.cheatAmmo))
player.ammo[weaponIndex]--;
Object *theWeapon = &weapons[ship->weaponType[weaponIndex]];
switch(theWeapon->id)
{
case WT_PLASMA: