mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
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:
@@ -678,6 +678,13 @@ void LoadGameExternalOptions()
|
|||||||
|
|
||||||
gGameExternalOptions.fEnableArmorCoverage = iniReader.ReadBoolean("JA2 Tactical Settings", "ENABLE_ARMOR_COVERAGE", FALSE); // ShadoWarrior for Captain J's armor coverage
|
gGameExternalOptions.fEnableArmorCoverage = iniReader.ReadBoolean("JA2 Tactical Settings", "ENABLE_ARMOR_COVERAGE", FALSE); // ShadoWarrior for Captain J's armor coverage
|
||||||
|
|
||||||
|
// The_Bob - real time sneaking code 01/06/09
|
||||||
|
// Suport disabling real time sneaking via external .ini file
|
||||||
|
gGameExternalOptions.fAllowRealTimeSneak = iniReader.ReadBoolean("JA2 Real Time Sneaking Settings","ALLOW_REAL_TIME_SNEAK", FALSE);
|
||||||
|
// Silence the RT sneaking messages
|
||||||
|
gGameExternalOptions.fQuietRealTimeSneak = iniReader.ReadBoolean("JA2 Real Time Sneaking Settings","QUIET_REAL_TIME_SNEAK", FALSE);
|
||||||
|
|
||||||
|
|
||||||
//################# Rain Settings ##################
|
//################# Rain Settings ##################
|
||||||
|
|
||||||
// Rain settings
|
// Rain settings
|
||||||
|
|||||||
@@ -629,6 +629,10 @@ BOOLEAN gbBulletTracer;
|
|||||||
// HEADROCK HAM B2.8: New Trainer Relations: 2 = Trainers will rest if no trainees available. 3 = Trainees will rest if no trainers available (not recommended). 1 = Both. 0 = Neither.
|
// HEADROCK HAM B2.8: New Trainer Relations: 2 = Trainers will rest if no trainees available. 3 = Trainees will rest if no trainers available (not recommended). 1 = Both. 0 = Neither.
|
||||||
UINT8 ubSmartTrainingRest;
|
UINT8 ubSmartTrainingRest;
|
||||||
|
|
||||||
|
// The_Bob - real time sneaking code 01/06/09
|
||||||
|
// Suport disabling/silencing real time sneaking via external .ini file
|
||||||
|
BOOLEAN fAllowRealTimeSneak;
|
||||||
|
BOOLEAN fQuietRealTimeSneak;
|
||||||
} GAME_EXTERNAL_OPTIONS;
|
} GAME_EXTERNAL_OPTIONS;
|
||||||
|
|
||||||
//This structure will contain general Ja2 settings NOT individual game settings.
|
//This structure will contain general Ja2 settings NOT individual game settings.
|
||||||
|
|||||||
@@ -246,6 +246,8 @@ UINT8 gubCheatLevel = STARTING_CHEAT_LEVEL;
|
|||||||
extern BOOLEAN CompatibleAmmoForGun( OBJECTTYPE *pTryObject, OBJECTTYPE *pTestObject );
|
extern BOOLEAN CompatibleAmmoForGun( OBJECTTYPE *pTryObject, OBJECTTYPE *pTestObject );
|
||||||
extern void DetermineWhichAssignmentMenusCanBeShown( void );
|
extern void DetermineWhichAssignmentMenusCanBeShown( void );
|
||||||
extern void DetermineWhichMilitiaControlMenusCanBeShown( void ); //lalien
|
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 )
|
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;
|
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 '/':
|
case '/':
|
||||||
|
|
||||||
|
|||||||
+21
-3
@@ -74,6 +74,9 @@ void DecayWatchedLocs( INT8 bTeam );
|
|||||||
|
|
||||||
void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT8 * pPersOL, INT8 * pbPublOL );
|
void HandleManNoLongerSeen( SOLDIERTYPE * pSoldier, SOLDIERTYPE * pOpponent, INT8 * pPersOL, INT8 * pbPublOL );
|
||||||
|
|
||||||
|
// The_Bob - real time sneaking code 01/06/09
|
||||||
|
extern void CancelItemPointer(void);
|
||||||
|
extern BOOLEAN NobodyAlerted(void);
|
||||||
//#define TESTOPPLIST
|
//#define TESTOPPLIST
|
||||||
|
|
||||||
// for ManSeesMan()
|
// for ManSeesMan()
|
||||||
@@ -480,9 +483,24 @@ void HandleBestSightingPositionInRealtime( void )
|
|||||||
//if (gfHumanSawSomeoneInRealtime)
|
//if (gfHumanSawSomeoneInRealtime)
|
||||||
{
|
{
|
||||||
if (gubBestToMakeSighting[ 1 ] == NOBODY)
|
if (gubBestToMakeSighting[ 1 ] == NOBODY)
|
||||||
{
|
{ // The_Bob - real time sneaking code 01/06/09
|
||||||
// award turn
|
// if real time sneaking conditions are met...
|
||||||
EnterCombatMode( MercPtrs[gubBestToMakeSighting[ 0 ]]->bTeam );
|
if (gGameExternalOptions.fAllowRealTimeSneak && MercPtrs[gubBestToMakeSighting[ 0 ]]->bTeam == OUR_TEAM && NobodyAlerted() )
|
||||||
|
{
|
||||||
|
// get rid of the item under cursor (we gotta react FAST)
|
||||||
|
CancelItemPointer();
|
||||||
|
// select (and center screen on) the merc who saw the enemy
|
||||||
|
if (gusSelectedSoldier != (UINT16)MercPtrs[gubBestToMakeSighting[ 0 ]]->ubID)
|
||||||
|
SelectSoldier (MercPtrs[gubBestToMakeSighting[ 0 ]]->ubID, false, true);
|
||||||
|
// if not quiet, emit a message warning the player
|
||||||
|
if (!gGameExternalOptions.fQuietRealTimeSneak)
|
||||||
|
ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Enemy spotted! (ctrl-x to enter turn based)");
|
||||||
|
|
||||||
|
return; // and do nothing
|
||||||
|
}
|
||||||
|
else
|
||||||
|
// otherwise, simply award the turn to the team that saw the enemy first
|
||||||
|
EnterCombatMode( MercPtrs[gubBestToMakeSighting[ 0 ]]->bTeam );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user