Campaign flow bug fixes.

This commit is contained in:
Steve 2016-02-21 16:55:11 +00:00
parent cedbed4dc8
commit 03712285c4
10 changed files with 26 additions and 19 deletions

View File

@ -4,7 +4,7 @@
],
"name" : "Patrol #3",
"description" : "Following the devastating loss of the Iliad system, we need to continue to be vigilant against incursion into the Alba system. Check all five waypoints, and report immediate any unusual or suspicious activity you encounter.",
"requires" : 26,
"requires" : 27,
"background" : "gfx/backgrounds/background03.jpg",
"planet" : "gfx/planets/torelli.png",
"music" : "",

View File

@ -1,7 +1,7 @@
{
"name" : "Iliad Defence #5",
"description" : "The defence of Iliad is slipping, our forces are being decimated. We have to hit the enemy back, hard. All available fighters are to move into range and engage. If we lose here, Iliad is finished. We are the last line of defence, and we cannot afford to fail.",
"requires" : 25,
"requires" : 26,
"background" : "gfx/backgrounds/background01.jpg",
"planet" : "gfx/planets/bluePlanet.png",
"music" : "music/DST-RailJet-LongSeamlessLoop.ogg",

View File

@ -1,7 +1,7 @@
{
"name" : "Rebel Assault #1",
"description" : "",
"requires" : 23,
"requires" : 28,
"background" : "gfx/backgrounds/background03.jpg",
"planet" : "gfx/planets/spirit.png",
"music" : "music/InnerCore_Low.ogg",

View File

@ -1,7 +1,7 @@
{
"name" : "Pirate Uprising #3",
"description" : "Allied intelligence have managed to locate one of the pirate ring lieutenants. We need to bring this man in alive, as he could provide us with further useful information that will allow us to track down and eliminate high ranking individuals. You will be piloting a Ray, and will need to use your Mag cannons to disable the target. Do not destroy the lieutenant's Dart.",
"requires" : 2,
"requires" : 3,
"background" : "gfx/backgrounds/background03.jpg",
"planet" : "gfx/planets/spirit.png",
"music" : "music/battleThemeA.mp3",

View File

@ -1,7 +1,7 @@
{
"name" : "Pirate Uprising #4",
"description" : "It took some time, but we have finally been able to extract the required information from the lieutenant we captured. His information has revealed that the pirates have formed a coalition to take advantage of the brewing war. We need to smash this alliance apart by targetting the faction leaders. They are currently fleeing an earlier ambush, one designed to send them your way. The leaders are all piloting acquired Nymphs. Take them down.",
"requires" : 3,
"requires" : 5,
"background" : "gfx/backgrounds/background03.jpg",
"planet" : "gfx/planets/spirit.png",
"music" : "music/battleThemeA.mp3",

View File

@ -1,7 +1,7 @@
{
"name" : "Pirate Uprising #5",
"description" : "With the leaders all gone, we're now in a position to end the organised piracy problem in Temper for good. We have identified a number of Darts massing for what appears to be a strike against CSN assets, in retribution. We're not going to give the pirates the chance to do so, and strike them first. Strickland will lead the Steel Bulls into battle.",
"requires" : 4,
"requires" : 8,
"background" : "gfx/backgrounds/background03.jpg",
"planet" : "gfx/planets/spirit.png",
"music" : "music/battleThemeA.mp3",

View File

@ -1,7 +1,7 @@
{
"name" : "Evacuation #5",
"description" : "The Pandoran fleet is closing in on Oracle IX, and their capital ships are moving rapidly up the field. We need to hold them back for as long as possible, to give the final evacuees time to escape the system. This will need to be done with fighters along. However, Lieutenant Commanders Taylor and Todd of the White Knights will be lending assistance with the ATAFs, which should give us the edge in battle.",
"requires" : 13,
"requires" : 22,
"background" : "gfx/backgrounds/background03.jpg",
"planet" : "gfx/planets/oracleIX.png",
"music" : "music/track-4.mp3",

View File

@ -65,6 +65,8 @@ static Widget *startMissionButton;
void initGalacticMap(void)
{
show = SHOW_GALAXY;
startSectionTransition();
stopMusic();
@ -83,6 +85,8 @@ void initGalacticMap(void)
centerOnSelectedStarSystem();
updateStarSystemMissions();
updatePandoranAdvance();
saveGame();
@ -108,8 +112,6 @@ void initGalacticMap(void)
getWidget("ok", "fallen")->action = fallenOK;
updateStarSystemMissions();
setMouse(SCREEN_WIDTH / 2, SCREEN_HEIGHT / 2);
endSectionTransition();
@ -183,7 +185,7 @@ static void doStarSystems(void)
for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next)
{
if (starSystem->totalMissions > 0 && collision(cx, cy, 64, 64, starSystem->x - camera.x, starSystem->y - camera.y, 4, 4))
if (starSystem->availableMissions > 0 && collision(cx, cy, 64, 64, starSystem->x - camera.x, starSystem->y - camera.y, 4, 4))
{
if (selectedStarSystem != starSystem)
{
@ -257,7 +259,7 @@ static void addPulses(void)
for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next)
{
if (starSystem->completedMissions < starSystem->totalMissions)
if (starSystem->completedMissions < starSystem->availableMissions)
{
pulse = malloc(sizeof(Pulse));
memset(pulse, 0, sizeof(Pulse));
@ -400,7 +402,7 @@ static void drawGalaxy(void)
drawText(r.x, r.y + 12, 14, TA_CENTER, color, starSystem->name);
if (starSystem->completedMissions < starSystem->totalMissions)
if (starSystem->completedMissions < starSystem->availableMissions)
{
ax = r.x;
ay = r.y;
@ -475,12 +477,12 @@ static void drawInfoBars(void)
SDL_RenderFillRect(app.renderer, &r);
SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE);
drawText((SCREEN_WIDTH / 2), 5, 18, TA_CENTER, colors.white, "Missions: %d / %d", game.completedMissions, game.totalMissions);
drawText((SCREEN_WIDTH / 2), 5, 18, TA_CENTER, colors.white, "Missions: %d / %d", game.completedMissions, game.availableMissions);
}
static void selectStarSystem(void)
{
if (selectedStarSystem->totalMissions > 0)
if (selectedStarSystem->availableMissions > 0)
{
show = SHOW_STAR_SYSTEM;
STRNCPY(game.selectedStarSystem, selectedStarSystem->name, MAX_NAME_LENGTH);

View File

@ -192,14 +192,16 @@ void updateStarSystemMissions(void)
StarSystem *starSystem;
Mission *mission, *prev;
game.completedMissions = game.totalMissions = 0;
game.completedMissions = game.totalMissions = game.availableMissions = 0;
for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next)
{
starSystem->completedMissions = starSystem->totalMissions = 0;
starSystem->completedMissions = starSystem->availableMissions = starSystem->totalMissions = 0;
for (mission = starSystem->missionHead.next ; mission != NULL ; mission = mission->next)
{
starSystem->totalMissions++;
if (mission->completed)
{
starSystem->completedMissions++;
@ -208,6 +210,7 @@ void updateStarSystemMissions(void)
if (strcmp(starSystem->name, "Sol") != 0)
{
game.totalMissions += starSystem->totalMissions;
game.completedMissions += starSystem->completedMissions;
}
}
@ -222,7 +225,7 @@ void updateStarSystemMissions(void)
if (mission->available)
{
starSystem->totalMissions++;
starSystem->availableMissions++;
}
prev = mission;
@ -230,10 +233,10 @@ void updateStarSystemMissions(void)
if (strcmp(starSystem->name, "Sol") != 0)
{
game.totalMissions += starSystem->totalMissions;
game.availableMissions += starSystem->availableMissions;
}
sprintf(starSystem->description, "[ %s ] [ Missions %d / %d ]", starSystem->name, starSystem->completedMissions, starSystem->totalMissions);
sprintf(starSystem->description, "[ %s ] [ Missions %d / %d ]", starSystem->name, starSystem->completedMissions, starSystem->availableMissions);
}
}

View File

@ -258,6 +258,7 @@ struct StarSystem {
int y;
int completedMissions;
int totalMissions;
int availableMissions;
int fallsToPandorans;
int isSol;
Mission missionHead, *missionTail;
@ -319,6 +320,7 @@ typedef struct {
Mission *currentMission;
char selectedStarSystem[MAX_NAME_LENGTH];
int completedMissions;
int availableMissions;
int totalMissions;
unsigned int stats[STAT_MAX];
} Game;