2011-08-24 14:14:44 +02:00
/*
Copyright ( C ) 2003 Parallel Realities
2015-03-01 21:37:32 +01:00
Copyright ( C ) 2011 , 2012 , 2013 Guus Sliepen
2016-01-02 22:59:48 +01:00
Copyright ( C ) 2012 , 2015 , 2016 onpon4 < onpon4 @ riseup . net >
2011-08-24 14:14:44 +02:00
This program is free software ; you can redistribute it and / or
modify it under the terms of the GNU General Public License
2015-02-26 17:20:36 +01:00
as published by the Free Software Foundation ; either version 3
2011-08-24 14:14:44 +02:00
of the License , or ( at your option ) any later version .
This program is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
2015-02-26 17:20:36 +01:00
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
GNU General Public License for more details .
2011-08-24 14:14:44 +02:00
You should have received a copy of the GNU General Public License
2015-02-26 17:20:36 +01:00
along with this program . If not , see < http : //www.gnu.org/licenses/>.
2011-08-24 14:14:44 +02:00
*/
2011-08-26 21:29:04 +02:00
# include "Starfighter.h"
2011-08-24 14:14:44 +02:00
/*
Drives the cursor . Is used by some other screens too
*/
2015-05-28 12:51:45 +02:00
static void intermission_doCursor ( )
2011-08-24 14:14:44 +02:00
{
getPlayerInput ( ) ;
2016-01-05 04:25:00 +01:00
LIMIT ( engine . cursor_x , 10 , screen - > w - 10 - gfx_sprites [ SP_CURSOR ] - > w ) ;
LIMIT ( engine . cursor_y , 10 , screen - > h - 10 - gfx_sprites [ SP_CURSOR ] - > h ) ;
screen_blit ( gfx_sprites [ SP_CURSOR ] , engine . cursor_x , engine . cursor_y ) ;
2011-08-24 14:14:44 +02:00
}
/*
Sets the player ' s current status information lines . These are the lines
that are scrolled up the screen when the player clicks on Current Status
These are set only once .
*/
2015-05-28 12:51:45 +02:00
static void intermission_setStatusLines ( )
2011-08-24 14:14:44 +02:00
{
char string [ 50 ] ;
2016-01-04 18:41:19 +01:00
int timeTaken = game . timeTaken ;
int y ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Shots Fired : %d " , game . shots ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_SHOTS_FIRED , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Hits Scored : %d " , game . hits ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_HITS_SCORED , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Accuracy : %d%% " , game . accuracy ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_ACCURACY , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Enemies Killed by Others : %d " , game . totalOtherKills ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_OTHER_KILLS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Total Cash Earned : %d " , game . cashEarned ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CASH_EARNED , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_HEADER , " *** Chris *** " , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Enemies Killed : %d " , game . totalKills ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_KILLS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Shield Restores Picked Up : %d " , game . shieldPickups ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_SHIELD_PICKUPS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Plasma Cells Picked Up : %d " , game . cellPickups ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_PLASMA_PICKUPS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Rockets Picked Up : %d " , game . rocketPickups ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_ROCKET_PICKUPS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2016-01-10 04:15:28 +01:00
sprintf ( string , " Powerups Picked Up : %d " , game . powerups ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_POWERUP_PICKUPS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Mines Destroyed : %d " , game . minesKilled ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_MINES_KILLED , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Slaves Rescued : %d " , game . slavesRescued ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CHRIS_SLAVES_RESCUED , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
if ( game . hasWingMate1 )
2011-08-24 14:14:44 +02:00
{
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_PHOEBE_HEADER , " *** Phoebe *** " , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Enemies Killed : %d " , game . wingMate1Kills ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_PHOEBE_KILLS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Ejections : %d " , game . wingMate1Ejects ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_PHOEBE_DEATHS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
}
2016-01-10 04:15:28 +01:00
else
{
gfx_createTextObject ( TS_PHOEBE_HEADER , " " , 0 , 0 , FONT_WHITE ) ;
gfx_createTextObject ( TS_PHOEBE_KILLS , " " , 0 , 0 , FONT_WHITE ) ;
gfx_createTextObject ( TS_PHOEBE_DEATHS , " " , 0 , 0 , FONT_WHITE ) ;
}
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
if ( game . hasWingMate2 )
2011-08-24 14:14:44 +02:00
{
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_URSULA_HEADER , " *** Ursula *** " , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Enemies Killed : %d " , game . wingMate2Kills ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_URSULA_KILLS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Ejections : %d " , game . wingMate2Ejects ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_URSULA_DEATHS , string , 0 , 0 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
}
2016-01-10 04:15:28 +01:00
else
{
gfx_createTextObject ( TS_URSULA_HEADER , " " , 0 , 0 , FONT_WHITE ) ;
gfx_createTextObject ( TS_URSULA_KILLS , " " , 0 , 0 , FONT_WHITE ) ;
gfx_createTextObject ( TS_URSULA_DEATHS , " " , 0 , 0 , FONT_WHITE ) ;
}
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_STATUS_HEADER , " Current Status " , - 1 , 83 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2011-08-24 16:01:36 +02:00
snprintf ( string , sizeof string , " Total Time : %2d:%02d:%02d " , timeTaken / 3600 , ( timeTaken / 60 ) % 60 , timeTaken % 60 ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_STATUS_FOOTER , string , - 1 , 404 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
y = 400 ;
for ( int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i + + )
2011-08-24 14:14:44 +02:00
{
2016-01-04 18:41:19 +01:00
y + = 20 ;
if ( ( i = = TS_CHRIS_HEADER ) | | ( i = = TS_PHOEBE_HEADER ) | |
( i = = TS_URSULA_HEADER ) )
y + = 25 ;
2011-08-24 14:14:44 +02:00
2016-01-04 04:39:16 +01:00
gfx_textSprites [ i ] . x = 150 ;
2016-01-04 18:41:19 +01:00
gfx_textSprites [ i ] . y = y ;
2011-08-24 14:14:44 +02:00
}
}
/*
Sets the names and stats of the planets within the current system .
*/
2015-05-28 12:51:45 +02:00
static void intermission_setSystemPlanets ( )
2011-08-24 14:14:44 +02:00
{
2016-01-09 03:33:40 +01:00
for ( int i = 0 ; i < 10 ; i + + )
{
systemPlanet [ i ] . y = - 1 ;
strcpy ( systemPlanet [ i ] . name , " " ) ;
systemPlanet [ i ] . image = NULL ;
systemPlanet [ i ] . messageMission = - 1 ;
systemPlanet [ i ] . messageSlot = - 1 ;
systemPlanet [ i ] . faceImage = - 1 ;
strcpy ( systemPlanet [ i ] . subject , " ERROR " ) ;
}
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
switch ( game . system )
2011-08-24 14:14:44 +02:00
{
2016-01-05 12:44:26 +01:00
case SYSTEM_SPIRIT :
2016-01-09 03:33:40 +01:00
systemPlanet [ PLANET_HAIL ] . y = 15 ;
strcpy ( systemPlanet [ PLANET_HAIL ] . name , " Hail " ) ;
systemPlanet [ PLANET_HAIL ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_CERADSE ] . y = 30 ;
strcpy ( systemPlanet [ PLANET_CERADSE ] . name , " Ceradse " ) ;
systemPlanet [ PLANET_CERADSE ] . image = gfx_sprites [ SP_PLANET_BLUE ] ;
systemPlanet [ PLANET_HINSTAG ] . y = 30 ;
strcpy ( systemPlanet [ PLANET_HINSTAG ] . name , " Hinstag " ) ;
systemPlanet [ PLANET_HINSTAG ] . image = gfx_sprites [ SP_PLANET_RED ] ;
systemPlanet [ PLANET_JOLDAR ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_JOLDAR ] . name , " Joldar " ) ;
systemPlanet [ PLANET_JOLDAR ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_MOEBO ] . y = 40 ;
strcpy ( systemPlanet [ PLANET_MOEBO ] . name , " Moebo " ) ;
systemPlanet [ PLANET_MOEBO ] . image = gfx_sprites [ SP_PLANET_ORANGE ] ;
systemPlanet [ PLANET_HAIL ] . messageMission = MISN_HAIL ;
systemPlanet [ PLANET_HAIL ] . messageSlot = 0 ;
systemPlanet [ PLANET_HAIL ] . faceImage = FS_KRASS ;
strcpy ( systemPlanet [ PLANET_HAIL ] . subject , " Destroy WEAPCO training ground " ) ;
systemPlanet [ PLANET_CERADSE ] . messageMission = MISN_CERADSE ;
systemPlanet [ PLANET_CERADSE ] . messageSlot = 1 ;
systemPlanet [ PLANET_CERADSE ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_CERADSE ] . subject , " Collect 6 cargo pods " ) ;
systemPlanet [ PLANET_HINSTAG ] . messageMission = MISN_HINSTAG ;
systemPlanet [ PLANET_HINSTAG ] . messageSlot = 2 ;
systemPlanet [ PLANET_HINSTAG ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_HINSTAG ] . subject , " Destroy 5 WEAPCO missile boats " ) ;
systemPlanet [ PLANET_JOLDAR ] . messageMission = MISN_JOLDAR ;
systemPlanet [ PLANET_JOLDAR ] . messageSlot = 3 ;
systemPlanet [ PLANET_JOLDAR ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_JOLDAR ] . subject , " Clear the mine field around Joldar " ) ;
systemPlanet [ PLANET_MOEBO ] . messageMission = MISN_MOEBO ;
systemPlanet [ PLANET_MOEBO ] . messageSlot = 0 ;
systemPlanet [ PLANET_MOEBO ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_MOEBO ] . subject , " Destroy WEAPCO frigate " ) ;
2011-08-24 14:14:44 +02:00
2016-01-09 03:33:40 +01:00
break ;
2011-08-24 14:14:44 +02:00
2016-01-09 03:33:40 +01:00
case SYSTEM_EYANANTH :
strcpy ( systemPlanet [ PLANET_RESCUESLAVES ] . name , " WEAPCO interceptions " ) ;
systemPlanet [ PLANET_NEROD ] . y = 15 ;
strcpy ( systemPlanet [ PLANET_NEROD ] . name , " Nerod " ) ;
systemPlanet [ PLANET_NEROD ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_ALLEZ ] . y = 30 ;
strcpy ( systemPlanet [ PLANET_ALLEZ ] . name , " Allez " ) ;
systemPlanet [ PLANET_ALLEZ ] . image = gfx_sprites [ SP_PLANET_BLUE ] ;
systemPlanet [ PLANET_URUSOR ] . y = 30 ;
strcpy ( systemPlanet [ PLANET_URUSOR ] . name , " Urusor " ) ;
systemPlanet [ PLANET_URUSOR ] . image = gfx_sprites [ SP_PLANET_RED ] ;
systemPlanet [ PLANET_DORIM ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_DORIM ] . name , " Dorim " ) ;
systemPlanet [ PLANET_DORIM ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_ELAMALE ] . y = 40 ;
strcpy ( systemPlanet [ PLANET_ELAMALE ] . name , " Elamale " ) ;
systemPlanet [ PLANET_ELAMALE ] . image = gfx_sprites [ SP_PLANET_ORANGE ] ;
systemPlanet [ PLANET_RESCUESLAVES ] . messageMission = MISN_RESCUESLAVES ;
systemPlanet [ PLANET_RESCUESLAVES ] . messageSlot = 0 ;
systemPlanet [ PLANET_RESCUESLAVES ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_RESCUESLAVES ] . subject , " Rescue slaves " ) ;
systemPlanet [ PLANET_NEROD ] . messageMission = MISN_NEROD ;
systemPlanet [ PLANET_NEROD ] . messageSlot = 1 ;
systemPlanet [ PLANET_NEROD ] . faceImage = FS_PHOEBE ;
strcpy ( systemPlanet [ PLANET_NEROD ] . subject , " SOS " ) ;
systemPlanet [ PLANET_ALLEZ ] . messageMission = MISN_ALLEZ ;
systemPlanet [ PLANET_ALLEZ ] . messageSlot = 2 ;
systemPlanet [ PLANET_ALLEZ ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_ALLEZ ] . subject , " Assist medical supply craft " ) ;
systemPlanet [ PLANET_URUSOR ] . messageMission = MISN_URUSOR ;
systemPlanet [ PLANET_URUSOR ] . messageSlot = 0 ;
systemPlanet [ PLANET_URUSOR ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_URUSOR ] . subject , " Capture five WEAPCO supply craft " ) ;
systemPlanet [ PLANET_DORIM ] . messageMission = MISN_DORIM ;
systemPlanet [ PLANET_DORIM ] . messageSlot = 1 ;
systemPlanet [ PLANET_DORIM ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_DORIM ] . subject , " Find WEAPCO scientist " ) ;
systemPlanet [ PLANET_ELAMALE ] . messageMission = MISN_ELAMALE ;
systemPlanet [ PLANET_ELAMALE ] . messageSlot = 0 ;
systemPlanet [ PLANET_ELAMALE ] . faceImage = FS_PHOEBE ;
strcpy ( systemPlanet [ PLANET_ELAMALE ] . subject , " Destroy WEAPCO Ore Mining craft " ) ;
2011-08-24 14:14:44 +02:00
2015-02-27 20:53:23 +01:00
break ;
2011-08-24 14:14:44 +02:00
2016-01-09 03:33:40 +01:00
case SYSTEM_MORDOR :
strcpy ( systemPlanet [ PLANET_CLOAKFIGHTER ] . name , " WEAPCO interceptions " ) ;
systemPlanet [ PLANET_ODEON ] . y = 15 ;
strcpy ( systemPlanet [ PLANET_ODEON ] . name , " Odeon " ) ;
systemPlanet [ PLANET_ODEON ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_FELLON ] . y = 30 ;
strcpy ( systemPlanet [ PLANET_FELLON ] . name , " Fellon " ) ;
systemPlanet [ PLANET_FELLON ] . image = gfx_sprites [ SP_PLANET_BLUE ] ;
systemPlanet [ PLANET_SIVEDI ] . y = 30 ;
strcpy ( systemPlanet [ PLANET_SIVEDI ] . name , " Sivedi " ) ;
systemPlanet [ PLANET_SIVEDI ] . image = gfx_sprites [ SP_PLANET_RED ] ;
systemPlanet [ PLANET_ALMARTHA ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_ALMARTHA ] . name , " Almartha " ) ;
systemPlanet [ PLANET_ALMARTHA ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_POSWIC ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_POSWIC ] . name , " Poswic " ) ;
systemPlanet [ PLANET_POSWIC ] . image = gfx_sprites [ SP_PLANET_ORANGE ] ;
systemPlanet [ PLANET_ELLESH ] . y = 40 ;
strcpy ( systemPlanet [ PLANET_ELLESH ] . name , " Ellesh " ) ;
systemPlanet [ PLANET_ELLESH ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_CLOAKFIGHTER ] . messageMission = MISN_CLOAKFIGHTER ;
systemPlanet [ PLANET_CLOAKFIGHTER ] . messageSlot = 0 ;
systemPlanet [ PLANET_CLOAKFIGHTER ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_CLOAKFIGHTER ] . subject , " Destroy experimental fighter " ) ;
systemPlanet [ PLANET_ODEON ] . messageMission = MISN_ODEON ;
systemPlanet [ PLANET_ODEON ] . messageSlot = 1 ;
systemPlanet [ PLANET_ODEON ] . faceImage = FS_PHOEBE ;
strcpy ( systemPlanet [ PLANET_ODEON ] . subject , " Rescue Ursula " ) ;
systemPlanet [ PLANET_FELLON ] . messageMission = MISN_FELLON ;
systemPlanet [ PLANET_FELLON ] . messageSlot = 2 ;
systemPlanet [ PLANET_FELLON ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_FELLON ] . subject , " Assist rebel forces " ) ;
systemPlanet [ PLANET_SIVEDI ] . messageMission = MISN_SIVEDI ;
systemPlanet [ PLANET_SIVEDI ] . messageSlot = 0 ;
systemPlanet [ PLANET_SIVEDI ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_SIVEDI ] . subject , " Mine ore from asteroid belt " ) ;
systemPlanet [ PLANET_ALMARTHA ] . messageMission = MISN_ALMARTHA ;
systemPlanet [ PLANET_ALMARTHA ] . messageSlot = 1 ;
systemPlanet [ PLANET_ALMARTHA ] . faceImage = FS_KRASS ;
strcpy ( systemPlanet [ PLANET_ALMARTHA ] . subject , " Create a diversion " ) ;
systemPlanet [ PLANET_POSWIC ] . messageMission = MISN_POSWIC ;
systemPlanet [ PLANET_POSWIC ] . messageSlot = 0 ;
systemPlanet [ PLANET_POSWIC ] . faceImage = FS_URSULA ;
strcpy ( systemPlanet [ PLANET_POSWIC ] . subject , " Capture WEAPCO executive transport " ) ;
systemPlanet [ PLANET_ELLESH ] . messageMission = MISN_ELLESH ;
systemPlanet [ PLANET_ELLESH ] . messageSlot = 0 ;
systemPlanet [ PLANET_ELLESH ] . faceImage = FS_PHOEBE ;
strcpy ( systemPlanet [ PLANET_ELLESH ] . subject , " Destroy WEAPCO executive transport " ) ;
2011-08-24 14:14:44 +02:00
2015-02-27 20:53:23 +01:00
break ;
2011-08-24 14:14:44 +02:00
2016-01-09 03:33:40 +01:00
case SYSTEM_SOL :
systemPlanet [ PLANET_MERCURY ] . y = 15 ;
strcpy ( systemPlanet [ PLANET_MERCURY ] . name , " Mercury " ) ;
systemPlanet [ PLANET_MERCURY ] . image = gfx_sprites [ SP_PLANET_RED ] ;
systemPlanet [ PLANET_VENUS ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_VENUS ] . name , " Venus " ) ;
systemPlanet [ PLANET_VENUS ] . image = gfx_sprites [ SP_PLANET_ORANGE ] ;
systemPlanet [ PLANET_EARTH ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_EARTH ] . name , " Earth " ) ;
systemPlanet [ PLANET_EARTH ] . image = gfx_sprites [ SP_PLANET_BLUE ] ;
systemPlanet [ PLANET_MARS ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_MARS ] . name , " Mars " ) ;
systemPlanet [ PLANET_MARS ] . image = gfx_sprites [ SP_PLANET_RED ] ;
systemPlanet [ PLANET_JUPITER ] . y = 30 ;
strcpy ( systemPlanet [ PLANET_JUPITER ] . name , " Jupiter " ) ;
systemPlanet [ PLANET_JUPITER ] . image = gfx_sprites [ SP_PLANET_ORANGE ] ;
systemPlanet [ PLANET_SATURN ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_SATURN ] . name , " Saturn " ) ;
systemPlanet [ PLANET_SATURN ] . image = gfx_sprites [ SP_PLANET_GREEN ] ;
systemPlanet [ PLANET_URANUS ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_URANUS ] . name , " Uranus " ) ;
systemPlanet [ PLANET_URANUS ] . image = gfx_sprites [ SP_PLANET_BLUE ] ;
systemPlanet [ PLANET_NEPTUNE ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_NEPTUNE ] . name , " Neptune " ) ;
systemPlanet [ PLANET_NEPTUNE ] . image = gfx_sprites [ SP_PLANET_BLUE ] ;
systemPlanet [ PLANET_PLUTO ] . y = 20 ;
strcpy ( systemPlanet [ PLANET_PLUTO ] . name , " Pluto " ) ;
systemPlanet [ PLANET_PLUTO ] . image = gfx_sprites [ SP_PLANET_BLUE ] ;
systemPlanet [ PLANET_PLUTO ] . messageMission = MISN_PLUTO ;
systemPlanet [ PLANET_PLUTO ] . messageSlot = 0 ;
systemPlanet [ PLANET_PLUTO ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_PLUTO ] . subject , " Secure Pluto " ) ;
systemPlanet [ PLANET_NEPTUNE ] . messageMission = MISN_NEPTUNE ;
systemPlanet [ PLANET_NEPTUNE ] . messageSlot = 1 ;
systemPlanet [ PLANET_NEPTUNE ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_NEPTUNE ] . subject , " Secure Neptune " ) ;
systemPlanet [ PLANET_URANUS ] . messageMission = MISN_URANUS ;
systemPlanet [ PLANET_URANUS ] . messageSlot = 2 ;
systemPlanet [ PLANET_URANUS ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_URANUS ] . subject , " Secure Uranus " ) ;
systemPlanet [ PLANET_SATURN ] . messageMission = MISN_SATURN ;
systemPlanet [ PLANET_SATURN ] . messageSlot = 0 ;
systemPlanet [ PLANET_SATURN ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_SATURN ] . subject , " Destroy outer defense system " ) ;
systemPlanet [ PLANET_JUPITER ] . messageMission = MISN_JUPITER ;
systemPlanet [ PLANET_JUPITER ] . messageSlot = 0 ;
systemPlanet [ PLANET_JUPITER ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_JUPITER ] . subject , " Investigate distress call " ) ;
systemPlanet [ PLANET_MARS ] . messageMission = MISN_MARS ;
systemPlanet [ PLANET_MARS ] . messageSlot = 0 ;
systemPlanet [ PLANET_MARS ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_MARS ] . subject , " Navigate asteroid belt " ) ;
systemPlanet [ PLANET_EARTH ] . messageMission = MISN_EARTH ;
systemPlanet [ PLANET_EARTH ] . messageSlot = 0 ;
systemPlanet [ PLANET_EARTH ] . faceImage = FS_CHRIS ;
strcpy ( systemPlanet [ PLANET_EARTH ] . subject , " Take back Earth " ) ;
systemPlanet [ PLANET_VENUS ] . messageMission = MISN_VENUS ;
systemPlanet [ PLANET_VENUS ] . messageSlot = 0 ;
systemPlanet [ PLANET_VENUS ] . faceImage = FS_SID ;
strcpy ( systemPlanet [ PLANET_VENUS ] . subject , " Defeat Kline " ) ;
2011-08-24 14:14:44 +02:00
2016-01-09 03:33:40 +01:00
break ;
2011-08-24 14:14:44 +02:00
}
}
/*
Spins the planets around the sun , spaced according to their Y value
2015-05-28 12:51:45 +02:00
as defined in intermission_setSystemPlanets ( ) . Moving the cursor over the planet
2011-08-24 14:14:44 +02:00
will show their name and their current status
*/
2015-05-28 12:51:45 +02:00
static bool intermission_showSystem ( float x , float y , bool selectable )
2011-08-24 14:14:44 +02:00
{
SDL_Rect r ;
2016-01-07 02:35:37 +01:00
int planet = 0 ;
2011-08-24 14:14:44 +02:00
int planetSpace = systemPlanet [ planet ] . y ;
2011-08-26 16:55:46 +02:00
bool rtn = false ;
2011-08-24 14:14:44 +02:00
// Blit the sun
2016-01-05 04:25:00 +01:00
screen_blit ( gfx_sprites [ SP_SUN ] , 370 , 220 ) ;
2011-08-24 14:14:44 +02:00
for ( int i = 50 ; i < 300 ; i + = planetSpace )
{
x * = 0.75 ;
y * = 0.75 ;
2015-11-20 20:11:12 +01:00
gfx_drawCircle ( 400 , 250 , i , screen , darkGrey ) ;
2011-08-24 14:14:44 +02:00
2011-08-24 22:43:54 +02:00
r . x = int ( 400 + ( sinf ( x ) * i ) ) ;
r . y = int ( 250 + ( cosf ( y ) * i ) ) ;
2011-08-24 14:14:44 +02:00
r . w = 10 ;
r . h = 10 ;
r . x - = ( systemPlanet [ planet ] . image - > w / 2 ) ;
r . y - = ( systemPlanet [ planet ] . image - > h / 2 ) ;
2015-09-26 14:49:21 +02:00
screen_blit ( systemPlanet [ planet ] . image , r . x , r . y ) ;
2011-08-24 14:14:44 +02:00
2015-03-04 01:28:15 +01:00
if ( selectable & &
2015-09-25 22:28:09 +02:00
game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 ,
2015-03-04 01:28:15 +01:00
r . x , r . y , systemPlanet [ planet ] . image - > w ,
systemPlanet [ planet ] . image - > h ) )
2011-08-24 14:14:44 +02:00
{
2015-11-07 01:36:20 +01:00
screen_renderString ( systemPlanet [ planet ] . name , - 1 , 545 , FONT_WHITE ) ;
2013-09-30 16:52:43 +02:00
if ( ( engine . keyState [ KEY_FIRE ] ) )
2011-08-24 14:14:44 +02:00
{
2016-01-09 16:13:32 +01:00
game . destinationPlanet = planet ;
strcpy ( game . destinationName , systemPlanet [ game . destinationPlanet ] . name ) ;
2011-08-26 16:55:46 +02:00
rtn = true ;
2013-09-30 16:52:43 +02:00
engine . keyState [ KEY_FIRE ] = 0 ;
2011-08-24 14:14:44 +02:00
}
}
planet + + ;
if ( systemPlanet [ planet ] . y = = - 1 )
break ;
planetSpace = systemPlanet [ planet ] . y ;
}
return rtn ;
}
/*
Scrolls the player ' s current information up the screen . When
the specified status line reaches a certain Y value , the entire
list is reset and the information lines begin again from the bottom
( in other words , they loop around ) .
*/
2015-05-28 12:51:45 +02:00
static void intermission_showStatus ( SDL_Surface * infoSurface )
2011-08-24 14:14:44 +02:00
{
2016-01-04 18:41:19 +01:00
int y ;
2012-03-11 17:52:10 +01:00
float speed = 0.25 ;
2013-09-30 16:52:43 +02:00
if ( engine . keyState [ KEY_DOWN ] )
2012-03-11 17:52:10 +01:00
speed = 1 ;
2013-09-30 16:52:43 +02:00
else if ( engine . keyState [ KEY_UP ] )
2012-03-11 17:52:10 +01:00
speed = - 1 ;
2015-09-26 14:49:21 +02:00
screen_blit ( infoSurface , 100 , 80 ) ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
for ( int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i + + )
2011-08-24 14:14:44 +02:00
{
2016-01-04 04:39:16 +01:00
gfx_textSprites [ i ] . y - = speed ;
if ( ( gfx_textSprites [ i ] . y > 80 ) & & ( gfx_textSprites [ i ] . y < 400 ) )
2015-10-11 18:04:52 +02:00
screen_blitText ( i ) ;
2011-08-24 14:14:44 +02:00
}
2016-01-04 18:41:19 +01:00
if ( gfx_textSprites [ TS_STATUS_FOOTER - 1 ] . y < 65 )
2011-08-24 14:14:44 +02:00
{
2016-01-04 18:41:19 +01:00
y = 400 ;
for ( int i = TS_STATUS_HEADER + 1 ; i < TS_STATUS_FOOTER ; i + + )
2011-08-24 14:14:44 +02:00
{
2016-01-04 18:41:19 +01:00
y + = 20 ;
if ( ( i = = TS_CHRIS_HEADER ) | | ( i = = TS_PHOEBE_HEADER ) | |
( i = = TS_URSULA_HEADER ) )
y + = 25 ;
gfx_textSprites [ i ] . y = y ;
2011-08-24 14:14:44 +02:00
}
}
2015-12-31 16:47:27 +01:00
screen_drawRect ( 100 , 80 , 600 , 20 , 0x00 , 0x00 , 0x99 ) ;
2011-08-24 14:14:44 +02:00
2015-12-31 16:47:27 +01:00
screen_drawRect ( 100 , 400 , 600 , 20 , 0x00 , 0x00 , 0x99 ) ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
screen_blitText ( TS_STATUS_HEADER ) ;
screen_blitText ( TS_STATUS_FOOTER ) ;
2011-08-24 14:14:44 +02:00
}
2015-05-28 12:51:45 +02:00
static void intermission_updateCommsSurface ( SDL_Surface * comms )
2015-04-25 04:40:50 +02:00
{
2016-01-09 13:37:36 +01:00
char string [ 255 ] ;
2015-04-25 04:40:50 +02:00
if ( engine . commsSection = = 1 )
return ;
2015-12-31 16:47:27 +01:00
gfx_drawRect ( comms , 0 , 10 , comms - > w - 1 , 55 , 0x00 , 0x22 , 0x00 ) ;
2016-01-04 15:07:30 +01:00
gfx_blit ( gfx_faceSprites [ FS_CHRIS ] , 20 , 15 , comms ) ;
2015-11-06 16:12:57 +01:00
gfx_renderString ( " Chris Bainfield " , 80 , 15 , FONT_WHITE , 0 , comms ) ;
2015-05-21 01:41:43 +02:00
sprintf ( string , " Current Location: %s " , systemPlanet [ game . stationedPlanet ] . name ) ;
2015-11-06 16:12:57 +01:00
gfx_renderString ( string , 80 , 35 , FONT_WHITE , 0 , comms ) ;
2015-04-25 04:40:50 +02:00
}
2015-05-28 12:51:45 +02:00
static void intermission_createCommsSurface ( SDL_Surface * comms )
2015-04-25 04:40:50 +02:00
{
engine . commsSection = 0 ;
2015-12-31 16:47:27 +01:00
gfx_drawRect ( comms , 0 , 0 , comms - > w - 1 , comms - > h - 1 , 0x00 , 0x00 , 0x25 ) ;
2015-04-25 04:40:50 +02:00
2016-01-09 13:37:36 +01:00
gfx_renderString ( " +++ CURRENT MISSIONS (click for info) +++ " , - 1 , 80 , FONT_GREEN , 0 , comms ) ;
2015-04-25 04:40:50 +02:00
int yOffset ;
2016-01-09 16:04:55 +01:00
// XXX: Magic number
2015-04-25 04:40:50 +02:00
for ( int i = 0 ; i < 10 ; i + + )
{
if ( ( systemPlanet [ i ] . messageSlot ! = - 1 ) & & ( systemPlanet [ i ] . missionCompleted = = 0 ) )
{
yOffset = systemPlanet [ i ] . messageSlot * 60 ;
2015-12-31 16:47:27 +01:00
gfx_drawRect ( comms , 0 , 105 + yOffset , comms - > w - 1 , 55 , 0x00 , 0x00 , 0x77 ) ;
2016-01-04 15:01:54 +01:00
gfx_blit ( gfx_faceSprites [ systemPlanet [ i ] . faceImage ] , 20 , 110 + yOffset , comms ) ;
2016-01-09 03:33:40 +01:00
gfx_renderString ( systemPlanet [ i ] . name , 80 , 110 + yOffset , FONT_WHITE , 0 , comms ) ;
2015-11-06 16:12:57 +01:00
gfx_renderString ( systemPlanet [ i ] . subject , 80 , 130 + yOffset , FONT_CYAN , 0 , comms ) ;
2015-04-25 04:40:50 +02:00
}
}
2015-05-28 12:51:45 +02:00
intermission_updateCommsSurface ( comms ) ;
2015-04-25 04:40:50 +02:00
}
2016-01-08 03:18:14 +01:00
static int intermission_renderDialog ( SDL_Surface * comms , int y , int face , const char * string )
{
int newY ;
gfx_blit ( gfx_faceSprites [ face ] , 10 , y , comms ) ;
newY = gfx_renderString ( string , 80 , y , FONT_WHITE , 1 , comms ) + 25 ;
if ( newY < y + 60 )
newY + = ( 60 - ( newY - y ) ) ;
return newY ;
}
2015-05-28 12:51:45 +02:00
static void intermission_createMissionDetailSurface ( SDL_Surface * comms , int missionSlot )
2015-04-25 04:40:50 +02:00
{
char name [ 50 ] ;
char string [ 2000 ] ;
int y = 50 ;
int mission = - 1 ;
2016-01-08 03:18:14 +01:00
// XXX: Magic number
2015-04-25 04:40:50 +02:00
for ( int i = 0 ; i < 10 ; i + + )
{
if ( ( systemPlanet [ i ] . messageSlot = = missionSlot ) & & ( systemPlanet [ i ] . missionCompleted = = 0 ) )
{
mission = systemPlanet [ i ] . messageMission ;
}
}
if ( mission = = - 1 )
return ;
2015-12-31 16:47:27 +01:00
gfx_drawRect ( comms , 0 , 0 , comms - > w - 1 , comms - > h - 1 , 0x00 , 0x00 , 0x25 ) ;
2015-04-25 04:40:50 +02:00
2016-01-08 03:18:14 +01:00
// XXX: The "name" should correspond with whatever name was presented in
// the screen listing all of the comms. For some reason, this has always
// been defined twice, which is redundant and has led to inconsistencies in
// the past.
switch ( mission )
{
case MISN_HAIL :
strcpy ( name , " Krass Tyler " ) ;
2015-04-25 04:40:50 +02:00
2016-01-08 03:18:14 +01:00
strcpy ( string , " Hey, boy! You still owe me money for the Firefly I stole for you! But instead, I want you to go to the WEAPCO training ground and destroy all the craft there. " ) ;
y = intermission_renderDialog ( comms , y , FS_KRASS , string ) ;
2015-04-25 04:40:50 +02:00
2016-01-08 03:18:14 +01:00
strcpy ( string , " Oh? That's the job I contracted you to do, was it not? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
2015-04-25 04:40:50 +02:00
2016-01-08 03:18:14 +01:00
strcpy ( string , " I know, but this way we can resolve your debt right now. Do this job, and also collect $500, and we will call it quits. And if you die... well, I guess the ship was not worth stealing! HA HA HA! " ) ;
y = intermission_renderDialog ( comms , y , FS_KRASS , string ) ;
strcpy ( string , " As usual, you take me too lightly, Krass. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_CERADSE :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " Hey, Sid, what's up? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Chris, I've intercepted a communication from WEAPCO. Seems they're transporting some medical supplies around Ceradse. We need to get hold of those pods to save some lives! " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " How many do we need? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " All six, Chris! If you lose even a single one, thousands of people could perish in Spirit within the next few months. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_HINSTAG :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " Wow! Missile boats? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Yup. Looks like WEAPCO is starting to take notice of your actions. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Sounds like fun! This will really put the Firefly's fighting ability to the test! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Please be careful, Chris. A single missile boat carries enough rockets to level most major cities. Try not to face them head-on, and keep your distance. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_JOLDAR :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " We're going to have to get rid of the mine deployment unit around Joldar. The minefield is stopping interplanetary traffic. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Are any fighters around to keep me entertained? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Not at the moment, but that doesn't mean they won't turn up. Be very careful of those mines! They'll only explode when they encounter a ship that's not transmitting a WEAPCO signal. Shoot them down if they get in your way. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_MOEBO :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " We've got a major problem here! WEAPCO has decided to stop our resistance by destroying Spirit! The explosion will incinerate everything in the system! You've got to destroy that frigate before it gets in range! " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Damn! I'll get right on it, then! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " We're all counting on you, Chris! But just remember - They didn't call that thing \" Star Killer \" just because it sounded nice! " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_RESCUESLAVES :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " As you know, WEAPCO has many slaves in this system. If we free a large number of them, it might help to spark a rebellion. I estimate that we will need to rescue around 250 to make a difference. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Most of the slaves are working in ore mines, aren't they? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
2016-01-09 03:33:40 +01:00
strcpy ( string , " Yes, but attacking the mines directly would be dangerous. You'd be better off intercepting slave transports. What you'll have to do is fly around and see if you can intercept a WEAPCO patrol. Of course, they might not be escorting any slave units, so be careful! " ) ;
2016-01-08 03:18:14 +01:00
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_NEROD :
2016-01-08 16:37:19 +01:00
strcpy ( name , " Phoebe Lexx " ) ;
2016-01-08 03:18:14 +01:00
strcpy ( string , " Help! This is an SOS! Can anyone hear me?! " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
strcpy ( string , " I'm hearing you loud and clear! What's up? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Oh, thank God! I was intercepted by a large WEAPCO force near Nerod! I'm in need of assistance! " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
strcpy ( string , " I'm on my way! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_ALLEZ :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " I've just received another SOS. This one is coming from a supply craft carrying essential medical supplies. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Alright, Tell 'em I'm on my way. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_URUSOR :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " I need some resources before we leave, it'll make life a lot easier in Mordor. Problem is that WEAPCO hoards these parts. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Where can we get them, then? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " There's a big shipment of them nearby. I can disable the supply craft carrying them; I just need you to give me some cover while I do it. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " You got it! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_DORIM :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " A WEAPCO scientist just ran off in an escape pod and hid in the asteroid belt. If we capture him, we may be able to get some information about Mordor. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " I'm on it. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_ELAMALE :
strcpy ( name , " Phoebe Lexx " ) ;
strcpy ( string , " I've received word that the slaves we rescued have started a rebellion. Looks like the plan worked. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " WEAPCO has an automated mining ship in orbit around Elamale. How about we take it out and cause some confusion? " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
strcpy ( string , " I like that idea! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " It'll work, but be careful. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_CLOAKFIGHTER :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " What have you found out about that experimental fighter? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " It's got some kind of cloaking device that makes it invisible to radar. Could prove hard to track down. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
2016-01-09 03:33:40 +01:00
strcpy ( string , " I'll just have to run around the system until I find it. " ) ;
2016-01-08 03:18:14 +01:00
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " It's likely to run away if you engage it in battle, so try and do as much damage to it as possible. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_ODEON :
strcpy ( name , " Phoebe Lexx " ) ;
strcpy ( string , " I've located my sister's ship currently in orbit around Odeon. She's ignoring my hails though. " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
strcpy ( string , " Something's off here. She seems to be travelling freely with a WEAPCO group. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Do you think she's turned traitor? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " No way. She hates WEAPCO with a passion. " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
strcpy ( string , " She must be under some kind of mind control. I've heard of WEAPCO developing a new \" AI training program \" recently. We'd better rescue her! " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_FELLON :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " A rebel group has organized a counter strike. If we can help them secure a victory it will be a real boost to morale. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Awesome! I'm on it! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
2016-01-09 03:33:40 +01:00
strcpy ( string , " Just make sure the rebel ships don't all get destroyed. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
2016-01-08 03:18:14 +01:00
break ;
case MISN_SIVEDI :
strcpy ( name , " Sid Wilson " ) ;
2016-01-09 03:33:40 +01:00
strcpy ( string , " Seems like taking out that WEAPCO mining ship wasn't such a good idea. The ore it collected is needed in weapons production. " ) ;
2016-01-08 03:18:14 +01:00
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Damn! I guess that means I'll have to mine some myself, then, huh? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Yes. Be careful, Chris. Your weapons weren't designed for that sort of work, after all. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
case MISN_ALMARTHA :
strcpy ( name , " Krass Tyler " ) ;
strcpy ( string , " Hey, Krass! I need you to help us out with something. Phoebe and Ursula are taking out key WEAPCO plants. Can you help me create a diversion by wreaking havoc a little bit away from that? " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Sure, I can help you out, boy. But I'll be needing my fee... " ) ;
y = intermission_renderDialog ( comms , y , FS_KRASS , string ) ;
break ;
case MISN_POSWIC :
strcpy ( name , " Ursula Lexx " ) ;
2016-01-09 03:33:40 +01:00
strcpy ( string , " My memory is finally back. Here's something interesting: just before I was captured, I found out that WEAPCO is transporting several important executives to Poswic. " ) ;
2016-01-08 03:18:14 +01:00
y = intermission_renderDialog ( comms , y , FS_URSULA , string ) ;
2016-01-09 03:33:40 +01:00
strcpy ( string , " We can't let a rare opportunity like this slip through our fingers! I'll need some cover so I can disable that ship. " ) ;
2016-01-08 03:18:14 +01:00
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " You got it! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_ELLESH :
strcpy ( name , " Phoebe Lexx " ) ;
strcpy ( string , " Phoebe, I need you to keep an eye on things here. I'm going after that ship! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Are you sure you can catch up to it? " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
2016-01-09 03:33:40 +01:00
strcpy ( string , " Absolutely. One thing that's really nice about the Firefly is its speed. I'll see you in a bit! " ) ;
2016-01-08 03:18:14 +01:00
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_PLUTO :
case MISN_NEPTUNE :
case MISN_URANUS :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " We've got to start from the outside and work our way in. That will give us less chance of being flanked during the final operation. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Gotcha. " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
strcpy ( string , " Okay. " ) ;
y = intermission_renderDialog ( comms , y , FS_URSULA , string ) ;
strcpy ( string , " Alright. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_SATURN :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " WEAPCO has set up a highly dangerous defense line between Saturn and Uranus. We'll need to take it out. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " What kind of defense system? " ) ;
y = intermission_renderDialog ( comms , y , FS_URSULA , string ) ;
strcpy ( string , " Several mobile Energy Ray cannons, not unlike the weapon used by the Star Killer back in Spirit. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Best check my ejection system, then! " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
break ;
case MISN_JUPITER :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " While you were gone I picked up a distress call coming from around Jupiter. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Who would be sending out a distress call within Sol? " ) ;
y = intermission_renderDialog ( comms , y , FS_URSULA , string ) ;
strcpy ( string , " Let's check it out. Even if it's a trap, I think we can handle it. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_MARS :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " Chris, we've got a small problem. WEAPCO has a minefield in the asteroid belt. We'll need you to clear a way through. " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Alright. I'll radio in once I've cleared a safe path. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
break ;
case MISN_EARTH :
strcpy ( name , " Everyone " ) ;
strcpy ( string , " Okay people, this is the big one. We go in fast and we go in hard. Don't hold back and hit them with everything we've got! " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " We've come too far to turn back now. None of us better die out there! " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
strcpy ( string , " Right with you, Chris! " ) ;
y = intermission_renderDialog ( comms , y , FS_PHOEBE , string ) ;
strcpy ( string , " WEAPCO'll regret sticking probes into my head! " ) ;
y = intermission_renderDialog ( comms , y , FS_URSULA , string ) ;
break ;
case MISN_VENUS :
strcpy ( name , " Sid Wilson " ) ;
strcpy ( string , " Kethlan has run off to Venus. I'm going after him. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Be careful, Chris. We've won the war, but it would be a real shame if you died now! " ) ;
y = intermission_renderDialog ( comms , y , FS_SID , string ) ;
break ;
default :
strcpy ( name , " Nobody " ) ;
strcpy ( string , " Hey, why am I talking to myself? This shouldn't happen! Clearly, this must be a bug. " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
sprintf ( string , " I should go to starfighter.nongnu.org and report this bug there. In that report, I should mention that the mission number is %d. " , mission ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
strcpy ( string , " Wait, what am I still talking into empty space for? It's not like anyone can hear me... " ) ;
y = intermission_renderDialog ( comms , y , FS_CHRIS , string ) ;
2015-04-25 04:40:50 +02:00
}
2016-01-08 03:18:14 +01:00
sprintf ( string , " +++ Communication with %s +++ " , name ) ;
gfx_renderString ( string , - 1 , 20 , FONT_GREEN , 0 , comms ) ;
2015-04-25 04:40:50 +02:00
2015-12-31 16:47:27 +01:00
gfx_drawRect ( comms , 5 , comms - > h - 28 , 180 , 20 , 0x25 , 0x00 , 0x00 ) ;
2016-01-09 13:37:36 +01:00
gfx_renderString ( " RETURN TO MISSIONS " , 15 , comms - > h - 25 , FONT_WHITE , 1 , comms ) ;
2015-04-25 04:40:50 +02:00
engine . commsSection = 1 ;
}
2015-05-28 12:51:45 +02:00
static void intermission_doComms ( SDL_Surface * comms )
2015-04-25 04:40:50 +02:00
{
if ( ( engine . keyState [ KEY_FIRE ] ) )
{
if ( engine . commsSection = = 0 )
{
for ( int i = 0 ; i < 4 ; i + + )
{
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 170 , 180 + ( i * 60 ) , 430 , 50 ) )
2015-04-25 04:40:50 +02:00
{
2015-05-28 12:51:45 +02:00
intermission_createMissionDetailSurface ( comms , i ) ;
2015-04-25 04:40:50 +02:00
engine . keyState [ KEY_FIRE ] = 0 ;
}
}
}
else
{
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 170 , 440 , 160 , 20 ) )
2015-04-25 04:40:50 +02:00
{
2015-05-28 12:51:45 +02:00
intermission_createCommsSurface ( comms ) ;
2015-04-25 04:40:50 +02:00
engine . keyState [ KEY_FIRE ] = 0 ;
}
}
}
}
2015-05-28 12:51:45 +02:00
static void intermission_createOptions ( SDL_Surface * optionsSurface )
2011-08-24 14:14:44 +02:00
{
2011-08-26 23:53:46 +02:00
SDL_FillRect ( optionsSurface , NULL , black ) ;
2011-08-24 14:14:44 +02:00
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 0 , 0 , optionsSurface - > w - 2 , optionsSurface - > h - 2 , 0x00 , 0x00 , 0x44 ) ;
2011-08-24 14:14:44 +02:00
2015-11-06 16:12:57 +01:00
gfx_renderString ( " ++ OPTIONS ++ " , 105 , 8 , FONT_WHITE , 0 , optionsSurface ) ;
2011-08-24 14:14:44 +02:00
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 190 , 45 , 50 , 22 , 0x00 , 0x00 , 0x00 ) ;
gfx_drawRect ( optionsSurface , 250 , 45 , 50 , 22 , 0x00 , 0x00 , 0x00 ) ;
gfx_drawRect ( optionsSurface , 20 , 45 , 150 , 22 , 0x00 , 0x00 , 0x00 ) ;
2011-08-26 22:48:52 +02:00
if ( engine . useSound )
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 190 , 45 , 50 , 22 , 0xff , 0x00 , 0x00 ) ;
2011-08-24 14:14:44 +02:00
else
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 250 , 45 , 50 , 22 , 0xff , 0x00 , 0x00 ) ;
2015-11-06 16:12:57 +01:00
gfx_renderString ( " ON " , 207 , 50 , FONT_WHITE , 0 , optionsSurface ) ;
gfx_renderString ( " OFF " , 263 , 50 , FONT_WHITE , 0 , optionsSurface ) ;
gfx_renderString ( " SOUND " , 30 , 50 , FONT_WHITE , 0 , optionsSurface ) ;
2011-08-26 23:53:46 +02:00
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 190 , 95 , 50 , 22 , 0x00 , 0x00 , 0x00 ) ;
gfx_drawRect ( optionsSurface , 250 , 95 , 50 , 22 , 0x00 , 0x00 , 0x00 ) ;
gfx_drawRect ( optionsSurface , 20 , 95 , 150 , 22 , 0x00 , 0x00 , 0x00 ) ;
2011-08-26 22:48:52 +02:00
if ( engine . useMusic )
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 190 , 95 , 50 , 22 , 0xff , 0x00 , 0x00 ) ;
2011-08-24 14:14:44 +02:00
else
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 250 , 95 , 50 , 22 , 0xff , 0x00 , 0x00 ) ;
2015-11-06 16:12:57 +01:00
gfx_renderString ( " ON " , 207 , 100 , FONT_WHITE , 0 , optionsSurface ) ;
gfx_renderString ( " OFF " , 263 , 100 , FONT_WHITE , 0 , optionsSurface ) ;
gfx_renderString ( " MUSIC " , 30 , 100 , FONT_WHITE , 0 , optionsSurface ) ;
2011-08-26 23:53:46 +02:00
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 190 , 145 , 50 , 22 , 0x00 , 0x00 , 0x00 ) ;
gfx_drawRect ( optionsSurface , 250 , 145 , 50 , 22 , 0x00 , 0x00 , 0x00 ) ;
gfx_drawRect ( optionsSurface , 20 , 145 , 150 , 22 , 0x00 , 0x00 , 0x00 ) ;
2011-08-26 22:48:52 +02:00
if ( engine . fullScreen )
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 190 , 145 , 50 , 22 , 0xff , 0x00 , 0x00 ) ;
2011-08-24 14:14:44 +02:00
else
2015-12-31 16:47:27 +01:00
gfx_drawRect ( optionsSurface , 250 , 145 , 50 , 22 , 0xff , 0x00 , 0x00 ) ;
2015-11-06 16:12:57 +01:00
gfx_renderString ( " ON " , 207 , 150 , FONT_WHITE , 0 , optionsSurface ) ;
gfx_renderString ( " OFF " , 263 , 150 , FONT_WHITE , 0 , optionsSurface ) ;
gfx_renderString ( " FULLSCREEN " , 30 , 150 , FONT_WHITE , 0 , optionsSurface ) ;
2011-08-24 14:14:44 +02:00
}
2015-05-28 12:51:45 +02:00
static void intermission_doOptions ( SDL_Surface * optionsSurface )
2011-08-24 14:14:44 +02:00
{
2013-09-30 16:52:43 +02:00
if ( ( engine . keyState [ KEY_FIRE ] ) )
2011-08-24 14:14:44 +02:00
{
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 417 , 172 , 45 , 22 ) )
2011-08-26 22:48:52 +02:00
engine . useSound = true ;
2011-08-24 14:14:44 +02:00
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 478 , 172 , 45 , 22 ) )
2011-08-26 22:48:52 +02:00
engine . useSound = false ;
2011-08-24 14:14:44 +02:00
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 417 , 222 , 45 , 22 ) )
2011-08-24 14:14:44 +02:00
{
2011-08-26 22:48:52 +02:00
engine . useMusic = true ;
2015-03-08 15:38:58 +01:00
audio_playMusic ( " music/through_space.ogg " , - 1 ) ;
2011-08-24 14:14:44 +02:00
}
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 478 , 222 , 45 , 22 ) )
2011-08-24 14:14:44 +02:00
{
2011-08-26 22:48:52 +02:00
engine . useMusic = false ;
2015-03-08 15:38:58 +01:00
audio_haltMusic ( ) ;
2011-08-24 14:14:44 +02:00
}
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 417 , 272 , 45 , 22 ) )
2011-08-24 14:14:44 +02:00
{
2011-08-26 22:48:52 +02:00
if ( ! engine . fullScreen )
2011-08-24 14:14:44 +02:00
{
2013-09-30 16:52:43 +02:00
SDL_SetWindowFullscreen ( window , SDL_WINDOW_FULLSCREEN_DESKTOP ) ;
2011-08-26 22:48:52 +02:00
engine . fullScreen = true ;
2011-08-24 14:14:44 +02:00
}
}
2015-09-25 22:28:09 +02:00
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 478 , 272 , 45 , 22 ) )
2011-08-24 14:14:44 +02:00
{
2011-08-26 22:48:52 +02:00
if ( engine . fullScreen )
2011-08-24 14:14:44 +02:00
{
2013-09-30 16:52:43 +02:00
SDL_SetWindowFullscreen ( window , 0 ) ;
2011-08-26 22:48:52 +02:00
engine . fullScreen = false ;
2011-08-24 14:14:44 +02:00
}
}
2015-05-28 12:51:45 +02:00
intermission_createOptions ( optionsSurface ) ;
2011-08-24 14:14:44 +02:00
}
}
/*
2015-05-28 12:51:45 +02:00
Controls the entire intermission screen . This simply draws a background ,
stars , gridlines and the icons at the bottom of the screen . Will call
( and continue to call ) the specified functions when the player has
selected an icon .
2011-08-24 14:14:44 +02:00
*/
2015-05-28 12:51:45 +02:00
int intermission ( )
2011-08-24 14:14:44 +02:00
{
2016-01-04 18:41:19 +01:00
int iconInfoY ;
2016-01-07 02:35:37 +01:00
char string [ 25 ] ;
SDL_Rect r ;
SDL_Rect destRect ;
int distance = 0 ;
double interceptionChance ;
int section = 1 ;
float sinX = 300 ;
float cosY = 300 ;
bool movePlanets = true ;
int saveSlot = - 1 ;
int rtn = 0 ;
bool redrawBackground = true ;
2016-01-02 22:59:48 +01:00
gfx_free ( ) ;
2011-08-24 14:14:44 +02:00
checkForBossMission ( ) ; // double check just to make sure!
// Tell the game we are not in a mission so
// do not perform certain keyboard actions
engine . gameSection = SECTION_INTERMISSION ;
2015-11-07 03:35:07 +01:00
screen_clear ( black ) ;
2015-10-27 01:07:31 +01:00
renderer_update ( ) ;
2015-11-07 03:35:07 +01:00
screen_clear ( black ) ;
2011-08-24 14:14:44 +02:00
initSaveSlots ( ) ;
2015-05-21 01:41:43 +02:00
loadBackground ( systemBackground [ game . system ] ) ;
2011-08-24 14:14:44 +02:00
2012-03-14 16:54:48 +01:00
engine . cursor_x = screen - > w / 2 ;
engine . cursor_y = screen - > h / 2 ;
2016-01-05 04:25:00 +01:00
gfx_sprites [ SP_CURSOR ] = gfx_loadImage ( " gfx/cursor.png " ) ;
2011-08-24 14:14:44 +02:00
2016-01-05 12:44:26 +01:00
// Icons
gfx_sprites [ SP_START_MISSION ] = gfx_loadImage ( " gfx/icon1.png " ) ;
gfx_sprites [ SP_MAP ] = gfx_loadImage ( " gfx/icon2.png " ) ;
gfx_sprites [ SP_STATUS ] = gfx_loadImage ( " gfx/icon3.png " ) ;
gfx_sprites [ SP_SAVE ] = gfx_loadImage ( " gfx/icon4.png " ) ;
gfx_sprites [ SP_SHOP ] = gfx_loadImage ( " gfx/icon5.png " ) ;
gfx_sprites [ SP_COMM ] = gfx_loadImage ( " gfx/icon6.png " ) ;
gfx_sprites [ SP_OPTIONS ] = gfx_loadImage ( " gfx/icon7.png " ) ;
gfx_sprites [ SP_EXIT ] = gfx_loadImage ( " gfx/icon8.png " ) ;
gfx_sprites [ SP_PLASMA_MAX_OUTPUT ] = gfx_loadImage ( " gfx/icon9.png " ) ;
gfx_sprites [ SP_PLASMA_MAX_POWER ] = gfx_loadImage ( " gfx/icon10.png " ) ;
gfx_sprites [ SP_PLASMA_MAX_RATE ] = gfx_loadImage ( " gfx/icon11.png " ) ;
gfx_sprites [ SP_PLASMA_AMMO ] = gfx_loadImage ( " gfx/icon12.png " ) ;
gfx_sprites [ SP_ROCKET_AMMO ] = gfx_loadImage ( " gfx/icon13.png " ) ;
gfx_sprites [ SP_PLASMA_MIN_OUTPUT ] = gfx_loadImage ( " gfx/icon14.png " ) ;
gfx_sprites [ SP_PLASMA_MIN_POWER ] = gfx_loadImage ( " gfx/icon15.png " ) ;
gfx_sprites [ SP_PLASMA_MIN_RATE ] = gfx_loadImage ( " gfx/icon16.png " ) ;
gfx_sprites [ SP_PLASMA_MAX_AMMO ] = gfx_loadImage ( " gfx/icon17.png " ) ;
gfx_sprites [ SP_ROCKET_MAX_AMMO ] = gfx_loadImage ( " gfx/icon18.png " ) ;
gfx_sprites [ SP_DOUBLE_ROCKETS ] = gfx_loadImage ( " gfx/icon19.png " ) ;
gfx_sprites [ SP_MICRO_ROCKETS ] = gfx_loadImage ( " gfx/icon20.png " ) ;
gfx_sprites [ SP_LASER ] = gfx_loadImage ( " gfx/icon21.png " ) ;
gfx_sprites [ SP_HOMING_MISSILE ] = gfx_loadImage ( " gfx/icon22.png " ) ;
gfx_sprites [ SP_CHARGER ] = gfx_loadImage ( " gfx/icon23.png " ) ;
gfx_sprites [ SP_DOUBLE_HOMING_MISSILES ] = gfx_loadImage ( " gfx/icon24.png " ) ;
gfx_sprites [ SP_MICRO_HOMING_MISSILES ] = gfx_loadImage ( " gfx/icon25.png " ) ;
gfx_sprites [ SP_GOTO ] = gfx_loadImage ( " gfx/icon26.png " ) ;
2016-01-05 04:25:00 +01:00
gfx_sprites [ SP_BUY ] = gfx_loadImage ( " gfx/buyIcon.png " ) ;
gfx_sprites [ SP_SELL ] = gfx_loadImage ( " gfx/sellIcon.png " ) ;
gfx_sprites [ SP_FIREFLY ] = gfx_loadImage ( " gfx/firefly1.png " ) ;
2011-08-24 14:14:44 +02:00
// Planets 30 - 39
2016-01-05 04:25:00 +01:00
gfx_sprites [ SP_SUN ] = gfx_loadImage ( " gfx/planet_sun.png " ) ;
gfx_sprites [ SP_PLANET_GREEN ] = gfx_loadImage ( " gfx/planet_green.png " ) ;
gfx_sprites [ SP_PLANET_BLUE ] = gfx_loadImage ( " gfx/planet_blue.png " ) ;
gfx_sprites [ SP_PLANET_RED ] = gfx_loadImage ( " gfx/planet_red.png " ) ;
gfx_sprites [ SP_PLANET_ORANGE ] = gfx_loadImage ( " gfx/planet_orange.png " ) ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
// Faces
2016-01-04 15:07:30 +01:00
gfx_faceSprites [ FS_CHRIS ] = gfx_loadImage ( " gfx/face_chris.png " ) ;
gfx_faceSprites [ FS_SID ] = gfx_loadImage ( " gfx/face_sid.png " ) ;
gfx_faceSprites [ FS_KRASS ] = gfx_loadImage ( " gfx/face_krass.png " ) ;
gfx_faceSprites [ FS_PHOEBE ] = gfx_loadImage ( " gfx/face_phoebe.png " ) ;
gfx_faceSprites [ FS_URSULA ] = gfx_loadImage ( " gfx/face_ursula.png " ) ;
gfx_faceSprites [ FS_KLINE ] = gfx_loadImage ( " gfx/face_kline.png " ) ;
2016-01-05 02:17:06 +01:00
gfx_faceSprites [ FS_CREW ] = gfx_loadImage ( " gfx/face_crew.png " ) ;
2011-08-24 14:14:44 +02:00
engine . done = 0 ;
2013-09-30 16:52:43 +02:00
engine . keyState [ KEY_FIRE ] = 0 ;
2015-02-27 05:23:08 +01:00
engine . ssx = 0 ;
engine . ssy = 0 ;
2011-08-24 14:14:44 +02:00
2015-05-28 12:51:45 +02:00
intermission_setStatusLines ( ) ;
2011-08-24 14:14:44 +02:00
initShop ( ) ;
2015-05-28 12:51:45 +02:00
intermission_setSystemPlanets ( ) ;
2011-08-24 14:14:44 +02:00
2016-01-02 22:59:48 +01:00
SDL_Surface * statsSurface = gfx_createAlphaRect ( 600 , 330 , 0x00 , 0x00 , 0x99 ) ;
2015-12-31 16:47:27 +01:00
SDL_Surface * savesSurface = gfx_createSurface ( 350 , 300 ) ;
SDL_Surface * optionsSurface = gfx_createSurface ( 320 , 240 ) ;
SDL_Surface * commsSurface = gfx_createSurface ( 450 , 400 ) ;
2011-08-24 14:14:44 +02:00
createSavesSurface ( savesSurface , - 1 ) ;
2015-05-28 12:51:45 +02:00
intermission_createOptions ( optionsSurface ) ;
intermission_createCommsSurface ( commsSurface ) ;
2011-08-24 14:14:44 +02:00
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
// Remove the Supercharge, if it is there
2015-05-21 01:41:43 +02:00
if ( ( game . difficulty ! = DIFFICULTY_EASY ) & &
( game . difficulty ! = DIFFICULTY_ORIGINAL ) )
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
{
2015-03-17 21:54:00 +01:00
weapon [ W_PLAYER_WEAPON ] . reload [ 0 ] = MAX (
weapon [ W_PLAYER_WEAPON ] . reload [ 0 ] ,
2015-05-21 01:41:43 +02:00
rate2reload [ game . maxPlasmaRate ] ) ;
2015-03-17 21:54:00 +01:00
weapon [ W_PLAYER_WEAPON ] . ammo [ 0 ] = MIN ( weapon [ W_PLAYER_WEAPON ] . ammo [ 0 ] ,
2015-05-21 01:41:43 +02:00
game . maxPlasmaOutput ) ;
2015-03-17 21:54:00 +01:00
weapon [ W_PLAYER_WEAPON ] . damage = MIN ( weapon [ W_PLAYER_WEAPON ] . damage ,
2015-05-21 01:41:43 +02:00
game . maxPlasmaDamage ) ;
Several adjustments for difficulty purposes.
Started out adjusting prices, then ended up doing other things
while testing. Committing this now before I start doing other
random stuff!
But all of the changes are related to balancing difficulty, mostly
with prices, except for a couple bugfixes in the shop. Most notably:
* Ammo now costs $10, not $50. You no longer have to worry about
saving ammo quite as much as a result.
* Plasma upgrades' cost is now calculated differently, and the result
is slightly lower prices than before.
* Easy mode now grants the player more max ammo than other difficulties.
* Increasing max plasma ammo now costs less at the start, and increases
in cost faster.
* You increase max plasma ammo by 25 at a time, not 10. (10 was just too
small of a number.)
* Destroying enemy ships no longer gives you money. I found that, even
in hard mode, I had *way* too much money coming in, and this cuts it
down substantially. It also makes the shield bonus at the end of missions
much more significant. To compensate for the loss of massive bonuses
bosses used to give, these bosses now drop a lot more stuff.
* Kline has decreased health in his first encounter, and increased health
in his last two encounters (the numbers have been reversed).
2015-03-07 18:19:35 +01:00
}
2016-01-05 12:44:26 +01:00
switch ( game . system )
{
2016-01-09 16:13:32 +01:00
case SYSTEM_SPIRIT :
2016-01-09 16:26:15 +01:00
if ( game . difficulty = = DIFFICULTY_ORIGINAL )
interceptionChance = 0 ;
else
interceptionChance = 1. / 600. ;
2016-01-09 16:13:32 +01:00
break ;
2016-01-05 12:44:26 +01:00
case SYSTEM_EYANANTH :
2016-01-05 12:59:37 +01:00
interceptionChance = 1. / 300. ;
2016-01-05 12:44:26 +01:00
break ;
case SYSTEM_MORDOR :
2016-01-05 12:59:37 +01:00
interceptionChance = 1. / 150. ;
2016-01-05 12:44:26 +01:00
break ;
case SYSTEM_SOL :
// There is no chance of being interceptted after the final attack on Earth
if ( ( game . system = = SYSTEM_SOL ) & & ( systemPlanet [ 2 ] . missionCompleted ) )
interceptionChance = 0 ;
else
2016-01-05 12:59:37 +01:00
interceptionChance = 1. / 100. ;
2016-01-05 12:44:26 +01:00
break ;
default :
interceptionChance = 0 ;
}
2011-08-24 14:14:44 +02:00
2011-08-26 22:48:52 +02:00
if ( ( engine . useAudio ) & & ( engine . useMusic ) )
2015-03-08 15:38:58 +01:00
audio_playMusic ( " music/through_space.ogg " , - 1 ) ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
sprintf ( string , " System : %s " , systemNames [ game . system ] ) ;
gfx_createTextObject ( TS_CURRENT_SYSTEM , string , - 1 , 15 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
iconInfoY = 545 ;
2011-08-24 14:14:44 +02:00
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_INFO_START_MISSION , " Start Next Mission " , - 1 , iconInfoY , FONT_WHITE ) ;
gfx_createTextObject ( TS_INFO_GOTO , " Go to Destination Planet " , - 1 , iconInfoY , FONT_WHITE ) ;
gfx_createTextObject ( TS_INFO_MAP , " View System Map " , - 1 , iconInfoY , FONT_WHITE ) ;
gfx_createTextObject ( TS_INFO_STATUS , " Current Status " , - 1 , iconInfoY , FONT_WHITE ) ;
gfx_createTextObject ( TS_INFO_SAVE_GAME , " Save Game " , - 1 , iconInfoY , FONT_WHITE ) ;
gfx_createTextObject ( TS_INFO_SHOP , " Upgrade FIREFLY " , - 1 , iconInfoY , FONT_WHITE ) ;
2016-01-09 16:06:16 +01:00
gfx_createTextObject ( TS_INFO_COMMS , " Missions " , - 1 , iconInfoY , FONT_WHITE ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_INFO_OPTIONS , " Options " , - 1 , iconInfoY , FONT_WHITE ) ;
gfx_createTextObject ( TS_INFO_EXIT , " Exit to Title Screen " , - 1 , iconInfoY , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
sprintf ( string , " Stationed At: %s " , systemPlanet [ game . stationedPlanet ] . name ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CURRENT_PLANET , string , 90 , 450 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
if ( game . destinationPlanet > - 1 )
sprintf ( string , " Destination: %s " , systemPlanet [ game . destinationPlanet ] . name ) ;
2012-03-11 15:23:12 +01:00
else
strcpy ( string , " Destination: None " ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_DEST_PLANET , string , 550 , 450 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
2015-05-21 01:41:43 +02:00
if ( game . distanceCovered > 0 )
2011-08-24 14:14:44 +02:00
section = 0 ;
else
player . shield = player . maxShield ;
flushInput ( ) ;
2013-09-30 16:52:43 +02:00
engine . keyState [ KEY_FIRE ] = engine . keyState [ KEY_ALTFIRE ] = 0 ;
2011-08-24 14:14:44 +02:00
engine . done = 0 ;
while ( ! engine . done )
{
2015-10-27 01:07:31 +01:00
renderer_update ( ) ;
2011-08-24 14:14:44 +02:00
2016-01-07 02:35:37 +01:00
if ( redrawBackground )
2011-08-24 14:14:44 +02:00
{
2015-11-07 01:43:34 +01:00
screen_drawBackground ( ) ;
2016-01-07 02:35:37 +01:00
redrawBackground = false ;
2011-08-24 14:14:44 +02:00
}
else
{
2015-11-02 23:53:05 +01:00
screen_unBuffer ( ) ;
2011-08-24 14:14:44 +02:00
}
2015-06-20 17:58:37 +02:00
game_doStars ( ) ;
2011-08-24 14:14:44 +02:00
r . x = 0 ;
r . y = 0 ;
2012-03-12 04:16:56 +01:00
r . h = screen - > h ;
2011-08-24 14:14:44 +02:00
r . w = 1 ;
2012-03-12 04:16:56 +01:00
for ( int i = 40 ; i < screen - > w ; i + = 40 )
2011-08-24 14:14:44 +02:00
{
r . x = i ;
2011-08-26 23:53:46 +02:00
SDL_FillRect ( screen , & r , darkerBlue ) ;
2011-08-24 14:14:44 +02:00
}
r . x = 0 ;
r . y = 0 ;
r . h = 1 ;
2012-03-12 04:16:56 +01:00
r . w = screen - > w ;
for ( int i = 40 ; i < screen - > h ; i + = 40 )
2011-08-24 14:14:44 +02:00
{
r . y = i ;
2011-08-26 23:53:46 +02:00
SDL_FillRect ( screen , & r , darkerBlue ) ;
2011-08-24 14:14:44 +02:00
}
if ( rand ( ) % 1000 < 2 )
{
2015-03-29 16:19:53 +02:00
engine . ssx = RANDRANGE ( - 100 , 100 ) ;
engine . ssy = RANDRANGE ( - 100 , 100 ) ;
2011-08-24 14:14:44 +02:00
engine . ssx / = 100 ;
engine . ssy / = 100 ;
}
2016-01-04 18:41:19 +01:00
screen_blitText ( TS_CURRENT_SYSTEM ) ;
2011-08-24 14:14:44 +02:00
switch ( section )
{
case 0 :
2015-05-21 01:41:43 +02:00
if ( game . stationedPlanet = = game . destinationPlanet )
2011-08-24 14:14:44 +02:00
{
2015-05-21 01:41:43 +02:00
game . area = systemPlanet [ game . stationedPlanet ] . missionNumber ;
2011-08-24 14:14:44 +02:00
rtn = 2 ;
engine . done = 1 ;
}
else
{
2015-05-21 01:41:43 +02:00
distance = abs ( game . stationedPlanet - game . destinationPlanet ) ;
2016-01-09 16:40:29 +01:00
if ( interceptionChance < = 0 )
distance = 1 ;
2011-08-24 14:14:44 +02:00
distance = ( 5 / distance ) ;
if ( distance < 1 )
distance = 1 ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CURRENT_PLANET , systemPlanet [ game . stationedPlanet ] . name ,
135 , 480 , FONT_WHITE ) ;
gfx_createTextObject ( TS_DEST_PLANET , systemPlanet [ game . destinationPlanet ] . name ,
635 , 480 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
section = 8 ;
destRect . x = 180 ;
destRect . y = 450 ;
destRect . w = 1 ;
2015-05-21 01:41:43 +02:00
if ( game . distanceCovered > 0 )
destRect . w = game . distanceCovered ;
2011-08-24 14:14:44 +02:00
destRect . h = 20 ;
}
break ;
case 1 :
2013-09-30 16:52:43 +02:00
if ( engine . keyState [ KEY_ALTFIRE ] )
2011-08-24 14:14:44 +02:00
{
movePlanets = ! movePlanets ;
2013-09-30 16:52:43 +02:00
engine . keyState [ KEY_ALTFIRE ] = 0 ;
2011-08-24 14:14:44 +02:00
}
if ( movePlanets )
{
sinX + = 0.01 ;
cosY + = 0.01 ;
}
2015-05-28 12:51:45 +02:00
if ( intermission_showSystem ( sinX , cosY , true ) )
2011-08-24 14:14:44 +02:00
{
2016-01-09 16:13:32 +01:00
sprintf ( string , " Destination: %s " , systemPlanet [ game . destinationPlanet ] . name ) ;
gfx_createTextObject ( TS_DEST_PLANET , string , 550 , 450 , FONT_WHITE ) ;
2011-08-24 14:14:44 +02:00
}
2016-01-04 18:41:19 +01:00
screen_blitText ( TS_CURRENT_PLANET ) ;
2016-01-09 16:13:32 +01:00
if ( game . stationedPlanet ! = game . destinationPlanet )
2016-01-04 18:41:19 +01:00
screen_blitText ( TS_DEST_PLANET ) ;
2011-08-24 14:14:44 +02:00
break ;
case 2 :
2015-05-28 12:51:45 +02:00
intermission_showStatus ( statsSurface ) ;
2011-08-24 14:14:44 +02:00
break ;
case 3 :
2015-09-26 14:49:21 +02:00
screen_blit ( savesSurface , 200 , 100 ) ;
2011-08-24 14:14:44 +02:00
saveSlot = showSaveSlots ( savesSurface , saveSlot ) ;
break ;
2012-02-29 14:12:22 +01:00
case 4 :
showShop ( ) ;
break ;
2011-08-24 14:14:44 +02:00
case 5 :
2015-09-26 14:49:21 +02:00
screen_blit ( commsSurface , 170 , 70 ) ;
2015-05-28 12:51:45 +02:00
intermission_doComms ( commsSurface ) ;
2011-08-24 14:14:44 +02:00
break ;
case 6 :
2015-09-26 14:49:21 +02:00
screen_blit ( optionsSurface , 230 , 130 ) ;
2015-05-28 12:51:45 +02:00
intermission_doOptions ( optionsSurface ) ;
2011-08-24 14:14:44 +02:00
break ;
2012-02-29 14:12:22 +01:00
case 7 :
rtn = 0 ;
2011-08-24 14:14:44 +02:00
engine . done = 1 ;
break ;
case 8 :
2015-05-28 12:51:45 +02:00
intermission_showSystem ( sinX , cosY , false ) ;
2011-08-24 14:14:44 +02:00
2015-09-26 14:49:21 +02:00
screen_blit ( systemPlanet [ game . stationedPlanet ] . image , 150 , 450 ) ;
2016-01-04 18:41:19 +01:00
screen_blitText ( TS_CURRENT_PLANET ) ;
2015-09-26 14:49:21 +02:00
screen_blit ( systemPlanet [ game . destinationPlanet ] . image , 650 , 450 ) ;
2016-01-04 18:41:19 +01:00
screen_blitText ( TS_DEST_PLANET ) ;
2011-08-24 14:14:44 +02:00
destRect . w + = distance ;
2011-08-26 23:53:46 +02:00
SDL_FillRect ( screen , & destRect , red ) ;
2011-08-24 14:14:44 +02:00
if ( destRect . w > = 450 )
{
2015-05-21 01:41:43 +02:00
game . stationedPlanet = game . destinationPlanet ;
game . distanceCovered = 0 ;
2011-08-24 14:14:44 +02:00
player . shield = player . maxShield ;
2015-03-04 01:28:15 +01:00
sprintf ( string , " Stationed At: %s " ,
2015-05-21 01:41:43 +02:00
systemPlanet [ game . stationedPlanet ] . name ) ;
strcpy ( game . stationedName ,
systemPlanet [ game . stationedPlanet ] . name ) ;
2016-01-04 18:41:19 +01:00
gfx_createTextObject ( TS_CURRENT_PLANET , string , 90 , 450 , FONT_WHITE ) ;
2015-05-28 12:51:45 +02:00
intermission_updateCommsSurface ( commsSurface ) ;
2011-08-24 14:14:44 +02:00
section = 1 ;
2016-01-07 02:35:37 +01:00
redrawBackground = true ;
2015-03-04 01:28:15 +01:00
saveGame ( 0 ) ;
2011-08-24 14:14:44 +02:00
}
2012-03-11 13:12:12 +01:00
else if ( interceptionChance > 0 )
2011-08-24 14:14:44 +02:00
{
2016-01-05 12:59:37 +01:00
if ( CHANCE ( interceptionChance ) )
2011-08-24 14:14:44 +02:00
{
2015-05-21 01:41:43 +02:00
game . area = MISN_INTERCEPTION ;
2011-08-24 14:14:44 +02:00
rtn = 2 ;
engine . done = 1 ;
2015-05-21 01:41:43 +02:00
game . distanceCovered = destRect . w ;
2011-08-24 14:14:44 +02:00
}
}
break ;
}
2015-11-02 23:53:05 +01:00
screen_addBuffer ( 300 , 545 , 200 , 15 ) ;
2011-08-24 14:14:44 +02:00
if ( section ! = 8 )
{
2016-01-07 02:35:37 +01:00
if ( ( game . stationedPlanet = = game . destinationPlanet ) & &
( ! systemPlanet [ game . stationedPlanet ] . missionCompleted ) )
screen_blit ( gfx_sprites [ SP_START_MISSION ] , 80 , 500 ) ;
else if ( game . stationedPlanet ! = game . destinationPlanet )
screen_blit ( gfx_sprites [ SP_GOTO ] , 80 , 500 ) ;
screen_blit ( gfx_sprites [ SP_MAP ] , 170 , 500 ) ;
screen_blit ( gfx_sprites [ SP_STATUS ] , 260 , 500 ) ;
screen_blit ( gfx_sprites [ SP_SAVE ] , 350 , 500 ) ;
screen_blit ( gfx_sprites [ SP_SHOP ] , 440 , 500 ) ;
screen_blit ( gfx_sprites [ SP_COMM ] , 530 , 500 ) ;
screen_blit ( gfx_sprites [ SP_OPTIONS ] , 620 , 500 ) ;
screen_blit ( gfx_sprites [ SP_EXIT ] , 710 , 500 ) ;
if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 80 , 500 , 32 , 32 ) & &
( ( game . stationedPlanet ! = game . destinationPlanet ) | |
( ! systemPlanet [ game . stationedPlanet ] . missionCompleted ) ) )
2011-08-24 14:14:44 +02:00
{
2016-01-07 02:35:37 +01:00
if ( game . stationedPlanet = = game . destinationPlanet )
screen_blitText ( TS_INFO_START_MISSION ) ;
else
screen_blitText ( TS_INFO_GOTO ) ;
if ( ( engine . keyState [ KEY_FIRE ] ) )
2011-08-24 14:14:44 +02:00
{
2016-01-07 02:35:37 +01:00
redrawBackground = true ;
section = 0 ;
engine . keyState [ KEY_FIRE ] = 0 ;
2011-08-24 14:14:44 +02:00
}
2016-01-07 02:35:37 +01:00
}
else if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 170 , 500 , 32 , 32 ) )
{
screen_blitText ( TS_INFO_MAP ) ;
if ( ( engine . keyState [ KEY_FIRE ] ) )
2011-08-24 14:14:44 +02:00
{
2016-01-07 02:35:37 +01:00
redrawBackground = true ;
section = 1 ;
engine . keyState [ KEY_FIRE ] = 0 ;
2011-08-24 14:14:44 +02:00
}
2016-01-07 02:35:37 +01:00
}
else if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 260 , 500 , 32 , 32 ) )
{
screen_blitText ( TS_INFO_STATUS ) ;
2011-08-24 14:14:44 +02:00
2016-01-07 02:35:37 +01:00
if ( ( engine . keyState [ KEY_FIRE ] ) )
2011-08-24 14:14:44 +02:00
{
2016-01-07 02:35:37 +01:00
redrawBackground = true ;
section = 2 ;
engine . keyState [ KEY_FIRE ] = 0 ;
}
}
else if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 350 , 500 , 32 , 32 ) )
{
screen_blitText ( TS_INFO_SAVE_GAME ) ;
2011-08-24 14:14:44 +02:00
2016-01-07 02:35:37 +01:00
if ( ( engine . keyState [ KEY_FIRE ] ) )
{
redrawBackground = true ;
section = 3 ;
engine . keyState [ KEY_FIRE ] = 0 ;
}
}
else if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 440 , 500 , 32 , 32 ) )
{
screen_blitText ( TS_INFO_SHOP ) ;
if ( ( engine . keyState [ KEY_FIRE ] ) )
{
redrawBackground = true ;
section = 4 ;
engine . keyState [ KEY_FIRE ] = 0 ;
}
}
else if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 530 , 500 , 32 , 32 ) )
{
screen_blitText ( TS_INFO_COMMS ) ;
if ( ( engine . keyState [ KEY_FIRE ] ) )
{
redrawBackground = true ;
section = 5 ;
engine . keyState [ KEY_FIRE ] = 0 ;
}
}
else if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 620 , 500 , 32 , 32 ) )
{
screen_blitText ( TS_INFO_OPTIONS ) ;
if ( ( engine . keyState [ KEY_FIRE ] ) )
{
redrawBackground = true ;
section = 6 ;
engine . keyState [ KEY_FIRE ] = 0 ;
}
}
else if ( game_collision ( engine . cursor_x + 13 , engine . cursor_y + 13 , 6 , 6 , 710 , 500 , 32 , 32 ) )
{
screen_blitText ( TS_INFO_EXIT ) ;
if ( ( engine . keyState [ KEY_FIRE ] ) )
{
redrawBackground = true ;
section = 7 ;
engine . keyState [ KEY_FIRE ] = 0 ;
2011-08-24 14:14:44 +02:00
}
}
}
2015-06-02 18:43:06 +02:00
engine . keyState [ KEY_FIRE ] = 0 ;
engine . keyState [ KEY_ALTFIRE ] = 0 ;
2015-05-28 12:51:45 +02:00
intermission_doCursor ( ) ;
2011-08-24 14:14:44 +02:00
2015-11-07 03:35:07 +01:00
game_delayFrame ( ) ;
2011-08-24 14:14:44 +02:00
}
2015-03-08 15:38:58 +01:00
audio_haltMusic ( ) ;
2011-08-24 14:14:44 +02:00
SDL_FreeSurface ( statsSurface ) ;
SDL_FreeSurface ( savesSurface ) ;
SDL_FreeSurface ( optionsSurface ) ;
SDL_FreeSurface ( commsSurface ) ;
2015-05-21 01:41:43 +02:00
if ( game . distanceCovered = = 0 )
2011-08-24 14:14:44 +02:00
player . shield = player . maxShield ;
return rtn ;
}