New Feature: 2 new Iron Man game modes (by anv)

- Selectable at campaign start under "Extra Difficulty" label
- Soft Iron Man: No saving when in turn-based combat. Can save with enemies around (in sector) but only if still in real-time mode.
- Extreme Iron Man: No saving, except punctually at midnight - save screen opens by itself, so Player won't accidentally miss saving time window. Besides Player's save, game will be auto-saved at midnight too if auto-saving is on.
- New ja2_options.ini values for Extreme Iron Man setting: EXTREME_IRON_MAN_SAVING_TIME_NOTIFICATION, 


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7167 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2014-04-27 16:16:14 +00:00
parent 6a46bcfb91
commit 8b494003fd
34 changed files with 654 additions and 179 deletions
+58 -38
View File
@@ -35,6 +35,8 @@
// anv: for hourly heli repair
#include "Vehicles.h"
#include "Map Screen Helicopter.h"
// anv: transition to save screen in extreme iron man mode
#include "gameloop.h"
void HourlyQuestUpdate();
void HourlyLarryUpdate();
@@ -157,81 +159,99 @@ CHAR16 zString[128];
{
if ( AutoSaveToSlot[0] == TRUE )
{
if( CanGameBeSaved() )
if( CanGameBeSaved() || ( gGameOptions.ubIronManMode == 3 && GetWorldHour() == gGameExternalOptions.ubExtremeIronManSavingHour ) )
{
guiPreviousOptionScreen = guiCurrentScreen;
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT1);
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT1,zString);
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = TRUE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = FALSE;
}
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = TRUE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = FALSE;
}
else if ( AutoSaveToSlot[1] == TRUE )
{
if( CanGameBeSaved() )
if( CanGameBeSaved() || ( gGameOptions.ubIronManMode == 3 && GetWorldHour() == gGameExternalOptions.ubExtremeIronManSavingHour ) )
{
guiPreviousOptionScreen = guiCurrentScreen;
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT2);
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT2,zString);
}
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = TRUE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = FALSE;
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = TRUE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = FALSE;
}
}
else if ( AutoSaveToSlot[2] == TRUE )
{
if( CanGameBeSaved() )
if( CanGameBeSaved() || ( gGameOptions.ubIronManMode == 3 && GetWorldHour() == gGameExternalOptions.ubExtremeIronManSavingHour ) )
{
guiPreviousOptionScreen = guiCurrentScreen;
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT3);
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT3,zString);
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = TRUE;
AutoSaveToSlot[4] = FALSE;
}
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = TRUE;
AutoSaveToSlot[4] = FALSE;
}
else if ( AutoSaveToSlot[3] == TRUE )
{
if( CanGameBeSaved() )
if( CanGameBeSaved() || ( gGameOptions.ubIronManMode == 3 && GetWorldHour() == gGameExternalOptions.ubExtremeIronManSavingHour ) )
{
guiPreviousOptionScreen = guiCurrentScreen;
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT4);
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT4,zString);
}
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = TRUE;
AutoSaveToSlot[0] = FALSE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = TRUE;
}
}
else if ( AutoSaveToSlot[4] == TRUE )
{
if( CanGameBeSaved() )
if( CanGameBeSaved() || ( gGameOptions.ubIronManMode == 3 && GetWorldHour() == gGameExternalOptions.ubExtremeIronManSavingHour ) )
{
guiPreviousOptionScreen = guiCurrentScreen;
swprintf( zString, L"%s%d",pMessageStrings[ MSG_SAVE_AUTOSAVE_TEXT ],SAVE__TIMED_AUTOSAVE_SLOT5);
DoAutoSave(SAVE__TIMED_AUTOSAVE_SLOT5,zString);
}
AutoSaveToSlot[0] = TRUE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = FALSE;
AutoSaveToSlot[0] = TRUE;
AutoSaveToSlot[1] = FALSE;
AutoSaveToSlot[2] = FALSE;
AutoSaveToSlot[3] = FALSE;
AutoSaveToSlot[4] = FALSE;
}
}
}
}
// anv: in extreme iron man mode notify player it's time to save
if( doAutoSave && gGameOptions.ubIronManMode == 3 && GetWorldHour() == gGameExternalOptions.ubExtremeIronManSavingHour )
{
// pause game
if( gGameExternalOptions.ubExtremeIronManSavingTimeNotification == 1 )
{
// not really player's doing but oh well
HandlePlayerPauseUnPauseOfGame();
}
// automatically open save screen when it's time
else if( gGameExternalOptions.ubExtremeIronManSavingTimeNotification == 0 )
{
gfSaveGame = TRUE;
guiPreviousOptionScreen = guiCurrentScreen;
SetPendingNewScreen( SAVE_LOAD_SCREEN );
}
}
}
void UpdateRegenCounters( void )