mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
- externalized settings for mobile militia
- made default militia settings less aggressive - added a message for breaking locks/doors git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@147 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+11
-4
@@ -353,11 +353,18 @@ void LoadGameExternalOptions()
|
||||
// Militia Settings
|
||||
gGameExternalOptions.fAllowTacticalMilitiaCommand = iniReader.ReadBoolean("JA2 Tactical Settings","ALLOW_TACTICAL_MILITIA_COMMAND",1);
|
||||
|
||||
gGameExternalOptions.gfAllowMilitiaGroups = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_MILITIA_MOBILE_GROUPS",1);
|
||||
gGameExternalOptions.gfAllowReinforcements = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS",1);
|
||||
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",0);
|
||||
gGameExternalOptions.guiBaseQueenPoolIncrement = iniReader.ReadInteger("JA2 Gameplay Settings","QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL",60);
|
||||
gGameExternalOptions.gfAllowMilitiaGroups = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_MILITIA_MOBILE_GROUPS",1);
|
||||
gGameExternalOptions.gfAllowReinforcements = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS",1);
|
||||
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",0);
|
||||
gGameExternalOptions.guiBaseQueenPoolIncrement = iniReader.ReadInteger("JA2 Gameplay Settings","QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL",60);
|
||||
|
||||
gGameExternalOptions.guiCreateEachNHours = iniReader.ReadInteger("JA2 Gameplay Settings","CREATE_EACH_N_HOURS",24);
|
||||
gGameExternalOptions.guiDivOfOriginalMilitia = iniReader.ReadInteger("JA2 Gameplay Settings","DIV_OF_ORIGINAL_MILITIA",4);
|
||||
gGameExternalOptions.guiMinMilitiaSquadSize = iniReader.ReadInteger("JA2 Gameplay Settings","MINIMUM_MILITIA_SQUAD_SIZE",5);
|
||||
gGameExternalOptions.guiMaxMilitiaSquadSize = iniReader.ReadInteger("JA2 Gameplay Settings","MAXIMUM_MILITIA_SQUAD_SIZE",20);
|
||||
gGameExternalOptions.guiMaxMilitiaSquadSizeBattle = iniReader.ReadInteger("JA2 Gameplay Settings","MAXIMUM_MILITIA_SQUAD_SIZE_BATTLE",20);
|
||||
|
||||
|
||||
//Sight range
|
||||
gGameExternalOptions.ubStraightSightRange = iniReader.ReadInteger("JA2 Tactical Settings","BASE_SIGHT_RANGE",13);
|
||||
gGameExternalOptions.ubVisDistDecreasePerRainIntensity = iniReader.ReadInteger("JA2 Tactical Settings","VISUAL_DISTANCE_DECREASE_PER_RAIN_INTENSITY",20);
|
||||
|
||||
@@ -204,6 +204,15 @@ typedef struct
|
||||
BOOLEAN gfAllowReinforcementsOnlyInCity;
|
||||
UINT32 guiBaseQueenPoolIncrement;
|
||||
|
||||
UINT32 guiCreateEachNHours;
|
||||
UINT32 guiDivOfOriginalMilitia;
|
||||
UINT32 guiMinMilitiaSquadSize;
|
||||
UINT32 guiMaxMilitiaSquadSize;
|
||||
UINT32 guiMaxMilitiaSquadSizeBattle;
|
||||
|
||||
|
||||
|
||||
|
||||
//Sight range
|
||||
UINT8 ubStraightSightRange;
|
||||
UINT32 ubVisDistDecreasePerRainIntensity;
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" };
|
||||
#else
|
||||
|
||||
//RELEASE BUILD VERSION
|
||||
INT16 zVersionLabel[256] = { L"Release v1.13.146" };
|
||||
INT16 zVersionLabel[256] = { L"Release v1.13.147" };
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+2
-2
@@ -43,7 +43,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libexpatMT.lib mss32.lib winmm.lib smackw32.lib fmodvc.lib"
|
||||
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.146_2006_05_30.exe"
|
||||
OutputFile="C:\games\Jagged Alliance 2 v1.13\ja2_debug_v1.13.147_2006_05_30.exe"
|
||||
LinkIncremental="2"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
|
||||
@@ -546,7 +546,7 @@
|
||||
<Tool
|
||||
Name="VCLinkerTool"
|
||||
AdditionalDependencies="libexpatMT.lib winmm.lib smackw32.lib mss32.lib fmodvc.lib"
|
||||
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.146_2006_05_30.exe"
|
||||
OutputFile="C:\Games\Jagged Alliance 2 v1.13\ja2_release_v1.13.147_2006_05_30.exe"
|
||||
LinkIncremental="1"
|
||||
SuppressStartupBanner="TRUE"
|
||||
AdditionalLibraryDirectories=".\..\..\Standard Gaming Platform\"
|
||||
|
||||
+16
-16
@@ -32,20 +32,20 @@
|
||||
|
||||
|
||||
// will create a squad each n hours (12 for example). Should divide 24 without remainder
|
||||
#define CREATE_EACH_N_HOURS 12
|
||||
//#define CREATE_EACH_N_HOURS 12
|
||||
|
||||
// more these values - less the chances
|
||||
#define CHANCE_TO_MOVE_A_SQUAD 5
|
||||
#define CHANCE_TO_MOVE_AN_UNFULL_SQUAD 40
|
||||
|
||||
#define DIV_OF_ORIGINAL_MILITIA 2
|
||||
//#define DIV_OF_ORIGINAL_MILITIA 2
|
||||
#define BASE_DIR_PRIORITY 5
|
||||
// little chance to move if below minimum
|
||||
|
||||
#define MINIMUM_MILITIA_SQUAD_SIZE 10
|
||||
//#define MINIMUM_MILITIA_SQUAD_SIZE 10
|
||||
// should be 2* Minimum
|
||||
//#define MAXIMUM_MILITIA_SQUAD_SIZE 30
|
||||
#define MAXIMUM_MILITIA_SQUAD_SIZE_BATTLE MAXIMUM_MILITIA_SQUAD_SIZE
|
||||
//#define MAXIMUM_MILITIA_SQUAD_SIZE_BATTLE MAXIMUM_MILITIA_SQUAD_SIZE
|
||||
|
||||
#define DIR_WITH_UNFULL_SQUAD_RATING_BONUS 100
|
||||
// rating of battle, when there's equal number of soldiers
|
||||
@@ -133,13 +133,13 @@ void GenerateMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY )
|
||||
{
|
||||
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
|
||||
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, GREEN_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ] / DIV_OF_ORIGINAL_MILITIA);
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, REGULAR_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] / DIV_OF_ORIGINAL_MILITIA);
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, ELITE_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ] / DIV_OF_ORIGINAL_MILITIA);
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, GREEN_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ] / gGameExternalOptions.guiDivOfOriginalMilitia);
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, REGULAR_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] / gGameExternalOptions.guiDivOfOriginalMilitia);
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, ELITE_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ] / gGameExternalOptions.guiDivOfOriginalMilitia);
|
||||
|
||||
pSectorInfo = &( SectorInfo[ SECTOR( sTMapX, sTMapY ) ] );
|
||||
|
||||
while( CountMilitia(pSectorInfo) > MAXIMUM_MILITIA_SQUAD_SIZE )
|
||||
while( CountMilitia(pSectorInfo) > gGameExternalOptions.guiMaxMilitiaSquadSize )
|
||||
if(pSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA])--pSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA];else
|
||||
if(pSectorInfo->ubNumberOfCivsAtLevel[REGULAR_MILITIA])--pSectorInfo->ubNumberOfCivsAtLevel[REGULAR_MILITIA];else
|
||||
if(pSectorInfo->ubNumberOfCivsAtLevel[ELITE_MILITIA])--pSectorInfo->ubNumberOfCivsAtLevel[ELITE_MILITIA];
|
||||
@@ -160,8 +160,8 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
||||
StrategicRemoveMilitiaFromSector( sMapX, sMapY, REGULAR_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] );
|
||||
StrategicRemoveMilitiaFromSector( sMapX, sMapY, ELITE_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ ELITE_MILITIA ] );
|
||||
|
||||
while( !fAlternativeMax && CountMilitia(pTSectorInfo) > MAXIMUM_MILITIA_SQUAD_SIZE ||
|
||||
fAlternativeMax && CountMilitia(pTSectorInfo) > MAXIMUM_MILITIA_SQUAD_SIZE_BATTLE )
|
||||
while( !fAlternativeMax && CountMilitia(pTSectorInfo) > gGameExternalOptions.guiMaxMilitiaSquadSize ||
|
||||
fAlternativeMax && CountMilitia(pTSectorInfo) > gGameExternalOptions.guiMaxMilitiaSquadSizeBattle )
|
||||
if(pTSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA])
|
||||
{--pTSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA];++pSectorInfo->ubNumberOfCivsAtLevel[GREEN_MILITIA];}else
|
||||
if(pTSectorInfo->ubNumberOfCivsAtLevel[REGULAR_MILITIA])
|
||||
@@ -289,7 +289,7 @@ UINT16 CountDirectionRating( INT16 sMapX, INT16 sMapY, UINT8 uiDir )
|
||||
}
|
||||
|
||||
if( CountAllMilitiaInSector( sDMapX, sDMapY ) &&
|
||||
CountAllMilitiaInSector( sDMapX, sDMapY ) + CountAllMilitiaInSector( sMapX, sMapY ) <= MAXIMUM_MILITIA_SQUAD_SIZE )
|
||||
CountAllMilitiaInSector( sDMapX, sDMapY ) + CountAllMilitiaInSector( sMapX, sMapY ) <= gGameExternalOptions.guiMaxMilitiaSquadSize )
|
||||
iRes += DIR_WITH_UNFULL_SQUAD_RATING_BONUS;
|
||||
|
||||
if( NumEnemiesInSector( sDMapX, sDMapY ) )
|
||||
@@ -328,7 +328,7 @@ BOOLEAN CheckStandardConditionsForDirection( INT16 sSMapX, INT16 sSMapY, INT16 s
|
||||
return (GetTownIdForSector( sMapX, sMapY ) == BLANK_SECTOR || fWithCities) && !IsThisSectorASAMSector( sMapX, sMapY , 0 ) &&
|
||||
(GetTownIdForSector( sMapX, sMapY ) != BLANK_SECTOR || !fOnlyCitySectors);// &&
|
||||
// ( !NumEnemiesInSector( sMapX, sMapY ) || GetEnemyGroupIdInSector(sMapX, sMapY ) || fForBattle ) &&
|
||||
// ( fForBattle || CountAllMilitiaInSector( sMapX, sMapY ) < MAXIMUM_MILITIA_SQUAD_SIZE || PlayerMercsInSector( sMapX, sMapY, 0 ) )
|
||||
// ( fForBattle || CountAllMilitiaInSector( sMapX, sMapY ) < gGameExternalOptions.guiMaxMilitiaSquadSize || PlayerMercsInSector( sMapX, sMapY, 0 ) )
|
||||
}
|
||||
|
||||
void GenerateDirectionInfos( INT16 sMapX, INT16 sMapY, UINT8* uiDirNumber, UINT16 pMoveDir[4][3], BOOLEAN fWithCities, BOOLEAN fForBattle, BOOLEAN fOnlyCitySectors )
|
||||
@@ -459,7 +459,7 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
|
||||
// new squad
|
||||
if( GetTownIdForSector( sMapX, sMapY ) != BLANK_SECTOR )
|
||||
{
|
||||
if( GetWorldHour() % CREATE_EACH_N_HOURS )return;
|
||||
if( GetWorldHour() % gGameExternalOptions.guiCreateEachNHours )return;
|
||||
|
||||
GenerateDirectionInfos( sMapX, sMapY, &uiDirNumber, pMoveDir, FALSE, FALSE, FALSE );
|
||||
|
||||
@@ -524,7 +524,7 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
|
||||
// ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%ld,%ld", x, pMoveDir[x][1]);
|
||||
|
||||
iRandom = Random( pMoveDir[ uiDirNumber - 1 ][1] +
|
||||
( uiMilitiaCount >= MINIMUM_MILITIA_SQUAD_SIZE ? CHANCE_TO_MOVE_A_SQUAD : CHANCE_TO_MOVE_AN_UNFULL_SQUAD ) );
|
||||
( uiMilitiaCount >= gGameExternalOptions.guiMinMilitiaSquadSize ? CHANCE_TO_MOVE_A_SQUAD : CHANCE_TO_MOVE_AN_UNFULL_SQUAD ) );
|
||||
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Roll %ld", iRandomRes);
|
||||
|
||||
@@ -601,7 +601,7 @@ void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY )
|
||||
guiDirNumber = uiDirNumber + 1;
|
||||
|
||||
x = 0;
|
||||
while( CountMilitia(pSectorInfo ) < MAXIMUM_MILITIA_SQUAD_SIZE_BATTLE &&
|
||||
while( CountMilitia(pSectorInfo ) < gGameExternalOptions.guiMaxMilitiaSquadSizeBattle &&
|
||||
( fMoreTroopsLeft[0] || fMoreTroopsLeft[1] || fMoreTroopsLeft[2] || fMoreTroopsLeft[3] || fFirstLoop ) )
|
||||
{
|
||||
fMoreTroopsLeft[ x ] = MoveOneBestMilitiaMan( SECTORX( pMoveDir[ x ][0] ), SECTORY( pMoveDir[ x ][0] ), sMapX, sMapY );
|
||||
@@ -663,7 +663,7 @@ void MilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY )
|
||||
|
||||
if( CountAllMilitiaInSector( sMapX, sMapY ) ) MSCallBack( MSG_BOX_RETURN_YES );
|
||||
|
||||
if( IsThereMilitiaInAdjacentSector( sMapX, sMapY ) && CountAllMilitiaInSector( sMapX, sMapY ) < MAXIMUM_MILITIA_SQUAD_SIZE_BATTLE )
|
||||
if( IsThereMilitiaInAdjacentSector( sMapX, sMapY ) && CountAllMilitiaInSector( sMapX, sMapY ) < gGameExternalOptions.guiMaxMilitiaSquadSizeBattle )
|
||||
DoScreenIndependantMessageBox( gzCWStrings[0], MSG_BOX_FLAG_YESNO, MSCallBack );
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include "Types.h"
|
||||
#include "Soldier Control.h"
|
||||
|
||||
#define MAXIMUM_MILITIA_SQUAD_SIZE 30
|
||||
//#define MAXIMUM_MILITIA_SQUAD_SIZE 30
|
||||
|
||||
extern UINT8 gpAttackDirs[5][4];
|
||||
extern UINT8 guiDirNumber;
|
||||
|
||||
@@ -179,7 +179,7 @@ BOOLEAN ARMoveBestMilitiaManFromAdjacentSector(INT16 sMapX, INT16 sMapY)
|
||||
if( !gGameExternalOptions.gfAllowReinforcements )
|
||||
return FALSE;
|
||||
|
||||
if( CountAllMilitiaInSector( sMapX, sMapY ) >= MAXIMUM_MILITIA_SQUAD_SIZE ||
|
||||
if( CountAllMilitiaInSector( sMapX, sMapY ) >= gGameExternalOptions.guiMaxMilitiaSquadSize ||
|
||||
CountAllMilitiaInFiveSectors( sMapX, sMapY ) - CountAllMilitiaInSector( sMapX, sMapY ) == 0 )
|
||||
return FALSE;
|
||||
|
||||
@@ -315,7 +315,7 @@ UINT8 NumFreeMilitiaSlots()
|
||||
if( !pSoldier->bActive )
|
||||
ubNumFreeSlots++;
|
||||
}
|
||||
return max( 0 , ubNumFreeSlots - ( 32 - MAXIMUM_MILITIA_SQUAD_SIZE ) );
|
||||
return max( 0 , ubNumFreeSlots - ( 32 - gGameExternalOptions.guiMaxMilitiaSquadSize ) );
|
||||
}
|
||||
|
||||
UINT8 DoReinforcementAsPendingMilitia( INT16 sMapX, INT16 sMapY, UINT8 *pubRank )
|
||||
@@ -379,7 +379,7 @@ void AddPossiblePendingMilitiaToBattle()
|
||||
|
||||
if( !PlayerMercsInSector( gWorldSectorX, gWorldSectorY, 0 ) || !CountAllMilitiaInSector( gWorldSectorX, gWorldSectorY )
|
||||
|| !NumEnemiesInSector( gWorldSectorX, gWorldSectorY ) ) return;
|
||||
//MAXIMUM_MILITIA_SQUAD_SIZE - CountAllMilitiaInSector( gWorldSectorX, gWorldSectorY );
|
||||
//gGameExternalOptions.guiMaxMilitiaSquadSize - CountAllMilitiaInSector( gWorldSectorX, gWorldSectorY );
|
||||
ubSlots = NumFreeMilitiaSlots();
|
||||
if( !ubSlots )
|
||||
{ //no available slots to add militia to. Try again later...
|
||||
|
||||
@@ -367,6 +367,8 @@ BOOLEAN AttemptToCrowbarLock( SOLDIERTYPE * pSoldier, DOOR * pDoor )
|
||||
{
|
||||
if (iResult > -10)
|
||||
{
|
||||
ScreenMsg( MSG_FONT_YELLOW, MSG_INTERFACE, TacticalStr[ LOCK_HAS_BEEN_HIT ] );
|
||||
|
||||
// STR GAIN - Damaged a lock by prying
|
||||
StatChange( pSoldier, STRAMT, 5, FALSE );
|
||||
|
||||
@@ -445,6 +447,8 @@ BOOLEAN AttemptToSmashDoor( SOLDIERTYPE * pSoldier, DOOR * pDoor )
|
||||
{
|
||||
if (iResult > -10)
|
||||
{
|
||||
ScreenMsg( MSG_FONT_YELLOW, MSG_INTERFACE, TacticalStr[ LOCK_HAS_BEEN_HIT ] );
|
||||
|
||||
// STR GAIN - Damaged a lock by prying
|
||||
StatChange( pSoldier, STRAMT, 5, FALSE );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user