Ctrl + D in turnbased - skip player interrupts for that turn (by Sevenfm)

- This only works for singleplayer
- This only works for Old interrupt system

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6682 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2013-12-05 08:08:20 +00:00
parent 60d9fae2b0
commit b9b58fe790
5 changed files with 24 additions and 3 deletions
+4
View File
@@ -7202,7 +7202,10 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
{
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubLastRequesterSurgeryTargetID, sizeof(gTacticalStatus.ubLastRequesterSurgeryTargetID), sizeof(UINT8), numBytesRead);
if ( guiCurrentSaveGameVersion >= IMPROVED_INTERRUPT_SYSTEM )
{
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubInterruptPending, sizeof(gTacticalStatus.ubInterruptPending), sizeof(UINT8), numBytesRead);
numBytesRead = ReadFieldByField(hFile, &gTacticalStatus.ubDisablePlayerInterrupts, sizeof(gTacticalStatus.ubDisablePlayerInterrupts), sizeof(BOOLEAN), numBytesRead);
}
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
numBytesRead = ReadFieldByField(hFile, &filler, sizeof(filler), sizeof(UINT8), numBytesRead);
}
@@ -7210,6 +7213,7 @@ BOOLEAN LoadTacticalStatusFromSavedGame( HWFILE hFile )
{
numBytesRead++; //&gTacticalStatus.ubLastRequesterSurgeryTargetID added with BUGFIX_NPC_DATA_FOR_BIG_MAPS
numBytesRead++; //&gTacticalStatus.ubInterruptPending added with IMPROVED_INTERRUPT_SYSTEM
numBytesRead++; //&gTacticalStatus.ubDisablePlayerInterrupts
while( (numBytesRead%4) != 0 ) // This is to make sure the total read is of DWORD length
numBytesRead++;
}
+4
View File
@@ -5842,6 +5842,8 @@ void CommonEnterCombatModeCode( )
gTacticalStatus.ubInterruptPending = DISABLED_INTERRUPT;
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
// ATE: If we have an item pointer end it!
CancelItemPointer( );
@@ -6037,6 +6039,8 @@ void ExitCombatMode( )
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, pMessageStrings[ MSG_FTM_EXIT_COMBAT ] );// ary-05/05/2009 : add forced turn mode
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
// OK, we have exited combat mode.....
// Reset some flags for no aps to move, etc
+2 -1
View File
@@ -161,7 +161,8 @@ struct TacticalStatusType
// SANDRO - added these
UINT8 ubLastRequesterSurgeryTargetID;
UINT8 ubInterruptPending;
// sevenfm: Ctrl+D disable interrupts
BOOLEAN ubDisablePlayerInterrupts;
// PADDING GONE!!!!!
};
+6
View File
@@ -168,6 +168,8 @@ void StartPlayerTeamTurn( BOOLEAN fDoBattleSnd, BOOLEAN fEnteringCombatMode )
SetFastForwardMode(FALSE);
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
// Start the turn of player charactors
//
@@ -2005,6 +2007,10 @@ BOOLEAN InterruptDuel( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent)
DebugMsg (TOPIC_JA2INTERRUPT,DBG_LEVEL_3,"InterruptDuel");
BOOLEAN fResult = FALSE;
// sevenfm: if Ctrl+D pressed - skip all player interrupts for this turn
if( !is_networked && !gGameOptions.fImprovedInterruptSystem && pSoldier->bTeam == OUR_TEAM && gTacticalStatus.ubDisablePlayerInterrupts )
return FALSE;
// if opponent can't currently see us and we can see them
if ( pSoldier->aiData.bOppList[ pOpponent->ubID ] == SEEN_CURRENTLY && pOpponent->aiData.bOppList[pSoldier->ubID] != SEEN_CURRENTLY )
{
+8 -2
View File
@@ -1669,6 +1669,8 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
{
if ( !( gTacticalStatus.uiFlags & ENGAGED_IN_CONV ) )
{
gTacticalStatus.ubDisablePlayerInterrupts = FALSE;
gfSaveGame = FALSE;
gfCameDirectlyFromGame = TRUE;
@@ -3137,12 +3139,16 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
}
}
else //End turn only if in combat and it is the player's turn
} else
{
//End turn only if in combat and it is the player's turn
if ( fCtrl )
gTacticalStatus.ubDisablePlayerInterrupts = TRUE;
*puiNewEvent = I_ENDTURN;
}
}
}
}
#ifdef JA2TESTVERSION
else if( fCtrl )
AdvanceToNextDay();