Caused charge cannon damage to be reduced in a different way.

This commit is contained in:
onpon4 2015-02-28 20:20:36 -05:00
parent 224b3ea8b1
commit f620334510
4 changed files with 20 additions and 18 deletions

View File

@ -80,8 +80,8 @@ void addBullet(object *theWeapon, object *attacker, int y, int dy)
if (bullet->id == WT_CHARGER)
{
bullet->damage = attacker->ammo[1];
if (bullet->damage < 50)
bullet->damage = attacker->ammo[1] / 2;
if (bullet->damage < 15)
{
bullet->damage = 1;
bullet->id = WT_PLASMA;
@ -525,8 +525,8 @@ void doBullets()
if (bullet->id == WT_CHARGER)
{
for (int i = 0 ; i < bullet->damage ; i++)
blit(bullet->image[0], (int)(bullet->x - rrand(-(bullet->damage / 3), 0)), (int)(bullet->y + rrand(-3, 3)));
for (int i = 0 ; i < bullet->damage * 2 ; i++)
blit(bullet->image[0], (int)(bullet->x - rrand(-(bullet->damage * 2 / 3), 0)), (int)(bullet->y + rrand(-3, 3)));
}
blit(bullet->image[0], (int)bullet->x, (int)bullet->y);

View File

@ -478,17 +478,6 @@ int galaxyMap()
// do not perform certain keyboard actions
engine.gameSection = SECTION_INTERMISSION;
// Remove the Supercharge, if it is there
if (currentGame.difficulty > DIFFICULTY_EASY)
{
weapon[W_PLAYER_WEAPON].reload[0] = max(weapon[W_PLAYER_WEAPON].reload[0],
rate2reload[currentGame.maxPlasmaRate]);
weapon[W_PLAYER_WEAPON].ammo[0] = min(weapon[W_PLAYER_WEAPON].ammo[0],
currentGame.maxPlasmaOutput);
weapon[W_PLAYER_WEAPON].damage = min(weapon[W_PLAYER_WEAPON].damage,
currentGame.maxPlasmaDamage);
}
clearScreen(black);
updateScreen();
clearScreen(black);

View File

@ -64,11 +64,24 @@ void initPlayer()
void exitPlayer()
{
charger_fired = false;
if (player.weaponType[1] == W_CHARGER)
player.ammo[1] = 0;
if (player.weaponType[1] == W_LASER)
player.ammo[1] = 0;
// Remove the Supercharge, if it is there
if (currentGame.difficulty > DIFFICULTY_EASY)
{
weapon[W_PLAYER_WEAPON].reload[0] = max(weapon[W_PLAYER_WEAPON].reload[0],
rate2reload[currentGame.maxPlasmaRate]);
weapon[W_PLAYER_WEAPON].ammo[0] = min(weapon[W_PLAYER_WEAPON].ammo[0],
currentGame.maxPlasmaOutput);
weapon[W_PLAYER_WEAPON].damage = min(weapon[W_PLAYER_WEAPON].damage,
currentGame.maxPlasmaDamage);
}
}
void doPlayer()
@ -121,8 +134,8 @@ void doPlayer()
{
if (!charger_fired)
{
player.ammo[1] += 1;
if (player.ammo[1] >= 125)
limitCharAdd(&player.ammo[1], 1, 0, 200);
if (player.ammo[1] >= 200)
{
fireBullet(&player, 1);
player.ammo[1] = 0;

View File

@ -34,7 +34,7 @@ struct object {
signed char speed;
unsigned char damage; // Contact damage for bullets
int score; // How much a kill of this is worth
unsigned char ammo[2]; // Ammo for 2nd weapon. Max of 100 (except laser)
unsigned char ammo[2]; // Ammo for 2nd weapon.
signed char face; // Either 0 or 1