Restored original charge cannon behavior for Classic difficulty.
This commit is contained in:
parent
d31b65f50e
commit
305e9fb05d
|
@ -7,7 +7,7 @@
|
||||||
# information. This file is offered as-is, without any warranty.
|
# information. This file is offered as-is, without any warranty.
|
||||||
|
|
||||||
AC_PREREQ([2.69])
|
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])
|
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
|
||||||
AC_CONFIG_SRCDIR([src/Starfighter.c])
|
AC_CONFIG_SRCDIR([src/Starfighter.c])
|
||||||
AC_CONFIG_HEADERS([config.h])
|
AC_CONFIG_HEADERS([config.h])
|
||||||
|
|
|
@ -33,6 +33,7 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
|
||||||
Object *bullet;
|
Object *bullet;
|
||||||
int imageIndex;
|
int imageIndex;
|
||||||
int tempX, tempY, steps;
|
int tempX, tempY, steps;
|
||||||
|
int min_damage;
|
||||||
|
|
||||||
bullet = malloc(sizeof(*bullet));
|
bullet = malloc(sizeof(*bullet));
|
||||||
if (bullet == NULL)
|
if (bullet == NULL)
|
||||||
|
@ -96,11 +97,17 @@ void bullet_add(Object *theWeapon, Object *attacker, int y, int dy)
|
||||||
if (bullet->id == WT_CHARGER)
|
if (bullet->id == WT_CHARGER)
|
||||||
{
|
{
|
||||||
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
|
{
|
||||||
bullet->damage = attacker->ammo[1];
|
bullet->damage = attacker->ammo[1];
|
||||||
|
min_damage = 50;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
bullet->damage = attacker->ammo[1] / 2;
|
bullet->damage = attacker->ammo[1] / 2;
|
||||||
|
min_damage = 15;
|
||||||
|
}
|
||||||
|
|
||||||
if (bullet->damage < 15)
|
if (bullet->damage < min_damage)
|
||||||
{
|
{
|
||||||
bullet->damage = 1;
|
bullet->damage = 1;
|
||||||
bullet->id = WT_PLASMA;
|
bullet->id = WT_PLASMA;
|
||||||
|
|
12
src/game.c
12
src/game.c
|
@ -759,12 +759,24 @@ static void game_doBullets()
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bullet->id == WT_CHARGER)
|
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;
|
bullet->damage -= old_shield;
|
||||||
if (bullet->damage <= 0)
|
if (bullet->damage <= 0)
|
||||||
{
|
{
|
||||||
bullet->active = 0;
|
bullet->active = 0;
|
||||||
bullet->shield = 0;
|
bullet->shield = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!bullet->active)
|
||||||
|
{
|
||||||
audio_playSound(SFX_EXPLOSION, bullet->x, bullet->y);
|
audio_playSound(SFX_EXPLOSION, bullet->x, bullet->y);
|
||||||
for (int i = 0 ; i < 10 ; i++)
|
for (int i = 0 ; i < 10 ; i++)
|
||||||
explosion_add(bullet->x + RANDRANGE(-35, 35),
|
explosion_add(bullet->x + RANDRANGE(-35, 35),
|
||||||
|
|
Loading…
Reference in New Issue