Allow all missions to be replayed once campaign is finished.
This commit is contained in:
parent
2471cd0814
commit
7dc18e4a59
|
@ -47,6 +47,8 @@ static void returnFromOptions(void);
|
||||||
static void doStarSystemView(void);
|
static void doStarSystemView(void);
|
||||||
static void updatePandoranAdvance(void);
|
static void updatePandoranAdvance(void);
|
||||||
static void fallenOK(void);
|
static void fallenOK(void);
|
||||||
|
static void updateCampaignProgress(void);
|
||||||
|
static void campaignCompleteOK(void);
|
||||||
static Mission *nextAvailableMission(StarSystem *starSystem);
|
static Mission *nextAvailableMission(StarSystem *starSystem);
|
||||||
|
|
||||||
static StarSystem *selectedStarSystem;
|
static StarSystem *selectedStarSystem;
|
||||||
|
@ -61,6 +63,7 @@ static float ssx, ssy;
|
||||||
static float arrowPulse;
|
static float arrowPulse;
|
||||||
static int show;
|
static int show;
|
||||||
static int scrollingMap;
|
static int scrollingMap;
|
||||||
|
static int campaignComplete = 0;
|
||||||
static PointF cameraMin, cameraMax;
|
static PointF cameraMin, cameraMax;
|
||||||
static Widget *startMissionButton;
|
static Widget *startMissionButton;
|
||||||
static char *MISSIONS_TEXT;
|
static char *MISSIONS_TEXT;
|
||||||
|
@ -108,6 +111,8 @@ void initGalacticMap(void)
|
||||||
awardCampaignTrophies();
|
awardCampaignTrophies();
|
||||||
|
|
||||||
awardStatsTrophies();
|
awardStatsTrophies();
|
||||||
|
|
||||||
|
updateCampaignProgress();
|
||||||
|
|
||||||
app.saveGame = 1;
|
app.saveGame = 1;
|
||||||
|
|
||||||
|
@ -141,6 +146,23 @@ void initGalacticMap(void)
|
||||||
playMusic("music/main/Pressure.ogg", 1);
|
playMusic("music/main/Pressure.ogg", 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void updateCampaignProgress(void)
|
||||||
|
{
|
||||||
|
StarSystem *starSystem;
|
||||||
|
|
||||||
|
if (game.completedMissions == game.totalMissions)
|
||||||
|
{
|
||||||
|
for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next)
|
||||||
|
{
|
||||||
|
starSystem->activeMission = starSystem->missionHead.next;
|
||||||
|
}
|
||||||
|
|
||||||
|
campaignComplete = 1;
|
||||||
|
|
||||||
|
showOKDialog(&campaignCompleteOK, _("Congratulations, you have completed the campaign! You may now replay past missions, for fun, to boost stats, or to earn missing trophies!"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void updatePandoranAdvance(void)
|
static void updatePandoranAdvance(void)
|
||||||
{
|
{
|
||||||
StarSystem *starSystem, *fallenStarSystem;
|
StarSystem *starSystem, *fallenStarSystem;
|
||||||
|
@ -313,7 +335,7 @@ static void addPulses(void)
|
||||||
|
|
||||||
for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next)
|
for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next)
|
||||||
{
|
{
|
||||||
if (starSystem->completedMissions < starSystem->availableMissions)
|
if (starSystem->completedMissions < starSystem->availableMissions || (campaignComplete && starSystem->activeMission))
|
||||||
{
|
{
|
||||||
pulse = malloc(sizeof(Pulse));
|
pulse = malloc(sizeof(Pulse));
|
||||||
memset(pulse, 0, sizeof(Pulse));
|
memset(pulse, 0, sizeof(Pulse));
|
||||||
|
@ -668,7 +690,7 @@ static void drawStarSystemDetail(void)
|
||||||
drawText(525, SCREEN_HEIGHT - 95, 18, TA_LEFT, colors.cyan, OPTIONAL_TEXT);
|
drawText(525, SCREEN_HEIGHT - 95, 18, TA_LEFT, colors.cyan, OPTIONAL_TEXT);
|
||||||
}
|
}
|
||||||
|
|
||||||
startMissionButton->enabled = (!game.currentMission->completed || selectedStarSystem->type == SS_SOL);
|
startMissionButton->enabled = (!game.currentMission->completed || selectedStarSystem->type == SS_SOL || campaignComplete);
|
||||||
|
|
||||||
drawWidgets("starSystem");
|
drawWidgets("starSystem");
|
||||||
}
|
}
|
||||||
|
@ -680,6 +702,15 @@ static void fallenOK(void)
|
||||||
app.modalDialog.type = MD_NONE;
|
app.modalDialog.type = MD_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void campaignCompleteOK(void)
|
||||||
|
{
|
||||||
|
show = SHOW_GALAXY;
|
||||||
|
|
||||||
|
app.modalDialog.type = MD_NONE;
|
||||||
|
|
||||||
|
campaignComplete = 2;
|
||||||
|
}
|
||||||
|
|
||||||
static void handleKeyboard(void)
|
static void handleKeyboard(void)
|
||||||
{
|
{
|
||||||
if (app.keyboard[SDL_SCANCODE_ESCAPE] && !app.awaitingWidgetInput)
|
if (app.keyboard[SDL_SCANCODE_ESCAPE] && !app.awaitingWidgetInput)
|
||||||
|
|
Loading…
Reference in New Issue