Restored original charge cannon behavior for Classic difficulty.

This commit is contained in:
Layla Marchant 2020-05-26 12:42:00 -04:00
parent d31b65f50e
commit 305e9fb05d
3 changed files with 25 additions and 6 deletions

View File

@ -7,7 +7,7 @@
# information. This file is offered as-is, without any warranty.
AC_PREREQ([2.69])
AC_INIT([Project: Starfighter], [2.1.1], [diligentcircle@riseup.net], [starfighter])
AC_INIT([Project: Starfighter], [2.2], [diligentcircle@riseup.net], [starfighter])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
AC_CONFIG_SRCDIR([src/Starfighter.c])
AC_CONFIG_HEADERS([config.h])

View File

@ -33,6 +33,7 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
Object *bullet;
int imageIndex;
int tempX, tempY, steps;
int min_damage;
bullet = malloc(sizeof(*bullet));
if (bullet == NULL)
@ -96,11 +97,17 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
if (bullet->id == WT_CHARGER)
{
if (game.difficulty == DIFFICULTY_ORIGINAL)
{
bullet->damage = attacker->ammo[1];
min_damage = 50;
}
else
{
bullet->damage = attacker->ammo[1] / 2;
min_damage = 15;
}
if (bullet->damage < 15)
if (bullet->damage < min_damage)
{
bullet->damage = 1;
bullet->id = WT_PLASMA;

View File

@ -759,12 +759,24 @@ static void game_doBullets()
}
if (bullet->id == WT_CHARGER)
{
if (game.difficulty == DIFFICULTY_ORIGINAL)
{
bullet->shield -= old_shield;
if (bullet->shield < 0)
bullet->active = 0;
}
else
{
bullet->damage -= old_shield;
if (bullet->damage <= 0)
{
bullet->active = 0;
bullet->shield = 0;
}
}
if (!bullet->active)
{
audio_playSound(SFX_EXPLOSION, bullet->x, bullet->y);
for (int i = 0 ; i < 10 ; i++)
explosion_add(bullet->x + RANDRANGE(-35, 35),