From 46337a1f16982aabe6de692b9242f33e6c1000bb Mon Sep 17 00:00:00 2001 From: Steve Date: Sun, 29 Nov 2015 08:44:34 +0000 Subject: [PATCH] Removed challenges from main campaign. --- data/missions/sol/07 - final.json | 14 ------ .../temper/01 - pirate uprising #1.json | 14 ------ .../temper/02 - pirate uprising #2.json | 14 ------ .../temper/03 - pirate uprising #3.json | 10 ---- src/galaxy/galacticMap.c | 46 +------------------ src/galaxy/starSystems.c | 15 +----- src/structs.h | 2 - 7 files changed, 4 insertions(+), 111 deletions(-) diff --git a/data/missions/sol/07 - final.json b/data/missions/sol/07 - final.json index 6d645a5..9533095 100644 --- a/data/missions/sol/07 - final.json +++ b/data/missions/sol/07 - final.json @@ -12,20 +12,6 @@ "targetType" : "TT_DESTROY" } ], - "challenges" : [ - { - "type" : "CHALLENGE_ARMOUR", - "targetValue" : 100 - }, - { - "type" : "CHALLENGE_TIME", - "targetValue" : 30 - }, - { - "type" : "CHALLENGE_ACCURACY", - "targetValue" : 25 - } - ], "player" : { "type" : "TAF", "side" : "SIDE_ALLIES", diff --git a/data/missions/temper/01 - pirate uprising #1.json b/data/missions/temper/01 - pirate uprising #1.json index 26fa408..37f8ac9 100644 --- a/data/missions/temper/01 - pirate uprising #1.json +++ b/data/missions/temper/01 - pirate uprising #1.json @@ -12,20 +12,6 @@ "targetType" : "TT_DESTROY" } ], - "challenges" : [ - { - "type" : "CHALLENGE_NO_LOSSES", - "targetValue" : 0 - }, - { - "type" : "CHALLENGE_ARMOUR", - "targetValue" : 100 - }, - { - "type" : "CHALLENGE_PLAYER_KILLS", - "targetValue" : 15 - } - ], "player" : { "type" : "TAF", "side" : "SIDE_ALLIES", diff --git a/data/missions/temper/02 - pirate uprising #2.json b/data/missions/temper/02 - pirate uprising #2.json index 3bde788..7f32214 100644 --- a/data/missions/temper/02 - pirate uprising #2.json +++ b/data/missions/temper/02 - pirate uprising #2.json @@ -13,20 +13,6 @@ "targetType" : "TT_DESTROY" } ], - "challenges" : [ - { - "type" : "CHALLENGE_1_LOSS", - "targetValue" : 0 - }, - { - "type" : "CHALLENGE_ARMOUR", - "targetValue" : 80 - }, - { - "type" : "CHALLENGE_PLAYER_KILLS", - "targetValue" : 10 - } - ], "player" : { "type" : "TAF", "side" : "SIDE_ALLIES", diff --git a/data/missions/temper/03 - pirate uprising #3.json b/data/missions/temper/03 - pirate uprising #3.json index a0a31b4..8511347 100644 --- a/data/missions/temper/03 - pirate uprising #3.json +++ b/data/missions/temper/03 - pirate uprising #3.json @@ -33,16 +33,6 @@ "isCondition" : 1 } ], - "challenges" : [ - { - "type" : "CHALLENGE_TIME_MINS", - "targetValue" : 3 - }, - { - "type" : "CHALLENGE_DISABLE", - "targetValue" : 3 - } - ], "player" : { "type" : "Ray", "side" : "SIDE_ALLIES", diff --git a/src/galaxy/galacticMap.c b/src/galaxy/galacticMap.c index 9ba24d5..5047971 100644 --- a/src/galaxy/galacticMap.c +++ b/src/galaxy/galacticMap.c @@ -58,7 +58,6 @@ static float ssx, ssy; static float arrowPulse; static int show; static int completedMissions, totalMissions; -static int completedChallenges, totalChallenges; void initGalacticMap(void) { @@ -151,7 +150,7 @@ static void doStarSystems(void) StarSystem *starSystem; int cx, cy; - completedMissions = totalMissions = completedChallenges = totalChallenges = 0; + completedMissions = totalMissions = 0; cx = app.mouse.x - 32; cy = app.mouse.y - 32; @@ -162,8 +161,6 @@ static void doStarSystems(void) { completedMissions += starSystem->completedMissions; totalMissions += starSystem->totalMissions; - completedChallenges += starSystem->completedChallenges; - totalChallenges += starSystem->totalChallenges; if (starSystem->totalMissions > 0 && collision(cx, cy, 64, 64, starSystem->x - camera.x, starSystem->y - camera.y, 4, 4)) { @@ -260,22 +257,6 @@ static void addPulses(void) pulseTail->next = pulse; pulseTail = pulse; } - else if (starSystem->completedChallenges < starSystem->totalChallenges) - { - if (pulseTimer % (FPS * 2) == 0) - { - pulse = malloc(sizeof(Pulse)); - memset(pulse, 0, sizeof(Pulse)); - - pulse->x = starSystem->x; - pulse->y = starSystem->y; - pulse->life = 255; - pulse->r = pulse->g = 255; - - pulseTail->next = pulse; - pulseTail = pulse; - } - } else if (starSystem->totalMissions > 0) { if (pulseTimer % (FPS * 3) == 0) @@ -478,8 +459,7 @@ static void drawInfoBars(void) SDL_RenderFillRect(app.renderer, &r); SDL_SetRenderDrawBlendMode(app.renderer, SDL_BLENDMODE_NONE); - drawText((SCREEN_WIDTH / 2) - 50, 5, 18, TA_RIGHT, colors.white, "Missions: %d / %d", completedMissions, totalMissions); - drawText((SCREEN_WIDTH / 2) + 50, 5, 18, TA_LEFT, colors.white, "Challenges: %d / %d", completedChallenges, totalChallenges); + drawText((SCREEN_WIDTH / 2), 5, 18, TA_CENTER, colors.white, "Missions: %d / %d", completedMissions, totalMissions); } static void selectStarSystem(void) @@ -497,7 +477,6 @@ static void drawStarSystemDetail(void) { int y; Mission *mission; - Challenge *challenge; SDL_Rect r; r.w = 900; @@ -564,27 +543,6 @@ static void drawStarSystemDetail(void) drawText(525, SCREEN_HEIGHT - 95, 18, TA_LEFT, colors.yellow, "Note: this is an Epic Mission."); } - if (selectedMission && selectedMission->available && selectedMission->challengeHead.next) - { - y = SCREEN_HEIGHT - 100; - - for (challenge = selectedMission->challengeHead.next ; challenge != NULL ; challenge = challenge->next) - { - y -= 25; - } - - drawText(525, y, 22, TA_LEFT, colors.yellow, "Challenges"); - - y += 30; - - for (challenge = selectedMission->challengeHead.next ; challenge != NULL ; challenge = challenge->next) - { - drawText(525, y, 18, TA_LEFT, challenge->passed ? colors.green : colors.lightGrey, "%s%s", getChallengeDescription(challenge), challenge->passed ? " - COMPLETE" : ""); - - y += 25; - } - } - drawWidgets("starSystem"); } diff --git a/src/galaxy/starSystems.c b/src/galaxy/starSystems.c index 443f069..003f4a8 100644 --- a/src/galaxy/starSystems.c +++ b/src/galaxy/starSystems.c @@ -154,11 +154,10 @@ void updateStarSystemDescriptions(void) { StarSystem *starSystem; Mission *mission; - Challenge *challenge; for (starSystem = game.starSystemHead.next ; starSystem != NULL ; starSystem = starSystem->next) { - starSystem->completedMissions = starSystem->totalMissions = starSystem->completedChallenges = starSystem->totalChallenges = 0; + starSystem->completedMissions = starSystem->totalMissions; for (mission = starSystem->missionHead.next ; mission != NULL ; mission = mission->next) { @@ -168,19 +167,9 @@ void updateStarSystemDescriptions(void) { starSystem->completedMissions++; } - - for (challenge = mission->challengeHead.next ; challenge != NULL ; challenge = challenge->next) - { - starSystem->totalChallenges++; - - if (challenge->passed) - { - starSystem->completedChallenges++; - } - } } - sprintf(starSystem->description, "[ %s ] [ Missions %d / %d ] [ Challenges %d / %d ]", starSystem->name, starSystem->completedMissions, starSystem->totalMissions, starSystem->completedChallenges, starSystem->totalChallenges); + sprintf(starSystem->description, "[ %s ] [ Missions %d / %d ]", starSystem->name, starSystem->completedMissions, starSystem->totalMissions); } } diff --git a/src/structs.h b/src/structs.h index 39d1b6e..c45391b 100644 --- a/src/structs.h +++ b/src/structs.h @@ -214,8 +214,6 @@ struct StarSystem { int y; int completedMissions; int totalMissions; - int completedChallenges; - int totalChallenges; Mission missionHead, *missionTail; StarSystem *next; };