mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
**********************************************************
** Big Maps Projects code (incl. Multiplayer v1.5 ** ********************************************************** - Merged Big Maps Project code from BMP+MP trunk (Revision: 3340) o Complete SVN Revision history: https://81.169.133.124/source/ja2/branches/Wanne/JA2%201.13%20MP - Before THIS merge, I made a branch of the existing 1.13 source o SVN Branch: https://81.169.133.124/source/ja2/branches/JA2_rev.3336/src - Removed old VS 6.0 and VS 2003 project and solutions files, because compilation is broken long time ago - I will add VS 2010 projects and solution file in the next few days git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@3341 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+55
-87
@@ -166,6 +166,7 @@ MOUSE_REGION gContractMenuRegion[ MAX_CONTRACT_MENU_STRING_COUNT ];
|
||||
MOUSE_REGION gRemoveMercAssignRegion[ MAX_REMOVE_MERC_COUNT ];
|
||||
MOUSE_REGION gEpcMenuRegion[ MAX_EPC_MENU_STRING_COUNT ];
|
||||
MOUSE_REGION gRepairMenuRegion[ 20 ];
|
||||
|
||||
// mouse region for vehicle menu
|
||||
MOUSE_REGION gVehicleMenuRegion[ 20 ];
|
||||
// HEADROCK HAM 3.6: Facility Menu
|
||||
@@ -512,7 +513,6 @@ BOOLEAN IsSoldierCloseEnoughToADoctor( SOLDIERTYPE *pPatient );
|
||||
*/
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
// HEADROCK HAM 3.6: Added argument for separation of Mobile/Town Militia
|
||||
void VerifyTownTrainingIsPaidFor( void );
|
||||
#endif
|
||||
|
||||
@@ -1067,8 +1067,7 @@ BOOLEAN CanCharacterPatient( SOLDIERTYPE *pSoldier )
|
||||
}
|
||||
|
||||
|
||||
// This function tests whether this sector EVER allows Militia Training, and whether the character is at all capable
|
||||
// of taking an assignment.
|
||||
|
||||
BOOLEAN BasicCanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
/////////////////////////////////////////////////////
|
||||
@@ -1081,17 +1080,16 @@ BOOLEAN BasicCanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// Is character dead or unconscious?
|
||||
// make sure character is alive and conscious
|
||||
if( pSoldier->stats.bLife < OKLIFE )
|
||||
{
|
||||
// dead or unconscious...
|
||||
return ( FALSE );
|
||||
}
|
||||
|
||||
// Is character underground?
|
||||
// underground training is not allowed (code doesn't support and it's a reasonable enough limitation)
|
||||
if( pSoldier->bSectorZ != 0 )
|
||||
{
|
||||
// underground training is not allowed (code doesn't support and it's a reasonable enough limitation)
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
@@ -1120,7 +1118,7 @@ BOOLEAN BasicCanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
// IS character inside a helicopter over a hostile sector?
|
||||
// check in helicopter in hostile sector
|
||||
if( pSoldier->bAssignment == VEHICLE )
|
||||
{
|
||||
if( ( iHelicopterVehicleId != -1 ) && ( pSoldier->iVehicleId == iHelicopterVehicleId ) )
|
||||
@@ -1183,7 +1181,6 @@ BOOLEAN BasicCanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
|
||||
|
||||
return ( TRUE );
|
||||
}
|
||||
|
||||
// Determines whether the character has the required condition to train Militia at this time.
|
||||
// The conditions tested in this function might change WHILE THE CHARACTER IS ALREADY TRAINING MILITIA, which is
|
||||
// how this function is normally different from "BasicCan...".
|
||||
@@ -2193,7 +2190,6 @@ void VerifyTownTrainingIsPaidFor( void )
|
||||
|
||||
pSoldier = &Menptr[ gCharactersList[ iCounter ].usSolID ];
|
||||
|
||||
// HEADROCK HAM 3.6: New argument controls testing for Mobiles/Garrisons separately.
|
||||
if( pSoldier->bActive && ( pSoldier->bAssignment == TRAIN_TOWN ) )
|
||||
{
|
||||
// make sure that sector is paid up!
|
||||
@@ -4530,32 +4526,31 @@ BOOLEAN TrainTownInSector( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMapY, INT1
|
||||
|
||||
|
||||
// increase town's training completed percentage
|
||||
// HEADROCK HAM 3.6: New town data for training Mobile Militia.
|
||||
if (pTrainer->bAssignment == TRAIN_TOWN)
|
||||
{
|
||||
pSectorInfo->ubMilitiaTrainingPercentDone += (sTrainingPts / 100);
|
||||
pSectorInfo->ubMilitiaTrainingHundredths += (sTrainingPts % 100);
|
||||
pSectorInfo->ubMilitiaTrainingPercentDone += (sTrainingPts / 100);
|
||||
pSectorInfo->ubMilitiaTrainingHundredths += (sTrainingPts % 100);
|
||||
|
||||
if (pSectorInfo->ubMilitiaTrainingHundredths >= 100)
|
||||
{
|
||||
pSectorInfo->ubMilitiaTrainingPercentDone++;
|
||||
pSectorInfo->ubMilitiaTrainingHundredths -= 100;
|
||||
}
|
||||
if (pSectorInfo->ubMilitiaTrainingHundredths >= 100)
|
||||
{
|
||||
pSectorInfo->ubMilitiaTrainingPercentDone++;
|
||||
pSectorInfo->ubMilitiaTrainingHundredths -= 100;
|
||||
}
|
||||
|
||||
// NOTE: Leave this at 100, change TOWN_TRAINING_RATE if necessary. This value gets reported to player as a %age!
|
||||
if( pSectorInfo->ubMilitiaTrainingPercentDone >= 100 )
|
||||
{
|
||||
// zero out training completion - there's no carryover to the next training session
|
||||
pSectorInfo->ubMilitiaTrainingPercentDone = 0;
|
||||
pSectorInfo->ubMilitiaTrainingHundredths = 0;
|
||||
// NOTE: Leave this at 100, change TOWN_TRAINING_RATE if necessary. This value gets reported to player as a %age!
|
||||
if( pSectorInfo->ubMilitiaTrainingPercentDone >= 100 )
|
||||
{
|
||||
// zero out training completion - there's no carryover to the next training session
|
||||
pSectorInfo->ubMilitiaTrainingPercentDone = 0;
|
||||
pSectorInfo->ubMilitiaTrainingHundredths = 0;
|
||||
|
||||
// make the player pay again next time he wants to train here
|
||||
pSectorInfo->fMilitiaTrainingPaid = FALSE;
|
||||
// make the player pay again next time he wants to train here
|
||||
pSectorInfo->fMilitiaTrainingPaid = FALSE;
|
||||
|
||||
TownMilitiaTrainingCompleted( pTrainer, sMapX, sMapY );
|
||||
TownMilitiaTrainingCompleted( pTrainer, sMapX, sMapY );
|
||||
|
||||
// training done
|
||||
return( TRUE );
|
||||
// training done
|
||||
return( TRUE );
|
||||
}
|
||||
}
|
||||
else if (pTrainer->bAssignment == TRAIN_MOBILE)
|
||||
@@ -4637,7 +4632,6 @@ INT16 GetTownTrainPtsForCharacter( SOLDIERTYPE *pTrainer, UINT16 *pusMaxPts )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// adjust for teaching bonus (a percentage)
|
||||
sTotalTrainingPts += ( ( sTrainingBonus * sTotalTrainingPts ) / 100 );
|
||||
// teach bonus is considered "normal" - it's always there
|
||||
@@ -6163,7 +6157,6 @@ void HandleShadingOfLinesForAssignmentMenus( void )
|
||||
// shade vehicle line
|
||||
ShadeStringInBox( ghAssignmentBox, ASSIGN_MENU_VEHICLE );
|
||||
}
|
||||
|
||||
if (BasicCanCharacterFacility( pSoldier ))
|
||||
{
|
||||
// unshade facility line
|
||||
@@ -6190,7 +6183,6 @@ void HandleShadingOfLinesForAssignmentMenus( void )
|
||||
|
||||
// training attributes submenu
|
||||
HandleShadingOfLinesForAttributeMenus( );
|
||||
|
||||
// HEADROCK HAM 3.6: Facility Menu
|
||||
HandleShadingOfLinesForFacilityMenu( );
|
||||
|
||||
@@ -6442,8 +6434,8 @@ void DetermineWhichAssignmentMenusCanBeShown( void )
|
||||
// SetRenderFlags(RENDER_FLAG_FULL);
|
||||
}
|
||||
}
|
||||
CreateDestroyMouseRegionForVehicleMenu( );
|
||||
|
||||
CreateDestroyMouseRegionForVehicleMenu( );
|
||||
// HEADROCK HAM 3.6: FACILITY menu
|
||||
if( fShowFacilityMenu == TRUE )
|
||||
{
|
||||
@@ -6542,11 +6534,6 @@ void AssignmentScreenMaskBtnCallback(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
|
||||
fShowContractMenu = FALSE;
|
||||
|
||||
// HEADROCK HAM 3.6: Facility Menu.
|
||||
//fShowFacilityMenu = FALSE;
|
||||
// And facility Submenu
|
||||
//fShowFacilityAssignmentMenu = FALSE;
|
||||
|
||||
// stop showing town mine info
|
||||
fShowTownInfo = FALSE;
|
||||
|
||||
@@ -7530,10 +7517,10 @@ void MercDismissConfirmCallBack( UINT8 bExitValue )
|
||||
{
|
||||
if ( bExitValue == MSG_BOX_RETURN_YES )
|
||||
{
|
||||
// Setup history code
|
||||
gpDismissSoldier->ubLeaveHistoryCode = HISTORY_MERC_FIRED;
|
||||
// Setup history code
|
||||
gpDismissSoldier->ubLeaveHistoryCode = HISTORY_MERC_FIRED;
|
||||
|
||||
BeginRemoveMercFromContract( gpDismissSoldier );
|
||||
BeginRemoveMercFromContract( gpDismissSoldier );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7920,7 +7907,6 @@ void TrainingMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
DetermineBoxPositions( );
|
||||
|
||||
break;
|
||||
// HEADROCK HAM 3.6: This is revamped for separating Mobile and Garrison training.
|
||||
case( TRAIN_MENU_TOWN):
|
||||
|
||||
// Full test of Character and Sector to see if this training is possible at the moment.
|
||||
@@ -7939,42 +7925,42 @@ void TrainingMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
break;
|
||||
}
|
||||
|
||||
// PASSED BOTH TESTS - ALLOW SOLDIER TO TRAIN MILITIA HERE
|
||||
// PASSED ALL THE TESTS - ALLOW SOLDIER TO TRAIN MILITIA HERE
|
||||
|
||||
pSoldier->bOldAssignment = pSoldier->bAssignment;
|
||||
pSoldier->bOldAssignment = pSoldier->bAssignment;
|
||||
|
||||
if( ( pSoldier->bAssignment != TRAIN_TOWN ) )
|
||||
{
|
||||
SetTimeOfAssignmentChangeForMerc( pSoldier );
|
||||
}
|
||||
if( ( pSoldier->bAssignment != TRAIN_TOWN ) )
|
||||
{
|
||||
SetTimeOfAssignmentChangeForMerc( pSoldier );
|
||||
}
|
||||
|
||||
MakeSoldiersTacticalAnimationReflectAssignment( pSoldier );
|
||||
MakeSoldiersTacticalAnimationReflectAssignment( pSoldier );
|
||||
|
||||
// stop showing menu
|
||||
// stop showing menu
|
||||
fShowAssignmentMenu = FALSE;
|
||||
giAssignHighLine = -1;
|
||||
giAssignHighLine = -1;
|
||||
|
||||
// remove from squad
|
||||
// remove from squad
|
||||
|
||||
if( pSoldier->bOldAssignment == VEHICLE )
|
||||
{
|
||||
TakeSoldierOutOfVehicle( pSoldier );
|
||||
}
|
||||
RemoveCharacterFromSquads( pSoldier );
|
||||
if( pSoldier->bOldAssignment == VEHICLE )
|
||||
{
|
||||
TakeSoldierOutOfVehicle( pSoldier );
|
||||
}
|
||||
RemoveCharacterFromSquads( pSoldier );
|
||||
|
||||
ChangeSoldiersAssignment( pSoldier, TRAIN_TOWN );
|
||||
ChangeSoldiersAssignment( pSoldier, TRAIN_TOWN );
|
||||
|
||||
// assign to a movement group
|
||||
AssignMercToAMovementGroup( pSoldier );
|
||||
if( SectorInfo[ SECTOR( pSoldier->sSectorX, pSoldier->sSectorY ) ].fMilitiaTrainingPaid == FALSE )
|
||||
{
|
||||
// show a message to confirm player wants to charge cost
|
||||
HandleInterfaceMessageForCostOfTrainingMilitia( pSoldier );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAssignmentForList( TRAIN_TOWN, 0 );
|
||||
}
|
||||
// assign to a movement group
|
||||
AssignMercToAMovementGroup( pSoldier );
|
||||
if( SectorInfo[ SECTOR( pSoldier->sSectorX, pSoldier->sSectorY ) ].fMilitiaTrainingPaid == FALSE )
|
||||
{
|
||||
// show a message to confirm player wants to charge cost
|
||||
HandleInterfaceMessageForCostOfTrainingMilitia( pSoldier );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetAssignmentForList( TRAIN_TOWN, 0 );
|
||||
}
|
||||
gfRenderPBInterface = TRUE;
|
||||
break;
|
||||
|
||||
@@ -8035,7 +8021,6 @@ void TrainingMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason )
|
||||
}
|
||||
gfRenderPBInterface = TRUE;
|
||||
break;
|
||||
|
||||
case( TRAIN_MENU_TEAMMATES):
|
||||
|
||||
if( CanCharacterTrainTeammates( pSoldier ) == TRUE )
|
||||
@@ -9373,15 +9358,6 @@ void DetermineBoxPositions( void )
|
||||
}
|
||||
}
|
||||
|
||||
/*// HEADROCK HAM 3.6: Facility Menu
|
||||
if( ( fShowFacilityMenu == TRUE ) && ( ghFacilityBox != -1 ) )
|
||||
{
|
||||
CreateDestroyMouseRegionForFacilityMenu( );
|
||||
pNewPoint.iY += ( ( GetFontHeight( MAP_SCREEN_FONT ) + 2 ) * ASSIGN_MENU_FACILITY );
|
||||
|
||||
SetBoxPosition( ghFacilityBox, pNewPoint );
|
||||
}*/
|
||||
|
||||
// HEADROCK HAM 3.6: Facility Sub-menu
|
||||
if( ( fShowFacilityMenu == TRUE ) && ( ghFacilityBox != -1 ) )
|
||||
{
|
||||
@@ -9406,7 +9382,6 @@ void DetermineBoxPositions( void )
|
||||
SetBoxPosition( ghFacilityAssignmentBox, pNewPoint );
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -9630,7 +9605,6 @@ void CheckAndUpdateTacticalAssignmentPopUpPositions( void )
|
||||
|
||||
SetBoxPosition( ghTrainingBox, pPoint );
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: Facility Sub-menu
|
||||
else if( fShowFacilityAssignmentMenu == TRUE )
|
||||
{
|
||||
@@ -9696,7 +9670,6 @@ void CheckAndUpdateTacticalAssignmentPopUpPositions( void )
|
||||
|
||||
SetBoxPosition( ghFacilityBox, pPoint );
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
// just the assignment box
|
||||
@@ -9812,7 +9785,6 @@ void HandleRestFatigueAndSleepStatus( void )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// CHECK FOR MERCS GOING TO SLEEP
|
||||
|
||||
// if awake
|
||||
@@ -11738,7 +11710,6 @@ void SetAssignmentForList( INT8 bAssignment, INT8 bParam )
|
||||
fItWorked = TRUE;
|
||||
}
|
||||
break;
|
||||
// HEADROCK HAM 3.6: Mobile Militia Training.
|
||||
case( TRAIN_MOBILE ):
|
||||
if( CanCharacterTrainMobileMilitia( pSoldier ) )
|
||||
{
|
||||
@@ -12082,7 +12053,6 @@ BOOLEAN CharacterIsTakingItEasy( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
// on duty, but able to catch naps (either not traveling, or not the driver of the vehicle)
|
||||
// The actual checks for this are in the "can he sleep" check above
|
||||
|
||||
if ( ( pSoldier->bAssignment < ON_DUTY ) || ( pSoldier->bAssignment == VEHICLE ) )
|
||||
{
|
||||
return( TRUE );
|
||||
@@ -12152,7 +12122,6 @@ UINT8 CalcSoldierNeedForSleep( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
ubNeedForSleep = 6;
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.5: WTF! This calculation is NOT correct!
|
||||
//ubPercentHealth = pSoldier->stats.bLife / pSoldier->stats.bLifeMax;
|
||||
ubPercentHealth = (pSoldier->stats.bLife*100) / pSoldier->stats.bLifeMax;
|
||||
@@ -12839,7 +12808,6 @@ BOOLEAN FindAnyAwakeTrainees( SOLDIERTYPE *pTrainer )
|
||||
|
||||
return(!fAllTraineesAsleep);
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: A new set of functions (this & next) to determine whether a character can train Mobile Militia.
|
||||
// This function tests character statistics.
|
||||
|
||||
@@ -15357,4 +15325,4 @@ void HandleShadingOfLinesForFacilityAssignmentMenu( void )
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-14
@@ -26,7 +26,7 @@
|
||||
|
||||
#define VEHICLE_REPAIR_POINTS_DIVISOR 10
|
||||
|
||||
// HEADROCK HAM 3.6: Added separate Mobile Militia training assignment.
|
||||
|
||||
// Assignments Defines
|
||||
enum{
|
||||
SQUAD_1 =0,
|
||||
@@ -86,16 +86,6 @@ enum{
|
||||
// NOTE: Wisdom isn't trainable!
|
||||
};
|
||||
|
||||
// HEADROCK HAM 3.2: Set bitwise flags for locating facilities in current sector (for training/otherwise)
|
||||
// facilities flags
|
||||
// HEADROCK HAM 3.4: Removed due to facility externalization.
|
||||
/*#define AT_HOSPITAL 0x00000001
|
||||
#define AT_INDUSTRY 0x00000002
|
||||
#define AT_PRISON 0x00000004
|
||||
#define AT_MILITARY 0x00000008
|
||||
#define AT_AIRPORT 0x00000010
|
||||
#define AT_GUN_RANGE 0x00000020*/
|
||||
|
||||
|
||||
typedef struct TOWN_TRAINER_TYPE
|
||||
{
|
||||
@@ -129,8 +119,6 @@ BOOLEAN CanCharacterPractise( SOLDIERTYPE *pCharacter );
|
||||
|
||||
// can this character train others?
|
||||
BOOLEAN CanCharacterTrainTeammates( SOLDIERTYPE *pSoldier );
|
||||
|
||||
// HEADROCK HAM 3.6: Can character use a specific facility?
|
||||
BOOLEAN CanCharacterFacility( SOLDIERTYPE *pSoldier, UINT8 ubFacilityType, UINT8 ubAssignmentType );
|
||||
|
||||
// put character on duty?
|
||||
@@ -284,7 +272,6 @@ void VehicleMenuBtnCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void CreateDestroyMouseRegionForRepairMenu( void );
|
||||
void RepairMenuMvtCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void RepairMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
// HEADROCK HAM 3.6: Facility Menu
|
||||
void CreateDestroyMouseRegionForFacilityMenu( void );
|
||||
void FacilityMenuMvtCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
@@ -228,20 +228,20 @@ BOOLEAN WriteInAltSectors(STR fileName)
|
||||
fclose(outfile);
|
||||
#else
|
||||
XMLWriter xmlw;
|
||||
xmlw.OpenNode(L"ALT_SECTORS_LIST");
|
||||
xmlw.openNode(L"ALT_SECTORS_LIST");
|
||||
UINT32 x, y;
|
||||
for(y = 1;y <= 16;y++)
|
||||
{
|
||||
xmlw.AddAttributeToNextValue(L"y",(char)(y+0x40));
|
||||
xmlw.addAttributeToNextValue(L"y",(char)(y+0x40));
|
||||
std::stringstream ss;
|
||||
for(x = 1;x <= 16; x++)
|
||||
{
|
||||
ss << " " << RandomSector[ ((y - 1) * 16) + (x - 1) ];
|
||||
}
|
||||
xmlw.AddValue(L"ROW", ss.str());
|
||||
xmlw.addValue(L"ROW", ss.str());
|
||||
}
|
||||
xmlw.CloseNode();
|
||||
xmlw.WriteToFile(fileName);
|
||||
xmlw.closeNode();
|
||||
xmlw.writeToFile(fileName);
|
||||
#endif
|
||||
return (TRUE);
|
||||
}
|
||||
@@ -599,10 +599,14 @@ void InitWorld()
|
||||
|
||||
for (sSectorCounter = 0; sSectorCounter < 256; sSectorCounter++)
|
||||
{
|
||||
if ( RandomSector[ sSectorCounter ] )
|
||||
// WANNE - MP: Disable "random sectors" in a multiplayer game
|
||||
if (!is_networked)
|
||||
{
|
||||
if ( Random(100) >= 50 )
|
||||
SectorInfo[ sSectorCounter ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
if ( RandomSector[ sSectorCounter ] )
|
||||
{
|
||||
if ( Random(100) >= 50 )
|
||||
SectorInfo[ sSectorCounter ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,8 +422,8 @@ typedef struct SECTORINFO
|
||||
//throught the sector without entering it.
|
||||
INT8 bNameId;
|
||||
INT8 bUSUSED;
|
||||
INT8 bBloodCats; // Actual number of bloodcats existing on this map.
|
||||
INT8 bBloodCatPlacements; // "Maximum" potential bloodcats that can appear on this map.
|
||||
INT8 bBloodCats;
|
||||
INT8 bBloodCatPlacements;
|
||||
INT8 UNUSEDbSAMCondition;
|
||||
|
||||
UINT8 ubTravelRating; //Represents how travelled a sector is. Typically, the higher the travel rating,
|
||||
|
||||
@@ -134,7 +134,7 @@ INT32 giDestroyedLairID = 0;
|
||||
//various information required for keeping track of the battle sector involved for
|
||||
//prebattle interface, autoresolve, etc.
|
||||
INT16 gsCreatureInsertionCode = 0;
|
||||
INT16 gsCreatureInsertionGridNo = 0;
|
||||
INT32 gsCreatureInsertionGridNo = 0;
|
||||
UINT8 gubNumCreaturesAttackingTown = 0;
|
||||
UINT8 gubYoungMalesAttackingTown = 0;
|
||||
UINT8 gubYoungFemalesAttackingTown = 0;
|
||||
@@ -1580,7 +1580,7 @@ BOOLEAN PlayerGroupIsInACreatureInfestedMine()
|
||||
}
|
||||
|
||||
//Returns TRUE if valid and creature quest over, FALSE if creature quest active or not yet started
|
||||
BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ, INT16 *psInsertionGridNo )
|
||||
BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ, INT32 *psInsertionGridNo )
|
||||
{
|
||||
INT32 iSwitchValue;
|
||||
|
||||
@@ -1621,7 +1621,7 @@ BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSecto
|
||||
*psSectorX = 13;
|
||||
*psSectorY = 4;
|
||||
*pbSectorZ = 0;
|
||||
*psInsertionGridNo = 20700;
|
||||
*psInsertionGridNo = 20700;//dnl!!!
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -1636,7 +1636,7 @@ BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSecto
|
||||
*psSectorX = 8;
|
||||
*psSectorY = 8;
|
||||
*pbSectorZ = 0;
|
||||
*psInsertionGridNo = 13002;
|
||||
*psInsertionGridNo = 13002;//dnl!!!
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -1651,7 +1651,7 @@ BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSecto
|
||||
*psSectorX = 14;
|
||||
*psSectorY = 9;
|
||||
*pbSectorZ = 0;
|
||||
*psInsertionGridNo = 9085;
|
||||
*psInsertionGridNo = 9085;//dnl!!!
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
@@ -1667,7 +1667,7 @@ BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSecto
|
||||
*psSectorX = 3;
|
||||
*psSectorY = 8;
|
||||
*pbSectorZ = 0;
|
||||
*psInsertionGridNo = 9822;
|
||||
*psInsertionGridNo = 9822;//dnl!!!
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -25,10 +25,10 @@ extern BOOLEAN gfUseCreatureMusic;
|
||||
BOOLEAN MineClearOfMonsters( UINT8 ubMineIndex );
|
||||
|
||||
//Returns TRUE if valid and creature quest over, FALSE if creature quest active or not yet started
|
||||
BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ, INT16 *psInsertionGridNo );
|
||||
BOOLEAN GetWarpOutOfMineCodes( INT16 *psSectorX, INT16 *psSectorY, INT8 *pbSectorZ, INT32 *psInsertionGridNo );
|
||||
|
||||
extern INT16 gsCreatureInsertionCode;
|
||||
extern INT16 gsCreatureInsertionGridNo;
|
||||
extern INT32 gsCreatureInsertionGridNo;
|
||||
extern UINT8 gubNumCreaturesAttackingTown;
|
||||
extern UINT8 gubYoungMalesAttackingTown;
|
||||
extern UINT8 gubYoungFemalesAttackingTown;
|
||||
|
||||
+100
-65
@@ -63,6 +63,7 @@
|
||||
#include "Interface Panels.h"
|
||||
// HEADROCK HAM 3.6: Include for adding facility debt reset
|
||||
#include "Facilities.h"
|
||||
#include "Map Screen Interface Map Inventory.h"//dnl ch51 081009
|
||||
#endif
|
||||
|
||||
#include "Vehicles.h"
|
||||
@@ -89,88 +90,120 @@ void InitNPCs( void )
|
||||
|
||||
// add the pilot at a random location!
|
||||
pProfile = &(gMercProfiles[ SKYRIDER ]);
|
||||
switch( Random( 4 ) )
|
||||
|
||||
if (!is_networked)
|
||||
{
|
||||
case 0:
|
||||
pProfile->sSectorX = 15;
|
||||
pProfile->sSectorY = MAP_ROW_B;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 1:
|
||||
pProfile->sSectorX = 14;
|
||||
pProfile->sSectorY = MAP_ROW_E;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 2:
|
||||
pProfile->sSectorX = 12;
|
||||
pProfile->sSectorY = MAP_ROW_D;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 3:
|
||||
pProfile->sSectorX = 16;
|
||||
pProfile->sSectorY = MAP_ROW_C;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
default:
|
||||
AssertMsg(false, "Skyrider was not set up properly");
|
||||
switch( Random( 4 ) )
|
||||
{
|
||||
case 0:
|
||||
pProfile->sSectorX = 15;
|
||||
pProfile->sSectorY = MAP_ROW_B;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 1:
|
||||
pProfile->sSectorX = 14;
|
||||
pProfile->sSectorY = MAP_ROW_E;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 2:
|
||||
pProfile->sSectorX = 12;
|
||||
pProfile->sSectorY = MAP_ROW_D;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 3:
|
||||
pProfile->sSectorX = 16;
|
||||
pProfile->sSectorY = MAP_ROW_C;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
default:
|
||||
AssertMsg(false, "Skyrider was not set up properly");
|
||||
}
|
||||
}
|
||||
// WANNE - MP: Set Skyrider in a MP game hardcoded to 15/B
|
||||
else
|
||||
{
|
||||
pProfile->sSectorX = 15;
|
||||
pProfile->sSectorY = MAP_ROW_B;
|
||||
pProfile->bSectorZ = 0;
|
||||
}
|
||||
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"Skyrider in %c %d", 'A' + pProfile->sSectorY - 1, pProfile->sSectorX );
|
||||
#endif
|
||||
|
||||
// use alternate map, with Skyrider's shack, in this sector
|
||||
SectorInfo[ SECTOR( pProfile->sSectorX, pProfile->sSectorY ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
|
||||
|
||||
// set up Madlab's secret lab (he'll be added when the meanwhile scene occurs)
|
||||
|
||||
switch( Random( 4 ) )
|
||||
if (!is_networked)
|
||||
{
|
||||
case 0:
|
||||
// use alternate map in this sector
|
||||
SectorInfo[ SECTOR( 7, MAP_ROW_H ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
case 1:
|
||||
SectorInfo[ SECTOR( 16, MAP_ROW_H ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
case 2:
|
||||
SectorInfo[ SECTOR( 11, MAP_ROW_I ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
case 3:
|
||||
SectorInfo[ SECTOR( 4, MAP_ROW_E ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
switch( Random( 4 ) )
|
||||
{
|
||||
case 0:
|
||||
// use alternate map in this sector
|
||||
SectorInfo[ SECTOR( 7, MAP_ROW_H ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
case 1:
|
||||
SectorInfo[ SECTOR( 16, MAP_ROW_H ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
case 2:
|
||||
SectorInfo[ SECTOR( 11, MAP_ROW_I ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
case 3:
|
||||
SectorInfo[ SECTOR( 4, MAP_ROW_E ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// WANNE - MP: Set Madlab in a MP game hardcoded to 7/H
|
||||
else
|
||||
{
|
||||
SectorInfo[ SECTOR( 7, MAP_ROW_H ) ].uiFlags |= SF_USE_ALTERNATE_MAP;
|
||||
}
|
||||
|
||||
// add Micky in random location
|
||||
|
||||
pProfile = &(gMercProfiles[MICKY]);
|
||||
switch( Random( 5 ) )
|
||||
|
||||
if (!is_networked)
|
||||
{
|
||||
case 0:
|
||||
pProfile->sSectorX = 9;
|
||||
pProfile->sSectorY = MAP_ROW_G;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 1:
|
||||
pProfile->sSectorX = 13;
|
||||
pProfile->sSectorY = MAP_ROW_D;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 2:
|
||||
pProfile->sSectorX = 5;
|
||||
pProfile->sSectorY = MAP_ROW_C;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 3:
|
||||
pProfile->sSectorX = 2;
|
||||
pProfile->sSectorY = MAP_ROW_H;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 4:
|
||||
pProfile->sSectorX = 6;
|
||||
pProfile->sSectorY = MAP_ROW_C;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
switch( Random( 5 ) )
|
||||
{
|
||||
case 0:
|
||||
pProfile->sSectorX = 9;
|
||||
pProfile->sSectorY = MAP_ROW_G;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 1:
|
||||
pProfile->sSectorX = 13;
|
||||
pProfile->sSectorY = MAP_ROW_D;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 2:
|
||||
pProfile->sSectorX = 5;
|
||||
pProfile->sSectorY = MAP_ROW_C;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 3:
|
||||
pProfile->sSectorX = 2;
|
||||
pProfile->sSectorY = MAP_ROW_H;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
case 4:
|
||||
pProfile->sSectorX = 6;
|
||||
pProfile->sSectorY = MAP_ROW_C;
|
||||
pProfile->bSectorZ = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// WANNE - MP: Set Micky in a MP game hardcoded to 9/G
|
||||
else
|
||||
{
|
||||
pProfile->sSectorX = 9;
|
||||
pProfile->sSectorY = MAP_ROW_G;
|
||||
pProfile->bSectorZ = 0;
|
||||
}
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
@@ -463,6 +496,9 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
}
|
||||
}
|
||||
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ)//dnl ch51 081009
|
||||
MemFreeInventoryPoolQ();
|
||||
|
||||
DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"InitNewGame: loading merc profiles");
|
||||
if( gubScreenCount == 0 )
|
||||
{
|
||||
@@ -586,7 +622,6 @@ BOOLEAN InitNewGame( BOOLEAN fReset )
|
||||
{
|
||||
SetLaptopExitScreen( MAP_SCREEN ); //hayden
|
||||
SetPendingNewScreen( MAP_SCREEN );
|
||||
|
||||
// WANNE: No more used
|
||||
/*
|
||||
ScreenMsg( MSG_FONT_WHITE, MSG_MPSYSTEM, L"------------------------------------------------------");
|
||||
@@ -769,7 +804,7 @@ void QuickSetupOfMercProfileItems( UINT32 uiCount, UINT8 ubProfileIndex )
|
||||
// TEMP!
|
||||
// make carman's opinion of us high!
|
||||
if (OKToCheckOpinion(ubProfileIndex))
|
||||
gMercProfiles[ 78 ].bMercOpinion[ ubProfileIndex ] = 25;
|
||||
gMercProfiles[ 78 ].bMercOpinion[ ubProfileIndex ] = 25;
|
||||
|
||||
}
|
||||
else if ( uiCount == 1 )
|
||||
|
||||
@@ -117,7 +117,7 @@ UINT8 ubRefuelList[ NUMBER_OF_REFUEL_SITES ][ 2 ] =
|
||||
};
|
||||
|
||||
|
||||
INT16 sRefuelStartGridNo[ NUMBER_OF_REFUEL_SITES ] ={
|
||||
INT32 sRefuelStartGridNo[ NUMBER_OF_REFUEL_SITES ] ={
|
||||
9001, // drassen
|
||||
13067, // estoni
|
||||
};
|
||||
@@ -1924,7 +1924,7 @@ BOOLEAN CanHelicopterTakeOff( void )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
void AddHeliPeice( INT16 sGridNo, UINT16 sOStruct )
|
||||
void AddHeliPeice( INT32 sGridNo, UINT16 sOStruct )
|
||||
{
|
||||
UINT16 usDummy;
|
||||
|
||||
@@ -1939,7 +1939,7 @@ void AddHeliPeice( INT16 sGridNo, UINT16 sOStruct )
|
||||
|
||||
void AddHelicopterToMaps( BOOLEAN fAdd, UINT8 ubSite )
|
||||
{
|
||||
INT16 sGridNo = sRefuelStartGridNo[ ubSite ];
|
||||
INT32 sGridNo = sRefuelStartGridNo[ ubSite ];
|
||||
INT16 sOStruct = 0;
|
||||
INT16 sGridX, sGridY;
|
||||
INT16 sCentreGridX, sCentreGridY;
|
||||
@@ -1962,10 +1962,10 @@ void AddHelicopterToMaps( BOOLEAN fAdd, UINT8 ubSite )
|
||||
{
|
||||
AddHeliPeice( sGridNo, sOStruct );
|
||||
AddHeliPeice( sGridNo, ( UINT16 )( sOStruct + 1));
|
||||
AddHeliPeice( (INT16)( sGridNo - 800 ), ( UINT16 )( sOStruct + 2 ));
|
||||
AddHeliPeice( ( sGridNo - 800 ), ( UINT16 )( sOStruct + 2 ));
|
||||
AddHeliPeice( sGridNo, ( UINT16 )(sOStruct + 3 ));
|
||||
AddHeliPeice( sGridNo, ( UINT16 )(sOStruct + 4));
|
||||
AddHeliPeice( (INT16)( sGridNo - 800 ), ( UINT16 )(sOStruct + 5));
|
||||
AddHeliPeice( ( sGridNo - 800 ), ( UINT16 )(sOStruct + 5));
|
||||
|
||||
InvalidateWorldRedundency();
|
||||
SetRenderFlags( RENDER_FLAG_FULL );
|
||||
@@ -1979,7 +1979,7 @@ void AddHelicopterToMaps( BOOLEAN fAdd, UINT8 ubSite )
|
||||
{
|
||||
sGridNo = MAPROWCOLTOPOS( sGridY, sGridX );
|
||||
|
||||
BumpAnyExistingMerc( sGridNo );
|
||||
BumpAnyExistingMerc( sGridNo );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -361,7 +361,7 @@ void RenderMapScreenInterfaceBottom( BOOLEAN fForceMapscreenFullRender )
|
||||
// display slider on the scroll bar
|
||||
DisplayScrollBarSlider( );
|
||||
|
||||
|
||||
|
||||
// handle auto scroll
|
||||
//CheckForAndHandleAutoMessageScroll( );
|
||||
|
||||
|
||||
@@ -37,12 +37,19 @@
|
||||
#include "ShopKeeper Interface.h"
|
||||
#include "ArmsDealerInvInit.h"
|
||||
#include <algorithm>
|
||||
|
||||
#include "InterfaceItemImages.h"
|
||||
#include "SaveLoadGame.h"//dnl ch51 081009
|
||||
#include "Map Information.h"//dnl ch51 091009
|
||||
|
||||
//forward declarations of common classes to eliminate includes
|
||||
class OBJECTTYPE;
|
||||
class SOLDIERTYPE;
|
||||
|
||||
//dnl ch51 081009
|
||||
UINT8 gInventoryPoolIndex = '0';
|
||||
std::vector<WORLDITEM> pInventoryPoolListQ[INVPOOLLISTNUM];
|
||||
INT32 iCurrentInventoryPoolPageQ[INVPOOLLISTNUM]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
INT32 iLastInventoryPoolPageQ[INVPOOLLISTNUM]={ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
|
||||
|
||||
extern BOOLEAN SaveWorldItemsToTempItemFile( INT16 sMapX, INT16 sMapY, INT8 bMapZ, UINT32 uiNumberOfItems, WORLDITEM* pData );
|
||||
#define MAP_INV_X_OFFSET (((SCREEN_WIDTH - 261) - 380) / 2)
|
||||
@@ -122,7 +129,7 @@ std::vector<WORLDITEM> pInventoryPoolList;
|
||||
INT32 iCurrentInventoryPoolPage = 0;
|
||||
INT32 iLastInventoryPoolPage = 0;
|
||||
|
||||
INT16 sObjectSourceGridNo = 0;
|
||||
INT32 sObjectSourceGridNo = 0;
|
||||
INT8 sObjectSourseSoldierID = -1;
|
||||
|
||||
// number of unseen items in sector
|
||||
@@ -350,7 +357,8 @@ BOOLEAN RenderItemInPoolSlot( INT32 iCurrentSlot, INT32 iFirstSlotOnPage )
|
||||
|
||||
GetVideoObject( &hHandle, GetInterfaceGraphicForItem( &(Item[ pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.usItem ] ) ) );
|
||||
|
||||
pTrav = &( hHandle->pETRLEObject[ Item[pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.usItem ].ubGraphicNum] );
|
||||
UINT16 usGraphicNum = g_bUsePngItemImages ? 0 : Item[pInventoryPoolList[ iCurrentSlot + iFirstSlotOnPage ].object.usItem ].ubGraphicNum;
|
||||
pTrav = &( hHandle->pETRLEObject[ usGraphicNum ] );
|
||||
usHeight = (UINT16)pTrav->usHeight;
|
||||
usWidth = (UINT16)pTrav->usWidth;
|
||||
|
||||
@@ -552,6 +560,8 @@ void CreateDestroyMapInventoryPoolButtons( BOOLEAN fExitFromMapScreen )
|
||||
}
|
||||
else if( ( fShowMapInventoryPool == FALSE ) && ( fCreated == TRUE ) )
|
||||
{
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ)//dnl ch51 081009
|
||||
SwitchToInventoryPoolQ(0);
|
||||
|
||||
// check fi we are in fact leaving mapscreen
|
||||
if( fExitFromMapScreen == FALSE )
|
||||
@@ -1001,6 +1011,13 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// Else, try to place here
|
||||
if ( PlaceObjectInInventoryStash( &( pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].object ), gpItemPointer ) )
|
||||
{
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ)//dnl ch51 091009
|
||||
{
|
||||
pInventoryPoolList[(iCurrentInventoryPoolPage*MAP_INVENTORY_POOL_SLOT_COUNT)+iCounter].bVisible = TRUE;
|
||||
pInventoryPoolList[(iCurrentInventoryPoolPage*MAP_INVENTORY_POOL_SLOT_COUNT)+iCounter].fExists = TRUE;
|
||||
if(!GridNoOnVisibleWorldTile(sObjectSourceGridNo))
|
||||
sObjectSourceGridNo = gMapInformation.sCenterGridNo;
|
||||
}
|
||||
|
||||
// set as reachable and set gridno
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_REACHABLE;
|
||||
@@ -1011,7 +1028,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// nothing here before, then place here
|
||||
if( iOldNumberOfObjects == 0 )
|
||||
{
|
||||
if( sObjectSourceGridNo == NOWHERE )
|
||||
if(TileIsOutOfBounds(sObjectSourceGridNo))
|
||||
{
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].usFlags |= WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT;
|
||||
pInventoryPoolList[ ( iCurrentInventoryPoolPage * MAP_INVENTORY_POOL_SLOT_COUNT ) + iCounter ].sGridNo = sObjectSourceGridNo;
|
||||
@@ -1035,7 +1052,7 @@ void MapInvenPoolSlots(MOUSE_REGION * pRegion, INT32 iReason )
|
||||
// update ptr
|
||||
// now set the cursor
|
||||
guiExternVo = GetInterfaceGraphicForItem( &(Item[ gpItemPointer->usItem ]) );
|
||||
gusExternVoSubIndex = Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
gusExternVoSubIndex = g_bUsePngItemImages ? 0 : Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
|
||||
fMapInventoryItem = TRUE;
|
||||
MSYS_ChangeRegionCursor( &gMPanelRegion , EXTERN_CURSOR );
|
||||
@@ -1473,6 +1490,8 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
|
||||
{
|
||||
for( UINT32 iNumber = 0 ; iNumber < pInventoryPoolList.size() ; ++iNumber)
|
||||
{
|
||||
// WANNE: Fix by Headrock
|
||||
//if ( pInventoryPoolList[ iNumber ].object.usItem == gItemPointer.usItem )
|
||||
if ( pInventoryPoolList[ iNumber ].object.usItem == gItemPointer.usItem && pInventoryPoolList[ iNumber ].usFlags & WORLD_ITEM_REACHABLE)
|
||||
{
|
||||
iPrice += SellItem( pInventoryPoolList[ iNumber ].object );
|
||||
@@ -1505,7 +1524,7 @@ void BeginInventoryPoolPtr( OBJECTTYPE *pInventorySlot )
|
||||
|
||||
// now set the cursor
|
||||
guiExternVo = GetInterfaceGraphicForItem( &(Item[ gpItemPointer->usItem ]) );
|
||||
gusExternVoSubIndex = Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
gusExternVoSubIndex = g_bUsePngItemImages ? 0 : Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
|
||||
fMapInventoryItem = TRUE;
|
||||
MSYS_ChangeRegionCursor( &gMPanelRegion , EXTERN_CURSOR );
|
||||
@@ -1544,7 +1563,7 @@ BOOLEAN PlaceObjectInInventoryStash( OBJECTTYPE *pInventorySlot, OBJECTTYPE *pIt
|
||||
}
|
||||
|
||||
|
||||
BOOLEAN AutoPlaceObjectInInventoryStash( OBJECTTYPE *pItemPtr, INT16 sGridNo )
|
||||
BOOLEAN AutoPlaceObjectInInventoryStash( OBJECTTYPE *pItemPtr, INT32 sGridNo )
|
||||
{
|
||||
OBJECTTYPE *pInventorySlot;
|
||||
INT32 cnt = 0;
|
||||
@@ -1932,6 +1951,9 @@ void DrawTextOnSectorInventory( void )
|
||||
// parse the string
|
||||
swprintf( sString, zMarksMapScreenText[ 11 ] );
|
||||
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ && gInventoryPoolIndex != '0')//dnl ch51 081009
|
||||
swprintf(sString, L"Inventory Pool %c", gInventoryPoolIndex);
|
||||
|
||||
SetFontDestBuffer( guiSAVEBUFFER, 0, 0, SCREEN_WIDTH, SCREEN_HEIGHT, FALSE );
|
||||
|
||||
//FindFontCenterCoordinates( MAP_INV_X_OFFSET + MAP_INVENTORY_POOL_SLOT_START_X, MAP_INVENTORY_POOL_SLOT_START_Y - 20, 630 - MAP_INVENTORY_POOL_SLOT_START_X, GetFontHeight( FONT14ARIAL ), sString, FONT14ARIAL, &sX, &sY );
|
||||
@@ -2145,7 +2167,7 @@ void CheckGridNoOfItemsInMapScreenMapInventory()
|
||||
|
||||
for( iCnt=0; iCnt<iTotalNumberItems; iCnt++)
|
||||
{
|
||||
if( pInventoryPoolList[ iCnt ].sGridNo == NOWHERE && !( pInventoryPoolList[ iCnt ].usFlags & WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT ) )
|
||||
if( ( TileIsOutOfBounds(pInventoryPoolList[ iCnt ].sGridNo) )&& !( pInventoryPoolList[ iCnt ].usFlags & WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT ) )
|
||||
{
|
||||
//set the flag
|
||||
pInventoryPoolList[ iCnt ].usFlags |= WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT;
|
||||
@@ -2158,8 +2180,8 @@ void CheckGridNoOfItemsInMapScreenMapInventory()
|
||||
|
||||
//loop through all the UNSEEN items
|
||||
for( iCnt=0; iCnt<(INT32)uiNumberOfUnSeenItems; iCnt++)
|
||||
{
|
||||
if( pUnSeenItems[ iCnt ].sGridNo == NOWHERE && !( pUnSeenItems[ iCnt ].usFlags & WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT ) )
|
||||
{
|
||||
if (TileIsOutOfBounds(pUnSeenItems[ iCnt ].sGridNo) && !( pUnSeenItems[ iCnt ].usFlags & WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT ) )
|
||||
{
|
||||
//set the flag
|
||||
pUnSeenItems[ iCnt ].usFlags |= WORLD_ITEM_GRIDNO_NOT_SET_USE_ENTRY_POINT;
|
||||
@@ -2256,7 +2278,15 @@ INT32 MapScreenSectorInventoryCompare( const void *pNum1, const void *pNum2)
|
||||
UINT16 usItem2Index;
|
||||
UINT16 ubItem1Quality;
|
||||
UINT16 ubItem2Quality;
|
||||
|
||||
/*
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ)//dnl??? ch51 081009
|
||||
{
|
||||
if(pFirst->object.usItem == 0)
|
||||
return(1);
|
||||
else if(pSecond->object.usItem == 0)
|
||||
return(-1);
|
||||
}
|
||||
*/
|
||||
usItem1Index = pFirst->object.usItem;
|
||||
usItem2Index = pSecond->object.usItem;
|
||||
|
||||
@@ -2290,6 +2320,271 @@ BOOLEAN CanPlayerUseSectorInventory( SOLDIERTYPE *pSelectedSoldier )
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
//dnl ch51 081009 start
|
||||
BOOLEAN LoadInventoryPoolQ (UINT8 ubSaveGameID)
|
||||
{
|
||||
BOOLEAN ret;
|
||||
INT32 i, j, iTotNumSlots;
|
||||
CHAR8 tmpbuf[1024];
|
||||
UINT32 uiNumBytesRead;
|
||||
HWFILE hFile;
|
||||
|
||||
if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
|
||||
{
|
||||
switch(iResolution)
|
||||
{
|
||||
case 0:
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
|
||||
break;
|
||||
case 1:
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
|
||||
break;
|
||||
case 2:
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 170;//MAP_INVENTORY_POOL_MAX_SLOTS;
|
||||
break;
|
||||
default:
|
||||
Assert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ret = FALSE;
|
||||
CreateSavedGameFileNameFromNumber(ubSaveGameID, tmpbuf);
|
||||
strcat(tmpbuf, ".IPQ");
|
||||
hFile = FileOpen(tmpbuf, FILE_ACCESS_READ|FILE_OPEN_EXISTING, FALSE);
|
||||
if(hFile == 0)
|
||||
return(TRUE);
|
||||
MemFreeInventoryPoolQ();
|
||||
FileRead(hFile, iCurrentInventoryPoolPageQ+1, (INVPOOLLISTNUM-1)*sizeof(INT32), &uiNumBytesRead);
|
||||
if(uiNumBytesRead != (INVPOOLLISTNUM-1)*sizeof(INT32))
|
||||
goto ERR;
|
||||
FileRead(hFile, iLastInventoryPoolPageQ+1, (INVPOOLLISTNUM-1)*sizeof(INT32), &uiNumBytesRead);
|
||||
if(uiNumBytesRead != (INVPOOLLISTNUM-1)*sizeof(INT32))
|
||||
goto ERR;
|
||||
for(i=1; i<INVPOOLLISTNUM; i++)
|
||||
{
|
||||
FileRead(hFile, &j, sizeof(INT32), &uiNumBytesRead);
|
||||
if(uiNumBytesRead != sizeof(INT32))
|
||||
goto ERR;
|
||||
if(j == 0)
|
||||
continue;
|
||||
iTotNumSlots = j;
|
||||
if(MAP_INVENTORY_POOL_SLOT_COUNT != (j/(iLastInventoryPoolPageQ[i]+1)))
|
||||
{
|
||||
iLastInventoryPoolPageQ[i] = j / MAP_INVENTORY_POOL_SLOT_COUNT + 1;
|
||||
j = iLastInventoryPoolPageQ[i] * MAP_INVENTORY_POOL_SLOT_COUNT;
|
||||
iCurrentInventoryPoolPageQ[i] = 0;
|
||||
}
|
||||
pInventoryPoolListQ[i].resize(j);
|
||||
for(j=0; j<iTotNumSlots; j++)
|
||||
if(!pInventoryPoolListQ[i][j].Load(hFile))
|
||||
goto ERR;
|
||||
}
|
||||
ret = TRUE;
|
||||
ERR:
|
||||
if(ret == FALSE)
|
||||
MemFreeInventoryPoolQ();
|
||||
FileClose(hFile);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
BOOLEAN MemFreeInventoryPoolQ(void)
|
||||
{
|
||||
INT32 i;
|
||||
|
||||
for(i=1; i<INVPOOLLISTNUM; i++)
|
||||
{
|
||||
pInventoryPoolListQ[i].clear();
|
||||
iCurrentInventoryPoolPageQ[i] = 0;
|
||||
iLastInventoryPoolPageQ[i] = 0;
|
||||
}
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN SaveInventoryPoolQ(UINT8 ubSaveGameID)
|
||||
{
|
||||
BOOLEAN ret;
|
||||
INT32 i, j;
|
||||
CHAR8 tmpbuf[1024];
|
||||
UINT32 uiNumBytesWritten;
|
||||
HWFILE hFile;
|
||||
|
||||
if(MAP_INVENTORY_POOL_SLOT_COUNT <= 0)
|
||||
{
|
||||
switch(iResolution)
|
||||
{
|
||||
case 0:
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 40;
|
||||
break;
|
||||
case 1:
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 77;
|
||||
case 2:
|
||||
MAP_INVENTORY_POOL_SLOT_COUNT = 170;//MAP_INVENTORY_POOL_MAX_SLOTS;
|
||||
break;
|
||||
default:
|
||||
Assert(0);
|
||||
break;
|
||||
}
|
||||
}
|
||||
ret = FALSE;
|
||||
CreateSavedGameFileNameFromNumber(ubSaveGameID, tmpbuf);
|
||||
strcat(tmpbuf, ".IPQ");
|
||||
hFile = FileOpen(tmpbuf, FILE_ACCESS_WRITE|FILE_OPEN_ALWAYS, FALSE);
|
||||
if(hFile == 0)
|
||||
goto ERR;
|
||||
FileWrite(hFile, iCurrentInventoryPoolPageQ+1, (INVPOOLLISTNUM-1)*sizeof(INT32), &uiNumBytesWritten);
|
||||
if(uiNumBytesWritten != (INVPOOLLISTNUM-1)*sizeof(INT32))
|
||||
goto ERR;
|
||||
FileWrite(hFile, iLastInventoryPoolPageQ+1, (INVPOOLLISTNUM-1)*sizeof(INT32), &uiNumBytesWritten);
|
||||
if(uiNumBytesWritten != (INVPOOLLISTNUM-1)*sizeof(INT32))
|
||||
goto ERR;
|
||||
for(i=1; i<INVPOOLLISTNUM; i++)
|
||||
{
|
||||
j = pInventoryPoolListQ[i].size();
|
||||
FileWrite(hFile, &j, sizeof(INT32), &uiNumBytesWritten);
|
||||
if(uiNumBytesWritten != sizeof(INT32))
|
||||
goto ERR;
|
||||
for(j=0; j<(INT32)pInventoryPoolListQ[i].size(); j++)
|
||||
if(!pInventoryPoolListQ[i][j].Save(hFile, TRUE))
|
||||
goto ERR;
|
||||
}
|
||||
ret = TRUE;
|
||||
ERR:
|
||||
FileClose(hFile);
|
||||
return(ret);
|
||||
}
|
||||
|
||||
BOOLEAN SortInventoryPoolQ(void)
|
||||
{
|
||||
if(pInventoryPoolList.size() > 0)
|
||||
{
|
||||
for(INT32 iSlotCounter=0; iSlotCounter<(INT32)pInventoryPoolList.size(); iSlotCounter++)
|
||||
if(pInventoryPoolList[iSlotCounter].object.usItem == NOTHING && pInventoryPoolList[iSlotCounter].object.exists() == false)
|
||||
{
|
||||
pInventoryPoolList[iSlotCounter].fExists = FALSE;
|
||||
pInventoryPoolList[iSlotCounter].bVisible = FALSE;
|
||||
}
|
||||
SortSectorInventory(pInventoryPoolList, pInventoryPoolList.size());
|
||||
iLastInventoryPoolPage = (pInventoryPoolList.size() - 1) / MAP_INVENTORY_POOL_SLOT_COUNT;
|
||||
if(iCurrentInventoryPoolPage > iLastInventoryPoolPage)
|
||||
iCurrentInventoryPoolPage = iLastInventoryPoolPage;
|
||||
}
|
||||
fMapPanelDirty = TRUE;
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN SwitchToInventoryPoolQ(UINT8 newidx)
|
||||
{
|
||||
UINT8 curidx;
|
||||
|
||||
curidx = gInventoryPoolIndex & 0x0F;
|
||||
pInventoryPoolListQ[curidx] = pInventoryPoolList;
|
||||
iCurrentInventoryPoolPageQ[curidx] = iCurrentInventoryPoolPage;
|
||||
iLastInventoryPoolPageQ[curidx] = iLastInventoryPoolPage;
|
||||
|
||||
newidx &= 0x0F;
|
||||
if (pInventoryPoolListQ[newidx].empty() == true)
|
||||
pInventoryPoolListQ[newidx].resize(MAP_INVENTORY_POOL_SLOT_COUNT);
|
||||
pInventoryPoolList = pInventoryPoolListQ[newidx];
|
||||
iCurrentInventoryPoolPage = iCurrentInventoryPoolPageQ[newidx];
|
||||
iLastInventoryPoolPage = iLastInventoryPoolPageQ[newidx];
|
||||
|
||||
gInventoryPoolIndex = newidx | 0x30;
|
||||
fMapPanelDirty = TRUE;
|
||||
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN CopySectorInventoryToInventoryPoolQ(UINT8 idx)
|
||||
{
|
||||
INT32 iSlotCounter, iSlotCounterQ;
|
||||
|
||||
idx = gInventoryPoolIndex & 0x0F;
|
||||
if(idx <= 0 || idx >= INVPOOLLISTNUM)
|
||||
return(FALSE);
|
||||
SwitchToInventoryPoolQ('0');
|
||||
iSlotCounterQ = 0;
|
||||
for(iSlotCounter=0; iSlotCounter<(INT32)pInventoryPoolList.size(); iSlotCounter++)
|
||||
{
|
||||
if(pInventoryPoolList[iSlotCounter].bVisible==1 && pInventoryPoolList[iSlotCounter].fExists && pInventoryPoolList[iSlotCounter].usFlags&WORLD_ITEM_REACHABLE && pInventoryPoolList[iSlotCounter].object.usItem != NOTHING)
|
||||
{
|
||||
while(1)
|
||||
{
|
||||
if(iSlotCounterQ >= (INT32)pInventoryPoolListQ[idx].size())
|
||||
{
|
||||
pInventoryPoolListQ[idx].resize(pInventoryPoolListQ[idx].size() + MAP_INVENTORY_POOL_SLOT_COUNT);
|
||||
iLastInventoryPoolPageQ[idx] = (pInventoryPoolListQ[idx].size() - 1) / MAP_INVENTORY_POOL_SLOT_COUNT;
|
||||
}
|
||||
if(pInventoryPoolListQ[idx][iSlotCounterQ].object.usItem == NOTHING)
|
||||
{
|
||||
pInventoryPoolListQ[idx][iSlotCounterQ] = pInventoryPoolList[iSlotCounter];
|
||||
DeleteObj(&pInventoryPoolList[iSlotCounter].object);
|
||||
iSlotCounterQ++;
|
||||
break;
|
||||
}
|
||||
iSlotCounterQ++;
|
||||
}
|
||||
}
|
||||
}
|
||||
SwitchToInventoryPoolQ(idx|'0');
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN CopySectorInventoryToInventoryPoolQs(UINT8 idx)
|
||||
{
|
||||
UINT8 defaultidx;
|
||||
INT32 iSlotCounter, iSlotCounterQ[INVPOOLLISTNUM];
|
||||
|
||||
idx = gInventoryPoolIndex & 0x0F;
|
||||
if(!(idx == 0 || idx == 8 || idx == 9))// Only from these inventories items could be separate to 1-7
|
||||
return(FALSE);
|
||||
defaultidx = idx;
|
||||
memset(iSlotCounterQ, 0, sizeof(iSlotCounterQ));
|
||||
for(iSlotCounter=0; iSlotCounter<(INT32)pInventoryPoolList.size(); iSlotCounter++)
|
||||
{
|
||||
if(pInventoryPoolList[iSlotCounter].bVisible==1 && pInventoryPoolList[iSlotCounter].fExists && pInventoryPoolList[iSlotCounter].usFlags&WORLD_ITEM_REACHABLE && pInventoryPoolList[iSlotCounter].object.usItem != NOTHING)
|
||||
{
|
||||
UINT32 usItemClass = Item[pInventoryPoolList[iSlotCounter].object.usItem].usItemClass;
|
||||
if(usItemClass == IC_GUN || usItemClass == IC_LAUNCHER)
|
||||
idx = 1;
|
||||
else if(usItemClass == IC_AMMO || usItemClass == IC_BELTCLIP)
|
||||
idx = 2;
|
||||
else if(usItemClass == IC_BOMB || usItemClass == IC_GRENADE)
|
||||
idx = 3;
|
||||
else if(usItemClass == IC_BLADE || usItemClass == IC_THROWING_KNIFE || usItemClass == IC_THROWN || usItemClass == IC_PUNCH)
|
||||
idx = 4;
|
||||
else if(usItemClass == IC_ARMOUR || usItemClass == IC_LBEGEAR)
|
||||
idx = 5;
|
||||
else if(usItemClass == IC_MEDKIT || usItemClass == IC_KIT || usItemClass == IC_APPLIABLE)
|
||||
idx = 6;
|
||||
else if(usItemClass == IC_NONE || usItemClass == IC_FACE || usItemClass == IC_KEY || usItemClass == IC_MISC || usItemClass == IC_MONEY || usItemClass == IC_TENTACLES)
|
||||
idx = 7;
|
||||
else
|
||||
idx = defaultidx;
|
||||
while(1)
|
||||
{
|
||||
if(iSlotCounterQ[idx] >= (INT32)pInventoryPoolListQ[idx].size())
|
||||
{
|
||||
pInventoryPoolListQ[idx].resize(pInventoryPoolListQ[idx].size() + MAP_INVENTORY_POOL_SLOT_COUNT);
|
||||
iLastInventoryPoolPageQ[idx] = (pInventoryPoolListQ[idx].size() - 1) / MAP_INVENTORY_POOL_SLOT_COUNT;
|
||||
}
|
||||
if(pInventoryPoolListQ[idx][iSlotCounterQ[idx]].object.usItem == NOTHING)
|
||||
{
|
||||
pInventoryPoolListQ[idx][iSlotCounterQ[idx]] = pInventoryPoolList[iSlotCounter];
|
||||
DeleteObj(&pInventoryPoolList[iSlotCounter].object);
|
||||
pInventoryPoolList[iSlotCounter].fExists = FALSE;
|
||||
pInventoryPoolList[iSlotCounter].bVisible = FALSE;
|
||||
iSlotCounterQ[idx]++;
|
||||
break;
|
||||
}
|
||||
iSlotCounterQ[idx]++;
|
||||
}
|
||||
}
|
||||
}
|
||||
fMapPanelDirty = TRUE;
|
||||
return(TRUE);
|
||||
}
|
||||
//dnl ch51 081009 finish
|
||||
|
||||
void DeleteAllItemsInInventoryPool()
|
||||
{
|
||||
pInventoryPoolList.clear();
|
||||
|
||||
@@ -43,12 +43,12 @@ void HandleFlashForHighLightedItem( void );
|
||||
extern std::vector<WORLDITEM> pInventoryPoolList;
|
||||
|
||||
// autoplace down object
|
||||
BOOLEAN AutoPlaceObjectInInventoryStash( OBJECTTYPE *pItemPtr, INT16 sGridNo=0 );
|
||||
BOOLEAN AutoPlaceObjectInInventoryStash( OBJECTTYPE *pItemPtr, INT32 sGridNo=0 );
|
||||
|
||||
// the current inventory item
|
||||
extern INT32 iCurrentlyHighLightedItem;
|
||||
extern BOOLEAN fFlashHighLightInventoryItemOnradarMap;
|
||||
extern INT16 sObjectSourceGridNo;
|
||||
extern INT32 sObjectSourceGridNo;
|
||||
extern INT32 iCurrentInventoryPoolPage;
|
||||
extern BOOLEAN fMapInventoryItemCompatable[ ];
|
||||
extern INT32 MAP_INVENTORY_POOL_SLOT_COUNT;
|
||||
@@ -56,5 +56,15 @@ extern INT32 MAP_INVENTORY_POOL_SLOT_COUNT;
|
||||
BOOLEAN IsMapScreenWorldItemInvisibleInMapInventory( WORLDITEM *pWorldItem );
|
||||
BOOLEAN IsMapScreenWorldItemVisibleInMapInventory( WORLDITEM *pWorldItem );
|
||||
|
||||
//dnl ch51 081009
|
||||
#define INVPOOLLISTNUM 10
|
||||
BOOLEAN CopySectorInventoryToInventoryPoolQ(UINT8 idx);
|
||||
BOOLEAN CopySectorInventoryToInventoryPoolQs(UINT8 idx);
|
||||
BOOLEAN DisplaySectorItemsInfo(void);
|
||||
BOOLEAN LoadInventoryPoolQ(UINT8 ubSaveGameID);
|
||||
BOOLEAN MemFreeInventoryPoolQ(void);
|
||||
BOOLEAN SaveInventoryPoolQ(UINT8 ubSaveGameID);
|
||||
BOOLEAN SortInventoryPoolQ(void);
|
||||
BOOLEAN SwitchToInventoryPoolQ(UINT8 newidx);
|
||||
|
||||
#endif
|
||||
@@ -7229,4 +7229,4 @@ void MilitiaDisbandYesNoBoxCallback( UINT8 bExitValue )
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -926,7 +926,6 @@ void RestoreBackgroundForAssignmentGlowRegionList( void )
|
||||
// restore background
|
||||
RestoreExternBackgroundRect( 66, Y_START - 1, 118 + 1 - 67, yHeight );
|
||||
|
||||
|
||||
// ARM: not good enough! must reblit the whole panel to erase glow chunk restored by help text disappearing!!!
|
||||
fTeamPanelDirty = TRUE;
|
||||
|
||||
@@ -1581,39 +1580,39 @@ void HandleLeavingOfEquipmentInCurrentSector( UINT32 uiMercId )
|
||||
{
|
||||
// just drop the stuff in the current sector
|
||||
//INT32 iCounter = 0;
|
||||
INT16 sGridNo, sTempGridNo;
|
||||
INT32 sGridNo, sTempGridNo;
|
||||
|
||||
if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || Menptr[ uiMercId ].bSectorZ != gbWorldSectorZ )
|
||||
{
|
||||
// ATE: Use insertion gridno if not nowhere and insertion is gridno
|
||||
if ( Menptr[ uiMercId ].ubStrategicInsertionCode == INSERTION_CODE_GRIDNO && Menptr[ uiMercId ].usStrategicInsertionData != NOWHERE )
|
||||
{
|
||||
sGridNo = Menptr[ uiMercId ].usStrategicInsertionData;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set flag for item...
|
||||
sGridNo = RandomGridNo();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// ATE: Mercs can have a gridno of NOWHERE.....
|
||||
sGridNo = Menptr[ uiMercId ].sGridNo;
|
||||
|
||||
if ( sGridNo == NOWHERE )
|
||||
{
|
||||
sGridNo = RandomGridNo();
|
||||
|
||||
sTempGridNo = FindNearestAvailableGridNoForItem( sGridNo, 5 );
|
||||
if( sTempGridNo == NOWHERE )
|
||||
sTempGridNo = FindNearestAvailableGridNoForItem( sGridNo, 15 );
|
||||
|
||||
if ( sTempGridNo != NOWHERE )
|
||||
// ATE: Use insertion gridno if not nowhere and insertion is gridno
|
||||
if ( Menptr[ uiMercId ].ubStrategicInsertionCode == INSERTION_CODE_GRIDNO && !TileIsOutOfBounds(Menptr[ uiMercId ].usStrategicInsertionData) )
|
||||
{
|
||||
sGridNo = sTempGridNo;
|
||||
sGridNo = Menptr[ uiMercId ].usStrategicInsertionData;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set flag for item...
|
||||
sGridNo = RandomGridNo();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// ATE: Mercs can have a gridno of NOWHERE.....
|
||||
sGridNo = Menptr[ uiMercId ].sGridNo;
|
||||
|
||||
if (TileIsOutOfBounds(sGridNo))
|
||||
{
|
||||
sGridNo = RandomGridNo();
|
||||
|
||||
sTempGridNo = FindNearestAvailableGridNoForItem( sGridNo, 5 );
|
||||
|
||||
if(TileIsOutOfBounds(sTempGridNo))
|
||||
sTempGridNo = FindNearestAvailableGridNoForItem( sGridNo, 15 );
|
||||
else
|
||||
{
|
||||
sGridNo = sTempGridNo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for( UINT32 iCounter = 0; iCounter < Menptr[ uiMercId ].inv.size(); iCounter++ )
|
||||
@@ -1622,11 +1621,11 @@ void HandleLeavingOfEquipmentInCurrentSector( UINT32 uiMercId )
|
||||
// check if actual item
|
||||
if( Menptr[ uiMercId ].inv[ iCounter ].exists() == true )
|
||||
{
|
||||
if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || Menptr[ uiMercId ].bSectorZ != gbWorldSectorZ )
|
||||
{
|
||||
// Set flag for item...
|
||||
if( Menptr[ uiMercId ].sSectorX != gWorldSectorX || Menptr[ uiMercId ].sSectorY != gWorldSectorY || Menptr[ uiMercId ].bSectorZ != gbWorldSectorZ )
|
||||
{
|
||||
// Set flag for item...
|
||||
AddItemsToUnLoadedSector( Menptr[ uiMercId ].sSectorX, Menptr[ uiMercId ].sSectorY, Menptr[ uiMercId ].bSectorZ , sGridNo, 1, &( Menptr[ uiMercId ].inv[ iCounter ]) , Menptr[ uiMercId ].pathing.bLevel, WOLRD_ITEM_FIND_SWEETSPOT_FROM_GRIDNO | WORLD_ITEM_REACHABLE, 0, 1, FALSE );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
AddItemToPool( sGridNo, &( Menptr[ uiMercId ].inv[ iCounter ] ) , 1, Menptr[ uiMercId ].pathing.bLevel, WORLD_ITEM_REACHABLE, 0 );
|
||||
|
||||
@@ -118,7 +118,7 @@ enum {
|
||||
MAX_ASSIGN_STRING_COUNT,
|
||||
};
|
||||
|
||||
// HEADROCK HAM 3.6: Added new option to train Mobile Militia separately.
|
||||
|
||||
// training assignment menu defines
|
||||
enum {
|
||||
TRAIN_MENU_SELF,
|
||||
|
||||
@@ -63,7 +63,7 @@ INT8 gzMeanwhileStr[][30] =
|
||||
|
||||
|
||||
// the snap to grid nos for meanwhile scenes
|
||||
INT16 gsMeanWhileGridNo[]=
|
||||
INT32 gusMeanWhileGridNo[]=
|
||||
{
|
||||
12248,
|
||||
12248,
|
||||
@@ -91,7 +91,7 @@ typedef struct
|
||||
INT16 sX;
|
||||
INT16 sY;
|
||||
INT16 sZ;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
} NPC_SAVE_INFO;
|
||||
|
||||
@@ -145,7 +145,7 @@ UINT32 uiMeanWhileFlags = 0;
|
||||
#define INTERROGATION_FLAG 0x00008000
|
||||
#define BALIME_LIBERATED_FLAG 0x00010000
|
||||
|
||||
extern void InternalLocateGridNo( INT16 sGridNo, BOOLEAN fForce );
|
||||
extern void InternalLocateGridNo( INT32 sGridNo, BOOLEAN fForce );
|
||||
|
||||
|
||||
void ProcessImplicationsOfMeanwhile( void );
|
||||
@@ -916,10 +916,10 @@ void DoneFadeInMeanwhileOnceDone( )
|
||||
|
||||
void LocateMeanWhileGrid( void )
|
||||
{
|
||||
INT16 sGridNo = 0;
|
||||
INT32 sGridNo = 0;
|
||||
|
||||
// go to the approp. gridno
|
||||
sGridNo = gsMeanWhileGridNo[ ubCurrentMeanWhileId ];
|
||||
sGridNo = gusMeanWhileGridNo[ ubCurrentMeanWhileId ];
|
||||
|
||||
InternalLocateGridNo( sGridNo, TRUE );
|
||||
|
||||
|
||||
+25
-11
@@ -865,7 +865,14 @@ BOOLEAN BeginStrategicRemoveMerc( SOLDIERTYPE *pSoldier, BOOLEAN fAddRehireButto
|
||||
}
|
||||
else
|
||||
{
|
||||
NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( pSoldier, fAddRehireButton );
|
||||
if (!is_networked)
|
||||
NotifyPlayerOfMercDepartureAndPromptEquipmentPlacement( pSoldier, fAddRehireButton );
|
||||
else
|
||||
{
|
||||
// WANNE - MP: Skip all the dialog boxes that appear. Just dismiss the merc
|
||||
StrategicRemoveMerc( pSoldier );
|
||||
pLeaveSoldier = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return( TRUE );
|
||||
@@ -1004,6 +1011,10 @@ BOOLEAN StrategicRemoveMerc( SOLDIERTYPE *pSoldier )
|
||||
UnLockPauseState();
|
||||
UnPauseGame();
|
||||
|
||||
|
||||
if (is_client)
|
||||
send_dismiss(pSoldier->ubID);
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -1486,17 +1497,20 @@ void ExtendMercInsuranceContractCallBack( UINT8 bExitValue )
|
||||
|
||||
void HandleUniqueEventWhenPlayerLeavesTeam( SOLDIERTYPE *pSoldier )
|
||||
{
|
||||
switch( pSoldier->ubProfile )
|
||||
if (!is_networked)
|
||||
{
|
||||
//When iggy leaves the players team,
|
||||
case IGGY:
|
||||
//if he is owed money ( ie the player didnt pay him )
|
||||
if( gMercProfiles[ pSoldier->ubProfile ].iBalance < 0 )
|
||||
{
|
||||
//iggy is now available to be handled by the enemy
|
||||
gubFact[ FACT_IGGY_AVAILABLE_TO_ARMY ] = TRUE;
|
||||
}
|
||||
break;
|
||||
switch( pSoldier->ubProfile )
|
||||
{
|
||||
//When iggy leaves the players team,
|
||||
case IGGY:
|
||||
//if he is owed money ( ie the player didnt pay him )
|
||||
if( gMercProfiles[ pSoldier->ubProfile ].iBalance < 0 )
|
||||
{
|
||||
//iggy is now available to be handled by the enemy
|
||||
gubFact[ FACT_IGGY_AVAILABLE_TO_ARMY ] = TRUE;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
#define DIR_SOUTH 2
|
||||
#define DIR_WEST 3
|
||||
|
||||
|
||||
INT32 iRestrictedSectorArraySize;
|
||||
UINT32 gRestrictMilitia[256];
|
||||
// HEADROCK HAM B1: Alternate array keeps track of dynamically unrestricted sectors
|
||||
@@ -145,7 +144,6 @@ UINT8 CountMilitia(SECTORINFO *pSectorInfo)
|
||||
pSectorInfo->ubNumberOfCivsAtLevel[ELITE_MILITIA];
|
||||
}
|
||||
|
||||
|
||||
// Creates militia at destination sector. The type and amount of militia depends on current sector's miltia type and amount
|
||||
// HEADROCK HAM 3.4: Added Leadership argument.
|
||||
void GenerateMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, UINT8 ubBestLeadership )
|
||||
|
||||
+45
-44
@@ -73,7 +73,7 @@ extern INT32 giGarrisonArraySize;
|
||||
extern BOOLEAN gfOverrideSector;
|
||||
#endif
|
||||
|
||||
INT16 gsInterrogationGridNo[3] = { 7756, 7757, 7758 };
|
||||
INT32 gsInterrogationGridNo[3] = { 7756, 7757, 7758 };
|
||||
|
||||
|
||||
extern void Ensure_RepairedGarrisonGroup( GARRISON_GROUP **ppGarrison, INT32 *pGarraySize );
|
||||
@@ -210,15 +210,15 @@ UINT8 NumEnemiesInSector( INT16 sSectorX, INT16 sSectorY )
|
||||
GROUP *pGroup;
|
||||
UINT8 ubNumTroops;
|
||||
|
||||
// HEADROCK HAM 3.5: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
||||
// probably isn't. But I need this bit to work.
|
||||
if (sSectorX < MINIMUM_VALID_X_COORDINATE ||
|
||||
sSectorX > MAXIMUM_VALID_X_COORDINATE ||
|
||||
sSectorY < MINIMUM_VALID_Y_COORDINATE ||
|
||||
sSectorY > MAXIMUM_VALID_Y_COORDINATE)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
// HEADROCK: This is a TEMPORARY fix to avoid the assertion error. Not sure this is the best solution,
|
||||
// probably isn't. But I need this bit to work.
|
||||
if (sSectorX < MINIMUM_VALID_X_COORDINATE ||
|
||||
sSectorX > MAXIMUM_VALID_X_COORDINATE ||
|
||||
sSectorY < MINIMUM_VALID_Y_COORDINATE ||
|
||||
sSectorY > MAXIMUM_VALID_Y_COORDINATE)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
AssertGE( sSectorX, MINIMUM_VALID_X_COORDINATE);
|
||||
AssertLE( sSectorX, MAXIMUM_VALID_X_COORDINATE );
|
||||
@@ -587,35 +587,35 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
else
|
||||
{
|
||||
|
||||
if( pSector->uiFlags & SF_USE_MAP_SETTINGS )
|
||||
{ //count the number of enemy placements in a map and use those
|
||||
SOLDIERINITNODE *curr = gSoldierInitHead;
|
||||
ubTotalAdmins = ubTotalTroops = ubTotalElites = 0;
|
||||
while( curr )
|
||||
{
|
||||
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
switch( curr->pBasicPlacement->ubSoldierClass )
|
||||
{
|
||||
case SOLDIER_CLASS_ADMINISTRATOR: ubTotalAdmins++; break;
|
||||
case SOLDIER_CLASS_ARMY: ubTotalTroops++; break;
|
||||
case SOLDIER_CLASS_ELITE: ubTotalElites++; break;
|
||||
}
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
pSector->ubNumAdmins = ubTotalAdmins;
|
||||
pSector->ubNumTroops = ubTotalTroops;
|
||||
pSector->ubNumElites = ubTotalElites;
|
||||
pSector->ubAdminsInBattle = 0;
|
||||
pSector->ubTroopsInBattle = 0;
|
||||
pSector->ubElitesInBattle = 0;
|
||||
}
|
||||
else
|
||||
if( pSector->uiFlags & SF_USE_MAP_SETTINGS )
|
||||
{ //count the number of enemy placements in a map and use those
|
||||
SOLDIERINITNODE *curr = gSoldierInitHead;
|
||||
ubTotalAdmins = ubTotalTroops = ubTotalElites = 0;
|
||||
while( curr )
|
||||
{
|
||||
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
|
||||
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
|
||||
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
|
||||
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
switch( curr->pBasicPlacement->ubSoldierClass )
|
||||
{
|
||||
case SOLDIER_CLASS_ADMINISTRATOR: ubTotalAdmins++; break;
|
||||
case SOLDIER_CLASS_ARMY: ubTotalTroops++; break;
|
||||
case SOLDIER_CLASS_ELITE: ubTotalElites++; break;
|
||||
}
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
pSector->ubNumAdmins = ubTotalAdmins;
|
||||
pSector->ubNumTroops = ubTotalTroops;
|
||||
pSector->ubNumElites = ubTotalElites;
|
||||
pSector->ubAdminsInBattle = 0;
|
||||
pSector->ubTroopsInBattle = 0;
|
||||
pSector->ubElitesInBattle = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
|
||||
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
|
||||
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -787,6 +787,7 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
continue;
|
||||
}
|
||||
|
||||
// At this point we should not have added more soldiers than are in slots
|
||||
AssertGT( sNumSlots, 0 );
|
||||
|
||||
switch( pSoldier->ubSoldierClass )
|
||||
@@ -1289,8 +1290,8 @@ void ProcessQueenCmdImplicationsOfDeath( SOLDIERTYPE *pSoldier )
|
||||
//identical, though it is highly likely that they will all be successfully added on the first call.
|
||||
void AddPossiblePendingEnemiesToBattle()
|
||||
{
|
||||
// check if no world is loaded
|
||||
if ( !gWorldSectorX && !gWorldSectorY && (gbWorldSectorZ == -1) )
|
||||
// Check if no world is loaded, and is not underground level
|
||||
if(!(gWorldSectorX > 0 && gWorldSectorY > 0 && gbWorldSectorZ == 0))//dnl ch57 161009
|
||||
return;
|
||||
|
||||
UINT8 ubSlots, ubNumAvailable;
|
||||
@@ -1392,7 +1393,6 @@ void AddPossiblePendingEnemiesToBattle()
|
||||
|
||||
if( ubStrategicInsertionCode == 255 )
|
||||
{
|
||||
// HEADROCK HAM 3.5: This runs into assertion errors along the map's edge! Should be fixed!
|
||||
if( NumEnemiesInSector( gWorldSectorX + 1, gWorldSectorY ) )
|
||||
ubStrategicInsertionCode = INSERTION_CODE_EAST;
|
||||
else if( NumEnemiesInSector( gWorldSectorX - 1, gWorldSectorY ) )
|
||||
@@ -1905,10 +1905,11 @@ void EnemyCapturesPlayerSoldier( SOLDIERTYPE *pSoldier )
|
||||
INT32 iNumEnemiesInSector;
|
||||
|
||||
|
||||
static INT16 sAlmaCaptureGridNos[] = { 9208, 9688, 9215 };
|
||||
static INT16 sAlmaCaptureItemsGridNo[] = { 12246, 12406, 13046 };
|
||||
// TODO.WANNE: Hardcoded grid number
|
||||
static INT32 sAlmaCaptureGridNos[] = { 9208, 9688, 9215 };
|
||||
static INT32 sAlmaCaptureItemsGridNo[] = { 12246, 12406, 13046 };
|
||||
|
||||
static INT16 sInterrogationItemGridNo[] = { 12089, 12089, 12089 };
|
||||
static INT32 sInterrogationItemGridNo[] = { 12089, 12089, 12089 };
|
||||
|
||||
AssertNotNIL(pSoldier);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ BOOLEAN PlayerSectorDefended( UINT8 ubSectorID );
|
||||
|
||||
BOOLEAN OnlyHostileCivsInSector();
|
||||
|
||||
extern INT16 gsInterrogationGridNo[3];
|
||||
extern INT32 gsInterrogationGridNo[3];
|
||||
|
||||
BOOLEAN CheckPendingEnemies();
|
||||
|
||||
|
||||
@@ -477,7 +477,7 @@ SCROLL_BOX gItemListBox; // The Npc Scroll box
|
||||
|
||||
SCROLL_BOX *gpActiveListBox; // Only 1 scroll box is active at a time, this is set to it.
|
||||
|
||||
INT16 gsQdsEnteringGridNo =0;
|
||||
INT32 gsQdsEnteringGridNo =0;
|
||||
|
||||
|
||||
UINT8 gubTextEntryAction = QD_DROP_DOWN_NO_ACTION;
|
||||
@@ -3008,7 +3008,7 @@ void AddNPCToGridNo( INT32 iGridNo )
|
||||
MercCreateStruct.sSectorX = sSectorX;
|
||||
MercCreateStruct.sSectorY = sSectorY;
|
||||
MercCreateStruct.bSectorZ = gbWorldSectorZ;
|
||||
MercCreateStruct.sInsertionGridNo = (INT16) iGridNo;
|
||||
MercCreateStruct.sInsertionGridNo = iGridNo;
|
||||
|
||||
// RandomizeNewSoldierStats( &MercCreateStruct );
|
||||
|
||||
@@ -3023,14 +3023,14 @@ void AddNPCToGridNo( INT32 iGridNo )
|
||||
//Add all the npc in the current sectory the npc array
|
||||
AddNPCsInSectorToArray();
|
||||
|
||||
gsQdsEnteringGridNo = (INT16)iGridNo;
|
||||
gsQdsEnteringGridNo = iGridNo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void AddItemToGridNo( INT32 iGridNo )
|
||||
{
|
||||
gsQdsEnteringGridNo = (INT16)iGridNo;
|
||||
gsQdsEnteringGridNo = iGridNo;
|
||||
|
||||
|
||||
if( Item[ gItemListBox.sCurSelectedItem ].usItemClass == IC_KEY )
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
|
||||
extern BOOLEAN gfNpcLogButton;
|
||||
extern INT16 gsQdsEnteringGridNo;
|
||||
extern INT32 gsQdsEnteringGridNo;
|
||||
|
||||
|
||||
void NpcRecordLoggingInit( UINT8 ubNpcID, UINT8 ubMercID, UINT8 ubQuoteNum, UINT8 ubApproach );
|
||||
|
||||
+12
-13
@@ -185,7 +185,7 @@ BOOLEAN CheckGuyVisible( UINT8 ubNPC, UINT8 ubGuy )
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN CheckNPCAt( UINT8 ubNPC, INT16 sGridNo )
|
||||
BOOLEAN CheckNPCAt( UINT8 ubNPC, INT32 sGridNo )
|
||||
{
|
||||
SOLDIERTYPE * pNPC;
|
||||
|
||||
@@ -227,7 +227,7 @@ BOOLEAN CheckNPCIsEnemy( UINT8 ubProfileID )
|
||||
BOOLEAN CheckIfMercIsNearNPC( SOLDIERTYPE *pMerc, UINT8 ubProfileId )
|
||||
{
|
||||
SOLDIERTYPE * pNPC;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
// no merc nearby?
|
||||
if ( pMerc == NULL )
|
||||
@@ -258,7 +258,7 @@ INT8 NumWoundedMercsNearby( UINT8 ubProfileID )
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE * pNPC;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||
if (!pNPC)
|
||||
@@ -289,7 +289,7 @@ INT8 NumMercsNear( UINT8 ubProfileID, UINT8 ubMaxDist )
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE * pNPC;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||
if (!pNPC)
|
||||
@@ -436,7 +436,7 @@ INT8 NumMalesPresent( UINT8 ubProfileID )
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE * pNPC;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||
if (!pNPC)
|
||||
@@ -470,7 +470,7 @@ BOOLEAN FemalePresent( UINT8 ubProfileID )
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE * pNPC;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
INT16 sGridNo;
|
||||
INT32 sGridNo;
|
||||
|
||||
pNPC = FindSoldierByProfileID( ubProfileID, FALSE );
|
||||
if (!pNPC)
|
||||
@@ -547,7 +547,7 @@ BOOLEAN CheckNPCSector( UINT8 ubProfileID, INT16 sSectorX, INT16 sSectorY, INT8
|
||||
|
||||
}
|
||||
|
||||
BOOLEAN AIMMercWithin( INT16 sGridNo, INT16 sDistance )
|
||||
BOOLEAN AIMMercWithin( INT32 sGridNo, INT16 sDistance )
|
||||
{
|
||||
UINT32 uiLoop;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
@@ -1250,11 +1250,11 @@ void InternalStartQuest( UINT8 ubQuest, INT16 sSectorX, INT16 sSectorY, BOOLEAN
|
||||
{
|
||||
gubQuest[ubQuest] = QUESTINPROGRESS;
|
||||
|
||||
if ( fUpdateHistory )
|
||||
{
|
||||
if ( fUpdateHistory )
|
||||
{
|
||||
if (!is_networked)
|
||||
SetHistoryFact( HISTORY_QUEST_STARTED, ubQuest, GetWorldTotalMin(), sSectorX, sSectorY );
|
||||
}
|
||||
SetHistoryFact( HISTORY_QUEST_STARTED, ubQuest, GetWorldTotalMin(), sSectorX, sSectorY );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1333,12 +1333,11 @@ void CheckForQuests( UINT32 uiDay )
|
||||
// already started
|
||||
if (gubQuest[QUEST_DELIVER_LETTER] == QUESTNOTSTARTED)
|
||||
{
|
||||
|
||||
StartQuest( QUEST_DELIVER_LETTER, -1, -1 );
|
||||
#ifdef TESTQUESTS
|
||||
|
||||
if (!is_networked)
|
||||
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"Started DELIVER LETTER quest");
|
||||
ScreenMsg( MSG_FONT_RED, MSG_DEBUG, L"Started DELIVER LETTER quest");
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -373,12 +373,15 @@ UINT8 DoReinforcementAsPendingMilitia( INT16 sMapX, INT16 sMapY, UINT8 *pubRank
|
||||
|
||||
void AddPossiblePendingMilitiaToBattle()
|
||||
{
|
||||
|
||||
UINT8 ubSlots;
|
||||
UINT8 ubNumElites, ubNumRegulars, ubNumGreens;
|
||||
static UINT8 ubPredefinedInsertionCode = 255;
|
||||
static UINT8 ubPredefinedRank = 255;
|
||||
|
||||
// Check if no world is loaded, and is not underground level
|
||||
if(!(gWorldSectorX > 0 && gWorldSectorY > 0 && gbWorldSectorZ == 0))//dnl ch57 161009
|
||||
return;
|
||||
|
||||
// Haydent
|
||||
if (is_networked)
|
||||
{
|
||||
|
||||
+135
-93
@@ -363,47 +363,6 @@ void PrepareSchedulesForEditorExit()
|
||||
PostSchedules();
|
||||
}
|
||||
|
||||
void LoadSchedules( INT8 **hBuffer )
|
||||
{
|
||||
SCHEDULENODE *pSchedule = NULL;
|
||||
SCHEDULENODE temp;
|
||||
UINT8 ubNum;
|
||||
|
||||
// delete all the schedules we might have loaded (though we shouldn't have any loaded!!)
|
||||
if ( gpScheduleList )
|
||||
{
|
||||
DestroyAllSchedules();
|
||||
}
|
||||
|
||||
LOADDATA( &ubNum, *hBuffer, sizeof( UINT8 ) );
|
||||
gubScheduleID = 1;
|
||||
while( ubNum )
|
||||
{
|
||||
LOADDATA( &temp, *hBuffer, sizeof( SCHEDULENODE ) );
|
||||
|
||||
if( gpScheduleList )
|
||||
{
|
||||
pSchedule->next = (SCHEDULENODE*)MemAlloc( sizeof( SCHEDULENODE ) );
|
||||
Assert( pSchedule->next );
|
||||
pSchedule = pSchedule->next;
|
||||
memcpy( pSchedule, &temp, sizeof( SCHEDULENODE ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
gpScheduleList = (SCHEDULENODE*)MemAlloc( sizeof( SCHEDULENODE ) );
|
||||
Assert( gpScheduleList );
|
||||
memcpy( gpScheduleList, &temp, sizeof( SCHEDULENODE ) );
|
||||
pSchedule = gpScheduleList;
|
||||
}
|
||||
pSchedule->ubScheduleID = gubScheduleID;
|
||||
pSchedule->ubSoldierID = NOBODY;
|
||||
pSchedule->next = NULL;
|
||||
gubScheduleID++;
|
||||
ubNum--;
|
||||
}
|
||||
//Schedules are posted when the soldier is added...
|
||||
}
|
||||
|
||||
extern BOOLEAN gfSchedulesHosed;
|
||||
BOOLEAN LoadSchedulesFromSave( HWFILE hFile )
|
||||
{
|
||||
@@ -517,55 +476,137 @@ void ClearAllSchedules()
|
||||
}
|
||||
}
|
||||
|
||||
BOOLEAN SaveSchedules( HWFILE hFile )
|
||||
//dnl ch42 260909
|
||||
SCHEDULENODE& SCHEDULENODE::operator=(const _OLD_SCHEDULENODE& src)
|
||||
{
|
||||
SCHEDULENODE *curr;
|
||||
UINT32 uiBytesWritten;
|
||||
UINT8 ubNum, ubNumFucker;
|
||||
INT32 iNum;
|
||||
//Now, count the number of schedules in the list
|
||||
iNum = 0;
|
||||
curr = gpScheduleList;
|
||||
while( curr )
|
||||
if((void*)this != (void*)&src)
|
||||
{
|
||||
// skip all default schedules
|
||||
if ( !(curr->usFlags & SCHEDULE_FLAGS_TEMPORARY) )
|
||||
next = NULL;
|
||||
TranslateArrayFields(usTime, src.usTime, OLD_MAX_SCHEDULE_ACTIONS, UINT16_UINT16);
|
||||
TranslateArrayFields(usData1, src.usData1, OLD_MAX_SCHEDULE_ACTIONS, INT16_INT32);
|
||||
TranslateArrayFields(usData2, src.usData2, OLD_MAX_SCHEDULE_ACTIONS, INT16_INT32);
|
||||
TranslateArrayFields(ubAction, src.ubAction, OLD_MAX_SCHEDULE_ACTIONS, UINT8_UINT8);
|
||||
ubScheduleID = src.ubScheduleID;
|
||||
ubSoldierID = src.ubSoldierID;
|
||||
usFlags = src.usFlags;
|
||||
}
|
||||
return(*this);
|
||||
}
|
||||
|
||||
BOOLEAN SCHEDULENODE::Load(INT8** hBuffer, FLOAT dMajorMapVersion)
|
||||
{
|
||||
if(dMajorMapVersion < 7.0)
|
||||
{
|
||||
_OLD_SCHEDULENODE OldScheduleNode;
|
||||
LOADDATA(&OldScheduleNode, *hBuffer, sizeof(_OLD_SCHEDULENODE));
|
||||
*this = OldScheduleNode;
|
||||
}
|
||||
else
|
||||
LOADDATA(this, *hBuffer, sizeof(SCHEDULENODE));
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
BOOLEAN SCHEDULENODE::Save(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMapVersion)
|
||||
{
|
||||
PTR pData = this;
|
||||
UINT32 uiBytesToWrite = sizeof(SCHEDULENODE);
|
||||
_OLD_SCHEDULENODE OldScheduleNode;
|
||||
if(dMajorMapVersion == VANILLA_MAJOR_MAP_VERSION && ubMinorMapVersion == VANILLA_MINOR_MAP_VERSION)
|
||||
{
|
||||
OldScheduleNode.next = NULL;
|
||||
TranslateArrayFields(OldScheduleNode.usTime, usTime, OLD_MAX_SCHEDULE_ACTIONS, UINT16_UINT16);
|
||||
TranslateArrayFields(OldScheduleNode.usData1, usData1, OLD_MAX_SCHEDULE_ACTIONS, INT32_INT16);
|
||||
TranslateArrayFields(OldScheduleNode.usData2, usData2, OLD_MAX_SCHEDULE_ACTIONS, INT32_INT16);
|
||||
TranslateArrayFields(OldScheduleNode.ubAction, ubAction, OLD_MAX_SCHEDULE_ACTIONS, UINT8_UINT8);
|
||||
OldScheduleNode.ubScheduleID = ubScheduleID;
|
||||
OldScheduleNode.ubSoldierID = ubSoldierID;
|
||||
OldScheduleNode.usFlags = usFlags;
|
||||
pData = &OldScheduleNode;
|
||||
uiBytesToWrite = sizeof(_OLD_SCHEDULENODE);
|
||||
}
|
||||
UINT32 uiBytesWritten = 0;
|
||||
FileWrite(hFile, pData, uiBytesToWrite, &uiBytesWritten);
|
||||
if(uiBytesToWrite == uiBytesWritten)
|
||||
return(TRUE);
|
||||
return(FALSE);
|
||||
}
|
||||
|
||||
void LoadSchedules(INT8** hBuffer, FLOAT dMajorMapVersion)
|
||||
{
|
||||
SCHEDULENODE* pSchedule = NULL;
|
||||
SCHEDULENODE temp;
|
||||
|
||||
// Delete all the schedules we might have loaded (though we shouldn't have any loaded!!)
|
||||
if(gpScheduleList)
|
||||
DestroyAllSchedules();
|
||||
UINT8 ubNum;
|
||||
LOADDATA(&ubNum, *hBuffer, sizeof(ubNum));
|
||||
gubScheduleID = 1;
|
||||
while(ubNum)
|
||||
{
|
||||
temp.Load(hBuffer, dMajorMapVersion);
|
||||
for(int i=0; i<MAX_SCHEDULE_ACTIONS; i++)//dnl ch44 280909 SCHEDULENODE translation
|
||||
{
|
||||
gMapTrn.GetTrnCnt((INT32&)temp.usData1[i]);
|
||||
gMapTrn.GetTrnCnt((INT32&)temp.usData2[i]);
|
||||
}
|
||||
if(gpScheduleList)
|
||||
{
|
||||
pSchedule->next = (SCHEDULENODE*)MemAlloc(sizeof(SCHEDULENODE));
|
||||
Assert(pSchedule->next);
|
||||
pSchedule = pSchedule->next;
|
||||
memcpy(pSchedule, &temp, sizeof(SCHEDULENODE));
|
||||
}
|
||||
else
|
||||
{
|
||||
gpScheduleList = (SCHEDULENODE*)MemAlloc(sizeof(SCHEDULENODE));
|
||||
Assert(gpScheduleList);
|
||||
memcpy(gpScheduleList, &temp, sizeof(SCHEDULENODE));
|
||||
pSchedule = gpScheduleList;
|
||||
}
|
||||
pSchedule->ubScheduleID = gubScheduleID;
|
||||
pSchedule->ubSoldierID = NOBODY;
|
||||
pSchedule->next = NULL;
|
||||
gubScheduleID++;
|
||||
ubNum--;
|
||||
}
|
||||
// Schedules are posted when the soldier is added...
|
||||
}
|
||||
|
||||
BOOLEAN SaveSchedules(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMapVersion)
|
||||
{
|
||||
// Now, count the number of schedules in the list
|
||||
INT32 iNum = 0;
|
||||
SCHEDULENODE* curr = gpScheduleList;
|
||||
while(curr)
|
||||
{
|
||||
// Skip all default schedules
|
||||
if(!(curr->usFlags & SCHEDULE_FLAGS_TEMPORARY))
|
||||
iNum++;
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
ubNum = (UINT8)(( iNum >= 32 ) ? 32 : iNum);
|
||||
|
||||
FileWrite( hFile, &ubNum, sizeof( UINT8 ), &uiBytesWritten );
|
||||
if ( uiBytesWritten != sizeof( UINT8 ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
//Now, save each schedule
|
||||
UINT8 ubNum = (UINT8)((iNum >= 32) ? 32 : iNum);
|
||||
UINT32 uiBytesWritten;
|
||||
FileWrite(hFile, &ubNum, sizeof(ubNum), &uiBytesWritten);
|
||||
if(uiBytesWritten != sizeof(ubNum))
|
||||
return(FALSE);
|
||||
// Now, save each schedule
|
||||
curr = gpScheduleList;
|
||||
ubNumFucker = 0;
|
||||
while( curr )
|
||||
UINT8 ubNumFucker = 0;
|
||||
while(curr)
|
||||
{
|
||||
// skip all default schedules
|
||||
if ( !(curr->usFlags & SCHEDULE_FLAGS_TEMPORARY) )
|
||||
// Skip all default schedules
|
||||
if(!(curr->usFlags & SCHEDULE_FLAGS_TEMPORARY))
|
||||
{
|
||||
|
||||
ubNumFucker++;
|
||||
if( ubNumFucker > ubNum )
|
||||
{
|
||||
return( TRUE );
|
||||
}
|
||||
FileWrite( hFile, curr, sizeof( SCHEDULENODE ), &uiBytesWritten );
|
||||
if ( uiBytesWritten != sizeof( SCHEDULENODE ) )
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
if(ubNumFucker > ubNum)
|
||||
return(TRUE);
|
||||
if(!curr->Save(hFile, dMajorMapVersion, ubMinorMapVersion))
|
||||
return(FALSE);
|
||||
}
|
||||
curr = curr->next;
|
||||
}
|
||||
return( TRUE );
|
||||
return(TRUE);
|
||||
}
|
||||
|
||||
//Each schedule has upto four parts to it, so sort them chronologically.
|
||||
@@ -614,11 +655,11 @@ BOOLEAN SortSchedule( SCHEDULENODE *pSchedule )
|
||||
return fSorted;
|
||||
}
|
||||
|
||||
BOOLEAN BumpAnyExistingMerc( INT16 sGridNo )
|
||||
BOOLEAN BumpAnyExistingMerc( INT32 sGridNo )
|
||||
{
|
||||
UINT8 ubID;
|
||||
SOLDIERTYPE * pSoldier; // NB this is the person already in the location,
|
||||
INT16 sNewGridNo;
|
||||
INT32 sNewGridNo;
|
||||
UINT8 ubDir;
|
||||
INT16 sCellX, sCellY;
|
||||
|
||||
@@ -644,7 +685,7 @@ BOOLEAN BumpAnyExistingMerc( INT16 sGridNo )
|
||||
sNewGridNo = FindGridNoFromSweetSpotWithStructDataFromSoldier( pSoldier, STANDING, 5, &ubDir, 1, pSoldier );
|
||||
//sNewGridNo = FindGridNoFromSweetSpotExcludingSweetSpot( pSoldier, sGridNo, 10, &ubDir );
|
||||
|
||||
if ( sNewGridNo == NOWHERE )
|
||||
if (TileIsOutOfBounds(sNewGridNo))
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
@@ -657,7 +698,8 @@ BOOLEAN BumpAnyExistingMerc( INT16 sGridNo )
|
||||
|
||||
void AutoProcessSchedule( SCHEDULENODE *pSchedule, INT32 index )
|
||||
{
|
||||
INT16 sCellX, sCellY, sGridNo;
|
||||
INT16 sCellX, sCellY;
|
||||
INT32 sGridNo;
|
||||
INT8 bDirection;
|
||||
SOLDIERTYPE * pSoldier;
|
||||
|
||||
@@ -711,7 +753,7 @@ void AutoProcessSchedule( SCHEDULENODE *pSchedule, INT32 index )
|
||||
case SCHEDULE_ACTION_UNLOCKDOOR:
|
||||
case SCHEDULE_ACTION_OPENDOOR:
|
||||
case SCHEDULE_ACTION_CLOSEDOOR:
|
||||
PerformActionOnDoorAdjacentToGridNo( pSchedule->ubAction[ index ], (INT16)pSchedule->usData1[ index ] );
|
||||
PerformActionOnDoorAdjacentToGridNo( pSchedule->ubAction[ index ], pSchedule->usData1[ index ] );
|
||||
BumpAnyExistingMerc( pSchedule->usData2[ index ] );
|
||||
ConvertGridNoToCellXY( pSchedule->usData2[ index ], &sCellX, &sCellY );
|
||||
|
||||
@@ -987,8 +1029,8 @@ void PostDefaultSchedule( SOLDIERTYPE *pSoldier )
|
||||
for( i = 0; i < MAX_SCHEDULE_ACTIONS; i++ )
|
||||
{
|
||||
gpScheduleList->usTime[i] = 0xffff;
|
||||
gpScheduleList->usData1[i] = 0xffff;
|
||||
gpScheduleList->usData2[i] = 0xffff;
|
||||
gpScheduleList->usData1[i] = 0xffffffff;
|
||||
gpScheduleList->usData2[i] = 0xffffffff;
|
||||
}
|
||||
//Have the default schedule enter between 7AM and 8AM
|
||||
gpScheduleList->ubAction[0] = SCHEDULE_ACTION_ENTERSECTOR;
|
||||
@@ -1055,13 +1097,13 @@ void PostSchedules()
|
||||
}
|
||||
}
|
||||
|
||||
void PerformActionOnDoorAdjacentToGridNo( UINT8 ubScheduleAction, INT16 sGridNo )
|
||||
void PerformActionOnDoorAdjacentToGridNo( UINT8 ubScheduleAction, INT32 usGridNo )
|
||||
{
|
||||
INT16 sDoorGridNo;
|
||||
INT32 sDoorGridNo;
|
||||
DOOR * pDoor;
|
||||
|
||||
sDoorGridNo = FindDoorAtGridNoOrAdjacent( (INT16) sGridNo );
|
||||
if (sDoorGridNo != NOWHERE)
|
||||
sDoorGridNo = FindDoorAtGridNoOrAdjacent( usGridNo );
|
||||
if (!TileIsOutOfBounds(sDoorGridNo))
|
||||
{
|
||||
switch( ubScheduleAction )
|
||||
{
|
||||
@@ -1306,7 +1348,7 @@ void ReconnectSchedules( void )
|
||||
}
|
||||
*/
|
||||
|
||||
UINT16 FindSleepSpot( SCHEDULENODE * pSchedule )
|
||||
UINT32 FindSleepSpot( SCHEDULENODE * pSchedule )
|
||||
{
|
||||
INT8 bLoop;
|
||||
|
||||
@@ -1336,10 +1378,10 @@ void ReplaceSleepSpot( SCHEDULENODE * pSchedule, UINT16 usNewSpot )
|
||||
}
|
||||
|
||||
|
||||
void SecureSleepSpot( SOLDIERTYPE * pSoldier, UINT16 usSleepSpot )
|
||||
void SecureSleepSpot( SOLDIERTYPE * pSoldier, UINT32 usSleepSpot )
|
||||
{
|
||||
SOLDIERTYPE * pSoldier2;
|
||||
UINT16 usSleepSpot2, usNewSleepSpot;
|
||||
UINT32 usSleepSpot2, usNewSleepSpot;
|
||||
UINT32 uiLoop;
|
||||
SCHEDULENODE * pSchedule;
|
||||
UINT8 ubDirection;
|
||||
@@ -1359,7 +1401,7 @@ void SecureSleepSpot( SOLDIERTYPE * pSoldier, UINT16 usSleepSpot )
|
||||
// conflict!
|
||||
//usNewSleepSpot = (INT16) FindGridNoFromSweetSpotWithStructData( pSoldier2, pSoldier2->usAnimState, usSleepSpot2, 3, &ubDirection, FALSE );
|
||||
usNewSleepSpot = FindGridNoFromSweetSpotExcludingSweetSpot( pSoldier2, usSleepSpot2, 3, &ubDirection );
|
||||
if ( usNewSleepSpot != NOWHERE )
|
||||
if (!TileIsOutOfBounds(usNewSleepSpot))
|
||||
{
|
||||
ReplaceSleepSpot( pSchedule, usNewSleepSpot );
|
||||
}
|
||||
@@ -1389,7 +1431,7 @@ void SecureSleepSpots( void )
|
||||
if ( pSchedule )
|
||||
{
|
||||
usSleepSpot = FindSleepSpot( pSchedule );
|
||||
if ( usSleepSpot != NOWHERE )
|
||||
if (!TileIsOutOfBounds(usSleepSpot))
|
||||
{
|
||||
SecureSleepSpot( pSoldier, usSleepSpot );
|
||||
}
|
||||
|
||||
+32
-13
@@ -38,19 +38,38 @@ enum
|
||||
// combo flag for turning active flags off
|
||||
#define SCHEDULE_FLAGS_ACTIVE_ALL 0x00F0
|
||||
|
||||
#define MAX_SCHEDULE_ACTIONS 4
|
||||
|
||||
typedef struct SCHEDULENODE
|
||||
//dnl ch42 260909
|
||||
#define MAX_SCHEDULE_ACTIONS 4//dnl Now is possible to extend beyond 4 and old maps should be correctly load, but didn't test behaviour in game
|
||||
#define OLD_MAX_SCHEDULE_ACTIONS 4
|
||||
// WANNE - BMP: DONE!
|
||||
typedef struct _OLD_SCHEDULENODE
|
||||
{
|
||||
struct SCHEDULENODE *next;
|
||||
UINT16 usTime[MAX_SCHEDULE_ACTIONS]; //converted to minutes 12:30PM would be 12*60 + 30 = 750
|
||||
UINT16 usData1[MAX_SCHEDULE_ACTIONS]; //typically the gridno, but depends on the action
|
||||
UINT16 usData2[MAX_SCHEDULE_ACTIONS]; //secondary information, not used by most actions
|
||||
struct _OLD_SCHEDULENODE *next;
|
||||
UINT16 usTime[OLD_MAX_SCHEDULE_ACTIONS]; //converted to minutes 12:30PM would be 12*60 + 30 = 750
|
||||
UINT16 usData1[OLD_MAX_SCHEDULE_ACTIONS]; //typically the gridno, but depends on the action
|
||||
UINT16 usData2[OLD_MAX_SCHEDULE_ACTIONS]; //secondary information, not used by most actions
|
||||
UINT8 ubAction[OLD_MAX_SCHEDULE_ACTIONS];
|
||||
UINT8 ubScheduleID;
|
||||
UINT8 ubSoldierID;
|
||||
UINT16 usFlags;
|
||||
}_OLD_SCHEDULENODE;
|
||||
|
||||
class SCHEDULENODE
|
||||
{
|
||||
public:
|
||||
SCHEDULENODE *next;
|
||||
UINT16 usTime[MAX_SCHEDULE_ACTIONS]; // Converted to minutes 12:30PM would be 12*60 + 30 = 750
|
||||
UINT32 usData1[MAX_SCHEDULE_ACTIONS]; // Typically the gridno, but depends on the action
|
||||
UINT32 usData2[MAX_SCHEDULE_ACTIONS]; // Secondary information, not used by most actions
|
||||
UINT8 ubAction[MAX_SCHEDULE_ACTIONS];
|
||||
UINT8 ubScheduleID;
|
||||
UINT8 ubSoldierID;
|
||||
UINT16 usFlags;
|
||||
}SCHEDULENODE;
|
||||
public:
|
||||
SCHEDULENODE& operator=(const _OLD_SCHEDULENODE& src);
|
||||
BOOLEAN Load(INT8** hBuffer, FLOAT dMajorMapVersion);
|
||||
BOOLEAN Save(HWFILE hFile, FLOAT dMajorMapVersion, UINT8 ubMinorMapVersion);
|
||||
};
|
||||
|
||||
extern UINT8 gubScheduleID;
|
||||
extern SCHEDULENODE *gpScheduleList;
|
||||
@@ -67,9 +86,9 @@ void ProcessTacticalSchedule( UINT8 ubScheduleID );
|
||||
|
||||
void DeleteSchedule( UINT8 ubScheduleID );
|
||||
|
||||
void LoadSchedules( INT8 **hBuffer );
|
||||
void LoadSchedules( INT8 **hBuffer, FLOAT dMajorMapVersion );
|
||||
BOOLEAN LoadSchedulesFromSave( HWFILE hFile );
|
||||
BOOLEAN SaveSchedules( HWFILE hFile );
|
||||
BOOLEAN SaveSchedules(HWFILE hFile, FLOAT dMajorMapVersion=MAJOR_MAP_VERSION, UINT8 ubMinorMapVersion=MINOR_MAP_VERSION);//dnl ch33 240909
|
||||
|
||||
void PostSchedule( SOLDIERTYPE *pSoldier );
|
||||
void PostDefaultSchedule( SOLDIERTYPE *pSoldier );
|
||||
@@ -91,16 +110,16 @@ void PrepareSchedulesForEditorExit();
|
||||
//before saving the map, as this forces the IDs to align with the SOLDIERINITNODE->ubScheduleID's.
|
||||
void OptimizeSchedules();
|
||||
|
||||
void PerformActionOnDoorAdjacentToGridNo( UINT8 ubScheduleAction, INT16 sMapIndex );
|
||||
void PerformActionOnDoorAdjacentToGridNo( UINT8 ubScheduleAction, INT32 usMapIndex );
|
||||
|
||||
BOOLEAN ExtractScheduleEntryAndExitInfo( SOLDIERTYPE * pSoldier, UINT32 * puiEntryTime, UINT32 * puiExitTime );
|
||||
BOOLEAN ExtractScheduleDoorLockAndUnlockInfo( SOLDIERTYPE * pSoldier, UINT32 * puiOpeningTime, UINT32 * puiClosingTime );
|
||||
|
||||
void ReconnectSchedules( void );
|
||||
|
||||
void SecureSleepSpot( SOLDIERTYPE * pSoldier, UINT16 usSleepSpot );
|
||||
void SecureSleepSpot( SOLDIERTYPE * pSoldier, UINT32 usSleepSpot );
|
||||
|
||||
BOOLEAN BumpAnyExistingMerc( INT16 sGridNo );
|
||||
BOOLEAN BumpAnyExistingMerc( INT32 sGridNo );
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ void ValidateWeights( INT32 iID );
|
||||
void ValidateGroup( GROUP *pGroup );
|
||||
void ValidateLargeGroup( GROUP *pGroup );
|
||||
|
||||
extern BOOLEAN TeleportSoldier( SOLDIERTYPE *pSoldier, INT16 sGridNo, BOOLEAN fForce );
|
||||
extern BOOLEAN TeleportSoldier( SOLDIERTYPE *pSoldier, INT32 sGridNo, BOOLEAN fForce );
|
||||
|
||||
|
||||
//The army composition defines attributes for the various garrisons. The priority reflects how important the sector is
|
||||
@@ -900,7 +900,7 @@ void ValidatePlayersAreInOneGroupOnly()
|
||||
|
||||
pSoldier = MercPtrs[ i ];
|
||||
|
||||
if( !pSoldier->bActive || !pSoldier->stats.bLife || !pSoldier->ubGroupID )
|
||||
if( !pSoldier || !pSoldier->bActive || !pSoldier->stats.bLife || !pSoldier->ubGroupID )
|
||||
{ //non-existant, dead, or in no group (don't care, skip to next merc)
|
||||
continue;
|
||||
}
|
||||
@@ -4570,7 +4570,7 @@ void HourlyCheckStrategicAI()
|
||||
#include "VFS/vfs.h"
|
||||
#include "VFS/Tools/Log.h"
|
||||
|
||||
static CLog& s_stratD = *CLog::Create(L"Strategic Decisions.txt", true);
|
||||
static CLog& s_stratD = *CLog::create(L"Strategic Decisions.txt", true);
|
||||
|
||||
void LogStrategicMsg( STR8 str, ... )
|
||||
{
|
||||
@@ -4590,7 +4590,7 @@ void LogStrategicMsg( STR8 str, ... )
|
||||
#ifndef USE_VFS
|
||||
fprintf( fp, "%s\n", string );
|
||||
#else
|
||||
s_stratD << string << CLog::endl;
|
||||
s_stratD << string << CLog::ENDL;
|
||||
#endif
|
||||
|
||||
if( gfDisplayStrategicAILogs )
|
||||
@@ -4626,7 +4626,7 @@ void LogStrategicEvent( STR8 str, ... )
|
||||
fprintf( fp, "\n%S:\n", WORLDTIMESTR );
|
||||
fprintf( fp, "%s\n", string );
|
||||
#else
|
||||
s_stratD.Endl() << WORLDTIMESTR << ":" << CLog::endl << string << CLog::endl;
|
||||
s_stratD.endl() << WORLDTIMESTR << ":" << CLog::ENDL << string << CLog::ENDL;
|
||||
#endif
|
||||
if( gfDisplayStrategicAILogs )
|
||||
{
|
||||
@@ -4653,7 +4653,7 @@ void ClearStrategicLog()
|
||||
|
||||
fclose( fp );
|
||||
#else
|
||||
s_stratD.Flush();
|
||||
s_stratD.flush();
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -147,7 +147,7 @@ typedef struct GARRISON_GROUP
|
||||
INT8 bPadding[10];
|
||||
}GARRISON_GROUP;
|
||||
|
||||
#define MAX_GARRISON_GROUPS 100
|
||||
#define MAX_GARRISON_GROUPS 256 // WANNE - MP: Changed from 100 to 256
|
||||
#define MAX_PATROL_GROUPS 50
|
||||
#define MAX_ARMY_COMPOSITIONS 60
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class SOLDIERTYPE;
|
||||
#define MEDUNA_ITEM_DROP_OFF_SECTOR_Z 0
|
||||
|
||||
|
||||
extern INT16 gsRobotGridNo;
|
||||
extern INT32 gsRobotGridNo;
|
||||
|
||||
UINT32 guiPabloExtraDaysBribed = 0;
|
||||
|
||||
@@ -417,7 +417,7 @@ void HandleDelayedItemsArrival( UINT32 uiReason )
|
||||
{
|
||||
// This function moves all the items that Pablos has stolen
|
||||
// (or items that were delayed) to the arrival location for new shipments,
|
||||
INT16 sStartGridNo;
|
||||
INT32 sStartGridNo;
|
||||
UINT32 uiNumWorldItems, uiLoop;
|
||||
BOOLEAN fOk;
|
||||
WORLDITEM * pTemp = 0;
|
||||
|
||||
@@ -1554,10 +1554,6 @@ void AwardExperienceForTravelling( GROUP * pGroup )
|
||||
|
||||
void AddCorpsesToBloodcatLair( INT16 sSectorX, INT16 sSectorY )
|
||||
{
|
||||
// HEADROCK HAM 3.6: Note, lair location externalized, but may cause issues because the GridNos here are
|
||||
// hardcoded... Maybe there will be a better way to solve this in the future, with externalized GridNos.
|
||||
// At the moment, no changes.
|
||||
|
||||
ROTTING_CORPSE_DEFINITION Corpse;
|
||||
INT16 sXPos, sYPos;
|
||||
|
||||
@@ -4716,9 +4712,6 @@ void RandomizePatrolGroupLocation( GROUP *pGroup )
|
||||
//roll the dice to see if this will become an ambush random encounter.
|
||||
BOOLEAN TestForBloodcatAmbush( GROUP *pGroup )
|
||||
{
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// HEADROCK HAM 3.6: Ambush locations, min/max strength and chance of ambush have all been externalized to XML.
|
||||
|
||||
SECTORINFO *pSector;
|
||||
INT32 iHoursElapsed;
|
||||
UINT8 ubSectorID;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,574 +0,0 @@
|
||||
# Microsoft Developer Studio Project File - Name="Strategic" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=Strategic - Win32 Demo Bounds Checker
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Strategic.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Strategic.mak" CFG="Strategic - Win32 Demo Bounds Checker"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "Strategic - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Strategic - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Strategic - Win32 Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Strategic - Win32 Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Strategic - Win32 Debug Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Strategic - Win32 Release Demo" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Strategic - Win32 Demo Release with Debug Info" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "Strategic - Win32 Demo Bounds Checker" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""$/Jagged Alliance 2/Development/Programming/Jagged Alliance 2/Build", AVAAAAAA"
|
||||
# PROP Scc_LocalPath "..\..\..\ja2\build"
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "Strategic - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /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 /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Strategic - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug"
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "..\Standard Gaming Platform" /I "..\TileEngine" /I "..\\" /I "..\Tactical" /I "..\Utils" /I "..\tacticalai" /I "..\Editor" /I "..\Laptop" /I ".\\" /D "PRECOMPILEDHEADERS" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Strategic - Win32 Release with Debug Info"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Strategi"
|
||||
# PROP BASE Intermediate_Dir "Strategi"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release with Debug"
|
||||
# PROP Intermediate_Dir "Release with Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\Editor" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GX /Zi /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\TileEngine" /I "..\Utils" /I "..\TacticalAI" /I "..\Tactical" /I "..\Laptop" /I "..\Editor" /I ".\\" /D "NDEBUG" /D "RELEASE_WITH_DEBUG_INFO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Strategic - Win32 Bounds Checker"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Strateg1"
|
||||
# PROP BASE Intermediate_Dir "Strateg1"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Bounds Checker"
|
||||
# PROP Intermediate_Dir "Bounds Checker"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\editor" /I "\ja2\build\tactical" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\editor" /I "\ja2\build\tactical" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "_VTUNE_PROFILING" /FR /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Strategic - Win32 Debug Demo"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Strateg0"
|
||||
# PROP BASE Intermediate_Dir "Strateg0"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Debug Demo"
|
||||
# PROP Intermediate_Dir "Debug Demo"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\editor" /I "\ja2\build\tactical" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\editor" /I "\ja2\build\tactical" /D "_DEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Strategic - Win32 Release Demo"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Strateg2"
|
||||
# PROP BASE Intermediate_Dir "Strateg2"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release Demo"
|
||||
# PROP Intermediate_Dir "Release Demo"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W4 /GX /Zi /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\Editor" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "RELEASE_WITH_DEBUG_INFO" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GX /Zi /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\Editor" /D "RELEASE_WITH_DEBUG_INFO" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Strategic - Win32 Demo Release with Debug Info"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Strateg3"
|
||||
# PROP BASE Intermediate_Dir "Strateg3"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Demo Release with Debug"
|
||||
# PROP Intermediate_Dir "Demo Release with Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MT /W4 /GX /Zi /O2 /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\Editor" /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "RELEASE_WITH_DEBUG_INFO" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W4 /GX /Zi /O2 /I "..\Standard Gaming Platform" /I "..\\" /I "..\TileEngine" /I "..\Utils" /I "..\TacticalAI" /I "..\Tactical" /I "..\Laptop" /I "..\Editor" /I ".\\" /D "RELEASE_WITH_DEBUG_INFO" /D "NDEBUG" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /D "XML_STATIC" /D "CINTERFACE" /FR /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "Strategic - Win32 Demo Bounds Checker"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Strateg4"
|
||||
# PROP BASE Intermediate_Dir "Strateg4"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "Demo Bounds Checker"
|
||||
# PROP Intermediate_Dir "Demo Bounds Checker"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\editor" /I "\ja2\build\tactical" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "BOUNDS_CHECKER" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MTd /W3 /GX /Z7 /Od /I "\Standard Gaming Platform" /I "\ja2\Build" /I "\ja2\Build\TileEngine" /I "\ja2\Build\Utils" /I "\ja2\build\TacticalAI" /I "\ja2\build\Communications" /I "\ja2\build\Tactical" /I "\ja2\build\Laptop" /I "\ja2\build\editor" /I "\ja2\build\tactical" /D "_DEBUG" /D "BOUNDS_CHECKER" /D "JA2DEMO" /D "WIN32" /D "_WINDOWS" /D "JA2" /D "PRECOMPILEDHEADERS" /FR /YX"Strategic All.h" /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "Strategic - Win32 Release"
|
||||
# Name "Strategic - Win32 Debug"
|
||||
# Name "Strategic - Win32 Release with Debug Info"
|
||||
# Name "Strategic - Win32 Bounds Checker"
|
||||
# Name "Strategic - Win32 Debug Demo"
|
||||
# Name "Strategic - Win32 Release Demo"
|
||||
# Name "Strategic - Win32 Demo Release with Debug Info"
|
||||
# Name "Strategic - Win32 Demo Bounds Checker"
|
||||
# Begin Group "Source Files"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\AI Viewer.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Assignments.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Auto Resolve.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Campaign Init.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Creature Spreading.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Clock.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Event Hook.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Events.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Init.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Hourly Update.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Helicopter.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Border.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Bottom.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Map Inventory.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Map.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface TownMine Info.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mapscreen.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Meanwhile.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Merc Contract.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MilitiaSquads.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Player Command.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\PreBattle Interface.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Queen Command.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Quest Debug System.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Quests.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\QuestText.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Reinforcement.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Scheduling.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic AI.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Event Handler.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Merc Handler.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Mines.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Movement Costs.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Movement.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Pathing.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Status.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Town Loyalty.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\strategic town reputation.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Turns.cpp"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strategic.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strategicmap.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
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"
|
||||
|
||||
# PROP Default_Filter ""
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Assignments.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Auto Resolve.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Campaign Init.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Campaign Types.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Creature Spreading.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Clock.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Event Hook.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Events.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Game Init.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Helicopter.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Border.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Bottom.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Map Inventory.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface Map.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface TownMine Info.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Map Screen Interface.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\mapscreen.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Merc Contract.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\MilitiaSquads.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Player Command.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\PreBattle Interface.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Queen Command.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Quests.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Reinforcement.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Scheduling.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic AI.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic All.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Event Handler.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Merc Handler.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Mines.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Movement.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Pathing.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Status.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Strategic Town Loyalty.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\strategic town reputation.h"
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strategic.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\strategicmap.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=".\Town Militia.h"
|
||||
# End Source File
|
||||
# End Group
|
||||
# End Target
|
||||
# End Project
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -267,6 +267,68 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_WithDebugInfo|Win32"
|
||||
OutputDirectory="$(ConfigurationName)"
|
||||
IntermediateDirectory="$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_2005Express.vsprops"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
AdditionalOptions="/D "_CRT_SECURE_NO_DEPRECATE""
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="..\Multiplayer;..\VFS"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;"
|
||||
RuntimeLibrary="0"
|
||||
RuntimeTypeInfo="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
||||
@@ -268,6 +268,70 @@
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
<Configuration
|
||||
Name="Release_WithDebugInfo|Win32"
|
||||
OutputDirectory="..\lib\VS2008\$(ConfigurationName)"
|
||||
IntermediateDirectory="..\build\VS2008\$(ProjectName)_$(ConfigurationName)"
|
||||
ConfigurationType="4"
|
||||
InheritedPropertySheets="..\ja2_VS2008.vsprops"
|
||||
CharacterSet="0"
|
||||
WholeProgramOptimization="0"
|
||||
>
|
||||
<Tool
|
||||
Name="VCPreBuildEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCustomBuildTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXMLDataGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCWebServiceProxyGeneratorTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCMIDLTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
EnableIntrinsicFunctions="true"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="true"
|
||||
RuntimeLibrary="0"
|
||||
EnableFunctionLevelLinking="false"
|
||||
UsePrecompiledHeader="0"
|
||||
WarningLevel="3"
|
||||
DebugInformationFormat="4"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCManagedResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCResourceCompilerTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPreLinkEventTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCLibrarianTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCALinkTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCXDCMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCBscMakeTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCFxCopTool"
|
||||
/>
|
||||
<Tool
|
||||
Name="VCPostBuildEventTool"
|
||||
/>
|
||||
</Configuration>
|
||||
</Configurations>
|
||||
<References>
|
||||
</References>
|
||||
|
||||
+23
-28
@@ -330,10 +330,10 @@ void TownMilitiaTrainingCompleted( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMa
|
||||
|
||||
}
|
||||
|
||||
// the trainer announces to player that he's finished his assignment. Make his sector flash!
|
||||
AssignmentDone( pTrainer, TRUE, FALSE );
|
||||
// the trainer announces to player that he's finished his assignment. Make his sector flash!
|
||||
AssignmentDone( pTrainer, TRUE, FALSE );
|
||||
|
||||
// handle completion of town by training group
|
||||
// handle completion of town by training group
|
||||
HandleCompletionOfTownTrainingByGroupWithTrainer( pTrainer, TOWN_MILITIA );
|
||||
}
|
||||
}
|
||||
@@ -673,7 +673,6 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia2");
|
||||
ubMilitiaType = MOBILE_MILITIA;
|
||||
else
|
||||
return;
|
||||
|
||||
// grab total number of sectors
|
||||
iNumberOfSectors = GetNumberOfUnpaidTrainableSectors( ubMilitiaType );
|
||||
Assert( iNumberOfSectors > 0 );
|
||||
@@ -687,25 +686,24 @@ DebugMsg (TOPIC_JA2,DBG_LEVEL_3,"Militia2");
|
||||
{
|
||||
// If Regulars are maxed, and Elites are allowed, calculate cost to upgrade Regular->Elite
|
||||
if (IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier, REGULAR_MILITIA )
|
||||
&& (gGameExternalOptions.gfTrainVeteranMilitia)
|
||||
&& (GetWorldDay( ) >= gGameExternalOptions.guiTrainVeteranMilitiaDelay))
|
||||
{
|
||||
giTotalCostOfTraining = (iMilitiaTrainingCost*gGameExternalOptions.iVeteranCostModifier) * iNumberOfSectors;
|
||||
Assert( giTotalCostOfTraining > 0 );
|
||||
gfAreWePromotingRegular = TRUE;
|
||||
}
|
||||
// If Greens are maxed, calculate cost to upgrade Green->Regular
|
||||
else if (IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier, GREEN_MILITIA ))
|
||||
{
|
||||
giTotalCostOfTraining = (iMilitiaTrainingCost*gGameExternalOptions.iRegularCostModifier) * iNumberOfSectors;
|
||||
Assert( giTotalCostOfTraining > 0 );
|
||||
gfAreWePromotingGreen = TRUE;
|
||||
}
|
||||
&& (gGameExternalOptions.gfTrainVeteranMilitia)
|
||||
&& (GetWorldDay( ) >= gGameExternalOptions.guiTrainVeteranMilitiaDelay))
|
||||
{
|
||||
giTotalCostOfTraining = (iMilitiaTrainingCost*gGameExternalOptions.iVeteranCostModifier) * iNumberOfSectors;
|
||||
Assert( giTotalCostOfTraining > 0 );
|
||||
gfAreWePromotingRegular = TRUE;
|
||||
}
|
||||
else if (IsMilitiaTrainableFromSoldiersSectorMaxed( pSoldier, GREEN_MILITIA ))
|
||||
{
|
||||
giTotalCostOfTraining = (iMilitiaTrainingCost*gGameExternalOptions.iRegularCostModifier) * iNumberOfSectors;
|
||||
Assert( giTotalCostOfTraining > 0 );
|
||||
gfAreWePromotingGreen = TRUE;
|
||||
}
|
||||
// Normal training.
|
||||
else
|
||||
{
|
||||
giTotalCostOfTraining = iMilitiaTrainingCost * iNumberOfSectors;
|
||||
Assert( giTotalCostOfTraining > 0 );
|
||||
else
|
||||
{
|
||||
giTotalCostOfTraining = iMilitiaTrainingCost * iNumberOfSectors;
|
||||
Assert( giTotalCostOfTraining > 0 );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1084,7 +1082,6 @@ void PayMilitiaTrainingYesNoBoxCallback( UINT8 bExitValue )
|
||||
|
||||
#ifdef JA2BETAVERSION
|
||||
// put this BEFORE training gets handled to avoid detecting an error everytime a sector completes training
|
||||
// HEADROCK HAM 3.6: Checks both Mobiles and Garrisons.
|
||||
VerifyTownTrainingIsPaidFor();
|
||||
#endif
|
||||
|
||||
@@ -1518,9 +1515,9 @@ void HandleContinueOfTownTraining( void )
|
||||
|
||||
//If the militia view isn't currently active, then turn it on when prompting to continue training.
|
||||
if ( !fShowMilitia )
|
||||
{
|
||||
ToggleShowMilitiaMode();
|
||||
}
|
||||
{
|
||||
ToggleShowMilitiaMode();
|
||||
}
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -1872,8 +1869,6 @@ void BuildMilitiaPromotionsString( STR16 str )
|
||||
gbRegToElitePromotions = 0;
|
||||
gbMilitiaPromotions = 0;
|
||||
}
|
||||
|
||||
|
||||
// HEADROCK HAM 3.3: This function finds the best Militia Trainer in the target sector. It may also take into account
|
||||
// mercs' TEACHING skill, if told to. The function returns the calculated "Effective Leadership" of the selected
|
||||
// trainer.
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
extern INT32 iRestrictedSectorArraySize;
|
||||
extern UINT32 gRestrictMilitia[256];
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ROAMING_ELEMENT_NONE = 0,
|
||||
|
||||
+137
-34
@@ -117,6 +117,7 @@
|
||||
|
||||
#include "connect.h" //hayden
|
||||
#include "fresh_header.h"
|
||||
#include "InterfaceItemImages.h"
|
||||
// DEFINES
|
||||
|
||||
|
||||
@@ -2864,7 +2865,6 @@ void DrawCharacterInfo(INT16 sCharNumber)
|
||||
{
|
||||
wcscpy(sString,pTownNames[GetTownIdForSector( pSoldier->sSectorX, pSoldier->sSectorY ) ] );
|
||||
}
|
||||
|
||||
// repairing?
|
||||
else if( pSoldier->bAssignment == REPAIR )
|
||||
{
|
||||
@@ -3989,10 +3989,9 @@ void DrawMPPlayerList ()
|
||||
SetBackgroundRectFilled( iBack );
|
||||
//DrawString( (STR16)szPlayerName , usX,usY, MAP_SCREEN_FONT);
|
||||
|
||||
// <TODO> check for gametype here
|
||||
//wcscpy(szTeam,L"N/A");
|
||||
if (PLAYER_BSIDE==MP_TYPE_DEATHMATCH)
|
||||
wcscpy(szTeam,L"N/A");
|
||||
// WANNE: No team selection in DM or COOP
|
||||
if (PLAYER_BSIDE == MP_TYPE_DEATHMATCH || PLAYER_BSIDE == MP_TYPE_COOP)
|
||||
wcscpy(szTeam, gszMPTeamNames[4]);
|
||||
else
|
||||
wcscpy(szTeam,gszMPTeamNames[client_teams[i]]);
|
||||
FindFontCenterCoordinates((short)MP_TEAM_X + 1, (short)(MP_ROWSTART_Y+(row*Y_SIZE)), (short)MP_TEAM_W, (short)Y_SIZE, szTeam, (long)MAP_SCREEN_FONT, &usX, &usY);
|
||||
@@ -4342,7 +4341,6 @@ void CreateDestroyMouseRegionsForTeamBox()
|
||||
|
||||
if (!is_team_box_open)
|
||||
{
|
||||
|
||||
// grab height of font
|
||||
iFontHeight = GetLineSpace( ghMPTeamBox ) + GetFontHeight( GetBoxFont( ghMPTeamBox ) );
|
||||
|
||||
@@ -4362,7 +4360,7 @@ void CreateDestroyMouseRegionsForTeamBox()
|
||||
SetCurrentBox( ghMPTeamBox );
|
||||
|
||||
// define regions
|
||||
for( iCounter = 0; iCounter < MAX_EDGES; iCounter++ )
|
||||
for( iCounter = 0; iCounter < MAX_MP_TEAMS; iCounter++ )
|
||||
{
|
||||
// add mouse region for each line of text..and set user data
|
||||
MSYS_DefineRegion( &gTeamMenuRegion[ iCounter ], ( INT16 )( iBoxXPosition ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghMPTeamBox ) + ( iFontHeight ) * iCounter ), ( INT16 )( iBoxXPosition + iBoxWidth ), ( INT16 )( iBoxYPosition + GetTopMarginSize( ghMPTeamBox ) + ( iFontHeight ) * ( iCounter + 1 ) ), MSYS_PRIORITY_HIGHEST - 4 ,
|
||||
@@ -6425,7 +6423,10 @@ UINT32 HandleMapUI( )
|
||||
// <TODO> OJW - 20081201 - change this state away from allowlaptop to its own field
|
||||
// or something more seperate from that concept
|
||||
if (is_server && !allowlaptop)
|
||||
{
|
||||
InitializeWorldSize(sMapX, sMapY, 0);
|
||||
send_mapchange();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -6561,6 +6562,65 @@ UINT32 HandleMapUI( )
|
||||
}
|
||||
|
||||
|
||||
// WANNE - BMP: This method is used only for multiplayer
|
||||
void InitializeWorldSize(INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ)
|
||||
{
|
||||
CHAR8 datFilename[ 50 ];
|
||||
CHAR8 mapFilename[ 50 ];
|
||||
UINT32 uiFileSize;
|
||||
INT8 *pBuffer;
|
||||
INT8 *pBufferHead;
|
||||
UINT32 uiBytesRead;
|
||||
UINT8 ubMinorMapVersion;
|
||||
FLOAT dMajorMapVersion;
|
||||
HWFILE hfile;
|
||||
|
||||
GetMapFileName( sSectorX, sSectorY, bSectorZ, datFilename, TRUE, TRUE );
|
||||
|
||||
//Load the placeholder map if the real map doesn't exist.
|
||||
if( !MapExists((UINT8 *) datFilename ) )
|
||||
{
|
||||
AssertMsg( 0, "Failed to load map file." );
|
||||
}
|
||||
|
||||
sprintf( mapFilename, "MAPS\\%s", datFilename );
|
||||
|
||||
// Open file
|
||||
hfile = FileOpen( mapFilename, FILE_ACCESS_READ, FALSE );
|
||||
|
||||
if ( !hfile )
|
||||
{
|
||||
// Initialize with default "normal" map size
|
||||
SetWorldSize(OLD_WORLD_ROWS, OLD_WORLD_COLS);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Get the file size and alloc one huge buffer for it.
|
||||
//We will use this buffer to transfer all of the data from.
|
||||
uiFileSize = FileGetSize( hfile );
|
||||
pBuffer = (INT8*)MemAlloc( uiFileSize );
|
||||
pBufferHead = pBuffer;
|
||||
FileRead( hfile, pBuffer, uiFileSize, &uiBytesRead );
|
||||
FileClose( hfile );
|
||||
|
||||
// Read JA2 Version ID
|
||||
LOADDATA( &dMajorMapVersion, pBuffer, sizeof( FLOAT ) );
|
||||
LOADDATA( &ubMinorMapVersion, pBuffer, sizeof( UINT8 ) );
|
||||
|
||||
if(dMajorMapVersion < 7.00)
|
||||
// old map - always 160x160
|
||||
SetWorldSize(OLD_WORLD_ROWS, OLD_WORLD_COLS);
|
||||
else
|
||||
{
|
||||
INT32 iRowSize = 0, iColSize = 0;
|
||||
LOADDATA( &iRowSize, pBuffer, sizeof( INT32 ) );
|
||||
LOADDATA( &iColSize, pBuffer, sizeof( INT32 ) );
|
||||
SetWorldSize(iRowSize, iColSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
{
|
||||
InputAtom InputEvent;
|
||||
@@ -6844,7 +6904,8 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
case BACKSPACE:
|
||||
StopAnyCurrentlyTalkingSpeech( );
|
||||
break;
|
||||
|
||||
|
||||
// multiplayer: Roman: Should be changed, because the keys are already bount to another feature
|
||||
case F1:
|
||||
// WANNE: No more needed
|
||||
/*
|
||||
@@ -7091,12 +7152,22 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
}*/
|
||||
case '8':
|
||||
case '9':
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ && fShowMapInventoryPool == TRUE)//dnl ch51 081009
|
||||
{
|
||||
SwitchToInventoryPoolQ((UINT8)InputEvent.usParam);
|
||||
break;
|
||||
}
|
||||
// multi-selects all characters in that squad. SHIFT key and 1-0 for squads 11-20
|
||||
bSquadNumber = ( INT8 ) ( InputEvent.usParam - '1' ); // internal squad #s start at 0
|
||||
SelectAllCharactersInSquad( bSquadNumber );
|
||||
break;
|
||||
|
||||
case '0':
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ && fShowMapInventoryPool == TRUE)//dnl ch51 081009
|
||||
{
|
||||
SwitchToInventoryPoolQ('0');
|
||||
break;
|
||||
}
|
||||
SelectAllCharactersInSquad( 9 ); // internal squad #s start at 0
|
||||
if(is_networked)test_func2();
|
||||
break;
|
||||
@@ -7202,6 +7273,11 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
break;
|
||||
|
||||
case 'c':
|
||||
if(gGameExternalOptions.fEnableInventoryPoolQ && fShowMapInventoryPool == TRUE)//dnl ch51 081009
|
||||
{
|
||||
CopySectorInventoryToInventoryPoolQ(0);
|
||||
break;
|
||||
}
|
||||
RequestContractMenu();
|
||||
break;
|
||||
|
||||
@@ -7423,6 +7499,11 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
if (is_networked)
|
||||
kick_player();
|
||||
}
|
||||
else if(gGameExternalOptions.fEnableInventoryPoolQ && fShowMapInventoryPool == TRUE)//dnl ch51 081009
|
||||
{
|
||||
CopySectorInventoryToInventoryPoolQs(0);
|
||||
//break;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'l':
|
||||
@@ -7570,6 +7651,11 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
gfSaveGame = TRUE;
|
||||
RequestTriggerExitFromMapscreen( MAP_EXIT_TO_SAVE );
|
||||
}
|
||||
else if(gGameExternalOptions.fEnableInventoryPoolQ && fShowMapInventoryPool == TRUE)//dnl ch51 081009
|
||||
{
|
||||
SortInventoryPoolQ();
|
||||
//break;
|
||||
}
|
||||
break;
|
||||
case 'S':
|
||||
if( fCtrl )
|
||||
@@ -9103,7 +9189,7 @@ void MAPInvClickCallback( MOUSE_REGION *pRegion, INT32 iReason )
|
||||
{
|
||||
// Update mouse cursor
|
||||
guiExternVo = GetInterfaceGraphicForItem( &(Item[ gpItemPointer->usItem ]) );
|
||||
gusExternVoSubIndex = Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
gusExternVoSubIndex = g_bUsePngItemImages ? 0 : Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
|
||||
MSYS_ChangeRegionCursor( &gMPanelRegion , EXTERN_CURSOR );
|
||||
MSYS_SetCurrentCursor( EXTERN_CURSOR );
|
||||
@@ -9202,7 +9288,7 @@ void InternalMAPBeginItemPointer( SOLDIERTYPE *pSoldier )
|
||||
|
||||
// Set mouse
|
||||
guiExternVo = GetInterfaceGraphicForItem( &(Item[ gpItemPointer->usItem ]) );
|
||||
gusExternVoSubIndex = Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
gusExternVoSubIndex = g_bUsePngItemImages ? 0 : Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
|
||||
MSYS_ChangeRegionCursor( &gMPanelRegion , EXTERN_CURSOR );
|
||||
MSYS_SetCurrentCursor( EXTERN_CURSOR );
|
||||
@@ -9287,7 +9373,7 @@ void MAPBeginKeyRingItemPointer( SOLDIERTYPE *pSoldier, UINT8 uiKeySlot )
|
||||
|
||||
// Set mouse
|
||||
guiExternVo = GetInterfaceGraphicForItem( &(Item[ gpItemPointer->usItem ]) );
|
||||
gusExternVoSubIndex = Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
gusExternVoSubIndex = g_bUsePngItemImages ? 0 : Item[ gpItemPointer->usItem ].ubGraphicNum;
|
||||
|
||||
MSYS_ChangeRegionCursor( &gMPanelRegion , EXTERN_CURSOR );
|
||||
MSYS_SetCurrentCursor( EXTERN_CURSOR );
|
||||
@@ -9806,10 +9892,12 @@ void MPReadyButtonCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
// warn the user that cannot change once buying has commenced
|
||||
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, gszMPMapscreenText[4]);
|
||||
}
|
||||
/*
|
||||
else if (RANDOM_SPAWN)
|
||||
{
|
||||
ScreenMsg( FONT_LTBLUE, MSG_MPSYSTEM, L"Cannot change edge, the game is set to random spawn");
|
||||
}
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -11315,34 +11403,44 @@ void HandleShadingOfLinesForContractMenu( void )
|
||||
{
|
||||
pProfile = &( gMercProfiles[ pSoldier->ubProfile ] );
|
||||
|
||||
// one day
|
||||
if( pProfile->sSalary > LaptopSaveInfo.iCurrentBalance )
|
||||
if (is_networked)
|
||||
{
|
||||
// WANNE - MP: Shade all contract renewals, because it is not needed in a MP game
|
||||
ShadeStringInBox( ghContractBox, CONTRACT_MENU_DAY );
|
||||
}
|
||||
else
|
||||
{
|
||||
UnShadeStringInBox( ghContractBox, CONTRACT_MENU_DAY );
|
||||
}
|
||||
|
||||
// one week
|
||||
if( ( INT32 )( pProfile->uiWeeklySalary ) > LaptopSaveInfo.iCurrentBalance )
|
||||
{
|
||||
ShadeStringInBox( ghContractBox, CONTRACT_MENU_WEEK );
|
||||
}
|
||||
else
|
||||
{
|
||||
UnShadeStringInBox( ghContractBox, CONTRACT_MENU_WEEK );
|
||||
}
|
||||
|
||||
// two weeks
|
||||
if( ( INT32 )( pProfile->uiBiWeeklySalary ) > LaptopSaveInfo.iCurrentBalance )
|
||||
{
|
||||
ShadeStringInBox( ghContractBox, CONTRACT_MENU_TWO_WEEKS );
|
||||
}
|
||||
else
|
||||
{
|
||||
UnShadeStringInBox( ghContractBox, CONTRACT_MENU_TWO_WEEKS );
|
||||
// one day
|
||||
if( pProfile->sSalary > LaptopSaveInfo.iCurrentBalance )
|
||||
{
|
||||
ShadeStringInBox( ghContractBox, CONTRACT_MENU_DAY );
|
||||
}
|
||||
else
|
||||
{
|
||||
UnShadeStringInBox( ghContractBox, CONTRACT_MENU_DAY );
|
||||
}
|
||||
|
||||
// one week
|
||||
if( ( INT32 )( pProfile->uiWeeklySalary ) > LaptopSaveInfo.iCurrentBalance )
|
||||
{
|
||||
ShadeStringInBox( ghContractBox, CONTRACT_MENU_WEEK );
|
||||
}
|
||||
else
|
||||
{
|
||||
UnShadeStringInBox( ghContractBox, CONTRACT_MENU_WEEK );
|
||||
}
|
||||
|
||||
// two weeks
|
||||
if( ( INT32 )( pProfile->uiBiWeeklySalary ) > LaptopSaveInfo.iCurrentBalance )
|
||||
{
|
||||
ShadeStringInBox( ghContractBox, CONTRACT_MENU_TWO_WEEKS );
|
||||
}
|
||||
else
|
||||
{
|
||||
UnShadeStringInBox( ghContractBox, CONTRACT_MENU_TWO_WEEKS );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -11362,6 +11460,12 @@ void HandleShadingOfLinesForContractMenu( void )
|
||||
{
|
||||
UnShadeStringInBox( ghContractBox, CONTRACT_MENU_TERMINATE );
|
||||
}
|
||||
|
||||
// WANNE - MP: Disable "Dismiss" button when Random merc was selected, because we cannot hire any new merc
|
||||
if (is_networked && RANDOM_MERCS)
|
||||
{
|
||||
ShadeStringInBox( ghContractBox, CONTRACT_MENU_TERMINATE );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15822,7 +15926,6 @@ void MapscreenMarkButtonsDirty()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: Get a total of all merc salaries. Used for the new Daily Expenses display.
|
||||
INT32 GetTotalContractExpenses ( void )
|
||||
{
|
||||
@@ -15866,4 +15969,4 @@ INT32 GetTotalContractExpenses ( void )
|
||||
ubCounter++;
|
||||
}
|
||||
return (iTotalCost);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,8 @@ BOOLEAN SetInfoChar(UINT8 ubSolId);
|
||||
void EndMapScreen( BOOLEAN fDuringFade );
|
||||
void ReBuildCharactersList( void );
|
||||
|
||||
// WANNE - BMP: Initialize world size for a multiplayer game
|
||||
void InitializeWorldSize( INT16 sSectorX, INT16 sSectorY , INT8 bSectorZ );
|
||||
|
||||
BOOLEAN HandlePreloadOfMapGraphics( void );
|
||||
void HandleRemovalOfPreLoadedMapGraphics( void );
|
||||
|
||||
+233
-415
File diff suppressed because it is too large
Load Diff
@@ -33,8 +33,8 @@ extern UINT8 NUMBER_OF_SAMS;
|
||||
#define MAX_NUMBER_OF_SAMS 50 //4 //50
|
||||
|
||||
extern INT16 pSamList[ MAX_NUMBER_OF_SAMS ];
|
||||
extern INT16 pSamGridNoAList[ MAX_NUMBER_OF_SAMS ];
|
||||
extern INT16 pSamGridNoBList[ MAX_NUMBER_OF_SAMS ];
|
||||
extern INT32 pSamGridNoAList[ MAX_NUMBER_OF_SAMS ];
|
||||
extern INT32 pSamGridNoBList[ MAX_NUMBER_OF_SAMS ];
|
||||
|
||||
extern BOOLEAN fFoundOrta;
|
||||
extern BOOLEAN fSamSiteFound[ MAX_NUMBER_OF_SAMS ];
|
||||
@@ -101,7 +101,7 @@ void GetSectorIDString( INT16 sSectorX, INT16 sSectorY, INT8 bSectorZ , STR16 zS
|
||||
void GetMapFileName(INT16 sMapX,INT16 sMapY, INT8 bSectorZ, STR8 bString, BOOLEAN fUsePlaceholder, BOOLEAN fAddAlternateMapLetter );
|
||||
|
||||
// Called from within tactical.....
|
||||
void JumpIntoAdjacentSector( UINT8 ubDirection, UINT8 ubJumpCode, INT16 sAdditionalData );
|
||||
void JumpIntoAdjacentSector( UINT8 ubDirection, UINT8 ubJumpCode, INT32 sAdditionalData );//dnl ch56 151009
|
||||
|
||||
|
||||
|
||||
@@ -126,8 +126,8 @@ BOOLEAN SectorIsPartOfTown( INT8 bTownId, INT16 sSectorX, INT16 sSectorY );
|
||||
//BOOLEAN IsThereAnyOneInThisTown( UINT8 ubTownId );
|
||||
|
||||
|
||||
BOOLEAN SoldierOKForSectorExit( SOLDIERTYPE * pSoldier, INT8 bExitDirection, UINT16 usAdditionalData );
|
||||
BOOLEAN OKForSectorExit( INT8 bExitDirection, UINT16 usAdditionalData, UINT32 *puiTraverseTimeInMinutes );
|
||||
BOOLEAN SoldierOKForSectorExit( SOLDIERTYPE * pSoldier, INT8 bExitDirection, INT32 usAdditionalData );//dnl ch56 151009
|
||||
BOOLEAN OKForSectorExit( INT8 bExitDirection, INT32 usAdditionalData, UINT32 *puiTraverseTimeInMinutes );//dnl ch56 151009
|
||||
void SetupNewStrategicGame( );
|
||||
|
||||
BOOLEAN LoadStrategicInfoFromSavedFile( HWFILE hFile );
|
||||
@@ -135,7 +135,7 @@ BOOLEAN SaveStrategicInfoToSavedFile( HWFILE hFile );
|
||||
|
||||
void AllMercsHaveWalkedOffSector( );
|
||||
|
||||
void AdjustSoldierPathToGoOffEdge( SOLDIERTYPE *pSoldier, INT16 sEndGridNo, UINT8 ubTacticalDirection );
|
||||
void AdjustSoldierPathToGoOffEdge( SOLDIERTYPE *pSoldier, INT32 sEndGridNo, UINT8 ubTacticalDirection );
|
||||
|
||||
void AllMercsWalkedToExitGrid();
|
||||
UINT8 GetMilitiaCountAtLevelAnywhereInTown( UINT8 ubTownValue, UINT8 ubLevelValue );
|
||||
@@ -170,6 +170,9 @@ void SetupProfileInsertionDataForSoldier( SOLDIERTYPE *pSoldier );
|
||||
|
||||
BOOLEAN HandlePotentialBringUpAutoresolveToFinishBattle( int pSectorX, int pSectorY, int pSectorZ );
|
||||
|
||||
// WANNE - BMP;
|
||||
BOOLEAN MapExists( UINT8 * szFilename );
|
||||
|
||||
BOOLEAN EscapeDirectionIsValid( INT8 * pbDirection );
|
||||
//Used for determining the type of error message that comes up when you can't traverse to
|
||||
//an adjacent sector. THESE VALUES DO NOT NEED TO BE SAVED!
|
||||
|
||||
Reference in New Issue
Block a user