Added "Real Time Mode" (by borys762 and The_Bob)

- To look for code changes search for "The_Bob" comments
- There are 2 new entries in the ja2_options.ini in the [JA2 Tactical Settings] section: ALLOW_REAL_TIME_SNEAK, QUIET_REAL_TIME_SNEAK

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2921 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Wanne
2009-06-02 10:25:42 +00:00
parent 2f36054c50
commit afaba958c5
4 changed files with 80 additions and 3 deletions
+48
View File
@@ -246,6 +246,8 @@ UINT8 gubCheatLevel = STARTING_CHEAT_LEVEL;
extern BOOLEAN CompatibleAmmoForGun( OBJECTTYPE *pTryObject, OBJECTTYPE *pTestObject );
extern void DetermineWhichAssignmentMenusCanBeShown( void );
extern void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lalien
// The_Bob - real time sneaking, 01-06-09
extern BOOLEAN WeSeeNoOne(void); // Needed to control entering turn-based with ctrl-x
void GetTBMouseButtonInput( UINT32 *puiNewEvent )
{
@@ -2363,7 +2365,53 @@ void GetKeyboardInput( UINT32 *puiNewEvent )
}
}
else if ( fCtrl ) // The_Bob - real time sneaking, 01-06-09
{ // ctrl-x: enter turn based while sneaking - check if RT sneak is on, iw we're not already in combat and if we actually see any enemies
if (gGameExternalOptions.fAllowRealTimeSneak)
{
BOOLEAN fSneakingInRealTime = true;
if( gTacticalStatus.uiFlags & INCOMBAT )
{ // Don't allow this in combat
if (!gGameExternalOptions.fQuietRealTimeSneak)
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"In combat already !");
fSneakingInRealTime = false;
}
if( WeSeeNoOne() )
{ // Don't allow this if no enemies are seen - we have the forced turn mode for that
if (!gGameExternalOptions.fQuietRealTimeSneak)
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"No enemies in sight !");
fSneakingInRealTime = false;
}
if (fSneakingInRealTime)
EnterCombatMode(OUR_TEAM);
}
}
break;
// The_Bob - real time sneaking, 01-06-09
case 'X': // shift-ctrl-x: toggle real time sneaking
if ( fCtrl )
{
if (gGameExternalOptions.fAllowRealTimeSneak)
{
gGameExternalOptions.fAllowRealTimeSneak = false;
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Real-time sneaking OFF");
if( !WeSeeNoOne() ) // if we're sneaking up on someone, enter turn-based
EnterCombatMode(OUR_TEAM);
}
else
{
gGameExternalOptions.fAllowRealTimeSneak = true;
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Real-time sneaking ON");
}
}
break;
case '/':