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, 2013 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
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
static ShopItem shopItems[MAX_SHOPITEMS];
|
|
|
|
static signed char shopSelectedItem;
|
|
|
|
|
2015-03-07 01:50:36 +01:00
|
|
|
static void sell(int i);
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
static void drawSecondaryWeaponSurface()
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
2012-03-11 15:16:19 +01:00
|
|
|
char description[50] = "";
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Secondary Weapon", 10, 3, FONT_WHITE, shopSurface[2]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
switch (player.weaponType[1])
|
|
|
|
{
|
|
|
|
case W_NONE:
|
|
|
|
strcpy(description, "Type : None");
|
|
|
|
break;
|
|
|
|
case W_ROCKETS:
|
|
|
|
strcpy(description, "Type : Rockets");
|
|
|
|
break;
|
|
|
|
case W_DOUBLE_ROCKETS:
|
|
|
|
strcpy(description, "Type : Dbl Rockets");
|
|
|
|
break;
|
|
|
|
case W_MICRO_ROCKETS:
|
|
|
|
strcpy(description, "Type : Micro Rockets");
|
|
|
|
break;
|
|
|
|
case W_LASER:
|
|
|
|
strcpy(description, "Type : Laser");
|
|
|
|
break;
|
|
|
|
case W_CHARGER:
|
|
|
|
strcpy(description, "Type : Charger");
|
|
|
|
break;
|
|
|
|
case W_HOMING_MISSILE:
|
|
|
|
strcpy(description, "Type : Homing Missile");
|
|
|
|
break;
|
|
|
|
case W_DOUBLE_HOMING_MISSILES:
|
|
|
|
strcpy(description, "Type : Dbl Homing Missiles");
|
|
|
|
break;
|
|
|
|
case W_MICRO_HOMING_MISSILES:
|
|
|
|
strcpy(description, "Type : Mcr Homing Missiles");
|
|
|
|
break;
|
|
|
|
}
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 22, FONT_WHITE, shopSurface[2]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
if ((player.weaponType[1] != W_LASER) &&
|
|
|
|
(player.weaponType[1] != W_CHARGER) && (player.weaponType[1] != W_NONE))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
2015-05-21 01:41:43 +02:00
|
|
|
sprintf(description, "Capacity : %d", game.maxRocketAmmo);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 37, FONT_WHITE, shopSurface[2]);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
static void adjustShopPrices()
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
2015-03-29 00:52:03 +01:00
|
|
|
{
|
|
|
|
shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (500 *
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaOutput);
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (500 *
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaDamage);
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_RATE].price = (500 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.maxPlasmaRate * 2 - 1));
|
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
|
|
|
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (2000 *
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaOutput);
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (2000 *
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaDamage);
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].price = (2000 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.minPlasmaRate * 2 - 1));
|
2015-03-29 00:52:03 +01:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
shopItems[SHOP_PLASMA_MAX_OUTPUT].price = (1000 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.maxPlasmaOutput + 1));
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_DAMAGE].price = (1000 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.maxPlasmaDamage + 1));
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_RATE].price = (1000 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.maxPlasmaRate + 1));
|
2015-03-29 00:52:03 +01:00
|
|
|
|
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].price = (1500 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.minPlasmaOutput + 1));
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].price = (1500 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.minPlasmaDamage + 1));
|
2015-03-29 00:52:03 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].price = (1500 *
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.minPlasmaRate + 1));
|
2015-03-29 00:52:03 +01:00
|
|
|
}
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaOutput <= game.minPlasmaOutput)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].price += shopItems[SHOP_PLASMA_MAX_OUTPUT].price;
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaDamage <= game.minPlasmaDamage)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].price += shopItems[SHOP_PLASMA_MAX_DAMAGE].price;
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaRate <= game.minPlasmaRate)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].price += shopItems[SHOP_PLASMA_MAX_RATE].price;
|
2015-03-06 17:48:45 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
shopItems[SHOP_PLASMA_MAX_AMMO].price = (10 * (game.maxPlasmaAmmo - 75));
|
|
|
|
shopItems[SHOP_ROCKET_MAX_AMMO].price = (25 * game.maxRocketAmmo);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaOutput >= game.maxPlasmaOutputLimit)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_OUTPUT].price = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaDamage >= game.maxPlasmaDamageLimit)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_DAMAGE].price = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaRate >= game.maxPlasmaRateLimit)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_RATE].price = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaOutput >= game.minPlasmaOutputLimit)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].price = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaDamage >= game.minPlasmaDamageLimit)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].price = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaRate >= game.minPlasmaRateLimit)
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].price = 0;
|
2015-03-07 21:34:47 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaAmmo >= game.maxPlasmaAmmoLimit)
|
2015-03-07 21:34:47 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_AMMO].price = 0;
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxRocketAmmo >= game.maxRocketAmmoLimit)
|
2015-03-07 21:34:47 +01:00
|
|
|
shopItems[SHOP_ROCKET_MAX_AMMO].price = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
static void drawShop()
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
adjustShopPrices();
|
|
|
|
|
|
|
|
for (int i = 0 ; i < MAX_SHOPSHAPES ; i++)
|
|
|
|
{
|
2011-08-26 23:53:46 +02:00
|
|
|
if (shopSurface[i] != NULL)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
2011-08-26 23:53:46 +02:00
|
|
|
SDL_FreeSurface(shopSurface[i]);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
for (int i = 0 ; i < 3 ; i++)
|
2011-08-26 23:53:46 +02:00
|
|
|
shopSurface[i] = createSurface(246, 91);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
for (int i = 0 ; i < 3 ; i++)
|
|
|
|
{
|
2011-08-26 23:53:46 +02:00
|
|
|
blevelRect(shopSurface[i], 0, 0, 245, 90, 0x00, 0x00, 0x55);
|
|
|
|
blevelRect(shopSurface[i], 0, 0, 245, 20, 0x00, 0x00, 0x99);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
shopSurface[4] = alphaRect(601, 101, 0x00, 0x00, 0x00);
|
|
|
|
blevelRect(shopSurface[4], 0, 0, 600, 100, 0x00, 0x00, 0x33);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
switch (shopSelectedItem)
|
|
|
|
{
|
|
|
|
case -1:
|
|
|
|
case -2:
|
|
|
|
case -3:
|
|
|
|
case -4:
|
|
|
|
case -5:
|
|
|
|
case -6:
|
|
|
|
break;
|
|
|
|
case 0:
|
|
|
|
case 1:
|
|
|
|
case 2:
|
|
|
|
case 8:
|
2011-08-26 23:53:46 +02:00
|
|
|
blevelRect(shopSurface[1], 0, 0, 245, 90, 0x55, 0x00, 0x00);
|
|
|
|
blevelRect(shopSurface[1], 0, 0, 245, 20, 0x99, 0x00, 0x00);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
case 4:
|
2011-08-26 23:53:46 +02:00
|
|
|
blevelRect(shopSurface[4], 0, 0, 600, 100, 0x33, 0x00, 0x00);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
case 6:
|
|
|
|
case 7:
|
2011-08-26 23:53:46 +02:00
|
|
|
blevelRect(shopSurface[0], 0, 0, 245, 90, 0x55, 0x00, 0x00);
|
|
|
|
blevelRect(shopSurface[0], 0, 0, 245, 20, 0x99, 0x00, 0x00);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
default:
|
2011-08-26 23:53:46 +02:00
|
|
|
blevelRect(shopSurface[2], 0, 0, 245, 90, 0x55, 0x00, 0x00);
|
|
|
|
blevelRect(shopSurface[2], 0, 0, 245, 20, 0x99, 0x00, 0x00);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
char description[100];
|
|
|
|
strcpy(description, "");
|
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Primary Weapon", 10, 3, FONT_WHITE, shopSurface[0]);
|
2015-05-21 01:41:43 +02:00
|
|
|
sprintf(description, "Plasma Cannons : %d", game.minPlasmaOutput);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 22, FONT_WHITE, shopSurface[0]);
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(description, "Plasma Power : Stage %d",
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaDamage);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 37, FONT_WHITE, shopSurface[0]);
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(description, "Cooler : Stage %d",
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaRate);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 52, FONT_WHITE, shopSurface[0]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Powerup Weapon", 10, 3, FONT_WHITE, shopSurface[1]);
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(description, "Plasma Output : Stage %d",
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaOutput);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 22, FONT_WHITE, shopSurface[1]);
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(description, "Plasma Condensor : Stage %d",
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaDamage);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 37, FONT_WHITE, shopSurface[1]);
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(description, "Liquid Nitrogen : Stage %d",
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaRate);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 52, FONT_WHITE, shopSurface[1]);
|
2015-05-21 01:41:43 +02:00
|
|
|
sprintf(description, "Plasma Capacity : %d", game.maxPlasmaAmmo);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 67, FONT_WHITE, shopSurface[1]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
drawSecondaryWeaponSurface();
|
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
shopSurface[3] = createSurface(601, 121);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
blevelRect(shopSurface[3], 0, 0, 600, 120, 0x00, 0x00, 0x22);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Temporary Weapons", 10, 2, FONT_WHITE, shopSurface[3]);
|
|
|
|
drawString("Ammo and Storage", 260, 2, FONT_WHITE, shopSurface[3]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Primary Weapons", 10, 62, FONT_WHITE, shopSurface[3]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Secondary Weapons", 260, 62, FONT_WHITE, shopSurface[3]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
signed char icons = MAX_SHOPITEMS;
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.system == 0)
|
2015-03-06 21:22:10 +01:00
|
|
|
icons = SHOP_DOUBLE_ROCKETS + 1;
|
2015-05-21 01:41:43 +02:00
|
|
|
else if (game.system == 1)
|
2015-03-06 21:22:10 +01:00
|
|
|
icons = SHOP_LASER + 1;
|
2015-05-21 01:41:43 +02:00
|
|
|
else if (game.system == 2)
|
2015-03-06 21:22:10 +01:00
|
|
|
icons = SHOP_CHARGER + 1;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
for (int i = 0 ; i < icons ; i++)
|
2015-03-06 22:25:12 +01:00
|
|
|
{
|
|
|
|
blit(shape[shopItems[i].image], shopItems[i].x - 90,
|
|
|
|
shopItems[i].y - 178, shopSurface[3]);
|
|
|
|
}
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-02-27 02:51:30 +01:00
|
|
|
sprintf(description, "Shield Units : %d", player.maxShield);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 4, FONT_WHITE, shopSurface[4]);
|
2015-05-21 01:41:43 +02:00
|
|
|
sprintf(description, "Cash : $%d", game.cash);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 10, 80, FONT_WHITE, shopSurface[4]);
|
2011-08-24 14:14:44 +02:00
|
|
|
sprintf(description, "Plasma Cells : %.3d", player.ammo[0]);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 430, 4, FONT_WHITE, shopSurface[4]);
|
2011-08-24 14:14:44 +02:00
|
|
|
sprintf(description, "Rockets : %.3d", player.ammo[1]);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 475, 80, FONT_WHITE, shopSurface[4]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
shopSurface[5] = createSurface(601, 56);
|
|
|
|
blevelRect(shopSurface[5], 0, 0, 600, 35, 0x00, 0x99, 0x00);
|
|
|
|
blevelRect(shopSurface[5], 0, 20, 600, 35, 0x00, 0x33, 0x00);
|
|
|
|
drawString("Information", 5, 4, FONT_WHITE, shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
switch (shopSelectedItem)
|
|
|
|
{
|
|
|
|
case -1:
|
|
|
|
break;
|
|
|
|
case -2:
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString("You don't have enough money", 20, 30, FONT_WHITE,
|
|
|
|
shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case -3:
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Cannot upgrade ship", 5, 22, FONT_WHITE, shopSurface[5]);
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString("Hardware capacity has been reached", 20, 38, FONT_CYAN,
|
|
|
|
shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case -4:
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString("Ammunition limit reached", 20, 30, FONT_WHITE,
|
|
|
|
shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case -5:
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString("You cannot sell that item", 20, 30, FONT_WHITE,
|
|
|
|
shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case -6:
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString("Nothing to sell", 20, 30, FONT_WHITE, shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case -7:
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString("Rockets cannot be bought for Laser or Charger Cannon",
|
|
|
|
5, 30, FONT_WHITE, shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case -8:
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString("You already have that weapon", 20, 30, FONT_WHITE,
|
|
|
|
shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
case -9:
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString("This weapon's ammo limit has been reached", 20, 30,
|
|
|
|
FONT_WHITE, shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (shopItems[shopSelectedItem].price != 0)
|
|
|
|
{
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(description, "%s ($%d)",
|
|
|
|
shopItems[shopSelectedItem].description,
|
|
|
|
shopItems[shopSelectedItem].price);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(description, "%s (N/A)",
|
|
|
|
shopItems[shopSelectedItem].description);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
2015-03-07 15:42:24 +01:00
|
|
|
drawString(shopItems[shopSelectedItem].name, 5, 22, FONT_WHITE,
|
|
|
|
shopSurface[5]);
|
2011-08-26 23:53:46 +02:00
|
|
|
drawString(description, 20, 38, FONT_CYAN, shopSurface[5]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void initShop()
|
|
|
|
{
|
|
|
|
/* ----------- Temporary Items ----------- */
|
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_OUTPUT].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_OUTPUT].name, "Plasma channel splitter");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_OUTPUT].description,
|
|
|
|
"Improves poweredup plasma output");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_OUTPUT].image = 9;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_DAMAGE].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_DAMAGE].name, "Plasma capacity condensor");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_DAMAGE].description,
|
|
|
|
"Increases poweredup plasma damage");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_DAMAGE].image = 10;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_RATE].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_RATE].name, "Liquid nitrogen capsules");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_RATE].description,
|
|
|
|
"Increases plasma firing rate");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_RATE].image = 11;
|
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
|
|
|
shopItems[SHOP_PLASMA_AMMO].price = 10;
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_AMMO].name, "10 Plasma cells");
|
|
|
|
strcpy(shopItems[SHOP_PLASMA_AMMO].description, "Plasma ammunition");
|
|
|
|
shopItems[SHOP_PLASMA_AMMO].image = 12;
|
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
|
|
|
shopItems[SHOP_ROCKET_AMMO].price = 10;
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_ROCKET_AMMO].name, "Rocket Ammo");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_ROCKET_AMMO].description,
|
|
|
|
"High velocity dumb fire rocket");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_ROCKET_AMMO].image = 13;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
/* ----------- Permanent Items ----------- */
|
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MIN_OUTPUT].name, "Additional Plasma Cannon");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MIN_OUTPUT].description,
|
|
|
|
"Adds an extra plasma cannon to the Firefly");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].image = 14;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MIN_DAMAGE].name, "Plasma Power Booster");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MIN_DAMAGE].description,
|
|
|
|
"Increases power of plasma shots");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].image = 15;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MIN_RATE].name, "Plasma Cooling Booster");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MIN_RATE].description,
|
|
|
|
"Permanently increases firing rate");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].image = 16;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
/* ----------- Ammo Items -------------- */
|
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_AMMO].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_AMMO].name, "Plasma compressor");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_PLASMA_MAX_AMMO].description,
|
|
|
|
"Increases plasma ammo capacity");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_AMMO].image = 17;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-07 15:42:24 +01:00
|
|
|
shopItems[SHOP_ROCKET_MAX_AMMO].price = 0; // Overwritten later
|
2015-03-06 21:22:10 +01:00
|
|
|
strcpy(shopItems[SHOP_ROCKET_MAX_AMMO].name, "Rocket Pod");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_ROCKET_MAX_AMMO].description,
|
|
|
|
"Allows for an additional 5 rockets to be carried");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_ROCKET_MAX_AMMO].image = 18;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
/* ---------- Weaponary --------------- */
|
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_DOUBLE_ROCKETS].price = 2000;
|
|
|
|
strcpy(shopItems[SHOP_DOUBLE_ROCKETS].name, "Dual Rocket Launcher");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_DOUBLE_ROCKETS].description,
|
|
|
|
"Allows for two rockets to be fired at once");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_DOUBLE_ROCKETS].image = 19;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_MICRO_ROCKETS].price = 2500;
|
|
|
|
strcpy(shopItems[SHOP_MICRO_ROCKETS].name, "Micro Rocket Launcher");
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_MICRO_ROCKETS].description,
|
|
|
|
"Launches several less powerful rockets at once");
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_MICRO_ROCKETS].image = 20;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_LASER].price = 5000;
|
|
|
|
strcpy(shopItems[SHOP_LASER].name, "Laser Cannon");
|
|
|
|
strcpy(shopItems[SHOP_LASER].description, "Laser Cannon");
|
|
|
|
shopItems[SHOP_LASER].image = 21;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_HOMING_MISSILE].price = 7500;
|
|
|
|
strcpy(shopItems[SHOP_HOMING_MISSILE].name, "Homing Missile Launcher");
|
2015-03-07 15:42:24 +01:00
|
|
|
sprintf(shopItems[SHOP_HOMING_MISSILE].description,
|
|
|
|
"Fires homing missile (max %i missiles)", maxHoming);
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_HOMING_MISSILE].image = 22;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_CHARGER].price = 10000;
|
|
|
|
strcpy(shopItems[SHOP_CHARGER].name, "Charge Cannon");
|
|
|
|
strcpy(shopItems[SHOP_CHARGER].description, "A charge up cannon");
|
|
|
|
shopItems[SHOP_CHARGER].image = 23;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_DOUBLE_HOMING_MISSILES].price = 10000;
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_DOUBLE_HOMING_MISSILES].name,
|
|
|
|
"Dual Homing Missile Launcher");
|
2015-03-06 21:22:10 +01:00
|
|
|
sprintf(shopItems[SHOP_DOUBLE_HOMING_MISSILES].description,
|
2015-03-03 15:25:32 +01:00
|
|
|
"Fires two homing missiles (max %i missiles)", maxDoubleHoming);
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_DOUBLE_HOMING_MISSILES].image = 24;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_MICRO_HOMING_MISSILES].price = 15000;
|
2015-03-07 15:42:24 +01:00
|
|
|
strcpy(shopItems[SHOP_MICRO_HOMING_MISSILES].name,
|
|
|
|
"Homing Micro Missile Launcher");
|
2015-03-06 21:22:10 +01:00
|
|
|
sprintf(shopItems[SHOP_MICRO_HOMING_MISSILES].description,
|
2015-03-03 15:25:32 +01:00
|
|
|
"Fires several small homing missiles (max %i missiles)", maxMicroHoming);
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_MICRO_HOMING_MISSILES].image = 25;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 22:25:12 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_OUTPUT].x = 100;
|
|
|
|
shopItems[SHOP_PLASMA_MAX_OUTPUT].y = 200;
|
|
|
|
|
|
|
|
shopItems[SHOP_PLASMA_MAX_DAMAGE].x = 150;
|
|
|
|
shopItems[SHOP_PLASMA_MAX_DAMAGE].y = 200;
|
|
|
|
|
|
|
|
shopItems[SHOP_PLASMA_MAX_RATE].x = 200;
|
|
|
|
shopItems[SHOP_PLASMA_MAX_RATE].y = 200;
|
|
|
|
|
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].x = 100;
|
|
|
|
shopItems[SHOP_PLASMA_MIN_OUTPUT].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].x = 150;
|
|
|
|
shopItems[SHOP_PLASMA_MIN_DAMAGE].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].x = 200;
|
|
|
|
shopItems[SHOP_PLASMA_MIN_RATE].y = 260;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_PLASMA_AMMO].x = 350;
|
|
|
|
shopItems[SHOP_PLASMA_AMMO].y = 200;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
shopItems[SHOP_ROCKET_AMMO].x = 400;
|
|
|
|
shopItems[SHOP_ROCKET_AMMO].y = 200;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 22:25:12 +01:00
|
|
|
shopItems[SHOP_PLASMA_MAX_AMMO].x = 450;
|
|
|
|
shopItems[SHOP_PLASMA_MAX_AMMO].y = 200;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 22:25:12 +01:00
|
|
|
shopItems[SHOP_ROCKET_MAX_AMMO].x = 500;
|
|
|
|
shopItems[SHOP_ROCKET_MAX_AMMO].y = 200;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2015-03-06 22:25:12 +01:00
|
|
|
shopItems[SHOP_DOUBLE_ROCKETS].x = 350;
|
|
|
|
shopItems[SHOP_DOUBLE_ROCKETS].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_MICRO_ROCKETS].x = 400;
|
|
|
|
shopItems[SHOP_MICRO_ROCKETS].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_LASER].x = 450;
|
|
|
|
shopItems[SHOP_LASER].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_HOMING_MISSILE].x = 500;
|
|
|
|
shopItems[SHOP_HOMING_MISSILE].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_CHARGER].x = 550;
|
|
|
|
shopItems[SHOP_CHARGER].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_DOUBLE_HOMING_MISSILES].x = 600;
|
|
|
|
shopItems[SHOP_DOUBLE_HOMING_MISSILES].y = 260;
|
|
|
|
|
|
|
|
shopItems[SHOP_MICRO_HOMING_MISSILES].x = 650;
|
|
|
|
shopItems[SHOP_MICRO_HOMING_MISSILES].y = 260;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
player.image[0] = shape[0];
|
2011-08-24 14:14:44 +02:00
|
|
|
player.x = 380;
|
|
|
|
player.y = 95;
|
|
|
|
|
|
|
|
drawShop();
|
|
|
|
}
|
|
|
|
|
2015-03-07 01:50:36 +01:00
|
|
|
static void shop_sellSecondaryWeapon()
|
|
|
|
{
|
|
|
|
switch (player.weaponType[1])
|
|
|
|
{
|
|
|
|
case W_DOUBLE_ROCKETS:
|
2015-03-18 00:20:04 +01:00
|
|
|
sell(SHOP_DOUBLE_ROCKETS);
|
2015-03-07 01:50:36 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case W_MICRO_ROCKETS:
|
|
|
|
sell(SHOP_MICRO_ROCKETS);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case W_LASER:
|
|
|
|
sell(SHOP_LASER);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case W_HOMING_MISSILE:
|
|
|
|
sell(SHOP_HOMING_MISSILE);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case W_CHARGER:
|
|
|
|
sell(SHOP_CHARGER);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case W_DOUBLE_HOMING_MISSILES:
|
|
|
|
sell(SHOP_DOUBLE_HOMING_MISSILES);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case W_MICRO_HOMING_MISSILES:
|
|
|
|
sell(SHOP_MICRO_HOMING_MISSILES);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
static void buy(int i)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
2015-05-21 01:41:43 +02:00
|
|
|
if ((game.cash < shopItems[i].price) && (!engine.cheatCash))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
shopSelectedItem = -2;
|
|
|
|
drawShop();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
switch (i)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_OUTPUT:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaOutput >= game.maxPlasmaOutputLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaOutput++;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_DAMAGE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaDamage >= game.maxPlasmaDamageLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaDamage++;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_RATE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaRate >= game.maxPlasmaRateLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaRate++;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_AMMO:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (player.ammo[0] >= game.maxPlasmaAmmo)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -4;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
LIMIT_ADD(player.ammo[0], 10, 0, game.maxPlasmaAmmo);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_ROCKET_AMMO:
|
2015-03-06 18:36:02 +01:00
|
|
|
if ((player.weaponType[1] == W_CHARGER) ||
|
|
|
|
(player.weaponType[1] == W_LASER))
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -7;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
if (player.ammo[1] == game.maxRocketAmmo)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -4;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
|
|
|
|
(player.ammo[1] >= maxHoming))
|
|
|
|
{
|
|
|
|
shopSelectedItem = -9;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
|
|
|
|
(player.ammo[1] >= maxDoubleHoming))
|
|
|
|
{
|
|
|
|
shopSelectedItem = -9;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
|
|
|
|
(player.ammo[1] >= maxMicroHoming))
|
|
|
|
{
|
|
|
|
shopSelectedItem = -9;
|
|
|
|
return;
|
|
|
|
}
|
2011-08-24 14:14:44 +02:00
|
|
|
player.ammo[1]++;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MIN_OUTPUT:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaOutput >= game.minPlasmaOutputLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaOutput++;
|
|
|
|
if (game.maxPlasmaOutput < game.minPlasmaOutput)
|
|
|
|
game.maxPlasmaOutput = game.minPlasmaOutput;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MIN_DAMAGE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaDamage >= game.minPlasmaDamageLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaDamage++;
|
|
|
|
if (game.maxPlasmaDamage < game.minPlasmaDamage)
|
|
|
|
game.maxPlasmaDamage = game.minPlasmaDamage;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MIN_RATE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaRate >= game.minPlasmaRateLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaRate++;
|
|
|
|
if (game.maxPlasmaRate < game.minPlasmaRate)
|
|
|
|
game.maxPlasmaRate = game.minPlasmaRate;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_AMMO:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaAmmo >= game.maxPlasmaAmmoLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaAmmo += 25;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_ROCKET_MAX_AMMO:
|
2015-03-06 18:36:02 +01:00
|
|
|
if ((player.weaponType[1] == W_CHARGER) ||
|
|
|
|
(player.weaponType[1] == W_LASER))
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -7;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-06 18:36:02 +01:00
|
|
|
if ((player.weaponType[1] == W_HOMING_MISSILE) &&
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.maxRocketAmmo >= maxHoming))
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -9;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-06 18:36:02 +01:00
|
|
|
if ((player.weaponType[1] == W_DOUBLE_HOMING_MISSILES) &&
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.maxRocketAmmo >= maxDoubleHoming))
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -9;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-06 18:36:02 +01:00
|
|
|
if ((player.weaponType[1] == W_MICRO_HOMING_MISSILES) &&
|
2015-05-21 01:41:43 +02:00
|
|
|
(game.maxRocketAmmo >= maxMicroHoming))
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -9;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxRocketAmmo >= game.maxRocketAmmoLimit)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -3;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxRocketAmmo += 5;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_DOUBLE_ROCKETS:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] == W_DOUBLE_ROCKETS)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -8;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
shop_sellSecondaryWeapon();
|
2011-08-24 14:14:44 +02:00
|
|
|
player.weaponType[1] = W_DOUBLE_ROCKETS;
|
2015-05-21 01:41:43 +02:00
|
|
|
LIMIT(game.maxRocketAmmo, 5, 50);
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_MICRO_ROCKETS:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] == W_MICRO_ROCKETS)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -8;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
shop_sellSecondaryWeapon();
|
2011-08-24 14:14:44 +02:00
|
|
|
player.weaponType[1] = W_MICRO_ROCKETS;
|
2015-05-21 01:41:43 +02:00
|
|
|
LIMIT(game.maxRocketAmmo, 5, 50);
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_LASER:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] == W_LASER)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -8;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
shop_sellSecondaryWeapon();
|
2011-08-24 14:14:44 +02:00
|
|
|
player.weaponType[1] = W_LASER;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.maxRocketAmmo > 5)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_ROCKET_MAX_AMMO);
|
|
|
|
while (player.ammo[1] > 0)
|
|
|
|
sell(SHOP_ROCKET_AMMO);
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_HOMING_MISSILE:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] == W_HOMING_MISSILE)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -8;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
shop_sellSecondaryWeapon();
|
2011-08-24 14:14:44 +02:00
|
|
|
player.weaponType[1] = W_HOMING_MISSILE;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.maxRocketAmmo > maxHoming)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_ROCKET_MAX_AMMO);
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
LIMIT(game.maxRocketAmmo, 5, maxHoming);
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_CHARGER:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] == W_CHARGER)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -8;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
shop_sellSecondaryWeapon();
|
2011-08-24 14:14:44 +02:00
|
|
|
player.weaponType[1] = W_CHARGER;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.maxRocketAmmo > 5)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_ROCKET_MAX_AMMO);
|
|
|
|
while (player.ammo[1] > 0)
|
|
|
|
sell(SHOP_ROCKET_AMMO);
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_DOUBLE_HOMING_MISSILES:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] == W_DOUBLE_HOMING_MISSILES)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -8;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
shop_sellSecondaryWeapon();
|
2011-08-24 14:14:44 +02:00
|
|
|
player.weaponType[1] = W_DOUBLE_HOMING_MISSILES;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.maxRocketAmmo > maxDoubleHoming)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_ROCKET_MAX_AMMO);
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
LIMIT(game.maxRocketAmmo, 5, maxDoubleHoming);
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_MICRO_HOMING_MISSILES:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] == W_MICRO_HOMING_MISSILES)
|
2015-03-03 15:25:32 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -8;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
shop_sellSecondaryWeapon();
|
2011-08-24 14:14:44 +02:00
|
|
|
player.weaponType[1] = W_MICRO_HOMING_MISSILES;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.maxRocketAmmo > maxMicroHoming)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_ROCKET_MAX_AMMO);
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
LIMIT(game.maxRocketAmmo, 5, maxMicroHoming);
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!engine.cheatCash)
|
2015-05-21 01:41:43 +02:00
|
|
|
game.cash -= shopItems[i].price;
|
2015-03-04 01:28:15 +01:00
|
|
|
saveGame(0);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
|
2011-08-26 21:29:04 +02:00
|
|
|
static void sell(int i)
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
switch (i)
|
|
|
|
{
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_OUTPUT:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaOutput <= 1)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -5;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.minPlasmaOutput >= game.maxPlasmaOutput)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_PLASMA_MIN_OUTPUT);
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaOutput--;
|
|
|
|
if (weapon[W_PLAYER_WEAPON].ammo[0] <= game.maxPlasmaOutput + 1)
|
2015-04-09 02:33:53 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0] = MIN(
|
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0],
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaOutput);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_DAMAGE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaDamage <= 1)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -5;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.minPlasmaDamage >= game.maxPlasmaDamage)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_PLASMA_MIN_DAMAGE);
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaDamage--;
|
|
|
|
if (weapon[W_PLAYER_WEAPON].damage <= game.maxPlasmaDamage + 1)
|
2015-04-09 02:33:53 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].damage = MIN(
|
|
|
|
weapon[W_PLAYER_WEAPON].damage,
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaDamage);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_RATE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaRate <= 1)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -5;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (game.minPlasmaRate >= game.maxPlasmaRate)
|
2015-03-29 14:58:03 +02:00
|
|
|
sell(SHOP_PLASMA_MIN_RATE);
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaRate--;
|
|
|
|
if (weapon[W_PLAYER_WEAPON].reload[0] >= rate2reload[game.maxPlasmaRate + 1])
|
2015-04-09 02:33:53 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].reload[0] = MAX(
|
|
|
|
weapon[W_PLAYER_WEAPON].reload[0],
|
2015-05-21 01:41:43 +02:00
|
|
|
rate2reload[game.maxPlasmaRate]);
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MIN_OUTPUT:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaOutput <= 1)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -5;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaOutput--;
|
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 (player.ammo[0] <= 0)
|
2015-05-21 01:41:43 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0] = game.minPlasmaOutput;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MIN_DAMAGE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaDamage <= 1)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -5;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaDamage--;
|
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 (player.ammo[0] <= 0)
|
2015-05-21 01:41:43 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].damage = game.minPlasmaDamage;
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MIN_RATE:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.minPlasmaRate <= 1)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -5;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.minPlasmaRate--;
|
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 (player.ammo[0] <= 0)
|
2015-05-21 01:41:43 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].reload[0] = rate2reload[game.minPlasmaRate];
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
|
|
|
case SHOP_PLASMA_AMMO:
|
|
|
|
if (player.ammo[0] <= 0)
|
|
|
|
{
|
|
|
|
shopSelectedItem = -6;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (player.ammo[0] > 10)
|
|
|
|
player.ammo[0] -= 10;
|
|
|
|
else
|
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
|
|
|
{
|
2015-03-07 01:50:36 +01:00
|
|
|
player.ammo[0] = 0;
|
2015-05-21 01:41:43 +02:00
|
|
|
weapon[W_PLAYER_WEAPON].ammo[0] = game.minPlasmaOutput;
|
|
|
|
weapon[W_PLAYER_WEAPON].damage = game.minPlasmaDamage;
|
|
|
|
weapon[W_PLAYER_WEAPON].reload[0] = rate2reload[game.minPlasmaRate];
|
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
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
break;
|
|
|
|
|
|
|
|
case SHOP_ROCKET_AMMO:
|
|
|
|
if (player.ammo[1] <= 0)
|
|
|
|
{
|
|
|
|
shopSelectedItem = -6;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
player.ammo[1]--;
|
|
|
|
break;
|
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_PLASMA_MAX_AMMO:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxPlasmaAmmo <= 100)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxPlasmaAmmo -= 25;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (player.ammo[0] > game.maxPlasmaAmmo)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_PLASMA_AMMO);
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_ROCKET_MAX_AMMO:
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.maxRocketAmmo <= 5)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-05-21 01:41:43 +02:00
|
|
|
game.maxRocketAmmo -= 5;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
while (player.ammo[1] > game.maxRocketAmmo)
|
2015-03-07 01:50:36 +01:00
|
|
|
sell(SHOP_ROCKET_AMMO);
|
|
|
|
|
2011-08-24 14:14:44 +02:00
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_DOUBLE_ROCKETS:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] != W_DOUBLE_ROCKETS)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
player.weaponType[1] = W_ROCKETS;
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_MICRO_ROCKETS:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] != W_MICRO_ROCKETS)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
player.weaponType[1] = W_ROCKETS;
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_LASER:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] != W_LASER)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
player.weaponType[1] = W_ROCKETS;
|
2011-08-24 14:14:44 +02:00
|
|
|
player.ammo[1] = 0;
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_HOMING_MISSILE:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] != W_HOMING_MISSILE)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
player.weaponType[1] = W_ROCKETS;
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_CHARGER:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] != W_CHARGER)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
player.weaponType[1] = W_ROCKETS;
|
2011-08-24 14:14:44 +02:00
|
|
|
player.ammo[1] = 0;
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_DOUBLE_HOMING_MISSILES:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] != W_DOUBLE_HOMING_MISSILES)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
player.weaponType[1] = W_ROCKETS;
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
2015-03-07 01:50:36 +01:00
|
|
|
|
2015-03-06 21:22:10 +01:00
|
|
|
case SHOP_MICRO_HOMING_MISSILES:
|
2011-08-24 14:14:44 +02:00
|
|
|
if (player.weaponType[1] != W_MICRO_HOMING_MISSILES)
|
2015-03-06 18:36:02 +01:00
|
|
|
{
|
|
|
|
shopSelectedItem = -1;
|
|
|
|
return;
|
|
|
|
}
|
2015-03-07 01:50:36 +01:00
|
|
|
player.weaponType[1] = W_ROCKETS;
|
2011-08-24 14:14:44 +02:00
|
|
|
shopSelectedItem = -1;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2011-08-26 15:35:03 +02:00
|
|
|
adjustShopPrices();
|
2015-06-08 04:51:16 +02:00
|
|
|
|
|
|
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
|
|
|
game.cash += shopItems[i].price / 2;
|
|
|
|
else
|
|
|
|
game.cash += shopItems[i].price;
|
|
|
|
|
2015-03-04 01:28:15 +01:00
|
|
|
saveGame(0);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void showShop()
|
|
|
|
{
|
2011-08-26 23:53:46 +02:00
|
|
|
blit(shopSurface[0], 20, 395);
|
|
|
|
blit(shopSurface[1], 275, 395);
|
|
|
|
blit(shopSurface[2], 530, 395);
|
|
|
|
blit(shopSurface[3], 100, 180);
|
|
|
|
blit(shopSurface[4], 100, 50);
|
|
|
|
blit(shopSurface[5], 100, 320);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
if (shopSelectedItem > -1)
|
|
|
|
{
|
2011-08-26 23:53:46 +02:00
|
|
|
blit(shape[27], 60, 350);
|
|
|
|
blit(shape[28], 710, 350);
|
2011-08-24 14:14:44 +02:00
|
|
|
}
|
|
|
|
|
2011-08-26 23:53:46 +02:00
|
|
|
blit(shape[29], (int)player.x, (int)player.y);
|
2011-08-24 14:14:44 +02:00
|
|
|
|
|
|
|
signed char icons = MAX_SHOPITEMS;
|
|
|
|
|
2015-05-21 01:41:43 +02:00
|
|
|
if (game.system == 0)
|
2015-03-06 21:22:10 +01:00
|
|
|
icons = SHOP_DOUBLE_ROCKETS + 1;
|
2015-05-21 01:41:43 +02:00
|
|
|
else if (game.system == 1)
|
2015-03-06 21:22:10 +01:00
|
|
|
icons = SHOP_LASER + 1;
|
2015-05-21 01:41:43 +02:00
|
|
|
else if (game.system == 2)
|
2015-03-06 21:22:10 +01:00
|
|
|
icons = SHOP_CHARGER + 1;
|
2011-08-24 14:14:44 +02:00
|
|
|
|
2013-09-30 16:52:43 +02:00
|
|
|
if ((engine.keyState[KEY_FIRE]))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
for (int i = 0 ; i < icons ; i++)
|
|
|
|
{
|
2015-03-06 22:25:12 +01:00
|
|
|
if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6,
|
|
|
|
shopItems[i].x, shopItems[i].y, 32, 25))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
shopSelectedItem = i;
|
2013-09-30 16:52:43 +02:00
|
|
|
engine.keyState[KEY_FIRE] = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
drawShop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (shopSelectedItem > -1)
|
|
|
|
{
|
2011-08-26 23:27:16 +02:00
|
|
|
if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 60, 350, 24, 16))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
buy(shopSelectedItem);
|
2013-09-30 16:52:43 +02:00
|
|
|
engine.keyState[KEY_FIRE] = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
drawShop();
|
|
|
|
}
|
|
|
|
|
2011-08-26 23:27:16 +02:00
|
|
|
if (collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, 700, 350, 24, 16))
|
2011-08-24 14:14:44 +02:00
|
|
|
{
|
|
|
|
sell(shopSelectedItem);
|
2013-09-30 16:52:43 +02:00
|
|
|
engine.keyState[KEY_FIRE] = 0;
|
2011-08-24 14:14:44 +02:00
|
|
|
drawShop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|