- externalized game starting time

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@917 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
lalien
2007-06-04 18:01:51 +00:00
parent eebe112427
commit e5308f27b3
7 changed files with 30 additions and 19 deletions
+8
View File
@@ -465,11 +465,19 @@ void LoadGameExternalOptions()
//################# Gameplay Settings ##################
//################# Settings valid on game start only ##################
//Money settings
gGameExternalOptions.iStartingCashNovice = iniReader.ReadInteger("JA2 Gameplay Settings", "NOVICE_CASH",45000);
gGameExternalOptions.iStartingCashExperienced = iniReader.ReadInteger("JA2 Gameplay Settings", "EXPERIENCED_CASH",35000);
gGameExternalOptions.iStartingCashExpert = iniReader.ReadInteger("JA2 Gameplay Settings", "EXPERT_CASH",30000);
gGameExternalOptions.iStartingCashInsane = iniReader.ReadInteger("JA2 Gameplay Settings", "INSANE_CASH",15000);
//Lalien: Game starting time
gGameExternalOptions.iGameStartingTime = iniReader.ReadInteger("JA2 Gameplay Settings", "GAME_STARTING_TIME", 3600);
gGameExternalOptions.iFirstArrivalDelay = iniReader.ReadInteger("JA2 Gameplay Settings", "FIRST_ARRIVAL_DELAY", 21600);
//################# Settings valid on game start only end ##################
gGameExternalOptions.fSellAll = iniReader.ReadBoolean("JA2 Gameplay Settings","CAN_SELL_ALT_LMB",FALSE);
gGameExternalOptions.iPriceModifier = iniReader.ReadInteger("JA2 Gameplay Settings","PRICE_MODIFIER",10);
+3
View File
@@ -143,6 +143,9 @@ typedef struct
INT32 iStartingCashExpert;
INT32 iStartingCashInsane;
UINT32 iGameStartingTime; //Lalien: game starting time
UINT32 iFirstArrivalDelay;
BOOLEAN fSellAll;
INT16 iPriceModifier;
+1 -1
View File
@@ -1360,7 +1360,7 @@ BOOLEAN DisplaySaveGameEntry( INT8 bEntryID )//, UINT16 usPosY )
//Create the string for the current location
if( SaveGameHeader.sSectorX == -1 && SaveGameHeader.sSectorY == -1 || SaveGameHeader.bSectorZ < 0 )
{
if( ( SaveGameHeader.uiDay * NUM_SEC_IN_DAY + SaveGameHeader.ubHour * NUM_SEC_IN_HOUR + SaveGameHeader.ubMin * NUM_SEC_IN_MIN ) <= STARTING_TIME )
if( ( SaveGameHeader.uiDay * NUM_SEC_IN_DAY + SaveGameHeader.ubHour * NUM_SEC_IN_HOUR + SaveGameHeader.ubMin * NUM_SEC_IN_MIN ) <= gGameExternalOptions.iGameStartingTime )
swprintf( zLocationString, gpStrategicString[ STR_PB_NOTAPPLICABLE_ABBREVIATION ] );
else
swprintf( zLocationString, gzLateLocalizedString[14] );
+13 -13
View File
@@ -68,23 +68,23 @@ extern BOOLEAN fMapScreenBottomDirty;
//These contain all of the information about the game time, rate of time, etc.
//All of these get saved and loaded.
INT32 giTimeCompressMode = TIME_COMPRESS_X0;
UINT8 gubClockResolution = 1;
BOOLEAN gfGamePaused = TRUE;
BOOLEAN gfTimeInterrupt = FALSE;
BOOLEAN gfTimeInterruptPause = FALSE;
BOOLEAN fSuperCompression = FALSE;
UINT32 guiGameClock = STARTING_TIME;
INT32 giTimeCompressMode = TIME_COMPRESS_X0;
UINT8 gubClockResolution = 1;
BOOLEAN gfGamePaused = TRUE;
BOOLEAN gfTimeInterrupt = FALSE;
BOOLEAN gfTimeInterruptPause = FALSE;
BOOLEAN fSuperCompression = FALSE;
UINT32 guiGameClock = gGameExternalOptions.iGameStartingTime;
UINT32 guiPreviousGameClock = 0; // used only for error-checking purposes
UINT32 guiGameSecondsPerRealSecond;
UINT32 guiTimesThisSecondProcessed = 0;
INT32 iPausedPopUpBox = -1;
INT32 iPausedPopUpBox = -1;
UINT32 guiDay;
UINT32 guiHour;
UINT32 guiMin;
CHAR16 gswzWorldTimeStr[20];
INT32 giTimeCompressSpeeds[ NUM_TIME_COMPRESS_SPEEDS ] = { 0, 1, 5 * 60, 30 * 60, 60 * 60 };
UINT16 usPausedActualWidth;
INT32 giTimeCompressSpeeds[ NUM_TIME_COMPRESS_SPEEDS ] = { 0, 1, 5 * 60, 30 * 60, 60 * 60 };
UINT16 usPausedActualWidth;
UINT16 usPausedActualHeight;
UINT32 guiTimeOfLastEventQuery = 0;
BOOLEAN gfLockPauseState = FALSE;
@@ -95,7 +95,7 @@ UINT32 guiLockPauseStateLastReasonId = 0;
//***When adding new saved time variables, make sure you remove the appropriate amount from the paddingbytes and
// more IMPORTANTLY, add appropriate code in Save/LoadGameClock()!
#define TIME_PADDINGBYTES 20
UINT8 gubUnusedTimePadding[TIME_PADDINGBYTES];
UINT8 gubUnusedTimePadding[TIME_PADDINGBYTES];
@@ -106,8 +106,8 @@ extern UINT32 guiEnvDay;
void InitNewGameClock( )
{
guiGameClock = STARTING_TIME;
guiPreviousGameClock = STARTING_TIME;
guiGameClock = gGameExternalOptions.iGameStartingTime;
guiPreviousGameClock = gGameExternalOptions.iGameStartingTime;
guiDay = ( guiGameClock / NUM_SEC_IN_DAY );
guiHour = ( guiGameClock - ( guiDay * NUM_SEC_IN_DAY ) ) / NUM_SEC_IN_HOUR;
guiMin = ( guiGameClock - ( ( guiDay * NUM_SEC_IN_DAY ) + ( guiHour * NUM_SEC_IN_HOUR ) ) ) / NUM_SEC_IN_MIN;
+3 -3
View File
@@ -95,9 +95,9 @@ enum
//dereferenced with the above enumerations to provide the actual time compression rate.
extern INT32 giTimeCompressSpeeds[ NUM_TIME_COMPRESS_SPEEDS ];
#define STARTING_TIME ( ( 1 * NUM_SEC_IN_HOUR ) + ( 0 * NUM_SEC_IN_MIN ) + NUM_SEC_IN_DAY ) // 1am
#define FIRST_ARRIVAL_DELAY ( ( 6 * NUM_SEC_IN_HOUR ) + ( 0 * NUM_SEC_IN_MIN ) ) // 7am ( 6hours later)
//Lalien: externalized game starting time
//#define STARTING_TIME ( ( 1 * NUM_SEC_IN_HOUR ) + ( 0 * NUM_SEC_IN_MIN ) + NUM_SEC_IN_DAY ) // 1am
//#define FIRST_ARRIVAL_DELAY ( ( 6 * NUM_SEC_IN_HOUR ) + ( 0 * NUM_SEC_IN_MIN ) ) // 7am ( 6hours later)
#define WORLDTIMESTR gswzWorldTimeStr
+1 -1
View File
@@ -183,7 +183,7 @@ INT8 HireMerc( MERC_HIRE_STRUCT *pHireMerc)
if( DidGameJustStart() )
{
// Set time of initial merc arrival in minutes
pHireMerc->uiTimeTillMercArrives = ( STARTING_TIME + FIRST_ARRIVAL_DELAY ) / NUM_SEC_IN_MIN;
pHireMerc->uiTimeTillMercArrives = ( gGameExternalOptions.iGameStartingTime + gGameExternalOptions.iFirstArrivalDelay ) / NUM_SEC_IN_MIN;
// Set insertion for first time in chopper
pHireMerc->ubInsertionCode = INSERTION_CODE_CHOPPER;
+1 -1
View File
@@ -1096,7 +1096,7 @@ void InitHelicopterEntranceByMercs( void )
AIR_RAID_DEFINITION AirRaidDef;
// Update clock ahead from STARTING_TIME to make mercs arrive!
WarpGameTime( FIRST_ARRIVAL_DELAY, WARPTIME_PROCESS_EVENTS_NORMALLY );
WarpGameTime( gGameExternalOptions.iFirstArrivalDelay, WARPTIME_PROCESS_EVENTS_NORMALLY );
AirRaidDef.sSectorX = 9;
AirRaidDef.sSectorY = 1;