2 Copyright (C) 2004 Parallel Realities
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13 See the GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 void doTimeRemaining()
25 map.remainingSeconds--;
27 if ((map.remainingMinutes == 0) && (map.remainingSeconds <= 10) && (map.remainingSeconds > 0))
29 audio.playSound(SND_CLOCK, CH_TOUCH);
32 if (map.remainingSeconds < 0)
34 if (map.remainingMinutes > 0)
36 map.remainingSeconds = 59;
37 map.remainingMinutes--;
41 if ((map.remainingSeconds == 0) && (map.remainingMinutes == 0))
45 Math::removeBit(&player.flags, ENT_FLIES);
46 game.setMissionOver(MIS_TIMEUP);
49 replayData.header.time++;
54 graphics.setFontSize(0);
55 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
59 graphics.blit(graphics.infoBar, 0, 0, graphics.screen, false);
61 graphics.drawString(_("Health"), 50, 5, TXT_RIGHT, graphics.screen);
63 for (int i = 0 ; i < MAX_HEALTH ; i++)
65 if (i < player.health)
66 graphics.blit(graphics.getSprite("HealthBlock", true)->getCurrentFrame(), 60 + (i * 15), 7, graphics.screen, false);
68 graphics.blit(graphics.getSprite("HealthBlockEmpty", true)->getCurrentFrame(), 60 + (i * 15), 7, graphics.screen, false);
71 if (player.health <= 3)
72 if (engine.getFrameLoop() < 30)
73 for (int i = 0 ; i < player.health ; i++)
74 graphics.blit(graphics.getSprite("WarningBlock", true)->getCurrentFrame(), 60 + (i * 15), 7, graphics.screen, false);
76 if ((!game.hasAquaLung) && (!engine.cheatExtras))
78 graphics.drawString(_("Oxygen"), 305, 5, TXT_RIGHT, graphics.screen);
80 for (int i = 0 ; i < 7 ; i++)
82 if (i < player.oxygen)
83 graphics.blit(graphics.getSprite("OxygenBlock", true)->getCurrentFrame(), 315 + (i * 15), 7, graphics.screen, false);
85 graphics.blit(graphics.getSprite("OxygenBlockEmpty", true)->getCurrentFrame(), 315 + (i * 15), 7, graphics.screen, false);
88 if (player.oxygen <= 3)
89 if (engine.getFrameLoop() < 30)
90 for (int i = 0 ; i < player.oxygen ; i++)
91 graphics.blit(graphics.getSprite("WarningBlock", true)->getCurrentFrame(), 315 + (i * 15), 7, graphics.screen, false);
93 else if ((game.hasJetPack) || (engine.cheatExtras))
95 graphics.drawString(_("Jetpack"), 305, 5, TXT_RIGHT, graphics.screen);
97 for (int i = 0 ; i < 7 ; i++)
100 graphics.blit(graphics.getSprite("OxygenBlock", true)->getCurrentFrame(), 315 + (i * 15), 7, graphics.screen, false);
102 graphics.blit(graphics.getSprite("OxygenBlockEmpty", true)->getCurrentFrame(), 315 + (i * 15), 7, graphics.screen, false);
105 if ((player.fuel < 3) && (!(player.flags & ENT_FLIES)))
106 if (engine.getFrameLoop() < 30)
107 for (int i = 0 ; i < player.fuel ; i++)
108 graphics.blit(graphics.getSprite("WarningBlock", true)->getCurrentFrame(), 315 + (i * 15), 7, graphics.screen, false);
111 if ((map.mainBossPart == NULL || strstr(engine.message, "Aqua") || strstr(engine.message, "Jet")) && (game.missionOverReason != MIS_GAMECOMPLETE))
113 if (engine.messageTime > -1)
115 switch (engine.messageType)
118 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
121 graphics.setFontColor(0x00, 0xff, 0x00, 0x00, 0x00, 0x00);
124 graphics.setFontColor(0xff, 0xaa, 0x00, 0x00, 0x00, 0x00);
127 graphics.setFontColor(0x00, 0xff, 0xff, 0x00, 0x00, 0x00);
130 graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
134 graphics.blit(graphics.infoBar, 0, 455, graphics.screen, false);
135 graphics.drawString(_(engine.message), 320, 466, true, graphics.screen);
137 engine.messageTime--;
138 if (engine.messageTime == -1)
140 engine.messagePriority = -1;
141 strcpy(engine.message, "");
144 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
149 if (map.mainBossPart != NULL)
151 graphics.blit(graphics.infoBar, 0, 455, graphics.screen, false);
153 graphics.drawString(_(map.mainBossPart->name), 255, 460, TXT_RIGHT, graphics.screen);
154 graphics.drawRect(265 - 1, 463 - 1, 200 + 2, 10 + 2, graphics.white, graphics.screen);
155 graphics.drawRect(265, 463, 200, 10, graphics.black, graphics.screen);
157 if (map.mainBossPart->health > 0)
159 graphics.drawRect(265, 463, (int)(map.mainBossPart->health * map.bossEnergyMeterBit), 10, graphics.red, graphics.screen);
164 sprintf(string, "%s %s", _("Weapon:"), _(player.currentWeapon->name));
165 graphics.drawString(string, 630, 5, TXT_RIGHT, graphics.screen);
169 sprintf(string, _("Time Remaining: %.2d:%.2d"), map.remainingMinutes, map.remainingSeconds);
170 graphics.blit(graphics.infoBar, 0, 25, graphics.screen, false);
172 if ((map.remainingMinutes > 0) || (map.remainingSeconds > 0))
174 if (map.remainingMinutes == 0)
176 if (map.remainingSeconds > 0)
178 if (map.remainingSeconds <= 10)
180 graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
182 else if (map.remainingSeconds <= 30)
184 graphics.setFontColor(0xff, 0xff, 0x00, 0x00, 0x00, 0x00);
188 graphics.drawString(string, 320, 35, TXT_CENTERED, graphics.screen);
192 graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
193 graphics.setFontSize(3);
194 graphics.drawString(_("Mission Failed! Time Up!"), 320, 220, TXT_CENTERED, graphics.screen);
195 graphics.setFontSize(0);
196 game.canContinue = 0;
214 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
216 sprintf(string, _("Position = %d:%d"), (int)player.x, (int)player.y);
217 graphics.drawString(string, 5, 25, false, graphics.screen);
219 graphics.drawString(_("*** PAUSED ***"), 320, y, TXT_CENTERED, graphics.screen);
221 graphics.drawString(_("MIAs in Area"), col1, y += 30, TXT_RIGHT, graphics.screen);
222 sprintf(string, "%d", map.totalMIAs - map.foundMIAs);
223 graphics.drawString(string, col2, y, TXT_LEFT, graphics.screen);
225 graphics.drawString(_("Enemies Defeated"), col1, y += 20, TXT_RIGHT, graphics.screen);
226 sprintf(string, "%d", game.currentMissionEnemiesDefeated);
227 graphics.drawString(string, col2, y, TXT_LEFT, graphics.screen);
229 graphics.drawString(_("Items Collected"), col1, y += 20, TXT_RIGHT, graphics.screen);
230 sprintf(string, "%d / %d", map.foundItems, map.totalItems);
231 graphics.drawString(string, col2, y, TXT_LEFT, graphics.screen);
233 graphics.drawString(_("Best Combo"), col1, y += 20, TXT_RIGHT, graphics.screen);
234 sprintf(string, _("%d Hits"), game.maxComboHits);
235 graphics.drawString(string, col2, y, TXT_LEFT, graphics.screen);
237 graphics.drawString(_("++ Inventory ++"), 320, y += 40, TXT_CENTERED, graphics.screen);
240 // Do the objectives list
241 Objective *objective = (Objective*)map.objectiveList.getHead();
246 if (map.totalMIAs > 0)
248 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
249 sprintf(message, _("Rescue %d MIAs"), map.requiredMIAs);
250 graphics.drawString(message, col1, y, TXT_RIGHT, graphics.screen);
252 if (map.foundMIAs < map.requiredMIAs)
254 graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
255 sprintf(message, "%d / %d", map.foundMIAs, map.requiredMIAs);
256 graphics.drawString(message, col2, y, TXT_LEFT, graphics.screen);
260 graphics.setFontColor(0x00, 0xff, 0x00, 0x00, 0x00, 0x00);
261 graphics.drawString(_("Completed"), col2, y, TXT_LEFT, graphics.screen);
265 while (objective->next != NULL)
267 objective = (Objective*)objective->next;
271 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
273 if ((game.skill < 3) && (strstr(objective->description, "L.R.T.S.")) && (!gameData.completedWorld))
275 graphics.drawString(_("???? ???????? ????"), col1, y, TXT_RIGHT, graphics.screen);
279 graphics.drawString(_(objective->description), col1, y, TXT_RIGHT, graphics.screen);
282 // this is a fake objective (for the 4th Ancient Tomb)
283 if (objective->targetValue == -1)
285 graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
286 graphics.drawString(_("Incomplete"), col2, y, TXT_LEFT, graphics.screen);
288 else if (objective->currentValue < objective->targetValue)
290 graphics.setFontColor(0xff, 0x00, 0x00, 0x00, 0x00, 0x00);
291 if (objective->targetValue == 1)
293 graphics.drawString(_("Incomplete"), col2, y, TXT_LEFT, graphics.screen);
297 sprintf(message, "%d / %d", objective->currentValue, objective->targetValue);
298 graphics.drawString(message, col2, y, TXT_LEFT, graphics.screen);
301 if (!objective->required)
303 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
304 graphics.drawString(_("(optional)"), 450, y, TXT_LEFT, graphics.screen);
309 graphics.setFontColor(0x00, 0xff, 0x00, 0x00, 0x00, 0x00);
310 graphics.drawString(_("Completed"), col2, y, TXT_LEFT, graphics.screen);
314 graphics.setFontColor(0xff, 0xff, 0xff, 0x00, 0x00, 0x00);
318 sprintf(string, "%s - %.2d:%.2d:%.2d", _("Mission Time"), game.currentMissionHours, game.currentMissionMinutes, game.currentMissionSeconds);
319 graphics.drawString(string, 320, 430, TXT_CENTERED, graphics.screen);