Removed gameplay option, have different max shield based on difficulty
This commit is contained in:
parent
bf844b25eb
commit
182ea70ba1
16
src/defs.h
16
src/defs.h
|
@ -266,6 +266,14 @@ enum {
|
||||||
FACE_CREW
|
FACE_CREW
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Difficulties
|
||||||
|
enum {
|
||||||
|
DIFFICULTY_EASY,
|
||||||
|
DIFFICULTY_NORMAL,
|
||||||
|
DIFFICULTY_HARD,
|
||||||
|
DIFFICULTY_NIGHTMARE
|
||||||
|
};
|
||||||
|
|
||||||
#define MAX_WEAPONS 20
|
#define MAX_WEAPONS 20
|
||||||
#define MAX_SHAPES 100
|
#define MAX_SHAPES 100
|
||||||
#define MAX_SHIPSHAPES 120
|
#define MAX_SHIPSHAPES 120
|
||||||
|
@ -307,11 +315,3 @@ const int screenWidth = 800;
|
||||||
const int screenHeight = 600;
|
const int screenHeight = 600;
|
||||||
|
|
||||||
const int viewBorder = 100;
|
const int viewBorder = 100;
|
||||||
|
|
||||||
#define DIFFICULTY_EASY -1
|
|
||||||
#define DIFFICULTY_NORMAL 0
|
|
||||||
#define DIFFICULTY_HARD 1
|
|
||||||
#define DIFFICULTY_NIGHTMARE 2
|
|
||||||
|
|
||||||
#define GAMEPLAY_ORIGINAL 0
|
|
||||||
#define GAMEPLAY_ONPON 1
|
|
||||||
|
|
21
src/game.cpp
21
src/game.cpp
|
@ -67,19 +67,22 @@ void newGame()
|
||||||
currentGame.maxPlasmaAmmo = 100;
|
currentGame.maxPlasmaAmmo = 100;
|
||||||
currentGame.maxRocketAmmo = 10;
|
currentGame.maxRocketAmmo = 10;
|
||||||
|
|
||||||
if (currentGame.gamePlay == GAMEPLAY_ONPON)
|
switch (currentGame.difficulty)
|
||||||
{
|
{
|
||||||
currentGame.shieldUnits = 2;
|
case DIFFICULTY_EASY:
|
||||||
player.maxShield = 50;
|
player.maxShield = 100;
|
||||||
player.shield = 50;
|
break;
|
||||||
}
|
case DIFFICULTY_HARD:
|
||||||
else
|
|
||||||
{
|
|
||||||
currentGame.shieldUnits = 1;
|
|
||||||
player.maxShield = 25;
|
player.maxShield = 25;
|
||||||
player.shield = 25;
|
break;
|
||||||
|
case DIFFICULTY_NIGHTMARE:
|
||||||
|
player.maxShield = 1;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
player.maxShield = 50;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
player.shield = player.maxShield;
|
||||||
player.ammo[0] = 0;
|
player.ammo[0] = 0;
|
||||||
player.ammo[1] = 5;
|
player.ammo[1] = 5;
|
||||||
player.weaponType[0] = W_PLAYER_WEAPON;
|
player.weaponType[0] = W_PLAYER_WEAPON;
|
||||||
|
|
|
@ -582,8 +582,6 @@ int galaxyMap()
|
||||||
|
|
||||||
bool redrawBackGround = true;
|
bool redrawBackGround = true;
|
||||||
|
|
||||||
player.maxShield = (25 * currentGame.shieldUnits);
|
|
||||||
|
|
||||||
if (currentGame.distanceCovered > 0)
|
if (currentGame.distanceCovered > 0)
|
||||||
section = 0;
|
section = 0;
|
||||||
else
|
else
|
||||||
|
@ -833,7 +831,6 @@ int galaxyMap()
|
||||||
for (int i = 0 ; i < 12 ; i++)
|
for (int i = 0 ; i < 12 ; i++)
|
||||||
SDL_FreeSurface(iconInfo[i].image);
|
SDL_FreeSurface(iconInfo[i].image);
|
||||||
|
|
||||||
player.maxShield = (25 * currentGame.shieldUnits);
|
|
||||||
if (currentGame.distanceCovered == 0)
|
if (currentGame.distanceCovered == 0)
|
||||||
player.shield = player.maxShield;
|
player.shield = player.maxShield;
|
||||||
|
|
||||||
|
|
|
@ -99,7 +99,6 @@ bool loadGame(int slot)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
if(currentGame.saveFormat < 2) {
|
if(currentGame.saveFormat < 2) {
|
||||||
currentGame.gamePlay = GAMEPLAY_ORIGINAL;
|
|
||||||
currentGame.difficulty = DIFFICULTY_NORMAL;
|
currentGame.difficulty = DIFFICULTY_NORMAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -156,9 +156,6 @@ void updateSystemStatus()
|
||||||
currentGame.area = 6;
|
currentGame.area = 6;
|
||||||
strcpy(currentGame.stationedName, "Nerod");
|
strcpy(currentGame.stationedName, "Nerod");
|
||||||
initPlanetMissions(currentGame.system);
|
initPlanetMissions(currentGame.system);
|
||||||
|
|
||||||
if (currentGame.gamePlay != GAMEPLAY_ONPON)
|
|
||||||
currentGame.shieldUnits = 2;
|
|
||||||
}
|
}
|
||||||
else if (currentGame.area == 11)
|
else if (currentGame.area == 11)
|
||||||
{
|
{
|
||||||
|
@ -167,9 +164,6 @@ void updateSystemStatus()
|
||||||
currentGame.area = 12;
|
currentGame.area = 12;
|
||||||
strcpy(currentGame.stationedName, "Odeon");
|
strcpy(currentGame.stationedName, "Odeon");
|
||||||
initPlanetMissions(currentGame.system);
|
initPlanetMissions(currentGame.system);
|
||||||
|
|
||||||
if (currentGame.gamePlay != GAMEPLAY_ONPON)
|
|
||||||
currentGame.shieldUnits = 3;
|
|
||||||
}
|
}
|
||||||
else if (currentGame.area == 18)
|
else if (currentGame.area == 18)
|
||||||
{
|
{
|
||||||
|
@ -178,9 +172,6 @@ void updateSystemStatus()
|
||||||
currentGame.area = 19;
|
currentGame.area = 19;
|
||||||
strcpy(currentGame.stationedName, "Pluto");
|
strcpy(currentGame.stationedName, "Pluto");
|
||||||
initPlanetMissions(currentGame.system);
|
initPlanetMissions(currentGame.system);
|
||||||
|
|
||||||
if (currentGame.gamePlay != GAMEPLAY_ONPON)
|
|
||||||
currentGame.shieldUnits = 4;
|
|
||||||
}
|
}
|
||||||
else // Update the mission for the planet
|
else // Update the mission for the planet
|
||||||
{
|
{
|
||||||
|
|
|
@ -28,7 +28,6 @@ void initPlayer()
|
||||||
player.x = screen->w / 2;
|
player.x = screen->w / 2;
|
||||||
player.y = screen->h / 2;
|
player.y = screen->h / 2;
|
||||||
player.speed = 2;
|
player.speed = 2;
|
||||||
player.maxShield = (25 * currentGame.shieldUnits);
|
|
||||||
player.systemPower = player.maxShield;
|
player.systemPower = player.maxShield;
|
||||||
player.face = 0;
|
player.face = 0;
|
||||||
|
|
||||||
|
@ -110,7 +109,7 @@ void doPlayer()
|
||||||
|
|
||||||
if (player.weaponType[1] == W_CHARGER)
|
if (player.weaponType[1] == W_CHARGER)
|
||||||
{
|
{
|
||||||
if (engine.keyState[KEY_ALTFIRE] && !(currentGame.gamePlay == GAMEPLAY_ONPON && engine.keyState[KEY_FIRE]))
|
if (engine.keyState[KEY_ALTFIRE] && !(engine.keyState[KEY_FIRE]))
|
||||||
{
|
{
|
||||||
limitCharAdd(&player.ammo[1], 1, 0, 200);
|
limitCharAdd(&player.ammo[1], 1, 0, 200);
|
||||||
}
|
}
|
||||||
|
|
|
@ -199,7 +199,7 @@ static void drawShop()
|
||||||
for (int i = 0 ; i < icons ; i++)
|
for (int i = 0 ; i < icons ; i++)
|
||||||
blit(shape[shopItems[i].image], shopItems[i].x - 90, shopItems[i].y - 178, shopSurface[3]);
|
blit(shape[shopItems[i].image], shopItems[i].x - 90, shopItems[i].y - 178, shopSurface[3]);
|
||||||
|
|
||||||
sprintf(description, "Shield Units : %d", currentGame.shieldUnits * 25);
|
sprintf(description, "Shield Units : %d", player.maxShield);
|
||||||
drawString(description, 10, 4, FONT_WHITE, shopSurface[4]);
|
drawString(description, 10, 4, FONT_WHITE, shopSurface[4]);
|
||||||
sprintf(description, "Cash : $%d", currentGame.cash);
|
sprintf(description, "Cash : $%d", currentGame.cash);
|
||||||
drawString(description, 10, 80, FONT_WHITE, shopSurface[4]);
|
drawString(description, 10, 80, FONT_WHITE, shopSurface[4]);
|
||||||
|
|
|
@ -126,7 +126,6 @@ struct Game {
|
||||||
unsigned char sfxVolume;
|
unsigned char sfxVolume;
|
||||||
|
|
||||||
signed char saveFormat;
|
signed char saveFormat;
|
||||||
signed char gamePlay;
|
|
||||||
signed char difficulty;
|
signed char difficulty;
|
||||||
|
|
||||||
signed char autoSaveSlot;
|
signed char autoSaveSlot;
|
||||||
|
@ -167,7 +166,6 @@ struct Game {
|
||||||
unsigned char maxPlasmaOutput;
|
unsigned char maxPlasmaOutput;
|
||||||
unsigned char maxPlasmaAmmo;
|
unsigned char maxPlasmaAmmo;
|
||||||
unsigned char maxRocketAmmo;
|
unsigned char maxRocketAmmo;
|
||||||
unsigned char shieldUnits;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -69,25 +69,21 @@ static void createDifficultyMenu()
|
||||||
textSurface(24, "DIFFICULTY - EASY", -1, 370, FONT_WHITE);
|
textSurface(24, "DIFFICULTY - EASY", -1, 370, FONT_WHITE);
|
||||||
else if (currentGame.difficulty == DIFFICULTY_HARD)
|
else if (currentGame.difficulty == DIFFICULTY_HARD)
|
||||||
textSurface(24, "DIFFICULTY - HARD", -1, 370, FONT_WHITE);
|
textSurface(24, "DIFFICULTY - HARD", -1, 370, FONT_WHITE);
|
||||||
|
else if (currentGame.difficulty == DIFFICULTY_NIGHTMARE)
|
||||||
|
textSurface(24, "DIFFICULTY - NIGHTMARE", -1, 370, FONT_WHITE);
|
||||||
else
|
else
|
||||||
textSurface(24, "DIFFICULTY - NORMAL", -1, 370, FONT_WHITE);
|
textSurface(24, "DIFFICULTY - NORMAL", -1, 370, FONT_WHITE);
|
||||||
|
|
||||||
if (currentGame.gamePlay == GAMEPLAY_ONPON)
|
|
||||||
textSurface(25, "GAMEPLAY - ONPON", -1, 390, FONT_WHITE);
|
|
||||||
else
|
|
||||||
textSurface(25, "GAMEPLAY - NORMAL", -1, 390, FONT_WHITE);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static signed char showDifficultyMenu()
|
static signed char showDifficultyMenu()
|
||||||
{
|
{
|
||||||
textShape[12].y = 430;
|
textShape[12].y = 410;
|
||||||
|
|
||||||
blitText(23);
|
blitText(23);
|
||||||
blitText(24);
|
blitText(24);
|
||||||
blitText(25);
|
|
||||||
blitText(12);
|
blitText(12);
|
||||||
|
|
||||||
return 4;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void createOptionsMenu()
|
static void createOptionsMenu()
|
||||||
|
@ -470,12 +466,8 @@ int doTitle()
|
||||||
engine.done = 1;
|
engine.done = 1;
|
||||||
else if (selectedOption == 2)
|
else if (selectedOption == 2)
|
||||||
currentGame.difficulty++;
|
currentGame.difficulty++;
|
||||||
if(currentGame.difficulty > DIFFICULTY_HARD)
|
if (currentGame.difficulty > DIFFICULTY_NIGHTMARE)
|
||||||
currentGame.difficulty = DIFFICULTY_EASY;
|
currentGame.difficulty = DIFFICULTY_EASY;
|
||||||
else if (selectedOption == 3)
|
|
||||||
currentGame.gamePlay++;
|
|
||||||
if(currentGame.gamePlay > GAMEPLAY_ONPON)
|
|
||||||
currentGame.gamePlay = GAMEPLAY_ORIGINAL;
|
|
||||||
else if (selectedOption == listLength)
|
else if (selectedOption == listLength)
|
||||||
{menuType = 0; selectedOption = 1;}
|
{menuType = 0; selectedOption = 1;}
|
||||||
createDifficultyMenu();
|
createDifficultyMenu();
|
||||||
|
@ -502,7 +494,10 @@ int doTitle()
|
||||||
resetLists();
|
resetLists();
|
||||||
|
|
||||||
if (selectedOption == 1)
|
if (selectedOption == 1)
|
||||||
|
{
|
||||||
|
newGame();
|
||||||
selectedOption = 2; // go straight to mission 0
|
selectedOption = 2; // go straight to mission 0
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedOption == 3)
|
if (selectedOption == 3)
|
||||||
{
|
{
|
||||||
|
@ -521,8 +516,7 @@ int doTitle()
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Scrolls the intro text up the screen and nothing else. The text will be placed
|
Scrolls the intro text up the screen and nothing else.
|
||||||
into a data file when the game is finished.
|
|
||||||
*/
|
*/
|
||||||
void showStory()
|
void showStory()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue