mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
New Feature: Added up to 15 game difficulty settings (by Jazz)
- Externalized the difficulty setings to "TableData\DifficultySettings.xml" file - Some INI Settings (ja2_options.ini, CTHConstants.ini and Creature_Settings.ini) moved from INI file to this xml file - see #define DIFFICULTY_SETTING git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7447 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -33,6 +33,10 @@
|
||||
#include "meanwhile.h"
|
||||
#endif
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
#define SCRIPT_DELAY 10
|
||||
#define AIR_RAID_SAY_QUOTE_TIME 3000
|
||||
#define AIR_RAID_DIVE_INTERVAL 10000
|
||||
@@ -509,7 +513,12 @@ void AirRaidLookForDive( )
|
||||
if ( fDoDive )
|
||||
{
|
||||
// If we are are beginning game, only do gun dives..
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
if ( gAirRaidDef.uiFlags & AIR_RAID_BEGINNING_GAME && zDeffSetting[gGameOptions.ubDifficultyLevel].bAirRaidLookForDive == FALSE)
|
||||
#else
|
||||
if ( gAirRaidDef.uiFlags & AIR_RAID_BEGINNING_GAME && gGameOptions.ubDifficultyLevel < DIF_LEVEL_HARD )
|
||||
#endif
|
||||
{
|
||||
if ( gbNumDives == 0 )
|
||||
{
|
||||
|
||||
+12
-3
@@ -49,6 +49,10 @@
|
||||
#include "ub_config.h"
|
||||
#endif
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
#include "email.h"
|
||||
#include "mercs.h"
|
||||
|
||||
@@ -1293,7 +1297,9 @@ void HandleUnhiredMercDeaths( INT32 iProfileID )
|
||||
// then we're not allowed to kill him (to avoid really pissing off player by killing his very favorite merc)
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
ubMaxDeaths = zDeffSetting[gGameOptions.ubDifficultyLevel].iMaxMercDeaths;
|
||||
#else
|
||||
// how many in total can be killed like this depends on player's difficulty setting
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
@@ -1314,7 +1320,7 @@ void HandleUnhiredMercDeaths( INT32 iProfileID )
|
||||
ubMaxDeaths = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
// if we've already hit the limit in this game, skip these checks
|
||||
if (gStrategicStatus.ubUnhiredMercDeaths >= ubMaxDeaths)
|
||||
{
|
||||
@@ -1613,6 +1619,9 @@ UINT8 CurrentPlayerProgressPercentage(void)
|
||||
|
||||
// kills per point depends on difficulty, and should match the ratios of starting enemy populations (730/1050/1500)
|
||||
// HEADROCK HAM 3: Externalized all four Kills-per-point ratios.
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
ubKillsPerPoint = zDeffSetting[gGameOptions.ubDifficultyLevel].iNumKillsPerProgressPoint;
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
@@ -1632,7 +1641,7 @@ UINT8 CurrentPlayerProgressPercentage(void)
|
||||
ubKillsPerPoint = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
usKillsProgress = gStrategicStatus.usPlayerKills / ubKillsPerPoint;
|
||||
if (usKillsProgress > usMaxKillsProgress)
|
||||
{
|
||||
|
||||
@@ -58,6 +58,10 @@
|
||||
#include "Explosion Control.h"
|
||||
#include "ub_config.h"
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
//*******************************************************************
|
||||
//
|
||||
// Local Defines
|
||||
@@ -1547,6 +1551,31 @@ void HandleJa25EnemyExpLevelModifier( )
|
||||
}
|
||||
}
|
||||
break;
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
default:
|
||||
//Get the 2nd highest player exp level
|
||||
bPlayerExpLevel = JA25SecondHighestExpLevelOnPlayersTeam( );
|
||||
|
||||
//get the enemies exp level
|
||||
bEnemyExpLevel = JA25SecondHighestExpLevelOnEnemiesTeam( );
|
||||
|
||||
//get the difference b/n the 2
|
||||
bDifference = bPlayerExpLevel - bEnemyExpLevel;
|
||||
|
||||
//if the players exp level is less then enemies
|
||||
if( bDifference < 0 )
|
||||
{
|
||||
//if the difference
|
||||
if( bDifference < JA25__MAX_EXP_DECREASE )
|
||||
{
|
||||
bDifference = JA25__MAX_EXP_DECREASE;
|
||||
}
|
||||
|
||||
//Degrade all the enemies exp levels by difference
|
||||
Ja25ScaleAllEnemiesByValue( bDifference );
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1798,7 +1827,10 @@ void HandleInitialEventsInHeliCrash()
|
||||
UINT32 GetNumberOfTurnsPowerGenFanWillBeStoppedFor()
|
||||
{
|
||||
UINT32 uiNumTurns = PGF__NUM_TURNS_TILL_START_FAN_BACK_UP_EASY;
|
||||
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
uiNumTurns = zDeffSetting[gGameOptions.ubDifficultyLevel].iGetNumberOfTurnsPowerGenFanWillBeStoppedFor;
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
@@ -1811,7 +1843,7 @@ UINT32 GetNumberOfTurnsPowerGenFanWillBeStoppedFor()
|
||||
uiNumTurns = PGF__NUM_TURNS_TILL_START_FAN_BACK_UP_HARD;
|
||||
break;
|
||||
}
|
||||
|
||||
#endif
|
||||
return( uiNumTurns );
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,10 @@
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
#include "AIInternals.h"//dnl ch61 180813
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -2217,7 +2221,23 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE
|
||||
if (PlacementType == BLOODCAT_PLACEMENT_STATIC)
|
||||
{
|
||||
// Are bloodcats set to forgo attacking enemies?
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLev;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLev = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLev = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLev = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLev = 4;
|
||||
else
|
||||
DiffLev = 1;
|
||||
|
||||
if (gBloodcatPlacements[ ubSectorID ][ DiffLev-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
|
||||
#else
|
||||
if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
|
||||
#endif
|
||||
{
|
||||
// skip sight between army & bloodcats
|
||||
if ( pStartSoldier->bTeam == ENEMY_TEAM && pEndSoldier->bTeam == CREATURE_TEAM && pEndSoldier->ubBodyType == BLOODCAT )
|
||||
@@ -2229,7 +2249,11 @@ INT32 SoldierToSoldierLineOfSightTest( SOLDIERTYPE * pStartSoldier, SOLDIERTYPE
|
||||
return( 0 );
|
||||
}
|
||||
}
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
else if (gBloodcatPlacements[ ubSectorID ][ DiffLev-1 ].ubFactionAffiliation > NON_CIV_GROUP)
|
||||
#else
|
||||
else if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
|
||||
#endif
|
||||
{
|
||||
// Bloodcats in this sector belong to a faction. They adhere to certain rules as a result.
|
||||
if ( pEndSoldier->bTeam == CREATURE_TEAM && pEndSoldier->ubBodyType == BLOODCAT && pStartSoldier->bSide != gbPlayerNum)
|
||||
|
||||
+74
-4
@@ -134,6 +134,9 @@
|
||||
#endif
|
||||
|
||||
#include "XML.h"
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
// OJW - 20090419
|
||||
UINT8 giMAXIMUM_NUMBER_OF_PLAYER_MERCS = CODE_MAXIMUM_NUMBER_OF_PLAYER_MERCS;
|
||||
@@ -4352,9 +4355,25 @@ SOLDIERTYPE * CivilianGroupMemberChangesSides( SOLDIERTYPE * pAttacked )
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: If this sector has affiliated bloodcats, make them all hostile.
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
DiffLevel = 1;
|
||||
if ( gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
|
||||
gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][ DiffLevel-1 ].ubFactionAffiliation == pNewAttacked->ubCivilianGroup )
|
||||
#else
|
||||
if ( gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
|
||||
gBloodcatPlacements[SECTOR(pNewAttacked->sSectorX,pNewAttacked->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == pNewAttacked->ubCivilianGroup )
|
||||
{
|
||||
#endif
|
||||
{
|
||||
MakeBloodcatsHostile();
|
||||
}
|
||||
|
||||
@@ -8853,13 +8872,47 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
|
||||
// Attacked a bloodcat.
|
||||
MakeBloodcatsHostile();
|
||||
// Are bloodcats in this sector affiliated with a faction?
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
DiffLevel = 1;
|
||||
|
||||
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
|
||||
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ DiffLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP )
|
||||
#else
|
||||
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
|
||||
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP )
|
||||
{
|
||||
#endif
|
||||
{
|
||||
// Temporarily change bloodcat's civilian group
|
||||
UINT8 ubFaction = pTarget->ubCivilianGroup;
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel2;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel2 = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel2 = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel2 = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel2 = 4;
|
||||
else
|
||||
DiffLevel2 = 1;
|
||||
|
||||
pTarget->ubCivilianGroup = gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ DiffLevel2-1 ].ubFactionAffiliation;
|
||||
#else
|
||||
pTarget->ubCivilianGroup = gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation;
|
||||
// Make entire faction hostile
|
||||
#endif
|
||||
// Make entire faction hostile
|
||||
CivilianGroupMembersChangeSidesWithinProximity( pTarget );
|
||||
// Change back
|
||||
pTarget->ubCivilianGroup = ubFaction;
|
||||
@@ -8909,9 +8962,26 @@ BOOLEAN ProcessImplicationsOfPCAttack( SOLDIERTYPE * pSoldier, SOLDIERTYPE ** pp
|
||||
CivilianGroupMembersChangeSidesWithinProximity( pTarget );
|
||||
|
||||
// HEADROCK HAM 3.6: If there are bloodcats affiliated with his group...
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
DiffLevel = 1;
|
||||
|
||||
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
|
||||
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ DiffLevel-1 ].ubFactionAffiliation == pTarget->ubCivilianGroup )
|
||||
#else
|
||||
if ( gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][0].PlacementType == BLOODCAT_PLACEMENT_STATIC &&
|
||||
gBloodcatPlacements[SECTOR(pTarget->sSectorX,pTarget->sSectorY)][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == pTarget->ubCivilianGroup )
|
||||
{
|
||||
#endif
|
||||
{
|
||||
// Make them hostile.
|
||||
MakeBloodcatsHostile();
|
||||
}
|
||||
|
||||
@@ -41,6 +41,11 @@
|
||||
#include "CampaignStats.h" // added by Flugente
|
||||
#endif
|
||||
#include "connect.h"
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
//#define BREATH_GAIN_REDUCTION_PER_RAIN_INTENSITY 25
|
||||
//end rain
|
||||
@@ -1387,6 +1392,11 @@ void UnusedAPsToBreath( SOLDIERTYPE * pSoldier )
|
||||
case DIF_LEVEL_INSANE:
|
||||
sBreathPerAP *= 6/5; // +20%
|
||||
break;
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
default:
|
||||
sBreathPerAP *= 9/10; // -10%
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
// SANDRO: this simple thing is the correct calculation
|
||||
@@ -4312,6 +4322,11 @@ INT32 GetBPCostPer10APsForGunHolding( SOLDIERTYPE * pSoldier, BOOLEAN fEstimate
|
||||
case DIF_LEVEL_INSANE:
|
||||
iBPcost /= 2; // -50%
|
||||
break;
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
default:
|
||||
iBPcost = (iBPcost * 9)/10; // -10%
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4476,6 +4491,11 @@ INT32 GetBPCostForRecoilkick( SOLDIERTYPE * pSoldier )
|
||||
case DIF_LEVEL_INSANE:
|
||||
iKickPower /= 2; // -50%
|
||||
break;
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
default:
|
||||
iKickPower = (iKickPower * 9)/10; // -10%
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@
|
||||
|
||||
#include "Animation Control.h"
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
@@ -976,8 +980,23 @@ BOOLEAN TurnSoldierIntoCorpse( SOLDIERTYPE *pSoldier, BOOLEAN fRemoveMerc, BOOLE
|
||||
{
|
||||
gTacticalStatus.fLockItemLocators = FALSE;
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
DiffLevel = 1;
|
||||
ubNumGoo = 6 - ( DiffLevel - DIF_LEVEL_EASY );
|
||||
#else
|
||||
ubNumGoo = 6 - ( gGameOptions.ubDifficultyLevel - DIF_LEVEL_EASY );
|
||||
|
||||
#endif
|
||||
|
||||
sNewGridNo = pSoldier->sGridNo + ( WORLD_COLS * 2 );
|
||||
|
||||
for ( cnt = 0; cnt < ubNumGoo; cnt++ )
|
||||
|
||||
@@ -103,6 +103,10 @@
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#endif
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
#include "fresh_header.h"
|
||||
|
||||
#include "Dialogue Control.h"
|
||||
@@ -2061,7 +2065,10 @@ INT16 SOLDIERTYPE::CalcActionPoints( void )
|
||||
//if ( this->bTeam != CIV_TEAM && this->bTeam != gbPlayerNum)
|
||||
if ( this->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
switch ( gGameOptions.ubDifficultyLevel )
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
ubPoints += zDeffSetting[gGameOptions.ubDifficultyLevel].iEnemyAPBonus;
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
|
||||
@@ -2086,6 +2093,7 @@ INT16 SOLDIERTYPE::CalcActionPoints( void )
|
||||
default:
|
||||
ubPoints += 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// Bonus to Militia APs
|
||||
else if ( this->bTeam == MILITIA_TEAM )
|
||||
@@ -2194,7 +2202,10 @@ void SOLDIERTYPE::CalcNewActionPoints( void )
|
||||
}
|
||||
if ( this->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
switch ( gGameOptions.ubDifficultyLevel )
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
usMaxActionPnts += zDeffSetting[gGameOptions.ubDifficultyLevel].iEnemyAPBonus;
|
||||
#else
|
||||
switch( gGameOptions.ubDifficultyLevel )
|
||||
{
|
||||
case DIF_LEVEL_EASY:
|
||||
usMaxActionPnts += gGameExternalOptions.iEasyAPBonus;
|
||||
@@ -2209,6 +2220,7 @@ void SOLDIERTYPE::CalcNewActionPoints( void )
|
||||
usMaxActionPnts += gGameExternalOptions.iInsaneAPBonus;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
// Bonus to Militia APs
|
||||
else if ( this->bTeam == MILITIA_TEAM )
|
||||
|
||||
@@ -56,6 +56,10 @@
|
||||
#include "Ja25 Strategic Ai.h"
|
||||
#endif
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
// THESE 3 DIFFICULTY FACTORS MUST ALWAYS ADD UP TO 100% EXACTLY!!!
|
||||
#define DIFF_FACTOR_PLAYER_PROGRESS 50
|
||||
#define DIFF_FACTOR_PALACE_DISTANCE 30
|
||||
@@ -2214,6 +2218,12 @@ INT8 CalcDifficultyModifier( UINT8 ubSoldierClass )
|
||||
bDiffModifier += (INT8)(DIFF_FACTOR_GAME_DIFFICULTY * 1.5);
|
||||
}
|
||||
break;
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
default:
|
||||
// equally strong militia, enemies, creatures, bloodcats (+10)
|
||||
bDiffModifier += ( DIFF_FACTOR_GAME_DIFFICULTY / 2 );
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -2472,7 +2482,26 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
|
||||
UINT8 PlacementType = gBloodcatPlacements[ SECTOR(gWorldSectorX, gWorldSectorY) ][0].PlacementType;
|
||||
if( PlacementType == BLOODCAT_PLACEMENT_LAIR )
|
||||
{
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
{
|
||||
DiffLevel = Random (4);
|
||||
if (DiffLevel == 0) DiffLevel = 1;
|
||||
}
|
||||
pp->bExpLevel += DiffLevel;
|
||||
#else
|
||||
pp->bExpLevel += gGameOptions.ubDifficultyLevel;
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -2498,9 +2527,26 @@ void CreateDetailedPlacementGivenBasicPlacementInfo( SOLDIERCREATE_STRUCT *pp, B
|
||||
pp->bExpLevel = min( 10, pp->bExpLevel ); //maximum exp. level of 9 // 10 - Madd
|
||||
|
||||
ubStatsLevel = pp->bExpLevel + bStatsModifier;
|
||||
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
{
|
||||
DiffLevel = Random (4);
|
||||
if (DiffLevel == 0) DiffLevel = 1;
|
||||
}
|
||||
ubStatsLevel = max( DiffLevel, ubStatsLevel ); //minimum stats level of 0 -- madd->= dif level
|
||||
#else
|
||||
ubStatsLevel = max( gGameOptions.ubDifficultyLevel, ubStatsLevel ); //minimum stats level of 0 -- madd->= dif level
|
||||
|
||||
#endif
|
||||
if ( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
ubStatsLevel = max( 6, ubStatsLevel ); //minimum stats level of 6 in insane
|
||||
|
||||
|
||||
@@ -61,6 +61,10 @@ class SOLDIERTYPE;
|
||||
// anv: for taunts on miss
|
||||
#include "Civ Quotes.h"
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
//rain
|
||||
//#define WEAPON_RELIABILITY_REDUCTION_PER_RAIN_INTENSITY 0
|
||||
extern INT8 gbCurrentRainIntensity;
|
||||
@@ -5902,7 +5906,11 @@ else
|
||||
// GAME DIFFICULTY
|
||||
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
|
||||
{
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
iBaseModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsBASE_DIFFICULTY;
|
||||
#else
|
||||
iBaseModifier += gGameCTHConstants.BASE_DIFFICULTY[gGameOptions.ubDifficultyLevel];
|
||||
#endif
|
||||
}
|
||||
|
||||
// Percentage based-modifier from the weapon and its attachments
|
||||
@@ -6235,7 +6243,11 @@ else
|
||||
// GAME DIFFICULTY
|
||||
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
|
||||
{
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
iAimModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsAIM_DIFFICULTY;
|
||||
#else
|
||||
iAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
|
||||
#endif
|
||||
}
|
||||
|
||||
// Percent modifier from the weapon and its attachments
|
||||
@@ -12835,7 +12847,11 @@ FLOAT CalcNewChanceToHitBaseSpecialBonus(SOLDIERTYPE *pSoldier)
|
||||
// GAME DIFFICULTY
|
||||
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
|
||||
{
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
fBaseModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsBASE_DIFFICULTY;
|
||||
#else
|
||||
fBaseModifier += gGameCTHConstants.BASE_DIFFICULTY[gGameOptions.ubDifficultyLevel];
|
||||
#endif
|
||||
}
|
||||
|
||||
return fBaseModifier;
|
||||
@@ -13134,7 +13150,11 @@ FLOAT CalcNewChanceToHitAimSpecialBonus(SOLDIERTYPE *pSoldier)
|
||||
// GAME DIFFICULTY
|
||||
if ( !(pSoldier->flags.uiStatusFlags & SOLDIER_PC ) && (pSoldier->bSide != gbPlayerNum) )
|
||||
{
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
fAimModifier += zDeffSetting[gGameOptions.ubDifficultyLevel].NewDifficualtySetingsAIM_DIFFICULTY;
|
||||
#else
|
||||
fAimModifier += gGameCTHConstants.AIM_DIFFICULTY[gGameOptions.ubDifficultyLevel];
|
||||
#endif
|
||||
}
|
||||
|
||||
return fAimModifier;
|
||||
|
||||
@@ -257,6 +257,10 @@ typedef PARSE_STAGE;
|
||||
|
||||
#define HISTORYNAMEFILENAME "History.xml"
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#define DIFFICULTYFILENAME "DifficultySettings.xml"
|
||||
#endif
|
||||
|
||||
extern BOOLEAN ReadInItemStats(STR fileName, BOOLEAN localizedVersion);
|
||||
extern BOOLEAN WriteItemStats();
|
||||
|
||||
@@ -553,4 +557,7 @@ extern BOOLEAN ReadInLanguageLocation(STR fileName, BOOLEAN localizedVersion, LA
|
||||
extern BOOLEAN ReadInAimOldArchive(STR fileName, BOOLEAN localizedVersion);
|
||||
|
||||
extern BOOLEAN ReadInHistorys(STR fileName, BOOLEAN localizedVersion );
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
extern BOOLEAN ReadInDifficultySettings(STR fileName, BOOLEAN localizedVersion);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+54
-2
@@ -55,6 +55,10 @@
|
||||
#include "Ja25_Tactical.h"
|
||||
#endif
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
#include "GameInitOptionsScreen.h"
|
||||
#endif
|
||||
|
||||
#include "Music Control.h"
|
||||
|
||||
#include "connect.h"
|
||||
@@ -931,7 +935,11 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
|
||||
RevealRoofsAndItems(pSoldier,TRUE, TRUE, pSoldier->pathing.bLevel, FALSE );
|
||||
}
|
||||
// unless in easy mode allow alerted enemies to radio
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
else if ( zDeffSetting[gGameOptions.ubDifficultyLevel].bRadioSightings == TRUE )
|
||||
#else
|
||||
else if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_MEDIUM )
|
||||
#endif
|
||||
{
|
||||
// don't allow admins to radio
|
||||
//Madd: Huh? why not admins? removed.
|
||||
@@ -978,7 +986,11 @@ void HandleSight(SOLDIERTYPE *pSoldier, UINT8 ubSightFlags)
|
||||
RadioSightings(pThem,pSoldier->ubID, pThem->bTeam);
|
||||
}
|
||||
// unless in easy mode allow alerted enemies to radio
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
else if ( zDeffSetting[gGameOptions.ubDifficultyLevel].bRadioSightings2 == TRUE )
|
||||
#else
|
||||
else if ( gGameOptions.ubDifficultyLevel >= DIF_LEVEL_MEDIUM )
|
||||
#endif
|
||||
{
|
||||
// don't allow admins to radio
|
||||
if ( pThem->bTeam == ENEMY_TEAM && gTacticalStatus.Team[ ENEMY_TEAM ].bAwareOfOpposition && pThem->ubSoldierClass != SOLDIER_CLASS_ADMINISTRATOR )
|
||||
@@ -2503,10 +2515,28 @@ void ManSeesMan(SOLDIERTYPE *pSoldier, SOLDIERTYPE *pOpponent, INT32 sOppGridNo,
|
||||
else if ( pOpponent->ubBodyType == BLOODCAT && pOpponent->aiData.bNeutral)
|
||||
{
|
||||
// HEADROCK HAM 3.6: If bloodcats are set as affiliated with civilians, do not trigger hostilities.
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
DiffLevel = 1;
|
||||
|
||||
if ( gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ 0 ].PlacementType != BLOODCAT_PLACEMENT_STATIC ||
|
||||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ DiffLevel - 1 ].ubFactionAffiliation == NON_CIV_GROUP ||
|
||||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ DiffLevel - 1 ].ubFactionAffiliation == QUEENS_CIV_GROUP )
|
||||
#else
|
||||
if ( gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ 0 ].PlacementType != BLOODCAT_PLACEMENT_STATIC ||
|
||||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ gGameOptions.ubDifficultyLevel - 1 ].ubFactionAffiliation == NON_CIV_GROUP ||
|
||||
gBloodcatPlacements[SECTOR(pSoldier->sSectorX, pSoldier->sSectorY)][ gGameOptions.ubDifficultyLevel - 1 ].ubFactionAffiliation == QUEENS_CIV_GROUP )
|
||||
{
|
||||
#endif
|
||||
{
|
||||
MakeBloodcatsHostile();
|
||||
}
|
||||
/*
|
||||
@@ -6020,9 +6050,27 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
|
||||
UINT8 ubSectorID = SECTOR(gWorldSectorX, gWorldSectorY);
|
||||
UINT8 PlacementType = gBloodcatPlacements[ ubSectorID ][0].PlacementType;
|
||||
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
UINT8 DiffLevel;
|
||||
if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_EASY )
|
||||
DiffLevel = 1;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_MEDIUM )
|
||||
DiffLevel = 2;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_HARD )
|
||||
DiffLevel = 3;
|
||||
else if( gGameOptions.ubDifficultyLevel == DIF_LEVEL_INSANE )
|
||||
DiffLevel = 4;
|
||||
else
|
||||
DiffLevel = 1;
|
||||
#endif
|
||||
|
||||
if (PlacementType == BLOODCAT_PLACEMENT_STATIC)
|
||||
{
|
||||
if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
if (gBloodcatPlacements[ ubSectorID ][ DiffLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
|
||||
#else
|
||||
if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation == QUEENS_CIV_GROUP)
|
||||
#endif
|
||||
{
|
||||
// skip noises between army & bloodcats
|
||||
if ( pSoldier->bTeam == ENEMY_TEAM && MercPtrs[ ubNoiseMaker ]->ubBodyType == BLOODCAT && MercPtrs[ ubNoiseMaker ]->bTeam == CREATURE_TEAM )
|
||||
@@ -6034,7 +6082,11 @@ void ProcessNoise(UINT8 ubNoiseMaker, INT32 sGridNo, INT8 bLevel, UINT8 ubTerrTy
|
||||
continue;
|
||||
}
|
||||
}
|
||||
#ifdef DIFFICULTY_SETTING
|
||||
else if (gBloodcatPlacements[ ubSectorID ][ DiffLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
|
||||
#else
|
||||
else if (gBloodcatPlacements[ ubSectorID ][ gGameOptions.ubDifficultyLevel-1 ].ubFactionAffiliation > NON_CIV_GROUP)
|
||||
#endif
|
||||
{
|
||||
if ( MercPtrs[ ubNoiseMaker ]->ubBodyType == BLOODCAT && MercPtrs[ ubNoiseMaker ]->bTeam == CREATURE_TEAM && pSoldier->bSide != gbPlayerNum)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user