2011-08-24 14:14:44 +02:00
|
|
|
/*
|
|
|
|
Copyright (C) 2003 Parallel Realities
|
2015-03-01 21:37:32 +01:00
|
|
|
Copyright (C) 2011, 2012 Guus Sliepen
|
|
|
|
Copyright (C) 2015 Julian Marchant
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
as published by the Free Software Foundation; either version 3
|
2011-08-24 14:14:44 +02:00
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2015-02-26 17:20:36 +01:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2015-02-26 17:20:36 +01:00
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2011-08-24 14:14:44 +02:00
|
|
|
*/
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
#include "Starfighter.h"
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
/*
|
|
|
|
Create a new collectable item based on supplied arguments.
|
|
|
|
*/
|
|
|
|
void addCollectable(float x, float y, int type, int value, int life)
|
|
|
|
{
|
2015-03-09 01:59:33 +01:00
|
|
|
int r;
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
if (type == P_ANYTHING)
|
|
|
|
{
|
|
|
|
type = P_CASH;
|
|
|
|
|
2015-03-09 01:59:33 +01:00
|
|
|
r = rand() % 9;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
switch (r)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
type = P_PLASMA_AMMO;
|
|
|
|
break;
|
|
|
|
case 1:
|
|
|
|
type = P_SHIELD;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
type = P_ROCKET;
|
|
|
|
value /= 10;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (type == P_WEAPONS)
|
|
|
|
{
|
|
|
|
type = P_PLASMA_RATE;
|
|
|
|
|
2015-03-09 01:59:33 +01:00
|
|
|
if ((currentGame.difficulty >= DIFFICULTY_NIGHTMARE) ||
|
|
|
|
((currentGame.difficulty > DIFFICULTY_EASY) &&
|
|
|
|
((currentGame.area == 5) || (currentGame.area == 11) ||
|
|
|
|
(currentGame.area == 18) || (currentGame.area == 25))))
|
|
|
|
{
|
|
|
|
// Deny the Super Charge in Nightmare difficulty, and on bosses.
|
|
|
|
r = rand() % 59;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
r = rand() % 61;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
if (r <= 19)
|
|
|
|
type = P_PLASMA_DAMAGE;
|
|
|
|
else if (r <= 39)
|
|
|
|
type = P_PLASMA_SHOT;
|
|
|
|
else if (r <= 59)
|
|
|
|
type = P_PLASMA_RATE;
|
|
|
|
else
|
|
|
|
type = P_SUPER;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (type == P_SUPER)
|
2015-03-17 21:54:00 +01:00
|
|
|
value = MAX(value, 1);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-02-28 15:45:26 +01:00
|
|
|
if (value == 0)
|
|
|
|
return; // don't bother!
|
|
|
|
|
2015-03-03 03:21:31 +01:00
|
|
|
// If plasma rate is at max, convert plasma rate powerup to ammo.
|
|
|
|
if (type == P_PLASMA_RATE)
|
|
|
|
{
|
2015-03-06 21:22:10 +01:00
|
|
|
if (weapon[W_PLAYER_WEAPON].reload[0] <= rate2reload[currentGame.maxPlasmaRate])
|
2015-03-03 03:21:31 +01:00
|
|
|
{
|
|
|
|
type = P_PLASMA_AMMO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If plasma output is at max, convert plasma output powerup to ammo.
|
|
|
|
if (type == P_PLASMA_SHOT)
|
|
|
|
{
|
2015-03-06 21:22:10 +01:00
|
|
|
if (weapon[W_PLAYER_WEAPON].ammo[0] >= currentGame.maxPlasmaOutput)
|
2015-03-03 03:21:31 +01:00
|
|
|
{
|
|
|
|
type = P_PLASMA_AMMO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// If plasma damage is at max, convert plasma damage powerup to ammo.
|
|
|
|
if (type == P_PLASMA_DAMAGE)
|
|
|
|
{
|
2015-03-06 21:22:10 +01:00
|
|
|
if (weapon[W_PLAYER_WEAPON].damage >= currentGame.maxPlasmaDamage)
|
2015-03-03 03:21:31 +01:00
|
|
|
{
|
|
|
|
type = P_PLASMA_AMMO;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-01 00:56:24 +01:00
|
|
|
// No point in giving the player plasma ammo if the weapons aren't
|
|
|
|
// upgraded! Give them money instead.
|
|
|
|
if (type == P_PLASMA_AMMO)
|
|
|
|
{
|
2015-03-06 21:22:10 +01:00
|
|
|
if ((weapon[W_PLAYER_WEAPON].reload[0] >= rate2reload[currentGame.minPlasmaRate]) &&
|
|
|
|
(weapon[W_PLAYER_WEAPON].ammo[0] <= currentGame.minPlasmaOutput) &&
|
|
|
|
(weapon[W_PLAYER_WEAPON].damage <= currentGame.minPlasmaDamage))
|
2015-03-01 00:56:24 +01:00
|
|
|
{
|
|
|
|
type = P_CASH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
// If the player has a charge cannon or a laser cannon, don't give them
|
|
|
|
// rockets. Causes problems otherwise :)
|
|
|
|
if (type == P_ROCKET)
|
|
|
|
{
|
|
|
|
if ((player.weaponType[1] == W_CHARGER) || (player.weaponType[1] == W_LASER))
|
|
|
|
{
|
|
|
|
type = P_CASH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-02-28 04:16:53 +01:00
|
|
|
// Shield bonus is useless in Nightmare difficulty; give cash instead.
|
|
|
|
if (type == P_SHIELD)
|
|
|
|
{
|
|
|
|
if (currentGame.difficulty >= DIFFICULTY_NIGHTMARE)
|
|
|
|
{
|
|
|
|
type = P_CASH;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-03-14 00:11:14 +01:00
|
|
|
/*
|
|
|
|
No cash, powerups, or ammo on interceptions. Stops point leeching(!)
|
|
|
|
*/
|
|
|
|
if ((currentGame.area == MAX_MISSIONS - 1) &&
|
|
|
|
((type == P_CASH) || (type == P_PLASMA_AMMO) || (type == P_ROCKET) ||
|
|
|
|
(type == P_PLASMA_DAMAGE) || (type == P_PLASMA_SHOT) ||
|
|
|
|
(type == P_PLASMA_RATE) || (type == P_SUPER)))
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
collectables *collectable = new collectables;
|
|
|
|
|
|
|
|
collectable->next = NULL;
|
2011-08-26 16:14:58 +02:00
|
|
|
collectable->active = true;
|
2011-08-24 14:14:44 +02:00
|
|
|
collectable->x = x;
|
|
|
|
collectable->y = y;
|
|
|
|
|
2011-08-26 23:27:16 +02:00
|
|
|
collectable->dx = rrand(-100, 100);
|
2011-08-24 14:14:44 +02:00
|
|
|
if (collectable->dx != 0)
|
|
|
|
collectable->dx /= 100;
|
|
|
|
|
2011-08-26 23:27:16 +02:00
|
|
|
collectable->dy = rrand(-100, 100);
|
2011-08-24 14:14:44 +02:00
|
|
|
if (collectable->dy != 0)
|
|
|
|
collectable->dy /= 100;
|
|
|
|
|
|
|
|
collectable->type = type;
|
|
|
|
collectable->value = value;
|
|
|
|
collectable->life = life;
|
|
|
|
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case P_CASH:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[24];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_ROCKET:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[49];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_AMMO:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[25];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_SHIELD:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[26];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_SHOT:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[27];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_RATE:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[28];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_DAMAGE:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[29];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_CARGO:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[32];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_SUPER:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[50];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_MINE:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[31];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_SLAVES:
|
|
|
|
case P_ESCAPEPOD:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[45];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
|
|
|
|
case P_ORE:
|
2011-08-26 23:53:46 +02:00
|
|
|
collectable->image = shape[46 + rand() % 3];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
engine.collectableTail->next = collectable;
|
|
|
|
engine.collectableTail = collectable;
|
|
|
|
}
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
static void explodeMine(collectables *collectable)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
|
|
|
if ((collectable->x >= 0) && (collectable->x <= screen->w) &&
|
|
|
|
(collectable->y >= 0) && (collectable->y <= screen->h))
|
2015-03-08 15:38:58 +01:00
|
|
|
audio_playSound(SFX_EXPLOSION, collectable->x);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
for (int i = 0 ; i < 10 ; i++)
|
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
|
|
|
addExplosion(collectable->x + rand() % 25 - rand() % 25,
|
|
|
|
collectable->y + rand() % 25 - rand() % 25, E_BIG_EXPLOSION);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-24 22:22:26 +02:00
|
|
|
if (checkPlayerShockDamage(collectable->x, collectable->y))
|
2011-08-24 14:14:44 +02:00
|
|
|
setInfoLine("Warning: Mine damage to shield!!", FONT_RED);
|
|
|
|
}
|
|
|
|
|
|
|
|
void checkMineBulletCollisions(object *bullet)
|
|
|
|
{
|
|
|
|
collectables *collectable = engine.collectableHead;
|
|
|
|
collectables *prevCollectable = engine.collectableHead;
|
|
|
|
engine.collectableTail = engine.collectableHead;
|
|
|
|
|
|
|
|
while (collectable->next != NULL)
|
|
|
|
{
|
|
|
|
collectable = collectable->next;
|
|
|
|
|
|
|
|
if (collectable->type == P_MINE)
|
|
|
|
{
|
2011-08-26 23:27:16 +02:00
|
|
|
if (collision(collectable, bullet))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
2011-08-26 16:14:58 +02:00
|
|
|
collectable->active = false;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
if (bullet->id != WT_CHARGER)
|
|
|
|
{
|
2011-08-26 16:14:58 +02:00
|
|
|
bullet->active = false;
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
bullet->shield--;
|
|
|
|
if (bullet->shield < 0)
|
2011-08-26 16:14:58 +02:00
|
|
|
bullet->active = false;
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
if (bullet->owner == &player)
|
|
|
|
{
|
|
|
|
currentGame.minesKilled++;
|
|
|
|
currentGame.hits++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
if (collectable->active)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
prevCollectable = collectable;
|
|
|
|
engine.collectableTail = collectable;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
explodeMine(collectable);
|
|
|
|
prevCollectable->next = collectable->next;
|
|
|
|
delete collectable;
|
|
|
|
collectable = prevCollectable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
Loops through the currently active collectables (in a linked list). The collectable
|
|
|
|
will travel in the direction that was defined when it was made. Its life will decreased
|
|
|
|
whilst it remains active. It will be removed if the player touches it or if its life
|
|
|
|
reaches 0. When it is picked up, depending on the type of collectable it is, mission requirements
|
|
|
|
will be updated. Information will be displayed and appropriate player variables altered.
|
|
|
|
*/
|
|
|
|
void doCollectables()
|
|
|
|
{
|
|
|
|
collectables *collectable = engine.collectableHead;
|
|
|
|
collectables *prevCollectable = engine.collectableHead;
|
|
|
|
engine.collectableTail = engine.collectableHead;
|
|
|
|
|
|
|
|
while (collectable->next != NULL)
|
|
|
|
{
|
|
|
|
collectable = collectable->next;
|
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
if (collectable->active)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
|
|
|
if ((collectable->x + collectable->image->w > 0) &&
|
|
|
|
(collectable->x < screen->w) &&
|
|
|
|
(collectable->y + collectable->image->h > 0) &&
|
|
|
|
(collectable->y < screen->h))
|
2011-08-26 23:53:46 +02:00
|
|
|
blit(collectable->image, (int)collectable->x, (int)collectable->y);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-02-27 05:23:08 +01:00
|
|
|
collectable->x += engine.ssx + engine.smx;
|
2015-02-27 05:31:26 +01:00
|
|
|
collectable->y += engine.ssy + engine.smy;
|
2011-08-24 14:14:44 +02:00
|
|
|
collectable->x += collectable->dx;
|
|
|
|
collectable->y += collectable->dy;
|
|
|
|
|
|
|
|
collectable->life--;
|
|
|
|
|
2011-08-26 23:27:16 +02:00
|
|
|
if ((player.shield > 0) && (collision(collectable, &player)))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
char temp[40];
|
|
|
|
switch(collectable->type)
|
|
|
|
{
|
|
|
|
case P_CASH:
|
|
|
|
currentGame.cash += collectable->value;
|
|
|
|
currentGame.cashEarned += collectable->value;
|
|
|
|
sprintf(temp, "Got $%d ", collectable->value);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_ROCKET:
|
2015-02-28 14:47:26 +01:00
|
|
|
limitCharAdd(&player.ammo[1], collectable->value, 0,
|
|
|
|
currentGame.maxRocketAmmo);
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.ammo[1] == currentGame.maxRocketAmmo)
|
|
|
|
sprintf(temp, "Rocket Ammo at Maximum");
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (collectable->value > 1)
|
|
|
|
sprintf(temp, "Got %d rockets", collectable->value);
|
|
|
|
else
|
|
|
|
sprintf(temp, "Got a rocket");
|
|
|
|
}
|
|
|
|
currentGame.rocketPickups += collectable->value;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_SHIELD:
|
2011-08-26 23:27:16 +02:00
|
|
|
limitInt(&(player.shield += 10), 0, player.maxShield);
|
2011-08-24 14:14:44 +02:00
|
|
|
currentGame.shieldPickups ++;
|
|
|
|
sprintf(temp, "Restored 10 shield points");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_RATE:
|
|
|
|
if (player.ammo[0] < 50)
|
|
|
|
player.ammo[0] = 50;
|
2015-02-28 14:15:53 +01:00
|
|
|
if (weapon[W_PLAYER_WEAPON].reload[0] <= rate2reload[currentGame.maxPlasmaRate])
|
2011-09-11 21:57:57 +02:00
|
|
|
sprintf(temp, "Firing Rate already at Maximum");
|
2011-08-24 14:14:44 +02:00
|
|
|
else
|
2011-09-11 21:57:57 +02:00
|
|
|
{
|
2015-02-28 14:15:53 +01:00
|
|
|
weapon[W_PLAYER_WEAPON].reload[0] -= 2;
|
2011-08-24 14:14:44 +02:00
|
|
|
sprintf(temp, "Firing rate increased");
|
2011-09-11 21:57:57 +02:00
|
|
|
}
|
2011-08-24 14:14:44 +02:00
|
|
|
currentGame.powerups++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_SHOT:
|
|
|
|
if (player.ammo[0] < 50)
|
|
|
|
player.ammo[0] = 50;
|
2015-02-28 14:15:53 +01:00
|
|
|
if (weapon[W_PLAYER_WEAPON].ammo[0] >= currentGame.maxPlasmaOutput)
|
2011-09-11 21:57:57 +02:00
|
|
|
sprintf(temp, "Plasma output already at Maximum");
|
2011-08-24 14:14:44 +02:00
|
|
|
else
|
2011-09-11 21:57:57 +02:00
|
|
|
{
|
2015-02-28 14:15:53 +01:00
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0]++;
|
2011-08-24 14:14:44 +02:00
|
|
|
sprintf(temp, "Plasma output increased");
|
2011-09-11 21:57:57 +02:00
|
|
|
}
|
2011-08-24 14:14:44 +02:00
|
|
|
currentGame.powerups++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_DAMAGE:
|
|
|
|
if (player.ammo[0] < 50)
|
|
|
|
player.ammo[0] = 50;
|
2015-02-28 14:15:53 +01:00
|
|
|
if (weapon[W_PLAYER_WEAPON].damage >= currentGame.maxPlasmaDamage)
|
2011-09-11 21:57:57 +02:00
|
|
|
sprintf(temp, "Plasma damage already at Maximum");
|
|
|
|
else {
|
2015-02-28 14:15:53 +01:00
|
|
|
weapon[W_PLAYER_WEAPON].damage++;
|
2011-08-24 14:14:44 +02:00
|
|
|
sprintf(temp, "Plasma damage increased");
|
2011-09-11 21:57:57 +02:00
|
|
|
}
|
2011-08-24 14:14:44 +02:00
|
|
|
currentGame.powerups++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_SUPER:
|
2015-02-28 14:15:53 +01:00
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0] = 5;
|
|
|
|
weapon[W_PLAYER_WEAPON].damage = 5;
|
|
|
|
weapon[W_PLAYER_WEAPON].reload[0] = rate2reload[5];
|
|
|
|
weapon[W_PLAYER_WEAPON].flags |= WF_SPREAD;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
sprintf(temp, "Picked up a Super Charge!!");
|
|
|
|
|
|
|
|
if (player.ammo[0] < 50)
|
|
|
|
player.ammo[0] = 50;
|
|
|
|
currentGame.powerups++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_PLASMA_AMMO:
|
2011-09-11 21:57:57 +02:00
|
|
|
if (player.ammo[0] >= currentGame.maxPlasmaAmmo)
|
|
|
|
sprintf(temp, "Plasma cells already at Maximum");
|
2011-08-24 14:14:44 +02:00
|
|
|
else
|
|
|
|
{
|
2011-09-11 21:57:57 +02:00
|
|
|
limitCharAdd(&player.ammo[0], collectable->value, 0, currentGame.maxPlasmaAmmo);
|
2011-08-24 14:14:44 +02:00
|
|
|
if (collectable->value > 1)
|
|
|
|
{
|
|
|
|
sprintf(temp, "Got %d plasma cells", collectable->value);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sprintf(temp, "Got a plasma cell");
|
|
|
|
if ((rand() % 25) == 0)
|
|
|
|
sprintf(temp, "Got one whole plasma cell (wahoo!)");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
currentGame.cellPickups += collectable->value;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_CARGO:
|
|
|
|
strcpy(temp, "Picked up some Cargo");
|
|
|
|
currentGame.cargoPickups++;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_SLAVES:
|
|
|
|
sprintf(temp, "Rescued %d slaves", collectable->value);
|
|
|
|
currentGame.slavesRescued += collectable->value;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_ESCAPEPOD:
|
|
|
|
sprintf(temp, "Picked up an Escape Pod");
|
|
|
|
break;
|
|
|
|
|
|
|
|
case P_ORE:
|
|
|
|
sprintf(temp, "Picked up some Ore");
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
|
|
|
updateMissionRequirements(M_COLLECT, collectable->type,
|
|
|
|
collectable->value);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
collectable->active = false;
|
2011-08-24 14:14:44 +02:00
|
|
|
if (collectable->type != P_MINE)
|
|
|
|
{
|
|
|
|
setInfoLine(temp, FONT_WHITE);
|
|
|
|
if (collectable->type == P_SHIELD)
|
2015-03-08 15:38:58 +01:00
|
|
|
audio_playSound(SFX_SHIELDUP, player.x);
|
2011-08-24 14:14:44 +02:00
|
|
|
else
|
2015-03-08 15:38:58 +01:00
|
|
|
audio_playSound(SFX_PICKUP, player.x);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// stop people from exploiting a weapon check condition
|
|
|
|
if (player.ammo[0] == 0)
|
|
|
|
{
|
2015-02-28 14:15:53 +01:00
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0] = currentGame.minPlasmaOutput;
|
|
|
|
weapon[W_PLAYER_WEAPON].damage = currentGame.minPlasmaDamage;
|
|
|
|
weapon[W_PLAYER_WEAPON].reload[0] = rate2reload[currentGame.minPlasmaRate];
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (collectable->life < 1)
|
|
|
|
{
|
2011-08-26 16:14:58 +02:00
|
|
|
collectable->active = false;
|
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
|
|
|
if ((collectable->type == P_CARGO) ||
|
|
|
|
(collectable->type == P_ESCAPEPOD) ||
|
|
|
|
(collectable->type == P_SLAVES))
|
2011-08-24 14:14:44 +02:00
|
|
|
updateMissionRequirements(M_PROTECT_PICKUP, collectable->type, 1);
|
|
|
|
}
|
|
|
|
|
2011-08-26 16:14:58 +02:00
|
|
|
if (collectable->active)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
prevCollectable = collectable;
|
|
|
|
engine.collectableTail = collectable;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (collectable->type == P_MINE)
|
|
|
|
explodeMine(collectable);
|
|
|
|
prevCollectable->next = collectable->next;
|
|
|
|
delete collectable;
|
|
|
|
collectable = prevCollectable;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|