- Added INI Setting and ability to manually train mobile militia at a cost

- Added INI setting and ability to train veteran militia

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@586 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
AcyForsythe
2006-10-01 06:52:06 +00:00
parent e88e16c038
commit 11b2e75e32
10 changed files with 477 additions and 191 deletions
+3
View File
@@ -478,7 +478,9 @@ void LoadGameExternalOptions()
gGameExternalOptions.gfUseAutoSave = iniReader.ReadBoolean("JA2 Gameplay Settings","USE_AUTO_SAVE",FALSE); gGameExternalOptions.gfUseAutoSave = iniReader.ReadBoolean("JA2 Gameplay Settings","USE_AUTO_SAVE",FALSE);
// Militia settings // Militia settings
gGameExternalOptions.gfTrainVeteranMilitia = iniReader.ReadBoolean("JA2 Gameplay Settings","TRAIN_VETERAN_MILITIA",FALSE);
gGameExternalOptions.gfAllowMilitiaGroups = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_MILITIA_MOBILE_GROUPS",FALSE); gGameExternalOptions.gfAllowMilitiaGroups = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_MILITIA_MOBILE_GROUPS",FALSE);
gGameExternalOptions.gfmusttrainroaming = iniReader.ReadBoolean("JA2 Gameplay Settings","MUST_TRAIN_MOBILE_MILITIA",FALSE);
gGameExternalOptions.gfAllowReinforcements = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS",FALSE); gGameExternalOptions.gfAllowReinforcements = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS",FALSE);
gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE); gGameExternalOptions.gfAllowReinforcementsOnlyInCity = iniReader.ReadBoolean("JA2 Gameplay Settings","ALLOW_REINFORCEMENTS_ONLY_IN_CITIES",FALSE);
gGameExternalOptions.guiBaseQueenPoolIncrement = iniReader.ReadInteger("JA2 Gameplay Settings","QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL",60); gGameExternalOptions.guiBaseQueenPoolIncrement = iniReader.ReadInteger("JA2 Gameplay Settings","QUEEN_POOL_INCREMENT_PER_DIFFICULTY_LEVEL",60);
@@ -492,6 +494,7 @@ void LoadGameExternalOptions()
gGameExternalOptions.iMaxMilitiaPerSector = iniReader.ReadInteger("JA2 Gameplay Settings","MAX_MILITIA_PER_SECTOR",20); gGameExternalOptions.iMaxMilitiaPerSector = iniReader.ReadInteger("JA2 Gameplay Settings","MAX_MILITIA_PER_SECTOR",20);
gGameExternalOptions.iTrainingSquadSize = iniReader.ReadInteger("JA2 Gameplay Settings","MAX_TRAINING_SQUAD_SIZE",10); gGameExternalOptions.iTrainingSquadSize = iniReader.ReadInteger("JA2 Gameplay Settings","MAX_TRAINING_SQUAD_SIZE",10);
gGameExternalOptions.iMilitiaTrainingCost = iniReader.ReadInteger("JA2 Gameplay Settings","MILITIA_TRAINING_COST",750); gGameExternalOptions.iMilitiaTrainingCost = iniReader.ReadInteger("JA2 Gameplay Settings","MILITIA_TRAINING_COST",750);
gGameExternalOptions.iMilitiaCostModifier = iniReader.ReadInteger("JA2 Gameplay Settings","MILITIA_COST_MODIFIER",3);
gGameExternalOptions.iMinLoyaltyToTrain = iniReader.ReadInteger("JA2 Gameplay Settings","MIN_LOYALTY_TO_TRAIN",20); gGameExternalOptions.iMinLoyaltyToTrain = iniReader.ReadInteger("JA2 Gameplay Settings","MIN_LOYALTY_TO_TRAIN",20);
//Assignment Settings (training, repairing, doctoring, etc) //Assignment Settings (training, repairing, doctoring, etc)
+3 -1
View File
@@ -154,6 +154,7 @@ typedef struct
INT32 iMaxMilitiaPerSector; INT32 iMaxMilitiaPerSector;
INT32 iTrainingSquadSize; INT32 iTrainingSquadSize;
INT32 iMilitiaTrainingCost; INT32 iMilitiaTrainingCost;
INT32 iMilitiaCostModifier;
INT32 iMinLoyaltyToTrain; INT32 iMinLoyaltyToTrain;
INT32 iMaxEnemyGroupSize; INT32 iMaxEnemyGroupSize;
@@ -212,8 +213,9 @@ typedef struct
// Militia Settings // Militia Settings
BOOLEAN fAllowTacticalMilitiaCommand; BOOLEAN fAllowTacticalMilitiaCommand;
BOOLEAN gfTrainVeteranMilitia;
BOOLEAN gfAllowMilitiaGroups; BOOLEAN gfAllowMilitiaGroups;
BOOLEAN gfmusttrainroaming;
BOOLEAN gfAllowReinforcements; BOOLEAN gfAllowReinforcements;
BOOLEAN gfAllowReinforcementsOnlyInCity; BOOLEAN gfAllowReinforcementsOnlyInCity;
UINT32 guiBaseQueenPoolIncrement; UINT32 guiBaseQueenPoolIncrement;
BIN
View File
Binary file not shown.
+47 -49
View File
@@ -6,7 +6,7 @@
--------------------Configuration: TileEngine - Win32 Release-------------------- --------------------Configuration: TileEngine - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2B.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP213.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/TileEngine.pch" /YX"TileEngine All.h" /Fo"Release/" /Fd"Release/" /FD /O2b2 /c /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/TileEngine.pch" /YX"TileEngine All.h" /Fo"Release/" /Fd"Release/" /FD /O2b2 /c
"C:\JA2\Build\TileEngine\Ambient Control.cpp" "C:\JA2\Build\TileEngine\Ambient Control.cpp"
@@ -46,8 +46,8 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2B.tmp" with content
"C:\JA2\Build\TileEngine\worldman.cpp" "C:\JA2\Build\TileEngine\worldman.cpp"
"C:\JA2\Build\TileEngine\XML_ExplosionData.cpp" "C:\JA2\Build\TileEngine\XML_ExplosionData.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2B.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP213.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2C.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP214.tmp" with contents
[ [
/nologo /out:"Release\TileEngine.lib" /nologo /out:"Release\TileEngine.lib"
".\Release\Ambient Control.obj" ".\Release\Ambient Control.obj"
@@ -87,7 +87,7 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2C.tmp" with content
.\Release\worldman.obj .\Release\worldman.obj
.\Release\XML_ExplosionData.obj .\Release\XML_ExplosionData.obj
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2C.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP214.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
Ambient Control.cpp Ambient Control.cpp
@@ -132,7 +132,7 @@ Creating library...
--------------------Configuration: Standard Gaming Platform - Win32 Release-------------------- --------------------Configuration: Standard Gaming Platform - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2D.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP215.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\\" /I "..\TileEngine" /I "..\Tactical" /I "..\Utils" /I "..\strategic" /I ".\\" /D "NO_ZLIB" /D "JA2_PRECOMPILED_HEADERS" /D "NO_ZLIB_COMPRESSION" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR".\Release/" /Fp".\Release/Standard Gaming Platform.pch" /YX"JA2 SGP ALL.H" /Fo".\Release/" /Fd".\Release/" /FD /c /nologo /MT /W3 /GX /O2 /I "..\\" /I "..\TileEngine" /I "..\Tactical" /I "..\Utils" /I "..\strategic" /I ".\\" /D "NO_ZLIB" /D "JA2_PRECOMPILED_HEADERS" /D "NO_ZLIB_COMPRESSION" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR".\Release/" /Fp".\Release/Standard Gaming Platform.pch" /YX"JA2 SGP ALL.H" /Fo".\Release/" /Fd".\Release/" /FD /c
"C:\JA2\Build\Standard Gaming Platform\Button Sound Control.cpp" "C:\JA2\Build\Standard Gaming Platform\Button Sound Control.cpp"
@@ -172,14 +172,14 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2D.tmp" with content
"C:\JA2\Build\Standard Gaming Platform\vsurface.cpp" "C:\JA2\Build\Standard Gaming Platform\vsurface.cpp"
"C:\JA2\Build\Standard Gaming Platform\WinFont.cpp" "C:\JA2\Build\Standard Gaming Platform\WinFont.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2D.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP215.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2E.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP216.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\\" /I "..\TileEngine" /I "..\Tactical" /I "..\Utils" /I "..\strategic" /I ".\\" /D "NO_ZLIB" /D "JA2_PRECOMPILED_HEADERS" /D "NO_ZLIB_COMPRESSION" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /D "_DEBUG" /FR".\Release/" /Fp".\Release/Standard Gaming Platform.pch" /YX"JA2 SGP ALL.H" /Fo".\Release/" /Fd".\Release/" /FD /c /nologo /MT /W3 /GX /O2 /I "..\\" /I "..\TileEngine" /I "..\Tactical" /I "..\Utils" /I "..\strategic" /I ".\\" /D "NO_ZLIB" /D "JA2_PRECOMPILED_HEADERS" /D "NO_ZLIB_COMPRESSION" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /D "_DEBUG" /FR".\Release/" /Fp".\Release/Standard Gaming Platform.pch" /YX"JA2 SGP ALL.H" /Fo".\Release/" /Fd".\Release/" /FD /c
"C:\JA2\Build\Standard Gaming Platform\DEBUG.cpp" "C:\JA2\Build\Standard Gaming Platform\DEBUG.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2E.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP216.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2F.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP217.tmp" with contents
[ [
/nologo /out:".\Release\Standard Gaming Platform.lib" /nologo /out:".\Release\Standard Gaming Platform.lib"
".\Release\Button Sound Control.obj" ".\Release\Button Sound Control.obj"
@@ -221,7 +221,7 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2F.tmp" with content
".\Release\WinFont.obj" ".\Release\WinFont.obj"
".\ddraw.lib" ".\ddraw.lib"
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP2F.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP217.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
Button Sound Control.cpp Button Sound Control.cpp
@@ -275,7 +275,7 @@ Creating library...
--------------------Configuration: Tactical - Win32 Release-------------------- --------------------Configuration: Tactical - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP30.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP218.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /FR"Release/" /Fp"Release/Tactical.pch" /YX"Tactical All.h" /Fo"Release/" /Fd"Release/" /FD /c /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /FR"Release/" /Fp"Release/Tactical.pch" /YX"Tactical All.h" /Fo"Release/" /Fd"Release/" /FD /c
"C:\JA2\Build\Tactical\Air Raid.cpp" "C:\JA2\Build\Tactical\Air Raid.cpp"
@@ -372,14 +372,14 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP30.tmp" with content
"C:\JA2\Build\Tactical\XML_Sounds.cpp" "C:\JA2\Build\Tactical\XML_Sounds.cpp"
"C:\JA2\Build\Tactical\XML_TonyInventory.cpp" "C:\JA2\Build\Tactical\XML_TonyInventory.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP30.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP218.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP31.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP219.tmp" with contents
[ [
/nologo /MT /W3 /GX /Od /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /FR"Release/" /Fp"Release/Tactical.pch" /YX"Tactical All.h" /Fo"Release/" /Fd"Release/" /FD /c /nologo /MT /W3 /GX /Od /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /FR"Release/" /Fp"Release/Tactical.pch" /YX"Tactical All.h" /Fo"Release/" /Fd"Release/" /FD /c
"C:\JA2\Build\Tactical\LOS.cpp" "C:\JA2\Build\Tactical\LOS.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP31.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP219.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP32.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21A.tmp" with contents
[ [
/nologo /out:"Release\Tactical.lib" /nologo /out:"Release\Tactical.lib"
".\Release\Air Raid.obj" ".\Release\Air Raid.obj"
@@ -477,7 +477,7 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP32.tmp" with content
.\Release\XML_Sounds.obj .\Release\XML_Sounds.obj
.\Release\XML_TonyInventory.obj .\Release\XML_TonyInventory.obj
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP32.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21A.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
Air Raid.cpp Air Raid.cpp
@@ -586,7 +586,7 @@ Creating library...
--------------------Configuration: Utils - Win32 Release-------------------- --------------------Configuration: Utils - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP33.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21B.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Utils.pch" /YX"Utils All.h" /Fo"Release/" /Fd"Release/" /FD /c /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Utils.pch" /YX"Utils All.h" /Fo"Release/" /Fd"Release/" /FD /c
"C:\JA2\Build\Utils\_DutchText.cpp" "C:\JA2\Build\Utils\_DutchText.cpp"
@@ -629,8 +629,8 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP33.tmp" with content
"C:\JA2\Build\Utils\XML_Strings.cpp" "C:\JA2\Build\Utils\XML_Strings.cpp"
"C:\JA2\Build\Utils\XML_Strings2.cpp" "C:\JA2\Build\Utils\XML_Strings2.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP33.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21B.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP34.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21C.tmp" with contents
[ [
/nologo /out:"Release\Utils.lib" /nologo /out:"Release\Utils.lib"
.\Release\_DutchText.obj .\Release\_DutchText.obj
@@ -673,7 +673,7 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP34.tmp" with content
.\Release\XML_Strings.obj .\Release\XML_Strings.obj
.\Release\XML_Strings2.obj .\Release\XML_Strings2.obj
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP34.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21C.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
_DutchText.cpp _DutchText.cpp
@@ -732,7 +732,7 @@ Creating library...
--------------------Configuration: TacticalAI - Win32 Release-------------------- --------------------Configuration: TacticalAI - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP35.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21D.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/TacticalAI.pch" /YX"AI All.h" /Fo"Release/" /Fd"Release/" /FD /c /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\Editor" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/TacticalAI.pch" /YX"AI All.h" /Fo"Release/" /Fd"Release/" /FD /c
"C:\JA2\Build\TacticalAI\AIList.cpp" "C:\JA2\Build\TacticalAI\AIList.cpp"
@@ -750,8 +750,8 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP35.tmp" with content
"C:\JA2\Build\TacticalAI\QuestDebug.cpp" "C:\JA2\Build\TacticalAI\QuestDebug.cpp"
"C:\JA2\Build\TacticalAI\Realtime.cpp" "C:\JA2\Build\TacticalAI\Realtime.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP35.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21D.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP36.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21E.tmp" with contents
[ [
/nologo /out:"Release\TacticalAI.lib" /nologo /out:"Release\TacticalAI.lib"
.\Release\AIList.obj .\Release\AIList.obj
@@ -769,7 +769,7 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP36.tmp" with content
.\Release\QuestDebug.obj .\Release\QuestDebug.obj
.\Release\Realtime.obj .\Release\Realtime.obj
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP36.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21E.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
AIList.cpp AIList.cpp
@@ -792,7 +792,7 @@ Creating library...
--------------------Configuration: Editor - Win32 Release-------------------- --------------------Configuration: Editor - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP37.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21F.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /Ob2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Editor.pch" /YX"Editor All.h" /Fo"Release/" /Fd"Release/" /FD /c /nologo /MT /W3 /GX /O2 /Ob2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\strategic" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Editor.pch" /YX"Editor All.h" /Fo"Release/" /Fd"Release/" /FD /c
"C:\JA2\Build\Editor\Cursor Modes.cpp" "C:\JA2\Build\Editor\Cursor Modes.cpp"
@@ -820,8 +820,8 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP37.tmp" with content
"C:\JA2\Build\Editor\smooth.cpp" "C:\JA2\Build\Editor\smooth.cpp"
"C:\JA2\Build\Editor\Smoothing Utils.cpp" "C:\JA2\Build\Editor\Smoothing Utils.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP37.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP21F.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP38.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP220.tmp" with contents
[ [
/nologo /out:"Release\Editor.lib" /nologo /out:"Release\Editor.lib"
".\Release\Cursor Modes.obj" ".\Release\Cursor Modes.obj"
@@ -849,11 +849,10 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP38.tmp" with content
.\Release\smooth.obj .\Release\smooth.obj
".\Release\Smoothing Utils.obj" ".\Release\Smoothing Utils.obj"
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP38.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP220.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
Cursor Modes.cpp Cursor Modes.cpp
GENERATED PCH FOR EDITOR PROJECT.
edit_sys.cpp edit_sys.cpp
Editor Callbacks.cpp Editor Callbacks.cpp
Editor Modes.cpp Editor Modes.cpp
@@ -882,7 +881,7 @@ Creating library...
--------------------Configuration: Laptop - Win32 Release-------------------- --------------------Configuration: Laptop - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP39.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP221.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Laptop.pch" /YX"Laptop All.h" /Fo"Release/" /Fd"Release/" /FD /c /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\strategic" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Laptop.pch" /YX"Laptop All.h" /Fo"Release/" /Fd"Release/" /FD /c
"C:\JA2\Build\Laptop\aim.cpp" "C:\JA2\Build\Laptop\aim.cpp"
@@ -943,8 +942,8 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP39.tmp" with content
"C:\JA2\Build\Laptop\sirtech.cpp" "C:\JA2\Build\Laptop\sirtech.cpp"
"C:\JA2\Build\Laptop\Store Inventory.cpp" "C:\JA2\Build\Laptop\Store Inventory.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP39.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP221.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3A.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP222.tmp" with contents
[ [
/nologo /out:"Release\Laptop.lib" /nologo /out:"Release\Laptop.lib"
.\Release\aim.obj .\Release\aim.obj
@@ -1005,7 +1004,7 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3A.tmp" with content
.\Release\sirtech.obj .\Release\sirtech.obj
".\Release\Store Inventory.obj" ".\Release\Store Inventory.obj"
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3A.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP222.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
aim.cpp aim.cpp
@@ -1071,7 +1070,7 @@ Creating library...
--------------------Configuration: Strategic - Win32 Release-------------------- --------------------Configuration: Strategic - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3B.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP223.tmp" with contents
[ [
/nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Strategic.pch" /YX"Strategic All.h" /Fo"Release/" /Fd"Release/" /FD /c /nologo /MT /W3 /GX /O2 /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/Strategic.pch" /YX"Strategic All.h" /Fo"Release/" /Fd"Release/" /FD /c
"C:\JA2\Build\Strategic\AI Viewer.cpp" "C:\JA2\Build\Strategic\AI Viewer.cpp"
@@ -1094,12 +1093,14 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3B.tmp" with content
"C:\JA2\Build\Strategic\mapscreen.cpp" "C:\JA2\Build\Strategic\mapscreen.cpp"
"C:\JA2\Build\Strategic\Meanwhile.cpp" "C:\JA2\Build\Strategic\Meanwhile.cpp"
"C:\JA2\Build\Strategic\Merc Contract.cpp" "C:\JA2\Build\Strategic\Merc Contract.cpp"
"C:\JA2\Build\Strategic\MilitiaSquads.cpp"
"C:\JA2\Build\Strategic\Player Command.cpp" "C:\JA2\Build\Strategic\Player Command.cpp"
"C:\JA2\Build\Strategic\PreBattle Interface.cpp" "C:\JA2\Build\Strategic\PreBattle Interface.cpp"
"C:\JA2\Build\Strategic\Queen Command.cpp" "C:\JA2\Build\Strategic\Queen Command.cpp"
"C:\JA2\Build\Strategic\Quest Debug System.cpp" "C:\JA2\Build\Strategic\Quest Debug System.cpp"
"C:\JA2\Build\Strategic\Quests.cpp" "C:\JA2\Build\Strategic\Quests.cpp"
"C:\JA2\Build\Strategic\QuestText.cpp" "C:\JA2\Build\Strategic\QuestText.cpp"
"C:\JA2\Build\Strategic\Reinforcement.cpp"
"C:\JA2\Build\Strategic\Scheduling.cpp" "C:\JA2\Build\Strategic\Scheduling.cpp"
"C:\JA2\Build\Strategic\Strategic AI.cpp" "C:\JA2\Build\Strategic\Strategic AI.cpp"
"C:\JA2\Build\Strategic\Strategic Event Handler.cpp" "C:\JA2\Build\Strategic\Strategic Event Handler.cpp"
@@ -1115,11 +1116,9 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3B.tmp" with content
"C:\JA2\Build\Strategic\strategic.cpp" "C:\JA2\Build\Strategic\strategic.cpp"
"C:\JA2\Build\Strategic\strategicmap.cpp" "C:\JA2\Build\Strategic\strategicmap.cpp"
"C:\JA2\Build\Strategic\Town Militia.cpp" "C:\JA2\Build\Strategic\Town Militia.cpp"
"C:\JA2\Build\Strategic\MilitiaSquads.cpp"
"C:\JA2\Build\Strategic\Reinforcement.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3B.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP223.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3C.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP224.tmp" with contents
[ [
/nologo /out:"Release\Strategic.lib" /nologo /out:"Release\Strategic.lib"
".\Release\AI Viewer.obj" ".\Release\AI Viewer.obj"
@@ -1142,12 +1141,14 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3C.tmp" with content
.\Release\mapscreen.obj .\Release\mapscreen.obj
.\Release\Meanwhile.obj .\Release\Meanwhile.obj
".\Release\Merc Contract.obj" ".\Release\Merc Contract.obj"
.\Release\MilitiaSquads.obj
".\Release\Player Command.obj" ".\Release\Player Command.obj"
".\Release\PreBattle Interface.obj" ".\Release\PreBattle Interface.obj"
".\Release\Queen Command.obj" ".\Release\Queen Command.obj"
".\Release\Quest Debug System.obj" ".\Release\Quest Debug System.obj"
.\Release\Quests.obj .\Release\Quests.obj
.\Release\QuestText.obj .\Release\QuestText.obj
.\Release\Reinforcement.obj
.\Release\Scheduling.obj .\Release\Scheduling.obj
".\Release\Strategic AI.obj" ".\Release\Strategic AI.obj"
".\Release\Strategic Event Handler.obj" ".\Release\Strategic Event Handler.obj"
@@ -1163,10 +1164,8 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3C.tmp" with content
.\Release\strategic.obj .\Release\strategic.obj
.\Release\strategicmap.obj .\Release\strategicmap.obj
".\Release\Town Militia.obj" ".\Release\Town Militia.obj"
.\Release\MilitiaSquads.obj
.\Release\Reinforcement.obj
] ]
Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3C.tmp" Creating command line "link.exe -lib @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP224.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling... Compiling...
AI Viewer.cpp AI Viewer.cpp
@@ -1190,12 +1189,14 @@ Map Screen Interface.cpp
mapscreen.cpp mapscreen.cpp
Meanwhile.cpp Meanwhile.cpp
Merc Contract.cpp Merc Contract.cpp
MilitiaSquads.cpp
Player Command.cpp Player Command.cpp
PreBattle Interface.cpp PreBattle Interface.cpp
Queen Command.cpp Queen Command.cpp
Quest Debug System.cpp Quest Debug System.cpp
Quests.cpp Quests.cpp
QuestText.cpp QuestText.cpp
Reinforcement.cpp
Scheduling.cpp Scheduling.cpp
Strategic AI.cpp Strategic AI.cpp
Strategic Event Handler.cpp Strategic Event Handler.cpp
@@ -1211,15 +1212,13 @@ Strategic Turns.cpp
strategic.cpp strategic.cpp
strategicmap.cpp strategicmap.cpp
Town Militia.cpp Town Militia.cpp
MilitiaSquads.cpp
Reinforcement.cpp
Creating library... Creating library...
<h3> <h3>
--------------------Configuration: ja2 - Win32 Release-------------------- --------------------Configuration: ja2 - Win32 Release--------------------
</h3> </h3>
<h3>Command Lines</h3> <h3>Command Lines</h3>
Creating command line "rc.exe /l 0x409 /fo"Release/ja2.res" /i "Res" /i ".\Res" /d "NDEBUG" "C:\JA2\Build\Res\ja2.rc"" Creating command line "rc.exe /l 0x409 /fo"Release/ja2.res" /i "Res" /i ".\Res" /d "NDEBUG" "C:\JA2\Build\Res\ja2.rc""
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3D.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP225.tmp" with contents
[ [
/nologo /G5 /MT /W3 /GX /Zi /O2 /Ob2 /I ".\Standard Gaming Platform" /I ".\TileEngine" /I ".\Tactical" /I ".\Utils" /I ".\TacticalAI" /I ".\Editor" /I ".\Strategic" /I ".\laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/JA2.pch" /YX"JA2 All.h" /Fo"Release/" /Fd"Release/" /FD /O2b2 /c /nologo /G5 /MT /W3 /GX /Zi /O2 /Ob2 /I ".\Standard Gaming Platform" /I ".\TileEngine" /I ".\Tactical" /I ".\Utils" /I ".\TacticalAI" /I ".\Editor" /I ".\Strategic" /I ".\laptop" /I ".\\" /D "CALLBACKTIMER" /D "PRECOMPILEDHEADERS" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "XML_STATIC" /D "CINTERFACE" /FR"Release/" /Fp"Release/JA2.pch" /YX"JA2 All.h" /Fo"Release/" /Fd"Release/" /FD /O2b2 /c
"C:\JA2\Build\Utils\_Ja25GermanText.cpp" "C:\JA2\Build\Utils\_Ja25GermanText.cpp"
@@ -1246,8 +1245,8 @@ Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3D.tmp" with content
"C:\JA2\Build\SCREENS.cpp" "C:\JA2\Build\SCREENS.cpp"
"C:\JA2\Build\Sys Globals.cpp" "C:\JA2\Build\Sys Globals.cpp"
] ]
Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3D.tmp" Creating command line "cl.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP225.tmp"
Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3E.tmp" with contents Creating temporary file "C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP226.tmp" with contents
[ [
libexpatMT.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib smackw32.lib mss32.lib /nologo /subsystem:windows /profile /map:"Release/ja2_cvs.map" /machine:I386 /out:"..\ja2_cvs.exe" libexpatMT.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib winmm.lib smackw32.lib mss32.lib /nologo /subsystem:windows /profile /map:"Release/ja2_cvs.map" /machine:I386 /out:"..\ja2_cvs.exe"
.\Release\_Ja25GermanText.obj .\Release\_Ja25GermanText.obj
@@ -1284,7 +1283,7 @@ libexpatMT.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advap
.\Laptop\Release\Laptop.lib .\Laptop\Release\Laptop.lib
.\Strategic\Release\Strategic.lib .\Strategic\Release\Strategic.lib
] ]
Creating command line "link.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP3E.tmp" Creating command line "link.exe @C:\DOCUME~1\Owner\LOCALS~1\Temp\RSP226.tmp"
<h3>Output Window</h3> <h3>Output Window</h3>
Compiling resources... Compiling resources...
Compiling... Compiling...
@@ -1307,7 +1306,6 @@ Init.cpp
Intro.cpp Intro.cpp
JA2 Splash.cpp JA2 Splash.cpp
jascreens.cpp jascreens.cpp
C:\JA2\Build\jascreens.cpp(269) : warning C4101: 'str' : unreferenced local variable
Loading Screen.cpp Loading Screen.cpp
MainMenuScreen.cpp MainMenuScreen.cpp
MessageBoxScreen.cpp MessageBoxScreen.cpp
@@ -1322,7 +1320,7 @@ LINK : warning LNK4089: all references to "ADVAPI32.dll" discarded by /OPT:REF
<h3>Results</h3> <h3>Results</h3>
ja2_cvs.exe - 0 error(s), 2 warning(s) ja2_cvs.exe - 0 error(s), 1 warning(s)
</pre> </pre>
</body> </body>
</html> </html>
+42 -10
View File
@@ -1092,21 +1092,43 @@ BOOLEAN BasicCanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
return( TRUE ); return( TRUE );
} }
// Kaiden: Roaming Militia Training:
// Commenting out the check for:
// IsMilitiaTrainableFromSoldiersSectorMaxed(
// At this point, we don't care if it's full yet
BOOLEAN CanCharacterTrainMilitia( SOLDIERTYPE *pSoldier ) BOOLEAN CanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
{ {
if( BasicCanCharacterTrainMilitia( pSoldier ) &&
if (gGameExternalOptions.gfmusttrainroaming)
{
if( BasicCanCharacterTrainMilitia( pSoldier ) &&
MilitiaTrainingAllowedInSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) &&
DoesSectorMercIsInHaveSufficientLoyaltyToTrainMilitia( pSoldier ) &&
/*( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) == FALSE ) && */
( CountMilitiaTrainersInSoldiersSector( pSoldier ) < gGameExternalOptions.ubMaxMilitiaTrainersPerSector ) )
{
return( TRUE );
}
else
{
return( FALSE );
}
}
else
{
if( BasicCanCharacterTrainMilitia( pSoldier ) &&
MilitiaTrainingAllowedInSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) && MilitiaTrainingAllowedInSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) &&
DoesSectorMercIsInHaveSufficientLoyaltyToTrainMilitia( pSoldier ) && DoesSectorMercIsInHaveSufficientLoyaltyToTrainMilitia( pSoldier ) &&
( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) == FALSE ) && ( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) == FALSE ) &&
( CountMilitiaTrainersInSoldiersSector( pSoldier ) < gGameExternalOptions.ubMaxMilitiaTrainersPerSector ) ) ( CountMilitiaTrainersInSoldiersSector( pSoldier ) < gGameExternalOptions.ubMaxMilitiaTrainersPerSector ) )
{ {
return( TRUE ); return( TRUE );
} }
else else
{ {
return( FALSE ); return( FALSE );
}
} }
} }
@@ -7372,7 +7394,12 @@ void TrainingMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
} }
} }
if( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) )
// Kaiden: Roaming Militia Training:
// Added to the if test here:
// && (!gGameExternalOptions.gfmusttrainroaming)
if( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) && (!gGameExternalOptions.gfmusttrainroaming))
{ {
if( bTownId == BLANK_SECTOR ) if( bTownId == BLANK_SECTOR )
{ {
@@ -7388,7 +7415,12 @@ void TrainingMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL ); DoScreenIndependantMessageBox( sString, MSG_BOX_FLAG_OK, NULL );
break; break;
} }
if ( CountMilitiaTrainersInSoldiersSector( pSoldier ) >= gGameExternalOptions.ubMaxMilitiaTrainersPerSector ) if ( CountMilitiaTrainersInSoldiersSector( pSoldier ) >= gGameExternalOptions.ubMaxMilitiaTrainersPerSector )
{ {
+127 -23
View File
@@ -456,7 +456,9 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
if( !uiMilitiaCount )return; if( !uiMilitiaCount )return;
// new squad
//new squad
if( GetTownIdForSector( sMapX, sMapY ) != BLANK_SECTOR ) if( GetTownIdForSector( sMapX, sMapY ) != BLANK_SECTOR )
{ {
if( GetWorldHour() % gGameExternalOptions.guiCreateEachNHours )return; if( GetWorldHour() % gGameExternalOptions.guiCreateEachNHours )return;
@@ -481,35 +483,41 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%ld,%ld:Dir count %ld, Rand %ld. Go to %ld,%ld", sMapX, sMapY, uiDirNumber, iRandomRes, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] )); //ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%ld,%ld:Dir count %ld, Rand %ld. Go to %ld,%ld", sMapX, sMapY, uiDirNumber, iRandomRes, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ));
GenerateMilitiaSquad( sMapX, sMapY, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
AddToBlockMoveList( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ); // Kaiden: Roaming Militia Training:
// If we're training roaming militia,
// We'll get our new squad elsewhere.
if(!gGameExternalOptions.gfmusttrainroaming)
{
GenerateMilitiaSquad( sMapX, sMapY, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
AddToBlockMoveList( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
if( NumEnemiesInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) && CountAllMilitiaInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) ) if( NumEnemiesInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) && CountAllMilitiaInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) )
{
/* GROUP* pEnemyGroup = GetGroup( GetEnemyGroupIdInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) );
if(pEnemyGroup && pEnemyGroup->ubGroupID)
{ {
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Attacking from %ld,%ld to %ld,%ld - enemy's group id %ld", sMapX, sMapY, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0], pEnemyGroup->ubGroupID )); /* GROUP* pEnemyGroup = GetGroup( GetEnemyGroupIdInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) );
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Arrival 1, Arrival 2");
if(pEnemyGroup && pEnemyGroup->ubGroupID)
{
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Attacking from %ld,%ld to %ld,%ld - enemy's group id %ld", sMapX, sMapY, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0], pEnemyGroup->ubGroupID ));
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Arrival 1, Arrival 2");
pEnemyGroup->ubPrevX = sMapX; pEnemyGroup->ubPrevX = sMapX;
pEnemyGroup->ubPrevY = sMapY; pEnemyGroup->ubPrevY = sMapY;
pEnemyGroup->ubNextX = SECTORX( pMoveDir[ iRandomRes ][0] ); pEnemyGroup->ubNextX = SECTORX( pMoveDir[ iRandomRes ][0] );
pEnemyGroup->ubNextY = SECTORY( pMoveDir[ iRandomRes ][0] ); pEnemyGroup->ubNextY = SECTORY( pMoveDir[ iRandomRes ][0] );
*/ */
gfMSBattle = TRUE; gfMSBattle = TRUE;
// GroupArrivedAtSector( pEnemyGroup->ubGroupID , TRUE, FALSE ); // GroupArrivedAtSector( pEnemyGroup->ubGroupID , TRUE, FALSE );
EnterAutoResolveMode( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ); EnterAutoResolveMode( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
// } // }
}
} }
} }
else return; else return;
} }
// moving squad, if it is not a SAM site // moving squad, if it is not a SAM site
else if(!IsThisSectorASAMSector( sMapX, sMapY, 0 )) else if(!IsThisSectorASAMSector( sMapX, sMapY, 0 ))
if( !PlayerMercsInSector_MSE( (UINT8)sMapX, (UINT8)sMapY, FALSE ) ) // and there's no player's mercs in the sector if( !PlayerMercsInSector_MSE( (UINT8)sMapX, (UINT8)sMapY, FALSE ) ) // and there's no player's mercs in the sector
@@ -581,6 +589,102 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
} }
// Kaiden: Roaming Militia Training:
// If we're training roaming militia,
// we'll get our squad from here:
void CreateMilitiaSquads(INT16 sMapX, INT16 sMapY )
{
UINT16 pMoveDir[4][3];
UINT8 uiDirNumber = 0;
UINT32 iRandomRes = 0, iRandom = 0;
UINT8 x;//,y;
SECTORINFO *pSectorInfo = &( SectorInfo[ SECTOR( sMapX, sMapY ) ] );
UINT8 uiMilitiaCount;
if( !gGameExternalOptions.gfAllowMilitiaGroups )
return;
if( sMapX == 1 && sMapY == 1 )
{
ClearBlockMoveList();
gfMSBattle = FALSE;
}
if( CheckInBlockMoveList( sMapX, sMapY ) )return;
uiMilitiaCount = CountMilitia(pSectorInfo);
if( !uiMilitiaCount )return;
// new squad
if(gGameExternalOptions.gfmusttrainroaming)
{
if( GetTownIdForSector( sMapX, sMapY ) != BLANK_SECTOR )
{
GenerateDirectionInfos( sMapX, sMapY, &uiDirNumber, pMoveDir, FALSE, FALSE, FALSE );
if(uiDirNumber)// && Random(100) < CHANCE_TO_GENERATE_A_SQUAD)
{
for( x = 1; x < uiDirNumber ; ++x )pMoveDir[x][1] += pMoveDir[x-1][1];
iRandomRes = Random( pMoveDir[ uiDirNumber - 1 ][1] );
for( x = 0; x < uiDirNumber; ++x)
if( iRandomRes < pMoveDir[x][1] )
{
iRandomRes = x;
break;
}
// shouldn't be!
if(iRandomRes >= uiDirNumber)iRandomRes = 0;
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%ld,%ld:Dir count %ld, Rand %ld. Go to %ld,%ld", sMapX, sMapY, uiDirNumber, iRandomRes, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ));
GenerateMilitiaSquad( sMapX, sMapY, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
AddToBlockMoveList( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
if( NumEnemiesInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) && CountAllMilitiaInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) )
{
/* GROUP* pEnemyGroup = GetGroup( GetEnemyGroupIdInSector( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) ) );
if(pEnemyGroup && pEnemyGroup->ubGroupID)
{
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Attacking from %ld,%ld to %ld,%ld - enemy's group id %ld", sMapX, sMapY, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0], pEnemyGroup->ubGroupID ));
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"Arrival 1, Arrival 2");
pEnemyGroup->ubPrevX = sMapX;
pEnemyGroup->ubPrevY = sMapY;
pEnemyGroup->ubNextX = SECTORX( pMoveDir[ iRandomRes ][0] );
pEnemyGroup->ubNextY = SECTORY( pMoveDir[ iRandomRes ][0] );
*/
gfMSBattle = TRUE;
// GroupArrivedAtSector( pEnemyGroup->ubGroupID , TRUE, FALSE );
EnterAutoResolveMode( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
// }
}
}
else return;
}
}
return;
}
extern BOOLEAN gfMSResetMilitia; extern BOOLEAN gfMSResetMilitia;
void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY ) void DoMilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY )
+1
View File
@@ -12,6 +12,7 @@ extern UINT8 gpAttackDirs[5][4];
extern UINT8 guiDirNumber; extern UINT8 guiDirNumber;
void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY ); void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY );
void CreateMilitiaSquads(INT16 sMapX, INT16 sMapY );
void MilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY ); void MilitiaHelpFromAdjacentSectors( INT16 sMapX, INT16 sMapY );
void GenerateDirectionInfos( INT16 sMapX, INT16 sMapY, UINT8* uiDirNumber, UINT16 pMoveDir[4][3], BOOLEAN fWithCities, BOOLEAN fForBattle, BOOLEAN fOnlyCitySectors ); void GenerateDirectionInfos( INT16 sMapX, INT16 sMapY, UINT8* uiDirNumber, UINT16 pMoveDir[4][3], BOOLEAN fWithCities, BOOLEAN fForBattle, BOOLEAN fOnlyCitySectors );
+16 -8
View File
@@ -315,6 +315,10 @@ SOURCE=".\Merc Contract.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\MilitiaSquads.cpp
# End Source File
# Begin Source File
SOURCE=".\Player Command.cpp" SOURCE=".\Player Command.cpp"
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -339,6 +343,10 @@ SOURCE=.\QuestText.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\Reinforcement.cpp
# End Source File
# Begin Source File
SOURCE=.\Scheduling.cpp SOURCE=.\Scheduling.cpp
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -475,6 +483,10 @@ SOURCE=".\Merc Contract.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\MilitiaSquads.h
# End Source File
# Begin Source File
SOURCE=".\Player Command.h" SOURCE=".\Player Command.h"
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -491,6 +503,10 @@ SOURCE=.\Quests.h
# End Source File # End Source File
# Begin Source File # Begin Source File
SOURCE=.\Reinforcement.h
# End Source File
# Begin Source File
SOURCE=.\Scheduling.h SOURCE=.\Scheduling.h
# End Source File # End Source File
# Begin Source File # Begin Source File
@@ -546,13 +562,5 @@ SOURCE=.\strategicmap.h
SOURCE=".\Town Militia.h" SOURCE=".\Town Militia.h"
# End Source File # End Source File
# End Group # End Group
# Begin Source File
SOURCE=.\MilitiaSquads.cpp
# End Source File
# Begin Source File
SOURCE=.\Reinforcement.cpp
# End Source File
# End Target # End Target
# End Project # End Project
+233 -97
View File
@@ -24,6 +24,7 @@
#include "GameSettings.h" #include "GameSettings.h"
#endif #endif
#include "MilitiaSquads.h"
#define SIZE_OF_MILITIA_COMPLETED_TRAINING_LIST 50 #define SIZE_OF_MILITIA_COMPLETED_TRAINING_LIST 50
// temporary local global variables // temporary local global variables
@@ -33,6 +34,7 @@ INT16 gsTownSectorServerSkipY = -1;
UINT8 gubTownSectorServerIndex = 0; UINT8 gubTownSectorServerIndex = 0;
BOOLEAN gfYesNoPromptIsForContinue = FALSE; // this flag remembers whether we're starting new training, or continuing BOOLEAN gfYesNoPromptIsForContinue = FALSE; // this flag remembers whether we're starting new training, or continuing
INT32 giTotalCostOfTraining = 0; INT32 giTotalCostOfTraining = 0;
BOOLEAN gfAreWeTrainingMobile = FALSE;
//the completed list of sector soldiers for training militia //the completed list of sector soldiers for training militia
@@ -81,7 +83,7 @@ void TownMilitiaTrainingCompleted( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMa
INT32 iMaxMilitiaPerSector = gGameExternalOptions.iMaxMilitiaPerSector; INT32 iMaxMilitiaPerSector = gGameExternalOptions.iMaxMilitiaPerSector;
INT32 iTrainingSquadSize = gGameExternalOptions.iTrainingSquadSize; INT32 iTrainingSquadSize = gGameExternalOptions.iTrainingSquadSize;
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia1"); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia1");
// get town index // get town index
ubTownId = StrategicMap[ sMapX + sMapY * MAP_WORLD_X ].bNameId; ubTownId = StrategicMap[ sMapX + sMapY * MAP_WORLD_X ].bNameId;
@@ -101,101 +103,149 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia1");
// 4) If not enough GREENS there to promote, promote GREENs in other sectors. // 4) If not enough GREENS there to promote, promote GREENs in other sectors.
// 5) If all friendly sectors of this town are completely filled with REGULAR militia, then training effect is wasted // 5) If all friendly sectors of this town are completely filled with REGULAR militia, then training effect is wasted
while (ubMilitiaTrained < iTrainingSquadSize)
// Kaiden: Roaming Militia Training:
// If we're not training roaming militia,
// then we will handle everything as normal.
if( (IsMilitiaTrainableFromSoldiersSectorMaxed( pTrainer )) && (gGameExternalOptions.gfmusttrainroaming))
{ {
// is there room for another militia in the training sector itself? CreateMilitiaSquads(sMapX, sMapY );
if (CountAllMilitiaInSector(sMapX, sMapY) < iMaxMilitiaPerSector) }
else
{
while (ubMilitiaTrained < iTrainingSquadSize)
{ {
// great! Create a new GREEN militia guy in the training sector // is there room for another militia in the training sector itself?
StrategicAddMilitiaToSector(sMapX, sMapY, GREEN_MILITIA, 1); if (CountAllMilitiaInSector(sMapX, sMapY) < iMaxMilitiaPerSector)
{
// great! Create a new GREEN militia guy in the training sector
StrategicAddMilitiaToSector(sMapX, sMapY, GREEN_MILITIA, 1);
}
else
{
fFoundOne = FALSE;
if( ubTownId != BLANK_SECTOR )
{
InitFriendlyTownSectorServer(ubTownId, sMapX, sMapY);
// check other eligible sectors in this town for room for another militia
while( ServeNextFriendlySectorInTown( &sNeighbourX, &sNeighbourY ) )
{
// is there room for another militia in this neighbouring sector ?
if (CountAllMilitiaInSector(sNeighbourX, sNeighbourY) < iMaxMilitiaPerSector)
{
// great! Create a new GREEN militia guy in the neighbouring sector
StrategicAddMilitiaToSector(sNeighbourX, sNeighbourY, GREEN_MILITIA, 1);
fFoundOne = TRUE;
break;
}
}
}
// if we still haven't been able to train anyone
if (!fFoundOne)
{
// alrighty, then. We'll have to *promote* guys instead.
// are there any GREEN militia men in the training sector itself?
if (MilitiaInSectorOfRank(sMapX, sMapY, GREEN_MILITIA) > 0)
{
// great! Promote a GREEN militia guy in the training sector to a REGULAR
StrategicPromoteMilitiaInSector(sMapX, sMapY, GREEN_MILITIA, 1);
fFoundOne = TRUE;
}
else
{
if( ubTownId != BLANK_SECTOR )
{
// dammit! Last chance - try to find other eligible sectors in the same town with a Green guy to be promoted
InitFriendlyTownSectorServer(ubTownId, sMapX, sMapY);
// check other eligible sectors in this town for room for another militia
while( ServeNextFriendlySectorInTown( &sNeighbourX, &sNeighbourY ) )
{
// are there any GREEN militia men in the neighbouring sector ?
if (MilitiaInSectorOfRank(sNeighbourX, sNeighbourY, GREEN_MILITIA) > 0)
{
// great! Promote a GREEN militia guy in the neighbouring sector to a REGULAR
StrategicPromoteMilitiaInSector(sNeighbourX, sNeighbourY, GREEN_MILITIA, 1);
fFoundOne = TRUE;
break;
}
}
}
// Kaiden: Veteran militia training
// This is essentially copy/pasted from above
// But the names have been changed to protect the innocent
if ((!fFoundOne) && (gGameExternalOptions.gfTrainVeteranMilitia))
{
// are there any REGULAR militia men in the training sector itself?
if (MilitiaInSectorOfRank(sMapX, sMapY, REGULAR_MILITIA) > 0)
{
// great! Promote a REGULAR militia guy in the training sector to a REGULAR
StrategicPromoteMilitiaInSector(sMapX, sMapY, REGULAR_MILITIA, 1);
fFoundOne = TRUE;
}
else
{
if( ubTownId != BLANK_SECTOR )
{
// dammit! Last chance - try to find other eligible sectors in the same town with a Green guy to be promoted
InitFriendlyTownSectorServer(ubTownId, sMapX, sMapY);
// check other eligible sectors in this town for room for another militia
while( ServeNextFriendlySectorInTown( &sNeighbourX, &sNeighbourY ) )
{
// are there any REGULAR militia men in the neighbouring sector ?
if (MilitiaInSectorOfRank(sNeighbourX, sNeighbourY, REGULAR_MILITIA) > 0)
{
// great! Promote a GREEN militia guy in the neighbouring sector to a REGULAR
StrategicPromoteMilitiaInSector(sNeighbourX, sNeighbourY, REGULAR_MILITIA, 1);
fFoundOne = TRUE;
break;
}
}
}
}
}
// if we still haven't been able to train anyone
if (!fFoundOne)
{
// Well, that's it. All eligible sectors of this town are full of REGULARs or ELITEs.
// The training goes to waste in this situation.
break; // the main while loop
}
}
}
}
// next, please!
ubMilitiaTrained++;
} }
else
// if anyone actually got trained
if (ubMilitiaTrained > 0)
{ {
fFoundOne = FALSE; // update the screen display
fMapPanelDirty = TRUE;
if( ubTownId != BLANK_SECTOR ) if( ubTownId != BLANK_SECTOR )
{ {
InitFriendlyTownSectorServer(ubTownId, sMapX, sMapY); // loyalty in this town increases a bit because we obviously care about them...
IncrementTownLoyalty( ubTownId, LOYALTY_BONUS_FOR_TOWN_TRAINING );
// check other eligible sectors in this town for room for another militia
while( ServeNextFriendlySectorInTown( &sNeighbourX, &sNeighbourY ) )
{
// is there room for another militia in this neighbouring sector ?
if (CountAllMilitiaInSector(sNeighbourX, sNeighbourY) < iMaxMilitiaPerSector)
{
// great! Create a new GREEN militia guy in the neighbouring sector
StrategicAddMilitiaToSector(sNeighbourX, sNeighbourY, GREEN_MILITIA, 1);
fFoundOne = TRUE;
break;
}
}
} }
// if we still haven't been able to train anyone
if (!fFoundOne)
{
// alrighty, then. We'll have to *promote* guys instead.
// are there any GREEN militia men in the training sector itself?
if (MilitiaInSectorOfRank(sMapX, sMapY, GREEN_MILITIA) > 0)
{
// great! Promote a GREEN militia guy in the training sector to a REGULAR
StrategicPromoteMilitiaInSector(sMapX, sMapY, GREEN_MILITIA, 1);
}
else
{
if( ubTownId != BLANK_SECTOR )
{
// dammit! Last chance - try to find other eligible sectors in the same town with a Green guy to be promoted
InitFriendlyTownSectorServer(ubTownId, sMapX, sMapY);
// check other eligible sectors in this town for room for another militia
while( ServeNextFriendlySectorInTown( &sNeighbourX, &sNeighbourY ) )
{
// are there any GREEN militia men in the neighbouring sector ?
if (MilitiaInSectorOfRank(sNeighbourX, sNeighbourY, GREEN_MILITIA) > 0)
{
// great! Promote a GREEN militia guy in the neighbouring sector to a REGULAR
StrategicPromoteMilitiaInSector(sNeighbourX, sNeighbourY, GREEN_MILITIA, 1);
fFoundOne = TRUE;
break;
}
}
}
// if we still haven't been able to train anyone
if (!fFoundOne)
{
// Well, that's it. All eligible sectors of this town are full of REGULARs or ELITEs.
// The training goes to waste in this situation.
break; // the main while loop
}
}
}
} }
// next, please!
ubMilitiaTrained++;
} }
// if anyone actually got trained
if (ubMilitiaTrained > 0)
{
// update the screen display
fMapPanelDirty = TRUE;
if( ubTownId != BLANK_SECTOR )
{
// loyalty in this town increases a bit because we obviously care about them...
IncrementTownLoyalty( ubTownId, LOYALTY_BONUS_FOR_TOWN_TRAINING );
}
}
// the trainer announces to player that he's finished his assignment. Make his sector flash! // the trainer announces to player that he's finished his assignment. Make his sector flash!
AssignmentDone( pTrainer, TRUE, FALSE ); AssignmentDone( pTrainer, TRUE, FALSE );
@@ -519,9 +569,21 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia2");
iNumberOfSectors = GetNumberOfUnpaidTrainableSectors( ); iNumberOfSectors = GetNumberOfUnpaidTrainableSectors( );
Assert( iNumberOfSectors > 0 ); Assert( iNumberOfSectors > 0 );
// Kaiden: Roaming Militia Training:
// We want to charge more for Roaming
// get total cost // get total cost
giTotalCostOfTraining = iMilitiaTrainingCost * iNumberOfSectors; if( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) && (gGameExternalOptions.gfmusttrainroaming))
Assert( giTotalCostOfTraining > 0 ); {
giTotalCostOfTraining = (iMilitiaTrainingCost*gGameExternalOptions.iMilitiaCostModifier) * iNumberOfSectors;
Assert( giTotalCostOfTraining > 0 );
gfAreWeTrainingMobile = TRUE;
}
else
{
giTotalCostOfTraining = iMilitiaTrainingCost * iNumberOfSectors;
Assert( giTotalCostOfTraining > 0 );
}
gfYesNoPromptIsForContinue = FALSE; gfYesNoPromptIsForContinue = FALSE;
@@ -579,6 +641,7 @@ void HandleInterfaceMessageForContinuingTrainingMilitia( SOLDIERTYPE *pSoldier )
INT32 iMinLoyaltyToTrain = gGameExternalOptions.iMinLoyaltyToTrain; INT32 iMinLoyaltyToTrain = gGameExternalOptions.iMinLoyaltyToTrain;
INT32 iMilitiaTrainingCost = gGameExternalOptions.iMilitiaTrainingCost; INT32 iMilitiaTrainingCost = gGameExternalOptions.iMilitiaTrainingCost;
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia3"); DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia3");
sSectorX = pSoldier->sSectorX; sSectorX = pSoldier->sSectorX;
@@ -599,7 +662,12 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia3");
return; return;
} }
if ( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) ) // Kaiden: Roaming Militia Training:
// Changed the if condition from
// if ( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) )
// And we're not training mobile militia from a SAM Site
if (( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier )) && (IsThisSectorASAMSector(sSectorX,sSectorY,0 )))
{ {
// we're full!!! go home! // we're full!!! go home!
bTownId = GetTownIdForSector( sSectorX, sSectorY ); bTownId = GetTownIdForSector( sSectorX, sSectorY );
@@ -618,10 +686,47 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia3");
DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback ); DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback );
return; return;
} }
else
{
if (( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier )) && (!gGameExternalOptions.gfmusttrainroaming))
{
// we're full!!! go home!
bTownId = GetTownIdForSector( sSectorX, sSectorY );
if ( bTownId == BLANK_SECTOR )
{
// wilderness SAM site
GetSectorIDString( sSectorX, sSectorY, 0, sStringB, TRUE );
void (*tempFptr)(INT16 , INT16 , INT8 , CHAR16 *, BOOLEAN) = GetSectorIDString;
swprintf( (wchar_t *)sString, (wchar_t *)pMilitiaConfirmStrings[ 10 ], sStringB, tempFptr, iMinLoyaltyToTrain );
}
else
{
// town
swprintf( (wchar_t *)sString, (wchar_t *)pMilitiaConfirmStrings[ 10 ], pTownNames[ bTownId ], iMinLoyaltyToTrain );
}
DoContinueMilitiaTrainingMessageBox( sSectorX, sSectorY, sString, MSG_BOX_FLAG_OK, CantTrainMilitiaOkBoxCallback );
return;
}
}
// continue training always handles just one sector at a time
giTotalCostOfTraining = iMilitiaTrainingCost;
// Kaiden: Roaming Militia Training:
// Charging more to train Roaming Militia
if ( IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier ) && (gGameExternalOptions.gfmusttrainroaming))
{
giTotalCostOfTraining = (iMilitiaTrainingCost*gGameExternalOptions.iMilitiaCostModifier);
gfAreWeTrainingMobile = TRUE;
}
else
{
// continue training always handles just one sector at a time
giTotalCostOfTraining = iMilitiaTrainingCost;
}
// can player afford to continue training? // can player afford to continue training?
if( LaptopSaveInfo.iCurrentBalance < giTotalCostOfTraining ) if( LaptopSaveInfo.iCurrentBalance < giTotalCostOfTraining )
{ {
@@ -804,9 +909,19 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia4");
if( SectorOursAndPeaceful( sSectorX, sSectorY, 0 ) ) if( SectorOursAndPeaceful( sSectorX, sSectorY, 0 ) )
{ {
// don't count GREEN militia, they can be trained into regulars first // don't count GREEN militia, they can be trained into regulars first
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, REGULAR_MILITIA ); // Kaiden: Veteran Militia Training:
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, ELITE_MILITIA ); // And we don't count regulars either if we're training veterans
iMaxNumber += iMaxMilitiaPerSector; if (gGameExternalOptions.gfTrainVeteranMilitia)
{
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, ELITE_MILITIA );
iMaxNumber += iMaxMilitiaPerSector;
}
else
{
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, REGULAR_MILITIA );
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, ELITE_MILITIA );
iMaxNumber += iMaxMilitiaPerSector;
}
} }
} }
@@ -840,11 +955,23 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia5");
if( SectorOursAndPeaceful( sSectorX, sSectorY, 0 ) ) if( SectorOursAndPeaceful( sSectorX, sSectorY, 0 ) )
{ {
// don't count GREEN militia, they can be trained into regulars first // don't count GREEN militia, they can be trained into regulars first
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, REGULAR_MILITIA );
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, ELITE_MILITIA ); // Kaiden: Veteran Militia Training:
iMaxNumber += iMaxMilitiaPerSector; // And we don't count regulars either if we're training veterans
if (gGameExternalOptions.gfTrainVeteranMilitia)
{
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, ELITE_MILITIA );
iMaxNumber += iMaxMilitiaPerSector;
}
else
{
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, REGULAR_MILITIA );
iNumberOfMilitia += MilitiaInSectorOfRank( sSectorX, sSectorY, ELITE_MILITIA );
iMaxNumber += iMaxMilitiaPerSector;
}
} }
// now check the number of militia // now check the number of militia
if ( iMaxNumber > iNumberOfMilitia ) if ( iMaxNumber > iNumberOfMilitia )
{ {
@@ -1123,8 +1250,17 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia6");
Assert( SectorInfo[ ubSector ].fMilitiaTrainingPaid == FALSE ); Assert( SectorInfo[ ubSector ].fMilitiaTrainingPaid == FALSE );
// spend the money // spend the money
AddTransactionToPlayersBook( TRAIN_TOWN_MILITIA, ubSector, GetWorldTotalMin(), -( iMilitiaTrainingCost ) ); // Kaiden: Roaming Militia Training:
// Charging more to train Roaming Militia
if ( gfAreWeTrainingMobile)
{
AddTransactionToPlayersBook( TRAIN_TOWN_MILITIA, ubSector, GetWorldTotalMin(), -( iMilitiaTrainingCost*gGameExternalOptions.iMilitiaCostModifier ) );
gfAreWeTrainingMobile = FALSE;
}
else
{
AddTransactionToPlayersBook( TRAIN_TOWN_MILITIA, ubSector, GetWorldTotalMin(), -( iMilitiaTrainingCost ) );
}
// mark this sector sectors as being paid up // mark this sector sectors as being paid up
SectorInfo[ ubSector ].fMilitiaTrainingPaid = TRUE; SectorInfo[ ubSector ].fMilitiaTrainingPaid = TRUE;
+5 -3
View File
@@ -27,9 +27,11 @@
#ifdef JA2BETAVERSION #ifdef JA2BETAVERSION
#define SGP_DEBUG #ifndef JA2EDITOR
#define FORCE_ASSERTS_ON #define SGP_DEBUG
#define SGP_VIDEO_DEBUGGING #define FORCE_ASSERTS_ON
#define SGP_VIDEO_DEBUGGING
#endif
#endif #endif
//#define CRIPPLED_VERSION //#define CRIPPLED_VERSION