Reformatted conditionals with trailing || and &&
This commit is contained in:
parent
123087e60e
commit
1a3e801271
|
@ -114,8 +114,8 @@ int main(int argc, char **argv)
|
||||||
cheatCount = 2;
|
cheatCount = 2;
|
||||||
if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2))
|
if ((strcmp(argv[i], "it") == 0) && (cheatCount == 2))
|
||||||
cheatCount = 3;
|
cheatCount = 3;
|
||||||
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3)) ||
|
if (((strcmp(argv[i], "better") == 0) && (cheatCount == 3))
|
||||||
(strcmp(argv[i], "humansdoitbetter") == 0))
|
|| (strcmp(argv[i], "humansdoitbetter") == 0))
|
||||||
{
|
{
|
||||||
printf("Humans do it better! Cheats enabled.\n");
|
printf("Humans do it better! Cheats enabled.\n");
|
||||||
engine.cheat = 1;
|
engine.cheat = 1;
|
||||||
|
|
22
src/alien.c
22
src/alien.c
|
@ -1144,8 +1144,8 @@ void aliens_init()
|
||||||
aliens[ALIEN_BOSS_PART2].dx = -20;
|
aliens[ALIEN_BOSS_PART2].dx = -20;
|
||||||
aliens[ALIEN_BOSS_PART2].dy = 37;
|
aliens[ALIEN_BOSS_PART2].dy = 37;
|
||||||
}
|
}
|
||||||
else if ((game.area == MISN_ELAMALE) ||
|
else if ((game.area == MISN_ELAMALE)
|
||||||
(game.area == MISN_FELLON))
|
|| (game.area == MISN_FELLON))
|
||||||
{
|
{
|
||||||
aliens[ALIEN_BOSS].target = &player;
|
aliens[ALIEN_BOSS].target = &player;
|
||||||
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
aliens[ALIEN_BOSS].x = -screen->w / 2;
|
||||||
|
@ -1194,8 +1194,8 @@ int alien_add()
|
||||||
{
|
{
|
||||||
int index = alien_getFreeIndex();
|
int index = alien_getFreeIndex();
|
||||||
|
|
||||||
if ((index == -1) || (game.area == MISN_JUPITER) ||
|
if ((index == -1) || (game.area == MISN_JUPITER)
|
||||||
(game.area == MISN_VENUS))
|
|| (game.area == MISN_VENUS))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
int *alienArray;
|
int *alienArray;
|
||||||
|
@ -1674,9 +1674,9 @@ void alien_setKlineAI(Object *alien)
|
||||||
case 1:
|
case 1:
|
||||||
case 2:
|
case 2:
|
||||||
// Kline only attacks when he is ready!
|
// Kline only attacks when he is ready!
|
||||||
if ((!(alien->flags & FL_NOFIRE)) &&
|
if ((!(alien->flags & FL_NOFIRE))
|
||||||
((game.area == MISN_ELAMALE) ||
|
&& ((game.area == MISN_ELAMALE)
|
||||||
game.difficulty != DIFFICULTY_ORIGINAL))
|
|| game.difficulty != DIFFICULTY_ORIGINAL))
|
||||||
alien->flags |= FL_DROPMINES;
|
alien->flags |= FL_DROPMINES;
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -1743,8 +1743,8 @@ void alien_searchForTarget(Object *alien)
|
||||||
if (targetEnemy->classDef == CD_BOSS)
|
if (targetEnemy->classDef == CD_BOSS)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((targetEnemy->flags & FL_DISABLED) ||
|
if ((targetEnemy->flags & FL_DISABLED)
|
||||||
(targetEnemy->flags & FL_NOFIRE))
|
|| (targetEnemy->flags & FL_NOFIRE))
|
||||||
badTarget = 1;
|
badTarget = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1815,8 +1815,8 @@ int alien_checkTarget(Object *alien)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
// Not at the correct vertical height
|
// Not at the correct vertical height
|
||||||
if ((alien->y < alien->target->y - 15) ||
|
if ((alien->y < alien->target->y - 15)
|
||||||
(alien->y > alien->target->y + alien->target->image[0]->h + 15))
|
|| (alien->y > alien->target->y + alien->target->image[0]->h + 15))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -45,8 +45,8 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
&& (weapons[W_PLAYER_WEAPON].damage <= game.minPlasmaDamage))
|
&& (weapons[W_PLAYER_WEAPON].damage <= game.minPlasmaDamage))
|
||||||
|| (player.ammo[0] >= game.maxPlasmaAmmo));
|
|| (player.ammo[0] >= game.maxPlasmaAmmo));
|
||||||
|
|
||||||
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
shield_useless = ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||||
(player.shield >= player.maxShield));
|
|| (player.shield >= player.maxShield));
|
||||||
|
|
||||||
rockets_useless = ((player.weaponType[1] == W_CHARGER)
|
rockets_useless = ((player.weaponType[1] == W_CHARGER)
|
||||||
|| (player.weaponType[1] == W_LASER)
|
|| (player.weaponType[1] == W_LASER)
|
||||||
|
@ -187,8 +187,8 @@ void collectable_add(float x, float y, int type, int value, int life)
|
||||||
// Shield bonus is useless if you can't heal; give cash instead.
|
// Shield bonus is useless if you can't heal; give cash instead.
|
||||||
if ((type == P_SHIELD) && (game.difficulty != DIFFICULTY_ORIGINAL))
|
if ((type == P_SHIELD) && (game.difficulty != DIFFICULTY_ORIGINAL))
|
||||||
{
|
{
|
||||||
if ((game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
if ((game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||||
(player.shield >= player.maxShield))
|
|| (player.shield >= player.maxShield))
|
||||||
{
|
{
|
||||||
type = P_CASH;
|
type = P_CASH;
|
||||||
}
|
}
|
||||||
|
@ -338,24 +338,27 @@ int collectable_numGood()
|
||||||
|
|
||||||
while (col != NULL)
|
while (col != NULL)
|
||||||
{
|
{
|
||||||
if ((col->type != P_MINE) && (col->type != P_ORE) &&
|
if ((col->type != P_MINE) && (col->type != P_ORE)
|
||||||
((col->type != P_SHIELD) || (player.shield < player.maxShield)) &&
|
&& ((col->type != P_SHIELD)
|
||||||
((col->type != P_ROCKET) || (player.ammo[1] < game.maxRocketAmmo)) &&
|
|| (player.shield < player.maxShield))
|
||||||
((col->type != P_PLASMA_AMMO) || (player.ammo[0] < game.maxPlasmaAmmo)) &&
|
&& ((col->type != P_ROCKET)
|
||||||
((col->type != P_PLASMA_SHOT) ||
|
|| (player.ammo[1] < game.maxRocketAmmo))
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
&& ((col->type != P_PLASMA_AMMO)
|
||||||
(weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput)) &&
|
|| (player.ammo[0] < game.maxPlasmaAmmo))
|
||||||
((col->type != P_PLASMA_DAMAGE) ||
|
&& ((col->type != P_PLASMA_SHOT)
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
(weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage)) &&
|
|| (weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput))
|
||||||
((col->type != P_PLASMA_RATE) ||
|
&& ((col->type != P_PLASMA_DAMAGE)
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
(weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])) &&
|
|| (weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage))
|
||||||
((col->type != P_SUPER) ||
|
&& ((col->type != P_PLASMA_RATE)
|
||||||
(player.ammo[0] < game.maxPlasmaAmmo) ||
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
(weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput) ||
|
|| (weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate]))
|
||||||
(weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage) ||
|
&& ((col->type != P_SUPER)
|
||||||
(weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])))
|
|| (player.ammo[0] < game.maxPlasmaAmmo)
|
||||||
|
|| (weapons[W_PLAYER_WEAPON].ammo[0] < game.maxPlasmaOutput)
|
||||||
|
|| (weapons[W_PLAYER_WEAPON].damage < game.maxPlasmaDamage)
|
||||||
|
|| (weapons[W_PLAYER_WEAPON].reload[0] > rate2reload[game.maxPlasmaRate])))
|
||||||
{
|
{
|
||||||
n++;
|
n++;
|
||||||
}
|
}
|
||||||
|
|
62
src/game.c
62
src/game.c
|
@ -567,9 +567,9 @@ static void game_doCollectables()
|
||||||
if (collectable->life < 1)
|
if (collectable->life < 1)
|
||||||
{
|
{
|
||||||
collectable->active = 0;
|
collectable->active = 0;
|
||||||
if ((collectable->type == P_CARGO) ||
|
if ((collectable->type == P_CARGO)
|
||||||
(collectable->type == P_ESCAPEPOD) ||
|
|| (collectable->type == P_ESCAPEPOD)
|
||||||
(collectable->type == P_SLAVES))
|
|| (collectable->type == P_SLAVES))
|
||||||
mission_updateRequirements(M_PROTECT_PICKUP, collectable->type, 1);
|
mission_updateRequirements(M_PROTECT_PICKUP, collectable->type, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -708,8 +708,8 @@ static void game_doBullets()
|
||||||
okayToHit = 1;
|
okayToHit = 1;
|
||||||
if ((bullet->flags & WF_WEAPCO) && (aliens[i].flags & FL_FRIEND))
|
if ((bullet->flags & WF_WEAPCO) && (aliens[i].flags & FL_FRIEND))
|
||||||
okayToHit = 1;
|
okayToHit = 1;
|
||||||
if ((bullet->id == WT_ROCKET) || (bullet->id == WT_LASER) ||
|
if ((bullet->id == WT_ROCKET) || (bullet->id == WT_LASER)
|
||||||
(bullet->id == WT_CHARGER))
|
|| (bullet->id == WT_CHARGER))
|
||||||
okayToHit = 1;
|
okayToHit = 1;
|
||||||
|
|
||||||
if (bullet->owner == aliens[i].owner)
|
if (bullet->owner == aliens[i].owner)
|
||||||
|
@ -815,8 +815,8 @@ static void game_doBullets()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for bullets hitting player
|
// Check for bullets hitting player
|
||||||
if ((bullet->flags & WF_WEAPCO) || (bullet->id == WT_ROCKET) ||
|
if ((bullet->flags & WF_WEAPCO) || (bullet->id == WT_ROCKET)
|
||||||
(bullet->id == WT_LASER) || (bullet->id == WT_CHARGER))
|
|| (bullet->id == WT_LASER) || (bullet->id == WT_CHARGER))
|
||||||
{
|
{
|
||||||
if (bullet->active && (player.shield > 0) &&
|
if (bullet->active && (player.shield > 0) &&
|
||||||
(bullet->owner != &player) && bullet_collision(bullet, &player))
|
(bullet->owner != &player) && bullet_collision(bullet, &player))
|
||||||
|
@ -1101,9 +1101,9 @@ static void game_doAliens()
|
||||||
if (aliens[i].x > aliens[i].target->x) aliens[i].face = 1;
|
if (aliens[i].x > aliens[i].target->x) aliens[i].face = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((game.area == MISN_ELLESH) &&
|
if ((game.area == MISN_ELLESH)
|
||||||
((aliens[i].classDef == CD_BOSS) ||
|
&& ((aliens[i].classDef == CD_BOSS)
|
||||||
(game.difficulty != DIFFICULTY_ORIGINAL)))
|
|| (game.difficulty != DIFFICULTY_ORIGINAL)))
|
||||||
aliens[i].face = 0;
|
aliens[i].face = 0;
|
||||||
|
|
||||||
if ((aliens[i].flags & FL_DEPLOYDRONES) && ((rand() % 300) == 0))
|
if ((aliens[i].flags & FL_DEPLOYDRONES) && ((rand() % 300) == 0))
|
||||||
|
@ -1194,8 +1194,8 @@ static void game_doAliens()
|
||||||
for (int j = 0 ; j < 2 ; j++)
|
for (int j = 0 ; j < 2 ; j++)
|
||||||
{
|
{
|
||||||
if ((aliens[i].reload[j] == 0) &&
|
if ((aliens[i].reload[j] == 0) &&
|
||||||
((rand() % 1000 < aliens[i].chance[j]) ||
|
((rand() % 1000 < aliens[i].chance[j])
|
||||||
(aliens[i].flags & FL_CONTINUOUS_FIRE)))
|
|| (aliens[i].flags & FL_CONTINUOUS_FIRE)))
|
||||||
{
|
{
|
||||||
if ((aliens[i].weaponType[j] != W_ENERGYRAY) &&
|
if ((aliens[i].weaponType[j] != W_ENERGYRAY) &&
|
||||||
(aliens[i].weaponType[j] != W_LASER))
|
(aliens[i].weaponType[j] != W_LASER))
|
||||||
|
@ -1387,8 +1387,8 @@ static void game_doPlayer()
|
||||||
if (player.weaponType[1] == W_CHARGER)
|
if (player.weaponType[1] == W_CHARGER)
|
||||||
{
|
{
|
||||||
if (engine.keyState[KEY_ALTFIRE] &&
|
if (engine.keyState[KEY_ALTFIRE] &&
|
||||||
((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
!(engine.keyState[KEY_FIRE])))
|
|| !(engine.keyState[KEY_FIRE])))
|
||||||
{
|
{
|
||||||
if (!player_chargerFired)
|
if (!player_chargerFired)
|
||||||
{
|
{
|
||||||
|
@ -1486,8 +1486,8 @@ static void game_doPlayer()
|
||||||
engine.keyState[KEY_PAUSE] = 0;
|
engine.keyState[KEY_PAUSE] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((game.area == MISN_ELLESH) ||
|
if ((game.area == MISN_ELLESH)
|
||||||
(game.area == MISN_MARS))
|
|| (game.area == MISN_MARS))
|
||||||
{
|
{
|
||||||
player.face = 0;
|
player.face = 0;
|
||||||
xmoved = 1;
|
xmoved = 1;
|
||||||
|
@ -1658,8 +1658,8 @@ static void game_doPlayer()
|
||||||
LIMIT(engine.ssy, -CAMERA_MAX_SPEED, CAMERA_MAX_SPEED);
|
LIMIT(engine.ssy, -CAMERA_MAX_SPEED, CAMERA_MAX_SPEED);
|
||||||
|
|
||||||
// Specific for the mission were you have to chase the Executive Transport
|
// Specific for the mission were you have to chase the Executive Transport
|
||||||
if (((game.area == MISN_ELLESH) && (player.shield > 0)) ||
|
if (((game.area == MISN_ELLESH) && (player.shield > 0))
|
||||||
(game.area == MISN_MARS))
|
|| (game.area == MISN_MARS))
|
||||||
{
|
{
|
||||||
engine.ssx = -6;
|
engine.ssx = -6;
|
||||||
engine.ssy = 0;
|
engine.ssy = 0;
|
||||||
|
@ -2473,9 +2473,9 @@ int game_mainLoop()
|
||||||
if (game.hasWingMate2)
|
if (game.hasWingMate2)
|
||||||
alien_addFriendly(ALIEN_URSULA);
|
alien_addFriendly(ALIEN_URSULA);
|
||||||
|
|
||||||
if ((game.area == MISN_URUSOR) ||
|
if ((game.area == MISN_URUSOR)
|
||||||
(game.area == MISN_POSWIC) ||
|
|| (game.area == MISN_POSWIC)
|
||||||
(game.area == MISN_EARTH))
|
|| (game.area == MISN_EARTH))
|
||||||
alien_addFriendly(ALIEN_SID);
|
alien_addFriendly(ALIEN_SID);
|
||||||
|
|
||||||
// Disable Wingmates for certain missions
|
// Disable Wingmates for certain missions
|
||||||
|
@ -2651,14 +2651,14 @@ int game_mainLoop()
|
||||||
if (player.shield > 0)
|
if (player.shield > 0)
|
||||||
{
|
{
|
||||||
if ((SDL_GetTicks() >= engine.missionCompleteTimer) &&
|
if ((SDL_GetTicks() >= engine.missionCompleteTimer) &&
|
||||||
((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
(game.difficulty == DIFFICULTY_NIGHTMARE) ||
|
|| (game.difficulty == DIFFICULTY_NIGHTMARE)
|
||||||
(game.area == MISN_INTERCEPTION) ||
|
|| (game.area == MISN_INTERCEPTION)
|
||||||
(game.area == MISN_ELLESH) ||
|
|| (game.area == MISN_ELLESH)
|
||||||
(game.area == MISN_MARS) ||
|
|| (game.area == MISN_MARS)
|
||||||
(mission_checkFailed()) ||
|
|| (mission_checkFailed())
|
||||||
(collectable_numGood() <= 0) ||
|
|| (collectable_numGood() <= 0)
|
||||||
(engine.done == ENGINE_SYSEXIT)))
|
|| (engine.done == ENGINE_SYSEXIT)))
|
||||||
{
|
{
|
||||||
if ((!mission_checkFailed()) && (game.area != MISN_VENUS))
|
if ((!mission_checkFailed()) && (game.area != MISN_VENUS))
|
||||||
{
|
{
|
||||||
|
@ -2683,8 +2683,8 @@ int game_mainLoop()
|
||||||
aliens[ALIEN_URSULA].face = 0;
|
aliens[ALIEN_URSULA].face = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((game.area == MISN_URUSOR) ||
|
if ((game.area == MISN_URUSOR)
|
||||||
(game.area == MISN_POSWIC))
|
|| (game.area == MISN_POSWIC))
|
||||||
{
|
{
|
||||||
aliens[ALIEN_SID].x = player.x - 100;
|
aliens[ALIEN_SID].x = player.x - 100;
|
||||||
aliens[ALIEN_SID].y = player.y;
|
aliens[ALIEN_SID].y = player.y;
|
||||||
|
|
|
@ -754,8 +754,8 @@ static void intermission_showStatus(SDL_Surface *infoSurface)
|
||||||
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
for (int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i++)
|
||||||
{
|
{
|
||||||
y += 20;
|
y += 20;
|
||||||
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER) ||
|
if ((i == TS_CHRIS_HEADER) || (i == TS_PHOEBE_HEADER)
|
||||||
(i == TS_URSULA_HEADER))
|
|| (i == TS_URSULA_HEADER))
|
||||||
y += 25;
|
y += 25;
|
||||||
|
|
||||||
gfx_textSprites[i].y = y;
|
gfx_textSprites[i].y = y;
|
||||||
|
@ -1743,9 +1743,9 @@ int intermission()
|
||||||
screen_blit(gfx_sprites[SP_OPTIONS], x + 6 * w / 7, y);
|
screen_blit(gfx_sprites[SP_OPTIONS], x + 6 * w / 7, y);
|
||||||
screen_blit(gfx_sprites[SP_EXIT], x + w, y);
|
screen_blit(gfx_sprites[SP_EXIT], x + w, y);
|
||||||
|
|
||||||
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x, y, 32, 32) &&
|
if (game_collision(engine.cursor_x + 13, engine.cursor_y + 13, 6, 6, x, y, 32, 32)
|
||||||
((game.stationedPlanet != game.destinationPlanet) ||
|
&& ((game.stationedPlanet != game.destinationPlanet)
|
||||||
(!intermission_planets[game.stationedPlanet].missionCompleted)))
|
|| (!intermission_planets[game.stationedPlanet].missionCompleted)))
|
||||||
{
|
{
|
||||||
if (game.stationedPlanet == game.destinationPlanet)
|
if (game.stationedPlanet == game.destinationPlanet)
|
||||||
screen_blitText(TS_INFO_START_MISSION, -1, screen->h - 25);
|
screen_blitText(TS_INFO_START_MISSION, -1, screen->h - 25);
|
||||||
|
|
|
@ -814,9 +814,9 @@ void mission_updateRequirements(int type, int id, int value)
|
||||||
{
|
{
|
||||||
if ((mission.completed1[i] == OB_INCOMPLETE) || (mission.completed1[i] == OB_CONDITION))
|
if ((mission.completed1[i] == OB_INCOMPLETE) || (mission.completed1[i] == OB_CONDITION))
|
||||||
{
|
{
|
||||||
if ((mission.primaryType[i] == type) &&
|
if ((mission.primaryType[i] == type)
|
||||||
((mission.target1[i] == id) ||
|
&& ((mission.target1[i] == id)
|
||||||
(mission.target1[i] == CD_ANY)))
|
|| (mission.target1[i] == CD_ANY)))
|
||||||
{
|
{
|
||||||
matched = 1;
|
matched = 1;
|
||||||
mission.targetValue1[i] -= value;
|
mission.targetValue1[i] -= value;
|
||||||
|
@ -833,9 +833,9 @@ void mission_updateRequirements(int type, int id, int value)
|
||||||
{
|
{
|
||||||
if ((mission.completed2[i] == OB_INCOMPLETE) || (mission.completed2[i] == OB_CONDITION))
|
if ((mission.completed2[i] == OB_INCOMPLETE) || (mission.completed2[i] == OB_CONDITION))
|
||||||
{
|
{
|
||||||
if ((mission.secondaryType[i] == type) &&
|
if ((mission.secondaryType[i] == type)
|
||||||
((mission.target2[i] == id) ||
|
&& ((mission.target2[i] == id)
|
||||||
(mission.target2[i] == CD_ANY)))
|
|| (mission.target2[i] == CD_ANY)))
|
||||||
{
|
{
|
||||||
mission.targetValue2[i] -= value;
|
mission.targetValue2[i] -= value;
|
||||||
mission_evaluate(type, id, &mission.completed2[i], &mission.targetValue2[i], FONT_YELLOW);
|
mission_evaluate(type, id, &mission.completed2[i], &mission.targetValue2[i], FONT_YELLOW);
|
||||||
|
@ -983,10 +983,10 @@ int mission_checkCompleted()
|
||||||
mission.completed1[i] = OB_COMPLETED;
|
mission.completed1[i] = OB_COMPLETED;
|
||||||
|
|
||||||
// do some area specific things
|
// do some area specific things
|
||||||
if ((game.area == MISN_MOEBO) ||
|
if ((game.area == MISN_MOEBO)
|
||||||
(game.area == MISN_DORIM) ||
|
|| (game.area == MISN_DORIM)
|
||||||
(game.area == MISN_ELLESH) ||
|
|| (game.area == MISN_ELLESH)
|
||||||
(game.area == MISN_MARS))
|
|| (game.area == MISN_MARS))
|
||||||
{
|
{
|
||||||
if (mission.remainingObjectives2 == 0)
|
if (mission.remainingObjectives2 == 0)
|
||||||
{
|
{
|
||||||
|
@ -1222,17 +1222,17 @@ void mission_showStartScreen()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((game.area == MISN_URUSOR) ||
|
if ((game.area == MISN_URUSOR)
|
||||||
(game.area == MISN_POSWIC) ||
|
|| (game.area == MISN_POSWIC)
|
||||||
(game.area == MISN_EARTH))
|
|| (game.area == MISN_EARTH))
|
||||||
screen_renderUnicode(_("Sid Wilson will join you on this mission"), screen->w / 2 - BRIEFING_WIDTH / 2 + 20, screen->h / 2 + 175, FONT_WHITE);
|
screen_renderUnicode(_("Sid Wilson will join you on this mission"), screen->w / 2 - BRIEFING_WIDTH / 2 + 20, screen->h / 2 + 175, FONT_WHITE);
|
||||||
|
|
||||||
renderer_update();
|
renderer_update();
|
||||||
|
|
||||||
game_delayFrame();
|
game_delayFrame();
|
||||||
player_getInput();
|
player_getInput();
|
||||||
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE]) ||
|
if ((engine.keyState[KEY_FIRE]) || (engine.keyState[KEY_ALTFIRE])
|
||||||
(engine.keyState[KEY_ESCAPE]))
|
|| (engine.keyState[KEY_ESCAPE]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
12
src/player.c
12
src/player.c
|
@ -100,13 +100,13 @@ void player_damage(int amount, int delay)
|
||||||
player_resetDamageDelay = 0;
|
player_resetDamageDelay = 0;
|
||||||
|
|
||||||
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0) &&
|
if ((!engine.cheatShield) && (engine.missionCompleteTimer == 0) &&
|
||||||
((!player.hit) ||
|
((!player.hit)
|
||||||
(game.difficulty == DIFFICULTY_ORIGINAL) ||
|
|| (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
((player.shield != engine.lowShield) &&
|
|| ((player.shield != engine.lowShield)
|
||||||
(player.shield != 1))))
|
&& (player.shield != 1))))
|
||||||
{
|
{
|
||||||
if ((game.difficulty == DIFFICULTY_ORIGINAL) ||
|
if ((game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
(player_damageDelay >= delay))
|
|| (player_damageDelay >= delay))
|
||||||
{
|
{
|
||||||
player.shield -= amount;
|
player.shield -= amount;
|
||||||
|
|
||||||
|
|
38
src/save.c
38
src/save.c
|
@ -160,42 +160,42 @@ int save_load(int slot)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
case 5:
|
case 5:
|
||||||
if ((fscanf(fp, "%d%*c", &game.difficulty) < 1) ||
|
if ((fscanf(fp, "%d%*c", &game.difficulty) < 1)
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
||||||
&game.minPlasmaRateLimit, &game.minPlasmaDamageLimit,
|
&game.minPlasmaRateLimit, &game.minPlasmaDamageLimit,
|
||||||
&game.minPlasmaOutputLimit, &game.maxPlasmaRateLimit,
|
&game.minPlasmaOutputLimit, &game.maxPlasmaRateLimit,
|
||||||
&game.maxPlasmaDamageLimit, &game.maxPlasmaOutputLimit,
|
&game.maxPlasmaDamageLimit, &game.maxPlasmaOutputLimit,
|
||||||
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8) ||
|
&game.maxPlasmaAmmoLimit, &game.maxRocketAmmoLimit) < 8)
|
||||||
(fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
|
|| (fscanf(fp, "%d %d %d%*c%*[^\n]%*c", &game.system, &game.area,
|
||||||
&game.stationedPlanet) < 3) ||
|
&game.stationedPlanet) < 3)
|
||||||
(fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2) ||
|
|| (fscanf(fp, "%d %d%*c", &game.hasWingMate1, &game.hasWingMate2) < 2)
|
||||||
(fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
|
|| (fscanf(fp, "%d %d %d %d%*c", &player.maxShield,
|
||||||
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4) ||
|
&player.ammo[0], &player.ammo[1], &player.weaponType[1]) < 4)
|
||||||
(fscanf(fp, "%d %d %d%*c",
|
|| (fscanf(fp, "%d %d %d%*c",
|
||||||
&weapons[W_PLAYER_WEAPON].ammo[0],
|
&weapons[W_PLAYER_WEAPON].ammo[0],
|
||||||
&weapons[W_PLAYER_WEAPON].damage,
|
&weapons[W_PLAYER_WEAPON].damage,
|
||||||
&weapons[W_PLAYER_WEAPON].reload[0]) < 3) ||
|
&weapons[W_PLAYER_WEAPON].reload[0]) < 3)
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d%*c",
|
||||||
&game.minPlasmaRate, &game.minPlasmaDamage,
|
&game.minPlasmaRate, &game.minPlasmaDamage,
|
||||||
&game.minPlasmaOutput, &game.maxPlasmaRate,
|
&game.minPlasmaOutput, &game.maxPlasmaRate,
|
||||||
&game.maxPlasmaDamage, &game.maxPlasmaOutput,
|
&game.maxPlasmaDamage, &game.maxPlasmaOutput,
|
||||||
&game.maxPlasmaAmmo, &game.maxRocketAmmo) < 8) ||
|
&game.maxPlasmaAmmo, &game.maxRocketAmmo) < 8)
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d%*c",
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d%*c",
|
||||||
&game.missionCompleted[0], &game.missionCompleted[1],
|
&game.missionCompleted[0], &game.missionCompleted[1],
|
||||||
&game.missionCompleted[2], &game.missionCompleted[3],
|
&game.missionCompleted[2], &game.missionCompleted[3],
|
||||||
&game.missionCompleted[4], &game.missionCompleted[5],
|
&game.missionCompleted[4], &game.missionCompleted[5],
|
||||||
&game.missionCompleted[6], &game.missionCompleted[7],
|
&game.missionCompleted[6], &game.missionCompleted[7],
|
||||||
&game.missionCompleted[8], &game.missionCompleted[9]) < 10) ||
|
&game.missionCompleted[8], &game.missionCompleted[9]) < 10)
|
||||||
(fscanf(fp, "%d%*c", &game.experimentalShield) < 1) ||
|
|| (fscanf(fp, "%d%*c", &game.experimentalShield) < 1)
|
||||||
(fscanf(fp, "%d %d%*c", &game.cash, &game.cashEarned) < 2) ||
|
|| (fscanf(fp, "%d %d%*c", &game.cash, &game.cashEarned) < 2)
|
||||||
(fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d%*c",
|
|| (fscanf(fp, "%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d%*c",
|
||||||
&game.shots, &game.hits, &game.accuracy, &game.totalKills,
|
&game.shots, &game.hits, &game.accuracy, &game.totalKills,
|
||||||
&game.wingMate1Kills, &game.wingMate2Kills,
|
&game.wingMate1Kills, &game.wingMate2Kills,
|
||||||
&game.wingMate1Ejects, &game.wingMate2Ejects,
|
&game.wingMate1Ejects, &game.wingMate2Ejects,
|
||||||
&game.totalOtherKills, &game.shieldPickups,
|
&game.totalOtherKills, &game.shieldPickups,
|
||||||
&game.rocketPickups, &game.cellPickups, &game.powerups,
|
&game.rocketPickups, &game.cellPickups, &game.powerups,
|
||||||
&game.minesKilled, &game.slavesRescued) < 15) ||
|
&game.minesKilled, &game.slavesRescued) < 15)
|
||||||
(fscanf(fp, "%lu%*c", &timeTaken) < 1))
|
|| (fscanf(fp, "%lu%*c", &timeTaken) < 1))
|
||||||
{
|
{
|
||||||
printf("Warning: Save data is not correctly formatted. Some data may be lost.\n");
|
printf("Warning: Save data is not correctly formatted. Some data may be lost.\n");
|
||||||
}
|
}
|
||||||
|
|
|
@ -645,8 +645,8 @@ static void buy(int i)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHOP_ROCKET_AMMO:
|
case SHOP_ROCKET_AMMO:
|
||||||
if ((player.weaponType[1] == W_CHARGER) ||
|
if ((player.weaponType[1] == W_CHARGER)
|
||||||
(player.weaponType[1] == W_LASER))
|
|| (player.weaponType[1] == W_LASER))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
||||||
return;
|
return;
|
||||||
|
@ -723,8 +723,8 @@ static void buy(int i)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SHOP_ROCKET_MAX_AMMO:
|
case SHOP_ROCKET_MAX_AMMO:
|
||||||
if ((player.weaponType[1] == W_CHARGER) ||
|
if ((player.weaponType[1] == W_CHARGER)
|
||||||
(player.weaponType[1] == W_LASER))
|
|| (player.weaponType[1] == W_LASER))
|
||||||
{
|
{
|
||||||
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
shopSelectedItem = SHOP_ERROR_IS_NOT_ROCKETS;
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -695,8 +695,8 @@ void title_showCredits()
|
||||||
screen_unBuffer();
|
screen_unBuffer();
|
||||||
|
|
||||||
player_getInput();
|
player_getInput();
|
||||||
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE] ||
|
if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE]
|
||||||
engine.keyState[KEY_ALTFIRE])
|
|| engine.keyState[KEY_ALTFIRE])
|
||||||
break;
|
break;
|
||||||
|
|
||||||
float speed = 0.5;
|
float speed = 0.5;
|
||||||
|
|
Loading…
Reference in New Issue