mirror of
https://github.com/1dot13/source.git
synced 2026-08-19 14:20:30 +02:00
- Added INI options for RESTRICT_ROAMING and REVEAL_ITEMS_AFTER_COMBAT
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@857 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -57,6 +57,9 @@
|
||||
#define DIR_SOUTH 2
|
||||
#define DIR_WEST 3
|
||||
|
||||
INT32 iRestrictedSectorArraySize;
|
||||
UINT32 gRestrictMilitia[256];
|
||||
|
||||
UINT8 gpAttackDirs[5][4]; // 0. Green Militia 1. Regular Militia 2. Elite Militia 3. Insertion code
|
||||
UINT8 guiDirNumber = 0;
|
||||
BOOLEAN gfMSBattle = FALSE;
|
||||
@@ -509,6 +512,16 @@ void UpdateMilitiaSquads(INT16 sMapX, INT16 sMapY )
|
||||
return;
|
||||
|
||||
//ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_INTERFACE, L"%ld,%ld:Dir count %ld, Rand %ld. Go to %ld,%ld. Have %ld militia men", sMapX, sMapY, uiDirNumber, iRandomRes, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ), uiMilitiaCount);
|
||||
//Kaiden: if Restricted Sectors List option is turned on,
|
||||
// militia can't move to any sectors in the list.
|
||||
// Unless they are following a group of mercs.
|
||||
if (gGameExternalOptions.gflimitedRoaming)
|
||||
for (INT32 i=0;i<iRestrictedSectorArraySize; ++i)
|
||||
{
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,String("RestrictedSectors, %d", gRestrictMilitia[i]));
|
||||
if(pMoveDir[iRandomRes][0] == gRestrictMilitia[i])
|
||||
return;
|
||||
}
|
||||
|
||||
MoveMilitiaSquad( sMapX, sMapY, SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ), FALSE );
|
||||
AddToBlockMoveList( SECTORX( pMoveDir[ iRandomRes ][0] ), SECTORY( pMoveDir[ iRandomRes ][0] ) );
|
||||
|
||||
@@ -405,6 +405,14 @@ SOURCE=.\strategicmap.cpp
|
||||
|
||||
SOURCE=".\Town Militia.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\XML_Army.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\XML_Roaming.cpp
|
||||
# End Source File
|
||||
# End Group
|
||||
# Begin Group "Header Files"
|
||||
|
||||
|
||||
@@ -208,7 +208,7 @@ void TownMilitiaTrainingCompleted( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMa
|
||||
// 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
|
||||
// great! Promote a REGULAR militia guy in the training sector to a VETERAN
|
||||
StrategicPromoteMilitiaInSector(sMapX, sMapY, REGULAR_MILITIA, 1);
|
||||
fFoundOne = TRUE;
|
||||
}
|
||||
@@ -216,7 +216,7 @@ void TownMilitiaTrainingCompleted( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMa
|
||||
{
|
||||
if( ubTownId != BLANK_SECTOR )
|
||||
{
|
||||
// dammit! Last chance - try to find other eligible sectors in the same town with a Green guy to be promoted
|
||||
// dammit! Last chance - try to find other eligible sectors in the same town with a Regular guy to be promoted
|
||||
InitFriendlyTownSectorServer(ubTownId, sMapX, sMapY);
|
||||
|
||||
// check other eligible sectors in this town for room for another militia
|
||||
@@ -225,7 +225,7 @@ void TownMilitiaTrainingCompleted( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMa
|
||||
// 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
|
||||
// great! Promote a Regular militia guy in the neighbouring sector to a Veteran
|
||||
StrategicPromoteMilitiaInSector(sNeighbourX, sNeighbourY, REGULAR_MILITIA, 1);
|
||||
|
||||
fFoundOne = TRUE;
|
||||
|
||||
Reference in New Issue
Block a user