mirror of
https://github.com/1dot13/source.git
synced 2026-09-02 14:36:06 +02:00
New feature: Diseaes affect your mercenaries. They can be contracted in varíous ways and have varying effects.
For more info, see http://www.ja-galaxy-forum.com/ubbthreads.php/topics/334918#Post334918 Requires GameDir >= r2099. Does not break savegame compatibility. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7384 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+780
-47
File diff suppressed because it is too large
Load Diff
+16
-1
@@ -56,7 +56,7 @@ enum
|
||||
VEHICLE,
|
||||
IN_TRANSIT,
|
||||
REPAIR,
|
||||
RADIO_SCAN, // added by Flugente
|
||||
RADIO_SCAN, // added by Flugente: a radio operators scans for enemy patrols in nearby sectors
|
||||
TRAIN_SELF,
|
||||
TRAIN_TOWN,
|
||||
TRAIN_MOBILE, // HEADROCK HAM 3.6: Training mobile militia.
|
||||
@@ -79,6 +79,8 @@ enum
|
||||
SNITCH_SPREAD_PROPAGANDA,
|
||||
SNITCH_GATHER_RUMOURS,
|
||||
FACILITY_STRATEGIC_MILITIA_MOVEMENT, // Flugente: merc staffs a military HQ, we can now control militia movement on the map
|
||||
DISEASE_DIAGNOSE, // Flugente: check for diseases among mercs and local population
|
||||
DISEASE_DOCTOR_SECTOR, // Flugente: treatpopulation (all non-mercs in the sector) against disease
|
||||
NUM_ASSIGNMENTS,
|
||||
};
|
||||
|
||||
@@ -142,6 +144,12 @@ typedef struct TOWN_TRAINER_TYPE
|
||||
// can this character be assigned as a doctor?
|
||||
BOOLEAN CanCharacterDoctor( SOLDIERTYPE *pCharacter );
|
||||
|
||||
// can this character diagnose diseases?
|
||||
BOOLEAN CanCharacterDiagnoseDisease( SOLDIERTYPE *pSoldier );
|
||||
|
||||
// can this character treat diseases of the population (NOT mercs)?
|
||||
BOOLEAN CanCharacterTreatSectorDisease( SOLDIERTYPE *pSoldier );
|
||||
|
||||
// can this character be assigned as a repairman?
|
||||
BOOLEAN CanCharacterRepair( SOLDIERTYPE *pCharacter );
|
||||
|
||||
@@ -262,6 +270,7 @@ extern INT32 ghVehicleBox;
|
||||
extern INT32 ghRepairBox;
|
||||
extern INT32 ghTrainingBox;
|
||||
extern INT32 ghMoveItemBox;
|
||||
extern INT32 ghDiseaseBox;
|
||||
extern INT32 ghAttributeBox;
|
||||
extern INT32 ghRemoveMercAssignBox;
|
||||
extern INT32 ghContractBox;
|
||||
@@ -296,6 +305,7 @@ extern BOOLEAN fShownContractMenu;
|
||||
extern BOOLEAN fShownAssignmentMenu;
|
||||
extern BOOLEAN fShowRepairMenu;
|
||||
extern BOOLEAN fShowMoveItemMenu;
|
||||
extern BOOLEAN fShowDiseaseMenu;
|
||||
|
||||
extern BOOLEAN fFirstClickInAssignmentScreenMask;
|
||||
|
||||
@@ -338,6 +348,11 @@ void CreateDestroyMouseRegionForMoveItemMenu( void );
|
||||
void MoveItemMenuMvtCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void MoveItemMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
// Flugente: disease menu
|
||||
void CreateDestroyMouseRegionForDiseaseMenu( void );
|
||||
void DiseaseMenuMvtCallback( MOUSE_REGION * pRegion, INT32 iReason );
|
||||
void DiseaseMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
// HEADROCK HAM 3.6: Facility Menu
|
||||
void CreateDestroyMouseRegionForFacilityMenu( void );
|
||||
void FacilityMenuMvtCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
@@ -4672,6 +4672,9 @@ void AttackTarget( SOLDIERCELL *pAttacker, SOLDIERCELL *pTarget )
|
||||
// Flugente: campaign stats
|
||||
gCurrentIncident.AddStat( pTarget->pSoldier, CAMPAIGNHISTORY_TYPE_KILL );
|
||||
|
||||
// Flugente: disease
|
||||
HandleDeathDiseaseImplications( pTarget->pSoldier );
|
||||
|
||||
if( pAttacker->uiFlags & CELL_MERC )
|
||||
{ //Player killed the enemy soldier -- update his stats as well as any assisters.
|
||||
/////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -4858,6 +4861,9 @@ void TargetHitCallback( SOLDIERCELL *pTarget, INT32 index )
|
||||
// Flugente: campaign stats
|
||||
gCurrentIncident.AddStat( pTarget->pSoldier, CAMPAIGNHISTORY_TYPE_KILL );
|
||||
|
||||
// Flugente: disease
|
||||
HandleDeathDiseaseImplications( pTarget->pSoldier );
|
||||
|
||||
//soldier has been killed
|
||||
if( pTarget->pAttacker[ index ]->uiFlags & CELL_PLAYER )
|
||||
{ //Player killed the enemy soldier -- update his stats as well as any assisters.
|
||||
|
||||
@@ -500,7 +500,7 @@ typedef struct SECTORINFO
|
||||
BOOLEAN fCampaignSector;
|
||||
#endif
|
||||
|
||||
UINT8 uiNumberOfPrisonersOfWar[PRISONER_MAX]; // TODO: PRISONER_MAX got expanded - Varaiblen werden falsch ausgelesen!!!
|
||||
UINT8 uiNumberOfPrisonersOfWar[PRISONER_MAX];
|
||||
UINT8 uiInterrogationHundredsLeft[PRISONER_MAX];
|
||||
|
||||
UINT32 uiTimeAIArtillerywasOrdered; // Flugente: updated every time an artillery strike is ordered from the militia
|
||||
@@ -508,7 +508,14 @@ typedef struct SECTORINFO
|
||||
UINT8 ubNumTanks;
|
||||
UINT8 ubTanksInBattle;
|
||||
|
||||
INT8 bPadding[ 20 ];
|
||||
// Flugente: disease
|
||||
UINT16 usInfected; // how many people (civilians + enemy + militia) are infected in this sector? Does NOT count our mercs
|
||||
FLOAT fInfectionSeverity; // mean infection rate of those infected (percentage)
|
||||
UINT8 usDiseaseDoctoringDelay; // AI doctoring in this sector is delayed due to player interference
|
||||
UINT8 usInfectionFlag;
|
||||
|
||||
|
||||
INT8 bPadding[ 12 ];
|
||||
|
||||
}SECTORINFO;
|
||||
|
||||
|
||||
@@ -487,6 +487,9 @@ void InitStrategicLayer( void )
|
||||
// HEADROCK HAM 4: Initialize Manual Mobile Militia Restrictions.
|
||||
InitManualMobileRestrictions();
|
||||
|
||||
// Flugente: initialize dynamic supply data
|
||||
//InitStrategicSupplies();
|
||||
|
||||
// free up any leave list arrays that were left allocated
|
||||
ShutDownLeaveList( );
|
||||
// re-set up leave list arrays for dismissed mercs
|
||||
|
||||
+63
-60
@@ -7072,78 +7072,81 @@ static int l_ACTION_ITEM_SEX (lua_State *L)
|
||||
{
|
||||
sGridNo = lua_tointeger(L, 1);
|
||||
|
||||
if ( ! (gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
{
|
||||
UINT8 ubID;
|
||||
OBJECTTYPE DoorCloser;
|
||||
INT16 sTeleportSpot;
|
||||
INT16 sDoorSpot;
|
||||
UINT8 ubDirection;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom, ubOldRoom;
|
||||
UINT16 usRoom, usOldRoom;
|
||||
|
||||
// Flugente: check for valid sGridNo
|
||||
if ( TileIsOutOfBounds(sGridNo) )
|
||||
return 0;
|
||||
|
||||
ubID = WhoIsThere2( sGridNo, 0 );
|
||||
if ( (ubID != NOBODY) && (MercPtrs[ ubID ]->bTeam == gbPlayerNum) )
|
||||
if ( ! (gTacticalStatus.uiFlags & INCOMBAT) )
|
||||
{
|
||||
if ( InARoom( sGridNo, &usRoom ) && InARoom( MercPtrs[ ubID ]->sOldGridNo, &usOldRoom ) && usOldRoom != usRoom )
|
||||
UINT8 ubID;
|
||||
OBJECTTYPE DoorCloser;
|
||||
INT16 sTeleportSpot;
|
||||
INT16 sDoorSpot;
|
||||
UINT8 ubDirection;
|
||||
//DBrot: More Rooms
|
||||
//UINT8 ubRoom, ubOldRoom;
|
||||
UINT16 usRoom, usOldRoom;
|
||||
|
||||
// Flugente: check for valid sGridNo
|
||||
if ( TileIsOutOfBounds(sGridNo) )
|
||||
return 0;
|
||||
|
||||
ubID = WhoIsThere2( sGridNo, 0 );
|
||||
if ( (ubID != NOBODY) && (MercPtrs[ ubID ]->bTeam == gbPlayerNum) )
|
||||
{
|
||||
// also require there to be a miniskirt civ in the room
|
||||
if ( HookerInRoom( usRoom ) )
|
||||
if ( InARoom( sGridNo, &usRoom ) && InARoom( MercPtrs[ ubID ]->sOldGridNo, &usOldRoom ) && usOldRoom != usRoom )
|
||||
{
|
||||
// stop the merc...
|
||||
MercPtrs[ ubID ]->EVENT_StopMerc( MercPtrs[ ubID ]->sGridNo, MercPtrs[ ubID ]->ubDirection );
|
||||
// also require there to be a miniskirt civ in the room
|
||||
if ( HookerInRoom( usRoom ) )
|
||||
{
|
||||
// stop the merc...
|
||||
MercPtrs[ ubID ]->EVENT_StopMerc( MercPtrs[ ubID ]->sGridNo, MercPtrs[ ubID ]->ubDirection );
|
||||
|
||||
if ( sGridNo == gModSettings.iCarlaDoorGridNo +1 )
|
||||
{
|
||||
sDoorSpot = gModSettings.iCarlaDoorGridNo;
|
||||
sTeleportSpot = gModSettings.iCarlaDoorGridNo;
|
||||
}
|
||||
else if ( sGridNo == gModSettings.iCindyDoorGridNo +1 )
|
||||
{
|
||||
sDoorSpot = gModSettings.iCindyDoorGridNo;
|
||||
sTeleportSpot = gModSettings.iCindyDoorGridNo;
|
||||
}
|
||||
else if ( sGridNo == gModSettings.iBambiDoorGridNo )
|
||||
{
|
||||
sDoorSpot = gModSettings.iBambiDoorGridNo;
|
||||
sTeleportSpot = gModSettings.iBambiDoorGridNo +1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sDoorSpot = NOWHERE;
|
||||
sTeleportSpot = NOWHERE;
|
||||
}
|
||||
if ( sGridNo == gModSettings.iCarlaDoorGridNo +1 )
|
||||
{
|
||||
sDoorSpot = gModSettings.iCarlaDoorGridNo;
|
||||
sTeleportSpot = gModSettings.iCarlaDoorGridNo;
|
||||
}
|
||||
else if ( sGridNo == gModSettings.iCindyDoorGridNo +1 )
|
||||
{
|
||||
sDoorSpot = gModSettings.iCindyDoorGridNo;
|
||||
sTeleportSpot = gModSettings.iCindyDoorGridNo;
|
||||
}
|
||||
else if ( sGridNo == gModSettings.iBambiDoorGridNo )
|
||||
{
|
||||
sDoorSpot = gModSettings.iBambiDoorGridNo;
|
||||
sTeleportSpot = gModSettings.iBambiDoorGridNo +1;
|
||||
}
|
||||
else
|
||||
{
|
||||
sDoorSpot = NOWHERE;
|
||||
sTeleportSpot = NOWHERE;
|
||||
}
|
||||
|
||||
if (!TileIsOutOfBounds(sDoorSpot) && !TileIsOutOfBounds(sTeleportSpot) )
|
||||
{
|
||||
// close the door...
|
||||
DoorCloser[0]->data.misc.bActionValue = ACTION_ITEM_CLOSE_DOOR;
|
||||
PerformItemAction( sDoorSpot, &DoorCloser );
|
||||
if (!TileIsOutOfBounds(sDoorSpot) && !TileIsOutOfBounds(sTeleportSpot) )
|
||||
{
|
||||
// close the door...
|
||||
DoorCloser[0]->data.misc.bActionValue = ACTION_ITEM_CLOSE_DOOR;
|
||||
PerformItemAction( sDoorSpot, &DoorCloser );
|
||||
|
||||
// have sex
|
||||
HandleNPCDoAction( 0, NPC_ACTION_SEX, 0 );
|
||||
// have sex
|
||||
HandleNPCDoAction( 0, NPC_ACTION_SEX, 0 );
|
||||
|
||||
// move the merc outside of the room again
|
||||
sTeleportSpot = FindGridNoFromSweetSpotWithStructData( MercPtrs[ ubID ], STANDING, sTeleportSpot, 2, &ubDirection, FALSE );
|
||||
MercPtrs[ ubID ]->ChangeSoldierState( STANDING, 0, TRUE );
|
||||
TeleportSoldier( MercPtrs[ ubID ], sTeleportSpot, FALSE );
|
||||
// move the merc outside of the room again
|
||||
sTeleportSpot = FindGridNoFromSweetSpotWithStructData( MercPtrs[ ubID ], STANDING, sTeleportSpot, 2, &ubDirection, FALSE );
|
||||
MercPtrs[ ubID ]->ChangeSoldierState( STANDING, 0, TRUE );
|
||||
TeleportSoldier( MercPtrs[ ubID ], sTeleportSpot, FALSE );
|
||||
|
||||
HandleMoraleEvent( MercPtrs[ ubID ], MORALE_SEX, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
DirtyMercPanelInterface( MercPtrs[ ubID ], DIRTYLEVEL1 );
|
||||
HandleMoraleEvent( MercPtrs[ ubID ], MORALE_SEX, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
FatigueCharacter( MercPtrs[ ubID ] );
|
||||
DirtyMercPanelInterface( MercPtrs[ ubID ], DIRTYLEVEL1 );
|
||||
|
||||
// Flugente: we might get a disease from this...
|
||||
HandlePossibleInfection( MercPtrs[ubID], NULL, INFECTION_TYPE_SEX );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -55,6 +55,8 @@ UINT16 MAP_BORDER_MILITIA_BTN_X;
|
||||
UINT16 MAP_BORDER_MILITIA_BTN_Y;
|
||||
UINT16 MAP_BORDER_MOBILE_BTN_X;
|
||||
UINT16 MAP_BORDER_MOBILE_BTN_Y;
|
||||
UINT16 MAP_BORDER_DISEASE_BTN_X; // Flugente: disease
|
||||
UINT16 MAP_BORDER_DISEASE_BTN_Y;
|
||||
|
||||
UINT16 MAP_LEVEL_MARKER_X;
|
||||
UINT16 MAP_LEVEL_MARKER_Y;
|
||||
@@ -81,7 +83,8 @@ BOOLEAN fShowTeamFlag = FALSE;
|
||||
BOOLEAN fShowMilitia = FALSE;
|
||||
BOOLEAN fShowAircraftFlag = FALSE;
|
||||
BOOLEAN fShowItemsFlag = FALSE;
|
||||
BOOLEAN fShowMobileRestrictionsFlag = FALSE; // HEADROCK HAM 4
|
||||
BOOLEAN fShowMobileRestrictionsFlag = FALSE; // HEADROCK HAM 4
|
||||
UINT8 fShowStrategicDiseaseFlag = 0; // Flugente: disease
|
||||
|
||||
//BOOLEAN fShowVehicleFlag = FALSE;
|
||||
|
||||
@@ -98,8 +101,8 @@ extern int CLOCK_Y_START;
|
||||
|
||||
// buttons & button images
|
||||
// HEADROCK HAM 4: Increase both arrays by one to accomodate new Mobile Restrictions button
|
||||
INT32 giMapBorderButtons[ 7 ] = { -1, -1, -1, -1, -1, -1, -1 };
|
||||
INT32 giMapBorderButtonsImage[ 7 ] = { -1, -1, -1, -1, -1, -1, -1 };
|
||||
INT32 giMapBorderButtons[ NUM_MAP_BORDER_BTNS ] = { -1, -1, -1, -1, -1, -1, -1, -1 };
|
||||
INT32 giMapBorderButtonsImage[ NUM_MAP_BORDER_BTNS ] = { -1, -1, -1, -1, -1, -1, -1, -1 };
|
||||
|
||||
void DeleteMapBorderButtons( void );
|
||||
BOOLEAN CreateButtonsForMapBorder( void );
|
||||
@@ -124,6 +127,9 @@ void BtnMilitiaCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
// HEADROCK HAM 4: Mobile Restrictions Button callback
|
||||
void BtnMobileCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
|
||||
// Flugente: disease
|
||||
void BtnDiseaseCallback(GUI_BUTTON *btn,INT32 reason);
|
||||
|
||||
void LevelMarkerBtnCallback(MOUSE_REGION * pRegion, INT32 iReason );
|
||||
|
||||
void CommonBtnCallbackBtnDownChecks( void );
|
||||
@@ -303,29 +309,40 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnMobileCallback);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// set up fast help text
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 0 ], pMapScreenBorderButtonHelpText[ 0 ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 1 ], pMapScreenBorderButtonHelpText[ 1 ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 2 ], pMapScreenBorderButtonHelpText[ 2 ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 3 ], pMapScreenBorderButtonHelpText[ 3 ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 4 ], pMapScreenBorderButtonHelpText[ 4 ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 5 ], pMapScreenBorderButtonHelpText[ 5 ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ MAP_BORDER_TOWN_BTN ], pMapScreenBorderButtonHelpText[ MAP_BORDER_TOWN_BTN ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ MAP_BORDER_MINE_BTN ], pMapScreenBorderButtonHelpText[ MAP_BORDER_MINE_BTN ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ], pMapScreenBorderButtonHelpText[ MAP_BORDER_TEAMS_BTN ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ], pMapScreenBorderButtonHelpText[ MAP_BORDER_AIRSPACE_BTN ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ MAP_BORDER_ITEM_BTN ], pMapScreenBorderButtonHelpText[ MAP_BORDER_ITEM_BTN ] );
|
||||
SetButtonFastHelpText( giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ], pMapScreenBorderButtonHelpText[ MAP_BORDER_MILITIA_BTN ] );
|
||||
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
SetButtonFastHelpText( giMapBorderButtons[ MAP_BORDER_MOBILE_BTN ], pMapScreenBorderButtonHelpText[ MAP_BORDER_MOBILE_BTN ] ); // HEADROCK HAM 4: Mobile Militia button
|
||||
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_TOWN_BTN ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_MINE_BTN ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_ITEM_BTN ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ], MSYS_NO_CURSOR );
|
||||
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
SetButtonFastHelpText( giMapBorderButtons[ 6 ], pMapScreenBorderButtonHelpText[ 6 ] ); // HEADROCK HAM 4: Mobile Militia button
|
||||
SetButtonCursor(giMapBorderButtons[ MAP_BORDER_MOBILE_BTN ], MSYS_NO_CURSOR ); // HEADROCK HAM 4: Mobile Militia button
|
||||
|
||||
// Flugente: disease
|
||||
if ( gGameExternalOptions.fDisease && gGameExternalOptions.fDiseaseStrategic )
|
||||
{
|
||||
giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] = LoadButtonImage( "INTERFACE\\map_border_buttons.sti", -1, 31, -1, 32, -1 );
|
||||
giMapBorderButtons[MAP_BORDER_DISEASE_BTN] = QuickCreateButton( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN], MAP_BORDER_DISEASE_BTN_X, MAP_BORDER_DISEASE_BTN_Y,
|
||||
BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH,
|
||||
(GUI_CALLBACK)MSYS_NO_CALLBACK, (GUI_CALLBACK)BtnDiseaseCallback );
|
||||
|
||||
SetButtonCursor(giMapBorderButtons[ 0 ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ 1 ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ 2 ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ 3 ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ 4 ], MSYS_NO_CURSOR );
|
||||
SetButtonCursor(giMapBorderButtons[ 5 ], MSYS_NO_CURSOR );
|
||||
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
SetButtonCursor(giMapBorderButtons[ 6 ], MSYS_NO_CURSOR ); // HEADROCK HAM 4: Mobile Militia button
|
||||
SetButtonFastHelpText( giMapBorderButtons[MAP_BORDER_DISEASE_BTN], pMapScreenBorderButtonHelpText[MAP_BORDER_DISEASE_BTN] );
|
||||
|
||||
SetButtonCursor( giMapBorderButtons[MAP_BORDER_DISEASE_BTN], MSYS_NO_CURSOR );
|
||||
}
|
||||
|
||||
#ifdef JA2UB
|
||||
//EnableButton
|
||||
@@ -392,8 +409,9 @@ BOOLEAN CreateButtonsForMapBorder( void )
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ]);
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ]);
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_ITEM_BTN ]);
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_MOBILE_BTN ]);
|
||||
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_MOBILE_BTN ]);
|
||||
DisableButton( giMapBorderButtons[ MAP_BORDER_DISEASE_BTN ]);
|
||||
|
||||
fShowTownFlag = FALSE;
|
||||
#endif
|
||||
|
||||
@@ -407,33 +425,38 @@ void DeleteMapBorderButtons( void )
|
||||
{
|
||||
UINT8 ubCnt;
|
||||
|
||||
RemoveButton( giMapBorderButtons[ 0 ]);
|
||||
RemoveButton( giMapBorderButtons[ 1 ]);
|
||||
RemoveButton( giMapBorderButtons[ 2 ]);
|
||||
RemoveButton( giMapBorderButtons[ 3 ]);
|
||||
RemoveButton( giMapBorderButtons[ 4 ]);
|
||||
RemoveButton( giMapBorderButtons[ 5 ]);
|
||||
RemoveButton( giMapBorderButtons[ MAP_BORDER_TOWN_BTN ]);
|
||||
RemoveButton( giMapBorderButtons[ MAP_BORDER_MINE_BTN ]);
|
||||
RemoveButton( giMapBorderButtons[ MAP_BORDER_TEAMS_BTN ]);
|
||||
RemoveButton( giMapBorderButtons[ MAP_BORDER_AIRSPACE_BTN ]);
|
||||
RemoveButton( giMapBorderButtons[ MAP_BORDER_ITEM_BTN ]);
|
||||
RemoveButton( giMapBorderButtons[ MAP_BORDER_MILITIA_BTN ]);
|
||||
|
||||
// WANNE: Only remove if we added the button
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
RemoveButton( giMapBorderButtons[ 6 ]); // HEADROCK HAM 4
|
||||
RemoveButton( giMapBorderButtons[ MAP_BORDER_MOBILE_BTN ]); // HEADROCK HAM 4
|
||||
|
||||
if ( giMapBorderButtons[MAP_BORDER_DISEASE_BTN] != -1 )
|
||||
RemoveButton( giMapBorderButtons[MAP_BORDER_DISEASE_BTN] );
|
||||
|
||||
// images
|
||||
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 0 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 1 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 2 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 3 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 4 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 5 ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ MAP_BORDER_TOWN_BTN ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ MAP_BORDER_MINE_BTN ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ MAP_BORDER_TEAMS_BTN ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ MAP_BORDER_AIRSPACE_BTN ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ MAP_BORDER_ITEM_BTN ] );
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ MAP_BORDER_MILITIA_BTN ] );
|
||||
|
||||
// WANNE: Only unload if we added the button
|
||||
if (gGameExternalOptions.gfAllowMilitiaGroups)
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ 6 ] ); // HEADROCK HAM 4
|
||||
|
||||
UnloadButtonImage( giMapBorderButtonsImage[ MAP_BORDER_MOBILE_BTN ] ); // HEADROCK HAM 4
|
||||
|
||||
if ( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] != -1 )
|
||||
UnloadButtonImage( giMapBorderButtonsImage[MAP_BORDER_DISEASE_BTN] );
|
||||
|
||||
// HEADROCK HAM 4: Increased number of buttons by one.
|
||||
for ( ubCnt = 0; ubCnt < NUM_MAP_BORDER_BTNS; ubCnt++ )
|
||||
for ( ubCnt = 0; ubCnt < NUM_MAP_BORDER_BTNS; ++ubCnt )
|
||||
{
|
||||
giMapBorderButtons[ ubCnt ] = -1;
|
||||
giMapBorderButtonsImage[ ubCnt ] = -1;
|
||||
@@ -527,6 +550,21 @@ void BtnItemCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: disease
|
||||
void BtnDiseaseCallback( GUI_BUTTON *btn, INT32 reason )
|
||||
{
|
||||
if(reason & MSYS_CALLBACK_REASON_LBUTTON_DWN )
|
||||
{
|
||||
CommonBtnCallbackBtnDownChecks();
|
||||
|
||||
ToggleDiseaseFilter();
|
||||
}
|
||||
else if(reason & MSYS_CALLBACK_REASON_RBUTTON_DWN )
|
||||
{
|
||||
CommonBtnCallbackBtnDownChecks();
|
||||
}
|
||||
}
|
||||
|
||||
// HEADROCK HAM 4: Callback for Mobile Restrictions Button
|
||||
void BtnMobileCallback(GUI_BUTTON *btn,INT32 reason)
|
||||
{
|
||||
@@ -616,6 +654,12 @@ void ToggleShowMinesMode( void )
|
||||
fShowMobileRestrictionsFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_MOBILE_BTN );
|
||||
}
|
||||
|
||||
if ( fShowStrategicDiseaseFlag )
|
||||
{
|
||||
fShowStrategicDiseaseFlag = MAPMODE_DISEASE;
|
||||
MapBorderButtonOff( MAP_BORDER_DISEASE_BTN );
|
||||
}
|
||||
}
|
||||
|
||||
fMapPanelDirty = TRUE;
|
||||
@@ -765,6 +809,27 @@ void ToggleItemsFilter( void )
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: disease
|
||||
void ToggleDiseaseFilter( void )
|
||||
{
|
||||
if ( fShowStrategicDiseaseFlag == MAPMODE_MAX - 1 )
|
||||
{
|
||||
// turn items OFF
|
||||
fShowStrategicDiseaseFlag = MAPMODE_OFF;
|
||||
MapBorderButtonOff( MAP_BORDER_DISEASE_BTN );
|
||||
|
||||
// dirty regions
|
||||
fMapPanelDirty = TRUE;
|
||||
fTeamPanelDirty = TRUE;
|
||||
fCharacterInfoPanelDirty = TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
// turn ON
|
||||
TurnOnDiseaseFilterMode( );
|
||||
}
|
||||
}
|
||||
|
||||
// HEADROCK HAM 4: Toggle Mobile Restrictions Button
|
||||
void ToggleMobileFilter( void )
|
||||
{
|
||||
@@ -890,13 +955,11 @@ void TurnOnShowTeamsMode( void )
|
||||
MapBorderButtonOff( MAP_BORDER_MOBILE_BTN );
|
||||
}
|
||||
|
||||
/*
|
||||
if( fShowAircraftFlag == TRUE )
|
||||
if ( fShowStrategicDiseaseFlag )
|
||||
{
|
||||
fShowAircraftFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_AIRSPACE_BTN );
|
||||
fShowStrategicDiseaseFlag = MAPMODE_DISEASE;
|
||||
MapBorderButtonOff( MAP_BORDER_DISEASE_BTN );
|
||||
}
|
||||
*/
|
||||
|
||||
if( fShowItemsFlag == TRUE )
|
||||
{
|
||||
@@ -958,6 +1021,12 @@ void TurnOnAirSpaceMode( void )
|
||||
MapBorderButtonOff( MAP_BORDER_MOBILE_BTN );
|
||||
}
|
||||
|
||||
if ( fShowStrategicDiseaseFlag )
|
||||
{
|
||||
fShowStrategicDiseaseFlag = MAPMODE_DISEASE;
|
||||
MapBorderButtonOff( MAP_BORDER_DISEASE_BTN );
|
||||
}
|
||||
|
||||
// Turn off items
|
||||
if( fShowItemsFlag == TRUE )
|
||||
{
|
||||
@@ -1004,7 +1073,6 @@ void TurnOnItemFilterMode( void )
|
||||
fShowItemsFlag = TRUE;
|
||||
MapBorderButtonOn( MAP_BORDER_ITEM_BTN );
|
||||
|
||||
|
||||
// Turn off towns, mines, teams, militia & airspace if any are on
|
||||
if( fShowTownFlag == TRUE )
|
||||
{
|
||||
@@ -1036,6 +1104,12 @@ void TurnOnItemFilterMode( void )
|
||||
MapBorderButtonOff( MAP_BORDER_MOBILE_BTN );
|
||||
}
|
||||
|
||||
if ( fShowStrategicDiseaseFlag )
|
||||
{
|
||||
fShowStrategicDiseaseFlag = MAPMODE_DISEASE;
|
||||
MapBorderButtonOff( MAP_BORDER_DISEASE_BTN );
|
||||
}
|
||||
|
||||
if( fShowAircraftFlag == TRUE )
|
||||
{
|
||||
fShowAircraftFlag = FALSE;
|
||||
@@ -1059,6 +1133,80 @@ void TurnOnItemFilterMode( void )
|
||||
}
|
||||
}
|
||||
|
||||
void TurnOnDiseaseFilterMode( void )
|
||||
{
|
||||
// if mode already on, leave, else set and redraw
|
||||
if ( fShowStrategicDiseaseFlag < MAPMODE_MAX - 1 )
|
||||
{
|
||||
++fShowStrategicDiseaseFlag;
|
||||
MapBorderButtonOn( MAP_BORDER_DISEASE_BTN );
|
||||
|
||||
if( fShowItemsFlag == TRUE )
|
||||
{
|
||||
fShowItemsFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_ITEM_BTN );
|
||||
}
|
||||
|
||||
// Turn off towns, mines, teams, militia & airspace if any are on
|
||||
if( fShowTownFlag == TRUE )
|
||||
{
|
||||
fShowTownFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_TOWN_BTN );
|
||||
}
|
||||
|
||||
if( fShowMineFlag == TRUE )
|
||||
{
|
||||
fShowMineFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_MINE_BTN );
|
||||
}
|
||||
|
||||
if( fShowTeamFlag == TRUE )
|
||||
{
|
||||
fShowTeamFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_TEAMS_BTN );
|
||||
}
|
||||
|
||||
if( fShowMilitia == TRUE )
|
||||
{
|
||||
fShowMilitia = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_MILITIA_BTN );
|
||||
}
|
||||
// HEADROCK HAM 4: Turn off Militia Restrictions
|
||||
if (fShowMobileRestrictionsFlag == TRUE)
|
||||
{
|
||||
fShowMobileRestrictionsFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_MOBILE_BTN );
|
||||
}
|
||||
|
||||
if( fShowAircraftFlag == TRUE )
|
||||
{
|
||||
fShowAircraftFlag = FALSE;
|
||||
MapBorderButtonOff( MAP_BORDER_AIRSPACE_BTN );
|
||||
}
|
||||
|
||||
if( ( bSelectedDestChar != -1 ) || ( fPlotForHelicopter == TRUE ) )
|
||||
{
|
||||
AbortMovementPlottingMode( );
|
||||
}
|
||||
else if ( gfInChangeArrivalSectorMode )
|
||||
{
|
||||
CancelChangeArrivalSectorMode( );
|
||||
}
|
||||
|
||||
if ( fShowStrategicDiseaseFlag == MAPMODE_DISEASE && !gubFact[FACT_DISEASE_VIEWED] )
|
||||
{
|
||||
MapScreenMessage( FONT_MCOLOR_LTYELLOW, MSG_MAP_UI_POSITION_MIDDLE, zMarksMapScreenText[27] );
|
||||
|
||||
SetFactTrue( FACT_DISEASE_VIEWED );
|
||||
}
|
||||
|
||||
// dirty regions
|
||||
fMapPanelDirty = TRUE;
|
||||
fTeamPanelDirty = TRUE;
|
||||
fCharacterInfoPanelDirty = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
// HEADROCK HAM 4: Activate "View Mobile Restrictions" mode.
|
||||
void TurnOnMobileFilterMode( void )
|
||||
{
|
||||
@@ -1098,6 +1246,12 @@ void TurnOnMobileFilterMode( void )
|
||||
MapBorderButtonOff( MAP_BORDER_ITEM_BTN );
|
||||
}
|
||||
|
||||
if ( fShowStrategicDiseaseFlag )
|
||||
{
|
||||
fShowStrategicDiseaseFlag = MAPMODE_DISEASE;
|
||||
MapBorderButtonOff( MAP_BORDER_DISEASE_BTN );
|
||||
}
|
||||
|
||||
if( ( bSelectedDestChar != -1 ) || ( fPlotForHelicopter == TRUE ) )
|
||||
{
|
||||
AbortMovementPlottingMode( );
|
||||
@@ -1201,6 +1355,15 @@ void InitializeMapBorderButtonStates( void )
|
||||
{
|
||||
MapBorderButtonOff( MAP_BORDER_MOBILE_BTN );
|
||||
}
|
||||
|
||||
if ( fShowStrategicDiseaseFlag )
|
||||
{
|
||||
MapBorderButtonOn( MAP_BORDER_DISEASE_BTN );
|
||||
}
|
||||
else
|
||||
{
|
||||
MapBorderButtonOff( MAP_BORDER_DISEASE_BTN );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1292,6 +1455,9 @@ void InitMapScreenFlags( void )
|
||||
|
||||
// HEADROCK HAM 4: Militia Restrictions
|
||||
fShowMobileRestrictionsFlag = FALSE;
|
||||
|
||||
// Flugente
|
||||
fShowStrategicDiseaseFlag = MAPMODE_DISEASE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1356,6 +1522,8 @@ void InitMapBorderButtonCoordinates()
|
||||
MAP_BORDER_MILITIA_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
MAP_BORDER_MOBILE_BTN_X = xResSize;
|
||||
MAP_BORDER_MOBILE_BTN_Y = 0;
|
||||
MAP_BORDER_DISEASE_BTN_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 190;
|
||||
MAP_BORDER_DISEASE_BTN_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
|
||||
MAP_LEVEL_MARKER_X = xResOffset + MAP_BORDER_X + ((SCREEN_WIDTH - MAP_BORDER_X - 2 * xResOffset) / 2) + 114;
|
||||
MAP_LEVEL_MARKER_Y = (SCREEN_HEIGHT - yResOffset - buttonOffset);
|
||||
|
||||
@@ -30,8 +30,9 @@ enum{
|
||||
MAP_BORDER_AIRSPACE_BTN,
|
||||
MAP_BORDER_ITEM_BTN,
|
||||
MAP_BORDER_MILITIA_BTN,
|
||||
MAP_BORDER_MOBILE_BTN, // HEADROCK HAM 4: Mobile Militia Restrictions button
|
||||
NUM_MAP_BORDER_BTNS, // end enumeration marker
|
||||
MAP_BORDER_MOBILE_BTN, // HEADROCK HAM 4: Mobile Militia Restrictions button
|
||||
MAP_BORDER_DISEASE_BTN, // Flugente: toggle disease views
|
||||
NUM_MAP_BORDER_BTNS, // end enumeration marker
|
||||
};
|
||||
|
||||
|
||||
@@ -50,6 +51,7 @@ extern BOOLEAN fShowMilitia;
|
||||
extern BOOLEAN fShowAircraftFlag;
|
||||
extern BOOLEAN fShowItemsFlag;
|
||||
extern BOOLEAN fShowMobileRestrictionsFlag; // HEADROCK HAM 4: Manual Mobile Militia mode
|
||||
extern UINT8 fShowStrategicDiseaseFlag; // Flugente: disease
|
||||
//extern BOOLEAN fShowVehicleFlag;
|
||||
|
||||
// scroll animation
|
||||
@@ -70,12 +72,18 @@ void ToggleItemsFilter( void );
|
||||
// HEADROCK HAM 4: Toggle Mobile Militia Restrictions Filter
|
||||
void ToggleMobileFilter( void );
|
||||
|
||||
// Flugente: disease
|
||||
void ToggleDiseaseFilter( );
|
||||
|
||||
void TurnOnShowTeamsMode( void );
|
||||
void TurnOnAirSpaceMode( void );
|
||||
void TurnOnItemFilterMode( void );
|
||||
// HEADROCK HAM 4: Turn on Mobile Militia Restrictions Filter
|
||||
void TurnOnMobileFilterMode( void );
|
||||
|
||||
// Flugente: disease
|
||||
void TurnOnDiseaseFilterMode();
|
||||
|
||||
// create/destroy buttons for map border region
|
||||
void DeleteMapBorderButtons( void );
|
||||
BOOLEAN CreateButtonsForMapBorder( void );
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -29,6 +29,41 @@ typedef struct
|
||||
|
||||
} MINERALS_VALUES;
|
||||
|
||||
// map shading colors
|
||||
enum{
|
||||
MAP_SHADE_BLACK =0,
|
||||
|
||||
MAP_SHADE_LT_GREEN,
|
||||
MAP_SHADE_MD_GREEN,
|
||||
MAP_SHADE_DK_GREEN,
|
||||
|
||||
MAP_SHADE_LT_RED,
|
||||
MAP_SHADE_MD_RED,
|
||||
MAP_SHADE_DK_RED,
|
||||
|
||||
MAP_SHADE_LT_YELLOW,
|
||||
MAP_SHADE_MD_YELLOW,
|
||||
MAP_SHADE_DK_YELLOW,
|
||||
|
||||
MAP_SHADE_LT_CYAN,
|
||||
MAP_SHADE_MD_CYAN,
|
||||
MAP_SHADE_DK_CYAN,
|
||||
|
||||
MAP_SHADE_LT_GREY,
|
||||
MAP_SHADE_MD_GREY,
|
||||
MAP_SHADE_DK_GREY,
|
||||
|
||||
MAP_SHADE_LT_BLUE,
|
||||
MAP_SHADE_MD_BLUE,
|
||||
MAP_SHADE_DK_BLUE,
|
||||
|
||||
MAP_SHADE_LT_PINK,
|
||||
|
||||
MAP_SHADE_ORANGE,
|
||||
|
||||
MAP_SHADE_MAX,
|
||||
};
|
||||
|
||||
extern MINERALS_VALUES MineralsName[255];
|
||||
|
||||
extern ICON_FILE gHiddenIcon[ 256 ];
|
||||
@@ -131,7 +166,6 @@ void BlitTownGridMarkers( void );
|
||||
BOOLEAN LoadMilitiaPopUpBox( void );
|
||||
void RemoveMilitiaPopUpBox( void );
|
||||
|
||||
|
||||
// check if anyone left behind, if not, move selected cursor along with movement group
|
||||
//void CheckIfAnyoneLeftInSector( INT16 sX, INT16 sY, INT16 sNewX, INT16 sNewY, INT8 bZ );
|
||||
|
||||
|
||||
@@ -1987,7 +1987,7 @@ void RemoveMapStatusBarsRegion( void )
|
||||
|
||||
void UpdateCharRegionHelpText( void )
|
||||
{
|
||||
CHAR16 sString[ 256 ], sTemp[ 20 ];
|
||||
CHAR16 sString[ 6000 ], sTemp[ 20 ];
|
||||
CHAR16 pMoraleStr[ 128 ];
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
|
||||
@@ -2060,6 +2060,10 @@ void UpdateCharRegionHelpText( void )
|
||||
pMapScreenStatusStrings[ 2 ], pMoraleStr );
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
pSoldier->PrintDiseaseDesc( sString, TRUE );
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -2321,6 +2325,14 @@ void UpdateMapScreenAssignmentPositions( void )
|
||||
SetBoxPosition( ghMoveItemBox, pPoint );
|
||||
}
|
||||
|
||||
if ( fShowDiseaseMenu )
|
||||
{
|
||||
GetBoxPosition( ghDiseaseBox, &pPoint );
|
||||
pPoint.iY = giBoxY + (GetFontHeight( MAP_SCREEN_FONT ) + 2) * ASSIGN_MENU_DOCTOR_DIAGNOSIS;
|
||||
|
||||
SetBoxPosition( ghDiseaseBox, pPoint );
|
||||
}
|
||||
|
||||
// HEADROCK HAM 3.6: Facility Menu
|
||||
if( fShowFacilityMenu )
|
||||
{
|
||||
|
||||
@@ -122,6 +122,7 @@ enum{
|
||||
enum {
|
||||
ASSIGN_MENU_ON_DUTY=0,
|
||||
ASSIGN_MENU_DOCTOR,
|
||||
ASSIGN_MENU_DOCTOR_DIAGNOSIS, // added by Flugente
|
||||
ASSIGN_MENU_PATIENT,
|
||||
ASSIGN_MENU_VEHICLE,
|
||||
ASSIGN_MENU_REPAIR,
|
||||
|
||||
@@ -615,6 +615,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
||||
UINT8 regulars = max(0, bRegularsDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ]);
|
||||
UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
||||
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
||||
|
||||
// Flugente: disease
|
||||
PopulationMove( sMapX, sMapY, sTMapX, sTMapY, elites + regulars + greens );
|
||||
|
||||
// Erase ALL militia from both locations.
|
||||
StrategicRemoveMilitiaFromSector( sMapX, sMapY, GREEN_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ] );
|
||||
@@ -651,6 +654,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
||||
UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
||||
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
||||
|
||||
// Flugente: disease
|
||||
PopulationMove( sMapX, sMapY, sTMapX, sTMapY, elites + regulars + greens );
|
||||
|
||||
// Add half team to target sector
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, GREEN_MILITIA, bGreensDestTeam );
|
||||
StrategicAddMilitiaToSector( sTMapX, sTMapY, REGULAR_MILITIA, bRegularsDestTeam );
|
||||
@@ -734,6 +740,9 @@ void MoveMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY, BOOL
|
||||
UINT8 greens = max(0, bGreensDestTeam - pTSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ]);
|
||||
MoveMilitiaEquipment(sMapX, sMapY, sTMapX, sTMapY, elites, regulars, greens);
|
||||
|
||||
// Flugente: disease
|
||||
PopulationMove( sMapX, sMapY, sTMapX, sTMapY, elites + regulars + greens );
|
||||
|
||||
// Erase ALL militia from both locations.
|
||||
StrategicRemoveMilitiaFromSector( sMapX, sMapY, GREEN_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ GREEN_MILITIA ] );
|
||||
StrategicRemoveMilitiaFromSector( sMapX, sMapY, REGULAR_MILITIA, pSectorInfo->ubNumberOfCivsAtLevel[ REGULAR_MILITIA ] );
|
||||
@@ -2770,6 +2779,9 @@ void MobileMilitiaDeserters(INT16 sMapX, INT16 sMapY, BOOLEAN fDeleteEquip, BOOL
|
||||
}
|
||||
}
|
||||
|
||||
// Flugente: disease
|
||||
PopulationMove( sMapX, sMapY, -1, -1, desertersGreen + desertersRegular );
|
||||
|
||||
///////////////////////////
|
||||
//notify player
|
||||
if ( fPrintMessage )
|
||||
|
||||
+41
-42
@@ -108,7 +108,7 @@ void ValidateEnemiesHaveWeapons()
|
||||
SOLDIERTYPE *pSoldier;
|
||||
INT32 iNumInvalid = 0;
|
||||
|
||||
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; i++ )
|
||||
for( i = gTacticalStatus.Team[ ENEMY_TEAM ].bFirstID; i <= gTacticalStatus.Team[ ENEMY_TEAM ].bLastID; ++i )
|
||||
{
|
||||
pSoldier = MercPtrs[ i ];
|
||||
if( !pSoldier->bActive || !pSoldier->bInSector )
|
||||
@@ -116,15 +116,13 @@ void ValidateEnemiesHaveWeapons()
|
||||
continue;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_ZOMBIES
|
||||
// Flugente: zombies are fine with having no weapons...
|
||||
if ( pSoldier->IsZombie() )
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if( !pSoldier->inv[ HANDPOS ].usItem )
|
||||
{
|
||||
iNumInvalid++;
|
||||
++iNumInvalid;
|
||||
}
|
||||
// WDS DEBUG
|
||||
// Uncommenting the following two lines will cause all the PLACED soldiers to instantly drop dead,
|
||||
@@ -552,7 +550,7 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
GROUP *pGroup;
|
||||
SOLDIERTYPE *pSoldier;
|
||||
unsigned ubNumAdmins, ubNumTroops, ubNumElites, ubNumTanks;
|
||||
unsigned ubTotalAdmins, ubTotalElites, ubTotalTroops, ubTotalTanks;
|
||||
unsigned ubTotalAdmins, ubTotalElites, ubTotalTroops, ubTotalTanks = 0;
|
||||
unsigned totalCountOfStationaryEnemies = 0;
|
||||
unsigned totalCountOfMobileEnemies = 0;
|
||||
int sNumSlots;
|
||||
@@ -611,9 +609,9 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
{
|
||||
HandleArrivalOfReinforcements( pGroup );
|
||||
}
|
||||
|
||||
pGroup = pGroup->next;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
ValidateEnemiesHaveWeapons();
|
||||
@@ -623,8 +621,10 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
// WDS Count the number of placements. This will limit the maximum number of enemies we can place on the map
|
||||
SOLDIERINITNODE *curr = gSoldierInitHead;
|
||||
unsigned mapMaximumNumberOfEnemies = 0;
|
||||
while( curr ) {
|
||||
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM ) {
|
||||
while( curr )
|
||||
{
|
||||
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
++mapMaximumNumberOfEnemies;
|
||||
}
|
||||
curr = curr->next;
|
||||
@@ -653,8 +653,8 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
while (totalEnemies < mapMaximumNumberOfEnemies)
|
||||
{
|
||||
// just fill out with standard troops
|
||||
ubTotalTroops++;
|
||||
totalEnemies++;
|
||||
++ubTotalTroops;
|
||||
++totalEnemies;
|
||||
}
|
||||
|
||||
pSector->ubNumAdmins = ubTotalAdmins;
|
||||
@@ -668,39 +668,38 @@ 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 )
|
||||
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 )
|
||||
{
|
||||
switch( curr->pBasicPlacement->ubSoldierClass )
|
||||
if( curr->pBasicPlacement->bTeam == ENEMY_TEAM )
|
||||
{
|
||||
case SOLDIER_CLASS_ADMINISTRATOR: ubTotalAdmins++; break;
|
||||
case SOLDIER_CLASS_ARMY: ubTotalTroops++; break;
|
||||
case SOLDIER_CLASS_ELITE: ubTotalElites++; break;
|
||||
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;
|
||||
}
|
||||
curr = curr->next;
|
||||
pSector->ubNumAdmins = ubTotalAdmins;
|
||||
pSector->ubNumTroops = ubTotalTroops;
|
||||
pSector->ubNumElites = ubTotalElites;
|
||||
pSector->ubNumTanks = ubTotalTanks;
|
||||
pSector->ubAdminsInBattle = 0;
|
||||
pSector->ubTroopsInBattle = 0;
|
||||
pSector->ubElitesInBattle = 0;
|
||||
pSector->ubTanksInBattle = 0;
|
||||
}
|
||||
pSector->ubNumAdmins = ubTotalAdmins;
|
||||
pSector->ubNumTroops = ubTotalTroops;
|
||||
pSector->ubNumElites = ubTotalElites;
|
||||
pSector->ubNumTanks = ubTotalTanks;
|
||||
pSector->ubAdminsInBattle = 0;
|
||||
pSector->ubTroopsInBattle = 0;
|
||||
pSector->ubElitesInBattle = 0;
|
||||
pSector->ubTanksInBattle = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
|
||||
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
|
||||
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
|
||||
ubTotalTanks = pSector->ubNumTanks - pSector->ubTanksInBattle;
|
||||
else
|
||||
{
|
||||
ubTotalAdmins = pSector->ubNumAdmins - pSector->ubAdminsInBattle;
|
||||
ubTotalTroops = pSector->ubNumTroops - pSector->ubTroopsInBattle;
|
||||
ubTotalElites = pSector->ubNumElites - pSector->ubElitesInBattle;
|
||||
ubTotalTanks = pSector->ubNumTanks - pSector->ubTanksInBattle;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -726,7 +725,7 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
pSector->ubElitesInBattle += ubTotalElites;
|
||||
pSector->ubTanksInBattle += ubTotalTanks;
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
#ifdef JA2TESTVERSION
|
||||
if( gfOverrideSector )
|
||||
{
|
||||
//if there are no troops in the current groups, then we're done.
|
||||
@@ -736,7 +735,7 @@ BOOLEAN PrepareEnemyForSectorBattle()
|
||||
ValidateEnemiesHaveWeapons();
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
//Search for movement groups that happen to be in the sector.
|
||||
sNumSlots = NumFreeEnemySlots();
|
||||
@@ -1758,8 +1757,8 @@ void AddPossiblePendingEnemiesToBattle()
|
||||
// The group has no movement orders. Where did it come from?
|
||||
Assert(0);
|
||||
}
|
||||
|
||||
if( pGroup->pEnemyGroup->ubElitesInBattle < pGroup->pEnemyGroup->ubNumElites )
|
||||
|
||||
if ( pGroup->pEnemyGroup->ubElitesInBattle < pGroup->pEnemyGroup->ubNumElites )
|
||||
{ //Add an elite troop
|
||||
pGroup->pEnemyGroup->ubElitesInBattle++;
|
||||
ubSlots--;
|
||||
|
||||
@@ -554,6 +554,11 @@ enum Facts
|
||||
|
||||
FACT_WALDO_MET,
|
||||
|
||||
// Flugente: disease
|
||||
FACT_DISEASE_VIEWED,
|
||||
FACT_DISEASE_WHODATA_SUBSCRIBED, // if we are currently subscripted, we will pay x$ per day
|
||||
FACT_DISEASE_WHODATA_ACCESS, // do we currently have access to the data
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
//Ja25 UB
|
||||
|
||||
@@ -261,6 +261,9 @@ UINT8 DoReinforcementAsPendingEnemy( INT16 sMapX, INT16 sMapY )
|
||||
{
|
||||
while ((pGroup = GetEnemyGroupInSector( SECTORX( pusMoveDir[ ubIndex][ 0 ] ), SECTORY( pusMoveDir[ ubIndex ][ 0 ] ) ) ) != NULL)
|
||||
{
|
||||
// Flugente: disease
|
||||
PopulationMove( pGroup->ubSectorX, pGroup->ubSectorY, sMapX, sMapY, pGroup->ubGroupSize );
|
||||
|
||||
pGroup->ubPrevX = pGroup->ubSectorX;
|
||||
pGroup->ubPrevY = pGroup->ubSectorY;
|
||||
|
||||
@@ -269,7 +272,7 @@ UINT8 DoReinforcementAsPendingEnemy( INT16 sMapX, INT16 sMapY )
|
||||
|
||||
gfPendingEnemies = TRUE;
|
||||
ResetMortarsOnTeamCount();
|
||||
ResetNumSquadleadersInArmyGroup(); // added by SANDRO
|
||||
ResetNumSquadleadersInArmyGroup(); // added by SANDRO
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -614,6 +614,9 @@ void MercDailyUpdate()
|
||||
|
||||
// Flugente: dynmaic opinion rollover
|
||||
HandleDynamicOpinionsDailyRefresh( );
|
||||
|
||||
// Flugente: disease
|
||||
HandleDiseaseDailyRefresh();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -510,13 +510,11 @@ INT32 GetAvailableWorkForceForMineForPlayer( INT8 bMineIndex )
|
||||
return ( 0 );
|
||||
}
|
||||
|
||||
|
||||
//bTownId = gMineLocation[ bMineIndex ].bAssociatedTown;
|
||||
bTownId = gMineStatus[ bMineIndex ].bAssociatedTown;
|
||||
|
||||
Assert ( GetTownSectorSize( bTownId ) != 0 );
|
||||
|
||||
|
||||
// get workforce size (is 0-100 based on local town's loyalty)
|
||||
iWorkForceSize = gTownLoyalty[ bTownId ].ubRating;
|
||||
|
||||
@@ -526,6 +524,9 @@ INT32 GetAvailableWorkForceForMineForPlayer( INT8 bMineIndex )
|
||||
iWorkForceSize /= 100;
|
||||
*/
|
||||
|
||||
// Flugente: if strategic disease is active, disease can affect out workforce, so the calculation gets slightly more complicated
|
||||
iWorkForceSize *= GetWorkforceEffectivenessWithDisease( bTownId, OUR_TEAM );
|
||||
|
||||
// now adjust for town size.. the number of sectors you control
|
||||
iWorkForceSize *= GetTownSectorsUnderControl( bTownId );
|
||||
iWorkForceSize /= GetTownSectorSize( bTownId );
|
||||
|
||||
@@ -1684,8 +1684,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
while( curr )
|
||||
{
|
||||
curr->pSoldier->flags.uiStatusFlags &= ~SOLDIER_SHOULD_BE_TACTICALLY_VALID;
|
||||
@@ -1717,6 +1715,7 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Check for exception cases which
|
||||
if( gTacticalStatus.bBoxingState != NOT_BOXING )
|
||||
{
|
||||
@@ -1725,6 +1724,7 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
fExceptionQueue = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
//First check if the group arriving is going to queue another battle.
|
||||
//NOTE: We can't have more than one battle ongoing at a time.
|
||||
if( fExceptionQueue || fCheckForBattle && gTacticalStatus.fEnemyInSector &&
|
||||
@@ -1773,6 +1773,11 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
return;
|
||||
}
|
||||
|
||||
// Flugente: disease
|
||||
if ( !pGroup->fPlayer )
|
||||
{
|
||||
PopulationMove( pGroup->ubSectorX, pGroup->ubSectorY, pGroup->ubNextX, pGroup->ubNextY, pGroup->ubGroupSize );
|
||||
}
|
||||
|
||||
//Update the position of the group
|
||||
pGroup->ubPrevX = pGroup->ubSectorX;
|
||||
@@ -1782,7 +1787,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
pGroup->ubNextX = 0;
|
||||
pGroup->ubNextY = 0;
|
||||
|
||||
|
||||
if( pGroup->fPlayer )
|
||||
{
|
||||
if( pGroup->ubSectorZ == 0 )
|
||||
@@ -1828,7 +1832,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
fMapPanelDirty = TRUE;
|
||||
fMapScreenBottomDirty = TRUE;
|
||||
|
||||
|
||||
// if a player group
|
||||
if( pGroup->fPlayer )
|
||||
{
|
||||
@@ -1867,7 +1870,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
if( pGroup->ubSectorX < pGroup->ubPrevX )
|
||||
{
|
||||
ubInsertionDirection = SOUTHWEST;
|
||||
@@ -1894,7 +1896,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if( pGroup->fVehicle == FALSE )
|
||||
{
|
||||
// non-vehicle player group
|
||||
@@ -1974,7 +1975,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
// update passengers position
|
||||
UpdatePositionOfMercsInVehicle( iVehId );
|
||||
|
||||
|
||||
if( iVehId != iHelicopterVehicleId )
|
||||
{
|
||||
pSoldier = GetSoldierStructureForVehicle( iVehId );
|
||||
@@ -1998,8 +1998,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
UpdateMercInSector( pSoldier, gWorldSectorX, gWorldSectorY, gbWorldSectorZ );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// set directions of insertion
|
||||
curr = pGroup->pPlayerList;
|
||||
while( curr )
|
||||
@@ -2034,7 +2032,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !fGroupDestroyed )
|
||||
{
|
||||
// don't print any messages when arriving underground, there's no delay involved
|
||||
@@ -2047,7 +2044,6 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( !fGroupDestroyed )
|
||||
{
|
||||
// check if sector had been visited previously
|
||||
@@ -2157,16 +2153,15 @@ void GroupArrivedAtSector( UINT8 ubGroupID, BOOLEAN fCheckForBattle, BOOLEAN fNe
|
||||
void HandleNonCombatGroupArrival( GROUP *pGroup, BOOLEAN fMainGroup, BOOLEAN fNeverLeft )
|
||||
{
|
||||
// if any mercs are actually in the group
|
||||
|
||||
|
||||
#ifdef JA2UB
|
||||
#ifdef JA2UB
|
||||
//Ja25 No strategic ai
|
||||
#else
|
||||
#else
|
||||
if( StrategicAILookForAdjacentGroups( pGroup ) )
|
||||
{ //The routine actually just deleted the enemy group (player's don't get deleted), so we are done!
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if( pGroup->fPlayer )
|
||||
{
|
||||
@@ -2203,7 +2198,6 @@ void HandleNonCombatGroupArrival( GROUP *pGroup, BOOLEAN fMainGroup, BOOLEAN fNe
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//MilitiaFollowPlayer( pGroup->ubPrevX, pGroup->ubPrevY, pGroup->ubSectorX, pGroup->ubSectorY );
|
||||
|
||||
// look for NPCs to stop for, anyone is too tired to keep going, if all OK rebuild waypoints & continue movement
|
||||
@@ -2313,6 +2307,7 @@ void PrepareGroupsForSimultaneousArrival()
|
||||
}
|
||||
pGroup = pGroup->next;
|
||||
}
|
||||
|
||||
//We still have the first group that has arrived. Because they are set up to be in the destination
|
||||
//sector, we will "warp" them back to the last sector, and also setup a new arrival time for them.
|
||||
pGroup = gpPendingSimultaneousGroup;
|
||||
@@ -2388,7 +2383,8 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup )
|
||||
}
|
||||
|
||||
if( ubNumNearbyGroups )
|
||||
{ //postpone the battle until the user answers the dialog.
|
||||
{
|
||||
//postpone the battle until the user answers the dialog.
|
||||
CHAR16 str[255];
|
||||
STR16 pStr, pEnemyType;
|
||||
InterruptTime();
|
||||
@@ -2412,6 +2408,7 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup )
|
||||
{
|
||||
pEnemyType = gpStrategicString[ STR_PB_ENEMIES ];
|
||||
}
|
||||
|
||||
//header, sector, singular/plural str, confirmation string.
|
||||
//Ex: Enemies have been detected in sector J9 and another squad is
|
||||
// about to arrive. Do you wish to coordinate a simultaneous arrival?
|
||||
@@ -2430,6 +2427,7 @@ BOOLEAN PossibleToCoordinateSimultaneousGroupArrivals( GROUP *pFirstGroup )
|
||||
gfWaitingForInput = TRUE;
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -2443,6 +2441,7 @@ void PlanSimultaneousGroupArrivalCallback( UINT8 bMessageValue )
|
||||
{
|
||||
PrepareForPreBattleInterface( gpPendingSimultaneousGroup, gpPendingSimultaneousGroup );
|
||||
}
|
||||
|
||||
UnLockPauseState();
|
||||
UnPauseGame();
|
||||
}
|
||||
@@ -2454,14 +2453,17 @@ void DelayEnemyGroupsIfPathsCross( GROUP *pPlayerGroup )
|
||||
while( pGroup )
|
||||
{
|
||||
if( !pGroup->fPlayer )
|
||||
{ //then check to see if this group will arrive in next sector before the player group.
|
||||
{
|
||||
//then check to see if this group will arrive in next sector before the player group.
|
||||
if( pGroup->uiArrivalTime < pPlayerGroup->uiArrivalTime )
|
||||
{ //check to see if enemy group will cross paths with player group.
|
||||
{
|
||||
//check to see if enemy group will cross paths with player group.
|
||||
if( pGroup->ubNextX == pPlayerGroup->ubSectorX &&
|
||||
pGroup->ubNextY == pPlayerGroup->ubSectorY &&
|
||||
pGroup->ubSectorX == pPlayerGroup->ubNextX &&
|
||||
pGroup->ubSectorY == pPlayerGroup->ubNextY )
|
||||
{ //Okay, the enemy group will cross paths with the player, so find and delete the arrival event
|
||||
{
|
||||
//Okay, the enemy group will cross paths with the player, so find and delete the arrival event
|
||||
//and repost it in the future (like a minute or so after the player arrives)
|
||||
DeleteStrategicEvent( EVENT_GROUP_ARRIVAL, pGroup->ubGroupID );
|
||||
|
||||
@@ -2473,6 +2475,7 @@ void DelayEnemyGroupsIfPathsCross( GROUP *pPlayerGroup )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pGroup = pGroup->next;
|
||||
}
|
||||
}
|
||||
@@ -2489,12 +2492,12 @@ void InitiateGroupMovementToNextSector( GROUP *pGroup )
|
||||
SOLDIERTYPE *pSoldier = NULL;
|
||||
UINT32 uiSleepMinutes = 0;
|
||||
|
||||
|
||||
Assert( pGroup );
|
||||
i = pGroup->ubNextWaypointID;
|
||||
wp = pGroup->pWaypoints;
|
||||
while( i-- )
|
||||
{ //Traverse through the waypoint list to the next waypoint ID
|
||||
{
|
||||
//Traverse through the waypoint list to the next waypoint ID
|
||||
Assert( wp );
|
||||
wp = wp->next;
|
||||
}
|
||||
@@ -2610,8 +2613,7 @@ void InitiateGroupMovementToNextSector( GROUP *pGroup )
|
||||
pGroup->uiTraverseTime = 1 + Random( pGroup->uiTraverseTime - 1 );
|
||||
SetGroupArrivalTime( pGroup, GetWorldTotalMin() + pGroup->uiTraverseTime );
|
||||
}
|
||||
|
||||
|
||||
|
||||
if( pGroup->fVehicle == TRUE )
|
||||
{
|
||||
// vehicle, set fact it is between sectors too
|
||||
@@ -2626,7 +2628,6 @@ void InitiateGroupMovementToNextSector( GROUP *pGroup )
|
||||
|
||||
// OK, Remove the guy from tactical engine!
|
||||
RemoveSoldierFromTacticalSector( pSoldier, TRUE );
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2707,8 +2708,6 @@ void SetWayPointsAsCanceled( UINT8 ubGroupID )
|
||||
Assert( pGroup );
|
||||
|
||||
//pGroup->fWaypointsCancelled = TRUE;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -2722,7 +2721,6 @@ void SetGroupPrevSectors( UINT8 ubGroupID, UINT8 ubX, UINT8 ubY )
|
||||
// since we have a group, set prev sector's x and y
|
||||
pGroup->ubPrevX = ubX;
|
||||
pGroup->ubPrevY = ubY;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2759,7 +2757,6 @@ void RemovePGroup( GROUP *pGroup )
|
||||
curr->next = pGroup->next;
|
||||
}
|
||||
|
||||
|
||||
//Remove the waypoints.
|
||||
RemovePGroupWaypoints( pGroup );
|
||||
|
||||
@@ -2944,8 +2941,7 @@ INT32 CalculateTravelTimeOfGroup( GROUP *pGroup )
|
||||
// not going anywhere...return current time
|
||||
return( uiEtaTime );
|
||||
}
|
||||
|
||||
|
||||
|
||||
// if already on the road
|
||||
if ( pGroup->fBetweenSectors )
|
||||
{
|
||||
@@ -2993,7 +2989,6 @@ INT32 FindTravelTimeBetweenWaypoints( WAYPOINT * pSource, WAYPOINT * pDest, GROU
|
||||
UINT8 ubDirection;
|
||||
INT32 iThisCostInTime;
|
||||
|
||||
|
||||
// find travel time between waypoints
|
||||
if( !pSource || !pDest )
|
||||
{
|
||||
@@ -3082,7 +3077,6 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
|
||||
UINT8 ubTraverseType;
|
||||
UINT8 ubTraverseMod;
|
||||
|
||||
|
||||
// THIS FUNCTION WAS WRITTEN TO HANDLE MOVEMENT TYPES WHERE MORE THAN ONE TRANSPORTAION TYPE IS AVAILABLE.
|
||||
|
||||
//Determine the group's method(s) of tranportation. If more than one,
|
||||
@@ -3153,6 +3147,7 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( fCar )
|
||||
{
|
||||
switch( ubTraverseType )
|
||||
@@ -3166,6 +3161,7 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
|
||||
if( iTraverseTime < iBestTraverseTime )
|
||||
iBestTraverseTime = iTraverseTime;
|
||||
}
|
||||
|
||||
if( fTruck )
|
||||
{
|
||||
switch( ubTraverseType )
|
||||
@@ -3182,6 +3178,7 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
|
||||
if( iTraverseTime < iBestTraverseTime )
|
||||
iBestTraverseTime = iTraverseTime;
|
||||
}
|
||||
|
||||
if( fTracked )
|
||||
{
|
||||
switch( ubTraverseType )
|
||||
@@ -3202,6 +3199,7 @@ INT32 GetSectorMvtTimeForGroup( UINT8 ubSector, UINT8 ubDirection, GROUP *pGroup
|
||||
if( iTraverseTime < iBestTraverseTime )
|
||||
iBestTraverseTime = iTraverseTime;
|
||||
}
|
||||
|
||||
if( fAir )
|
||||
{
|
||||
iTraverseTime = AIR_TRAVEL_TIME;
|
||||
@@ -3303,7 +3301,7 @@ UINT8 PlayerMercsInSector( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ )
|
||||
// robots count as mercs here, because they can fight, but vehicles don't
|
||||
if( ( pPlayer->pSoldier->stats.bLife ) && !( pPlayer->pSoldier->flags.uiStatusFlags & SOLDIER_VEHICLE ) )
|
||||
{
|
||||
ubNumMercs++;
|
||||
++ubNumMercs;
|
||||
}
|
||||
pPlayer = pPlayer->next;
|
||||
}
|
||||
@@ -3332,7 +3330,7 @@ UINT8 PlayerGroupsInSector( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ )
|
||||
{
|
||||
if( pPlayer->pSoldier->stats.bLife )
|
||||
{
|
||||
ubNumGroups++;
|
||||
++ubNumGroups;
|
||||
break;
|
||||
}
|
||||
pPlayer = pPlayer->next;
|
||||
@@ -3341,6 +3339,7 @@ UINT8 PlayerGroupsInSector( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ )
|
||||
}
|
||||
pGroup = pGroup->next;
|
||||
}
|
||||
|
||||
return ubNumGroups;
|
||||
}
|
||||
|
||||
@@ -3348,10 +3347,8 @@ UINT8 PlayerGroupsInSector( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ )
|
||||
// is the player group with this id in motion?
|
||||
BOOLEAN PlayerIDGroupInMotion( UINT8 ubID )
|
||||
{
|
||||
GROUP *pGroup;
|
||||
|
||||
// get the group
|
||||
pGroup = GetGroup( ubID );
|
||||
GROUP* pGroup = GetGroup( ubID );
|
||||
|
||||
// make sure it is valid
|
||||
|
||||
@@ -3361,7 +3358,6 @@ BOOLEAN PlayerIDGroupInMotion( UINT8 ubID )
|
||||
return ( FALSE );
|
||||
}
|
||||
|
||||
|
||||
return( PlayerGroupInMotion( pGroup ) );
|
||||
}
|
||||
|
||||
@@ -3394,7 +3390,6 @@ INT32 GetTravelTimeForFootTeam( UINT8 ubSector, UINT8 ubDirection )
|
||||
Group.ubTransportationMask = FOOT;
|
||||
|
||||
return( GetSectorMvtTimeForGroup( ubSector, ubDirection, &( Group ) ) );
|
||||
|
||||
}
|
||||
|
||||
//Add this group to the current battle fray!
|
||||
@@ -3444,7 +3439,7 @@ void HandleArrivalOfReinforcements( GROUP *pGroup )
|
||||
{
|
||||
TacticalCharacterDialogue( pSoldier, QUOTE_MERC_REACHED_DESTINATION );
|
||||
}
|
||||
cnt++;
|
||||
++cnt;
|
||||
}
|
||||
ScreenMsg( FONT_YELLOW, MSG_INTERFACE, Message[ STR_PLAYER_REINFORCEMENTS ] );
|
||||
|
||||
@@ -3482,12 +3477,10 @@ BOOLEAN PlayersBetweenTheseSectors( INT16 sSource, INT16 sDest, INT32 *iCountEnt
|
||||
BOOLEAN fHelicopterGroup = FALSE;
|
||||
UINT8 ubMercsInGroup = 0;
|
||||
|
||||
|
||||
*iCountEnter = 0;
|
||||
*iCountExit = 0;
|
||||
*fAboutToArriveEnter = FALSE;
|
||||
|
||||
|
||||
if( gpBattleGroup )
|
||||
{
|
||||
// Assert( gfPreBattleInterfaceActive );
|
||||
@@ -3500,7 +3493,6 @@ BOOLEAN PlayersBetweenTheseSectors( INT16 sSource, INT16 sDest, INT32 *iCountEnt
|
||||
// Assert( gfPreBattleInterfaceActive );
|
||||
}
|
||||
|
||||
|
||||
// get number of characters entering/existing between these two sectors. Special conditions during
|
||||
// pre-battle interface to return where this function is used to show potential retreating directions instead!
|
||||
|
||||
@@ -3576,10 +3568,8 @@ BOOLEAN PlayersBetweenTheseSectors( INT16 sSource, INT16 sDest, INT32 *iCountEnt
|
||||
{
|
||||
return ( TRUE );
|
||||
}
|
||||
else
|
||||
{
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
void MoveAllGroupsInCurrentSectorToSector( UINT8 ubSectorX, UINT8 ubSectorY, UINT8 ubSectorZ )
|
||||
@@ -3639,9 +3629,6 @@ void GetGroupPosition( UINT8 *ubNextX, UINT8 *ubNextY, UINT8 *ubPrevX, UINT8 *ub
|
||||
*ubPrevY = pGroup->ubPrevY;
|
||||
*uiTraverseTime = pGroup->uiTraverseTime;
|
||||
*uiArriveTime = pGroup->uiArrivalTime;
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -3651,14 +3638,12 @@ void SetGroupPosition( UINT8 ubNextX, UINT8 ubNextY, UINT8 ubPrevX, UINT8 ubPrev
|
||||
GROUP *pGroup;
|
||||
PLAYERGROUP *pPlayer;
|
||||
|
||||
|
||||
// get the group
|
||||
pGroup = GetGroup( ubGroupId );
|
||||
|
||||
// no group
|
||||
if( pGroup == NULL )
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -3671,7 +3656,6 @@ void SetGroupPosition( UINT8 ubNextX, UINT8 ubNextY, UINT8 ubPrevX, UINT8 ubPrev
|
||||
SetGroupArrivalTime( pGroup, uiArriveTime );
|
||||
pGroup->fBetweenSectors = TRUE;
|
||||
|
||||
|
||||
AddWaypointToPGroup( pGroup, pGroup->ubNextX, pGroup->ubNextY );
|
||||
//now, if player group set all grunts in the group to be between secotrs
|
||||
if( pGroup->fPlayer == TRUE )
|
||||
@@ -3683,9 +3667,6 @@ void SetGroupPosition( UINT8 ubNextX, UINT8 ubNextY, UINT8 ubPrevX, UINT8 ubPrev
|
||||
pPlayer = pPlayer->next;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
BOOLEAN SaveStrategicMovementGroupsToSaveGameFile( HWFILE hFile )
|
||||
@@ -3699,11 +3680,10 @@ BOOLEAN SaveStrategicMovementGroupsToSaveGameFile( HWFILE hFile )
|
||||
//Count the number of active groups
|
||||
while( pGroup )
|
||||
{
|
||||
uiNumberOfGroups++;
|
||||
++uiNumberOfGroups;
|
||||
pGroup = pGroup->next;
|
||||
}
|
||||
|
||||
|
||||
// Save the number of movement groups to the saved game file
|
||||
FileWrite( hFile, &uiNumberOfGroups, sizeof( UINT32 ), &uiNumBytesWritten );
|
||||
if( uiNumBytesWritten != sizeof( UINT32 ) )
|
||||
@@ -3712,7 +3692,6 @@ BOOLEAN SaveStrategicMovementGroupsToSaveGameFile( HWFILE hFile )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
pGroup = gpGroupList;
|
||||
|
||||
//Loop through the linked lists and add each node
|
||||
@@ -3751,9 +3730,7 @@ BOOLEAN SaveStrategicMovementGroupsToSaveGameFile( HWFILE hFile )
|
||||
|
||||
//Save the waypoint list for the group, if they have one
|
||||
SaveWayPointList( hFile, pGroup );
|
||||
|
||||
|
||||
|
||||
|
||||
pGroup = pGroup->next;
|
||||
}
|
||||
|
||||
@@ -3765,7 +3742,6 @@ BOOLEAN SaveStrategicMovementGroupsToSaveGameFile( HWFILE hFile )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
return( TRUE );
|
||||
}
|
||||
|
||||
@@ -3785,13 +3761,10 @@ BOOLEAN LoadStrategicMovementGroupsFromSavedGameFile( HWFILE hFile )
|
||||
UINT8 ubNumPlayerGroupsFull = 0;
|
||||
UINT8 ubNumEnemyGroupsFull = 0;
|
||||
|
||||
|
||||
|
||||
//delete the existing group list
|
||||
while( gpGroupList )
|
||||
RemoveGroupFromList( gpGroupList );
|
||||
|
||||
|
||||
//load the number of nodes in the list
|
||||
FileRead( hFile, &uiNumberOfGroups, sizeof( UINT32 ), &uiNumBytesRead );
|
||||
if( uiNumBytesRead != sizeof( UINT32 ) )
|
||||
@@ -3819,7 +3792,6 @@ BOOLEAN LoadStrategicMovementGroupsFromSavedGameFile( HWFILE hFile )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// Add either the pointer or the linked list.
|
||||
//
|
||||
@@ -3838,11 +3810,9 @@ BOOLEAN LoadStrategicMovementGroupsFromSavedGameFile( HWFILE hFile )
|
||||
LoadEnemyGroupStructFromSavedGame( hFile, pTemp );
|
||||
}
|
||||
|
||||
|
||||
//Save the waypoint list for the group, if they have one
|
||||
LoadWayPointList( hFile, pTemp );
|
||||
|
||||
|
||||
|
||||
pTemp->next = NULL;
|
||||
|
||||
//add the node to the list
|
||||
@@ -3873,22 +3843,22 @@ BOOLEAN LoadStrategicMovementGroupsFromSavedGameFile( HWFILE hFile )
|
||||
{
|
||||
if( pGroup->ubGroupSize )
|
||||
{
|
||||
ubNumPlayerGroupsFull++;
|
||||
++ubNumPlayerGroupsFull;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubNumPlayerGroupsEmpty++;
|
||||
++ubNumPlayerGroupsEmpty;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if( pGroup->ubGroupSize )
|
||||
{
|
||||
ubNumEnemyGroupsFull++;
|
||||
++ubNumEnemyGroupsFull;
|
||||
}
|
||||
else
|
||||
{
|
||||
ubNumEnemyGroupsEmpty++;
|
||||
++ubNumEnemyGroupsEmpty;
|
||||
}
|
||||
}
|
||||
if( ubNumPlayerGroupsEmpty || ubNumEnemyGroupsEmpty )
|
||||
@@ -3980,16 +3950,14 @@ BOOLEAN LoadPlayerGroupList( HWFILE hFile, GROUP **pGroup )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
//loop through all the nodes and set them up
|
||||
for( cnt=0; cnt< uiNumberOfNodes; cnt++)
|
||||
for( cnt=0; cnt< uiNumberOfNodes; ++cnt)
|
||||
{
|
||||
//allcate space for the current node
|
||||
pTemp = (PLAYERGROUP *) MemAlloc( sizeof( PLAYERGROUP ) );
|
||||
if( pTemp == NULL )
|
||||
return( FALSE );
|
||||
|
||||
|
||||
// Load the ubProfile ID for this node
|
||||
FileRead( hFile, &uiProfileID, sizeof( UINT32 ), &uiNumBytesRead );
|
||||
if( uiNumBytesRead != sizeof( UINT32 ) )
|
||||
@@ -4115,12 +4083,11 @@ void CheckMembersOfMvtGroupAndComplainAboutBleeding( SOLDIERTYPE *pSoldier )
|
||||
// complain about bleeding
|
||||
TacticalCharacterDialogue( pCurrentSoldier, QUOTE_STARTING_TO_BLEED );
|
||||
}
|
||||
pPlayer = pPlayer->next;
|
||||
|
||||
pPlayer = pPlayer->next;
|
||||
}
|
||||
|
||||
BeginLoggingForBleedMeToos( FALSE );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -4134,7 +4101,7 @@ BOOLEAN SaveWayPointList( HWFILE hFile, GROUP *pGroup )
|
||||
//loop trhough and count all the node in the waypoint list
|
||||
while( pWayPoints != NULL )
|
||||
{
|
||||
uiNumberOfWayPoints++;
|
||||
++uiNumberOfWayPoints;
|
||||
pWayPoints = pWayPoints->next;
|
||||
}
|
||||
|
||||
@@ -4146,11 +4113,10 @@ BOOLEAN SaveWayPointList( HWFILE hFile, GROUP *pGroup )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
if( uiNumberOfWayPoints )
|
||||
{
|
||||
pWayPoints = pGroup->pWaypoints;
|
||||
for(cnt=0; cnt<uiNumberOfWayPoints; cnt++)
|
||||
for(cnt=0; cnt<uiNumberOfWayPoints; ++cnt)
|
||||
{
|
||||
//Save the waypoint node
|
||||
FileWrite( hFile, pWayPoints, sizeof( WAYPOINT ), &uiNumBytesWritten );
|
||||
@@ -4178,7 +4144,6 @@ BOOLEAN LoadWayPointList(HWFILE hFile, GROUP *pGroup )
|
||||
WAYPOINT *pWayPoints = pGroup->pWaypoints;
|
||||
WAYPOINT *pTemp=NULL;
|
||||
|
||||
|
||||
//Load the number of waypoints
|
||||
FileRead( hFile, &uiNumberOfWayPoints, sizeof( UINT32 ), &uiNumBytesRead );
|
||||
if( uiNumBytesRead != sizeof( UINT32 ) )
|
||||
@@ -4187,7 +4152,6 @@ BOOLEAN LoadWayPointList(HWFILE hFile, GROUP *pGroup )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
if( uiNumberOfWayPoints )
|
||||
{
|
||||
pWayPoints = pGroup->pWaypoints;
|
||||
@@ -4207,10 +4171,8 @@ BOOLEAN LoadWayPointList(HWFILE hFile, GROUP *pGroup )
|
||||
return( FALSE );
|
||||
}
|
||||
|
||||
|
||||
pTemp->next = NULL;
|
||||
|
||||
|
||||
//if its the first node
|
||||
if( cnt == 0 )
|
||||
{
|
||||
@@ -4269,6 +4231,7 @@ void CalculateGroupRetreatSector( GROUP *pGroup )
|
||||
AssertMsg( 0, String("Player group cannot retreat from sector %c%d ", pGroup->ubSectorY+'A'-1, pGroup->ubSectorX ) );
|
||||
return;
|
||||
}
|
||||
|
||||
if( pGroup->fPlayer )
|
||||
{ //update the previous sector for the mercs
|
||||
PLAYERGROUP *pPlayer;
|
||||
@@ -4363,7 +4326,6 @@ void RetreatGroupToPreviousSector( GROUP *pGroup )
|
||||
AddStrategicEvent( EVENT_GROUP_ABOUT_TO_ARRIVE, pGroup->uiArrivalTime - ABOUT_TO_ARRIVE_DELAY, pGroup->ubGroupID );
|
||||
}
|
||||
|
||||
|
||||
while( curr )
|
||||
{
|
||||
curr->pSoldier->flags.fBetweenSectors = TRUE;
|
||||
@@ -4429,14 +4391,12 @@ BOOLEAN GroupAtFinalDestination( GROUP *pGroup )
|
||||
|
||||
WAYPOINT *GetFinalWaypoint( GROUP *pGroup )
|
||||
{
|
||||
WAYPOINT *wp;
|
||||
|
||||
Assert( pGroup );
|
||||
|
||||
//Make sure they're on a one way route, otherwise this request is illegal
|
||||
Assert( pGroup->ubMoveType == ONE_WAY );
|
||||
|
||||
wp = pGroup->pWaypoints;
|
||||
WAYPOINT* wp = pGroup->pWaypoints;
|
||||
if( wp )
|
||||
{
|
||||
while( wp->next )
|
||||
@@ -4488,11 +4448,12 @@ void ResetMovementForEnemyGroup( GROUP *pGroup )
|
||||
if( !pGroup->fBetweenSectors || !pGroup->ubNextX || !pGroup->ubNextY )
|
||||
{ //Reset the group's assignment by moving it to the group's original sector as it's pending group.
|
||||
|
||||
#ifdef JA2UB
|
||||
#ifdef JA2UB
|
||||
//Ja25 No strategic ai
|
||||
#else
|
||||
#else
|
||||
RepollSAIGroup( pGroup );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
+94
-139
@@ -27,17 +27,9 @@ extern SECTOR_EXT_DATA SectorExternalData[256][4];
|
||||
//extern CHAR16 gzSectorUndergroundNames2[256][4][MAX_SECTOR_NAME_LENGTH];
|
||||
//extern CHAR16 gzSectorUndergroundNames3[256][4][MAX_SECTOR_NAME_LENGTH];
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SECTORNAME_ELEMENT_NONE = 0,
|
||||
SECTORNAME_ELEMENT_SECTOR_NAMES,
|
||||
SECTORNAME_ELEMENT_SECTOR,
|
||||
SECTORNAME_ELEMENT,
|
||||
} SECTORNAME_PARSE_STAGE;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
SECTORNAME_PARSE_STAGE curElement;
|
||||
PARSE_STAGE curElement;
|
||||
CHAR8 szCharData[MAX_CHAR_DATA_LENGTH+1];
|
||||
UINT8 sCurSectorX;
|
||||
UINT8 sCurSectorY;
|
||||
@@ -45,15 +37,13 @@ typedef struct
|
||||
CHAR16 szCurDetailedUnexploredName[MAX_SECTOR_NAME_LENGTH];
|
||||
CHAR16 szCurExploredName[MAX_SECTOR_NAME_LENGTH];
|
||||
CHAR16 szCurDetailedExploredName[MAX_SECTOR_NAME_LENGTH];
|
||||
UINT8 sWaterType; // Food System
|
||||
UINT16 usNaturalDirt; // Dirt System
|
||||
UINT8 usCurfewValue; // Covert Ops
|
||||
INT8 sRadioScanModifier; // Radio Operator
|
||||
UINT16 usPrisonRoomNumber[MAX_PRISON_ROOMS]; // Prisoner System
|
||||
SECTOR_EXT_DATA sectordata;
|
||||
UINT8 curSupplyType;
|
||||
UINT32 currentDepth;
|
||||
UINT32 maxReadDepth;
|
||||
} SectorNameParseData;
|
||||
|
||||
|
||||
BOOLEAN SectorName_TextOnly;
|
||||
|
||||
INT8 Sector_Level;
|
||||
@@ -67,9 +57,9 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char **
|
||||
if(pData->currentDepth <= pData->maxReadDepth) //are we reading this element?
|
||||
{
|
||||
|
||||
if(strcmp(name, "SECTOR_NAMES") == 0 && pData->curElement == SECTORNAME_ELEMENT_NONE)
|
||||
if(strcmp(name, "SECTOR_NAMES") == 0 && pData->curElement == ELEMENT_NONE)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR_NAMES;
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
// Initiate Array by setting first character to 0.
|
||||
for (UINT16 x = 0; x < 256; x++)
|
||||
@@ -104,40 +94,16 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char **
|
||||
gzSectorNames[x][2][0]=0;
|
||||
gzSectorNames[x][3][0]=0;
|
||||
}
|
||||
|
||||
// moved to lua
|
||||
//if (Sector_Level == 1 )
|
||||
//{
|
||||
// gzSectorUndergroundNames1[x][0][0]=0;
|
||||
// gzSectorUndergroundNames1[x][1][0]=0;
|
||||
// gzSectorUndergroundNames1[x][2][0]=0;
|
||||
// gzSectorUndergroundNames1[x][3][0]=0;
|
||||
//}
|
||||
// if (Sector_Level == 2 )
|
||||
//{
|
||||
// gzSectorUndergroundNames2[x][0][0]=0;
|
||||
// gzSectorUndergroundNames2[x][1][0]=0;
|
||||
// gzSectorUndergroundNames2[x][2][0]=0;
|
||||
// gzSectorUndergroundNames2[x][3][0]=0;
|
||||
//}
|
||||
//if (Sector_Level == 3 )
|
||||
//{
|
||||
// gzSectorUndergroundNames3[x][0][0]=0;
|
||||
// gzSectorUndergroundNames3[x][1][0]=0;
|
||||
// gzSectorUndergroundNames3[x][2][0]=0;
|
||||
// gzSectorUndergroundNames3[x][3][0]=0;
|
||||
//}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
else if(strcmp(name, "SECTOR") == 0 && pData->curElement == SECTORNAME_ELEMENT_SECTOR_NAMES)
|
||||
else if(strcmp(name, "SECTOR") == 0 && pData->curElement == ELEMENT_LIST)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->curElement = ELEMENT;
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
|
||||
else if(pData->curElement == SECTORNAME_ELEMENT_SECTOR &&
|
||||
else if(pData->curElement == ELEMENT &&
|
||||
(strcmp(name, "SectorGrid") == 0 ||
|
||||
strcmp(name, "szUnexploredName") == 0 ||
|
||||
strcmp(name, "szDetailedUnexploredName") == 0 ||
|
||||
@@ -162,9 +128,10 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char **
|
||||
strcmp(name, "usPrisonRoomNumber12") == 0 ||
|
||||
strcmp(name, "usPrisonRoomNumber13") == 0 ||
|
||||
strcmp(name, "usPrisonRoomNumber14") == 0 ||
|
||||
strcmp(name, "usPrisonRoomNumber15") == 0 ))
|
||||
strcmp(name, "usPrisonRoomNumber15") == 0 ||
|
||||
strcmp(name, "usCivilianPopulation") == 0 ))
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT;
|
||||
pData->curElement = ELEMENT_PROPERTY;
|
||||
|
||||
pData->maxReadDepth++; //we are not skipping this element
|
||||
}
|
||||
@@ -173,7 +140,6 @@ SectorNameStartElementHandle(void *userData, const XML_Char *name, const char **
|
||||
}
|
||||
|
||||
pData->currentDepth++;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -197,11 +163,11 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
|
||||
{
|
||||
if(strcmp(name, "SECTOR_NAMES") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_NONE;
|
||||
pData->curElement = ELEMENT_NONE;
|
||||
}
|
||||
else if(strcmp(name, "SECTOR") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR_NAMES;
|
||||
pData->curElement = ELEMENT_LIST;
|
||||
|
||||
UINT8 ubSectorId = SECTOR(pData->sCurSectorX, pData->sCurSectorY);
|
||||
if (ubSectorId >= 0 && ubSectorId < 256)
|
||||
@@ -247,70 +213,54 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
|
||||
wcscpy(gzSectorNames[ubSectorId][2], pData->szCurExploredName);
|
||||
wcscpy(gzSectorNames[ubSectorId][3], pData->szCurDetailedExploredName);
|
||||
}
|
||||
// moved to lua
|
||||
//else if (Sector_Level == 1 )
|
||||
//{
|
||||
// wcscpy(gzSectorUndergroundNames1[ubSectorId][0], pData->szCurUnexploredName);
|
||||
// wcscpy(gzSectorUndergroundNames1[ubSectorId][1], pData->szCurDetailedUnexploredName);
|
||||
// wcscpy(gzSectorUndergroundNames1[ubSectorId][2], pData->szCurExploredName);
|
||||
// wcscpy(gzSectorUndergroundNames1[ubSectorId][3], pData->szCurDetailedExploredName);
|
||||
//}
|
||||
//else if (Sector_Level == 2 )
|
||||
//{
|
||||
// wcscpy(gzSectorUndergroundNames2[ubSectorId][0], pData->szCurUnexploredName);
|
||||
// wcscpy(gzSectorUndergroundNames2[ubSectorId][1], pData->szCurDetailedUnexploredName);
|
||||
// wcscpy(gzSectorUndergroundNames2[ubSectorId][2], pData->szCurExploredName);
|
||||
// wcscpy(gzSectorUndergroundNames2[ubSectorId][3], pData->szCurDetailedExploredName);
|
||||
//}
|
||||
//else if (Sector_Level == 3 )
|
||||
//{
|
||||
// wcscpy(gzSectorUndergroundNames3[ubSectorId][0], pData->szCurUnexploredName);
|
||||
// wcscpy(gzSectorUndergroundNames3[ubSectorId][1], pData->szCurDetailedUnexploredName);
|
||||
// wcscpy(gzSectorUndergroundNames3[ubSectorId][2], pData->szCurExploredName);
|
||||
// wcscpy(gzSectorUndergroundNames3[ubSectorId][3], pData->szCurDetailedExploredName);
|
||||
//}
|
||||
}
|
||||
|
||||
SectorExternalData[ubSectorId][0].usWaterType = pData->sWaterType;
|
||||
SectorExternalData[ubSectorId][1].usWaterType = pData->sWaterType;
|
||||
SectorExternalData[ubSectorId][2].usWaterType = pData->sWaterType;
|
||||
SectorExternalData[ubSectorId][3].usWaterType = pData->sWaterType;
|
||||
SectorExternalData[ubSectorId][0].usWaterType = pData->sectordata.usWaterType;
|
||||
SectorExternalData[ubSectorId][1].usWaterType = pData->sectordata.usWaterType;
|
||||
SectorExternalData[ubSectorId][2].usWaterType = pData->sectordata.usWaterType;
|
||||
SectorExternalData[ubSectorId][3].usWaterType = pData->sectordata.usWaterType;
|
||||
|
||||
SectorExternalData[ubSectorId][0].usNaturalDirt = pData->usNaturalDirt;
|
||||
SectorExternalData[ubSectorId][1].usNaturalDirt = pData->usNaturalDirt;
|
||||
SectorExternalData[ubSectorId][2].usNaturalDirt = pData->usNaturalDirt;
|
||||
SectorExternalData[ubSectorId][3].usNaturalDirt = pData->usNaturalDirt;
|
||||
SectorExternalData[ubSectorId][0].usNaturalDirt = pData->sectordata.usNaturalDirt;
|
||||
SectorExternalData[ubSectorId][1].usNaturalDirt = pData->sectordata.usNaturalDirt;
|
||||
SectorExternalData[ubSectorId][2].usNaturalDirt = pData->sectordata.usNaturalDirt;
|
||||
SectorExternalData[ubSectorId][3].usNaturalDirt = pData->sectordata.usNaturalDirt;
|
||||
|
||||
SectorExternalData[ubSectorId][0].usCurfewValue = pData->usCurfewValue;
|
||||
SectorExternalData[ubSectorId][1].usCurfewValue = pData->usCurfewValue;
|
||||
SectorExternalData[ubSectorId][2].usCurfewValue = pData->usCurfewValue;
|
||||
SectorExternalData[ubSectorId][3].usCurfewValue = pData->usCurfewValue;
|
||||
SectorExternalData[ubSectorId][0].usCurfewValue = pData->sectordata.usCurfewValue;
|
||||
SectorExternalData[ubSectorId][1].usCurfewValue = pData->sectordata.usCurfewValue;
|
||||
SectorExternalData[ubSectorId][2].usCurfewValue = pData->sectordata.usCurfewValue;
|
||||
SectorExternalData[ubSectorId][3].usCurfewValue = pData->sectordata.usCurfewValue;
|
||||
|
||||
INT8 radioscanmod = max(-3, pData->sRadioScanModifier);
|
||||
radioscanmod = min(3, pData->sRadioScanModifier);
|
||||
SectorExternalData[ubSectorId][0].sRadioScanModifier = pData->sRadioScanModifier;
|
||||
SectorExternalData[ubSectorId][1].sRadioScanModifier = pData->sRadioScanModifier;
|
||||
SectorExternalData[ubSectorId][2].sRadioScanModifier = pData->sRadioScanModifier;
|
||||
SectorExternalData[ubSectorId][3].sRadioScanModifier = pData->sRadioScanModifier;
|
||||
INT8 radioscanmod = max( -3, pData->sectordata.sRadioScanModifier );
|
||||
radioscanmod = min( 3, pData->sectordata.sRadioScanModifier );
|
||||
SectorExternalData[ubSectorId][0].sRadioScanModifier = pData->sectordata.sRadioScanModifier;
|
||||
SectorExternalData[ubSectorId][1].sRadioScanModifier = pData->sectordata.sRadioScanModifier;
|
||||
SectorExternalData[ubSectorId][2].sRadioScanModifier = pData->sectordata.sRadioScanModifier;
|
||||
SectorExternalData[ubSectorId][3].sRadioScanModifier = pData->sectordata.sRadioScanModifier;
|
||||
|
||||
SectorExternalData[ubSectorId][0].usCivilianPopulation = pData->sectordata.usCivilianPopulation;
|
||||
SectorExternalData[ubSectorId][1].usCivilianPopulation = pData->sectordata.usCivilianPopulation;
|
||||
SectorExternalData[ubSectorId][2].usCivilianPopulation = pData->sectordata.usCivilianPopulation;
|
||||
SectorExternalData[ubSectorId][3].usCivilianPopulation = pData->sectordata.usCivilianPopulation;
|
||||
|
||||
for(UINT8 i = 0; i <MAX_PRISON_ROOMS; ++i)
|
||||
{
|
||||
SectorExternalData[ubSectorId][0].usPrisonRoomNumber[i] = pData->usPrisonRoomNumber[i];
|
||||
pData->usPrisonRoomNumber[i] = 0;
|
||||
SectorExternalData[ubSectorId][0].usPrisonRoomNumber[i] = pData->sectordata.usPrisonRoomNumber[i];
|
||||
pData->sectordata.usPrisonRoomNumber[i] = 0;
|
||||
}
|
||||
|
||||
// clean up values afterwards
|
||||
pData->sWaterType = 0;
|
||||
pData->usNaturalDirt = 100;
|
||||
pData->usCurfewValue = 0;
|
||||
pData->sRadioScanModifier = 0;
|
||||
pData->sectordata.usWaterType = 0;
|
||||
pData->sectordata.usNaturalDirt = 100;
|
||||
pData->sectordata.usCurfewValue = 0;
|
||||
pData->sectordata.sRadioScanModifier = 0;
|
||||
pData->sectordata.usCivilianPopulation = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else if(strcmp(name, "SectorGrid") == 0 )
|
||||
{
|
||||
UINT8 x, y;
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
y = (UINT8)pData->szCharData[0] & 0x1F;
|
||||
x = (UINT8)atol(&pData->szCharData[1]);
|
||||
@@ -322,7 +272,7 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
|
||||
}
|
||||
else if(strcmp(name, "szUnexploredName") == 0 )
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->szCurUnexploredName, sizeof(pData->szCurUnexploredName)/sizeof(pData->szCurUnexploredName[0]) );
|
||||
pData->szCurUnexploredName[sizeof(pData->szCurUnexploredName)/sizeof(pData->szCurUnexploredName[0]) - 1] = '\0';
|
||||
@@ -330,7 +280,7 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
|
||||
|
||||
else if(strcmp(name, "szDetailedUnexploredName") == 0 )
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->szCurDetailedUnexploredName, sizeof(pData->szCurDetailedUnexploredName)/sizeof(pData->szCurDetailedUnexploredName[0]) );
|
||||
pData->szCurDetailedUnexploredName[sizeof(pData->szCurDetailedUnexploredName)/sizeof(pData->szCurDetailedUnexploredName[0]) - 1] = '\0';
|
||||
@@ -338,7 +288,7 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
|
||||
|
||||
else if(strcmp(name, "szExploredName") == 0 )
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->szCurExploredName, sizeof(pData->szCurExploredName)/sizeof(pData->szCurExploredName[0]) );
|
||||
pData->szCurExploredName[sizeof(pData->szCurExploredName)/sizeof(pData->szCurExploredName[0]) - 1] = '\0';
|
||||
@@ -346,7 +296,7 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
|
||||
|
||||
else if(strcmp(name, "szDetailedExploredName") == 0 )
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->curElement = ELEMENT;
|
||||
|
||||
MultiByteToWideChar( CP_UTF8, 0, pData->szCharData, -1, pData->szCurDetailedExploredName, sizeof(pData->szCurDetailedExploredName)/sizeof(pData->szCurDetailedExploredName[0]) );
|
||||
pData->szCurDetailedExploredName[sizeof(pData->szCurDetailedExploredName)/sizeof(pData->szCurDetailedExploredName[0]) - 1] = '\0';
|
||||
@@ -354,104 +304,109 @@ SectorNameEndElementHandle(void *userData, const XML_Char *name)
|
||||
|
||||
else if(strcmp(name, "sWaterType") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->sWaterType = (UINT8) atol(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usWaterType = (UINT8)atol( pData->szCharData );
|
||||
}
|
||||
|
||||
else if(strcmp(name, "usNaturalDirt") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usNaturalDirt = (UINT16) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usNaturalDirt = (UINT16)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usCurfewValue") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usCurfewValue = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usCurfewValue = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "sRadioScanModifier") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->sRadioScanModifier = (INT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.sRadioScanModifier = (INT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber00") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[0] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[0] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber01") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[1] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[1] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber02") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[2] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[2] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber03") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[3] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[3] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber04") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[4] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[4] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber05") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[5] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[5] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber06") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[6] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[6] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber07") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[7] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[7] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber08") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[8] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[8] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber09") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[9] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[9] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber10") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[10] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[10] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber11") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[11] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[11] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber12") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[12] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[12] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber13") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[13] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[13] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber14") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[14] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[14] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usPrisonRoomNumber15") == 0)
|
||||
{
|
||||
pData->curElement = SECTORNAME_ELEMENT_SECTOR;
|
||||
pData->usPrisonRoomNumber[15] = (UINT8) atoi(pData->szCharData);
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usPrisonRoomNumber[15] = (UINT8)atoi( pData->szCharData );
|
||||
}
|
||||
else if(strcmp(name, "usCivilianPopulation") == 0)
|
||||
{
|
||||
pData->curElement = ELEMENT;
|
||||
pData->sectordata.usCivilianPopulation = (UINT16)atoi( pData->szCharData );
|
||||
}
|
||||
|
||||
pData->maxReadDepth--;
|
||||
|
||||
@@ -894,6 +894,7 @@ extern BOOLEAN CanPlayerUseSectorInventory( SOLDIERTYPE *pSelectedSoldier );
|
||||
void HandleSpontanousTalking( void );
|
||||
BOOLEAN ContinueDialogue(SOLDIERTYPE *pSoldier, BOOLEAN fDone );
|
||||
extern void CreateDestroyMilitiaSectorButtons( void );
|
||||
extern void CreateDestroySupplySectorButtons();
|
||||
|
||||
// mouse position test
|
||||
BOOLEAN IsCursorWithInRegion(INT16 sLeft, INT16 sRight, INT16 sTop, INT16 sBottom );
|
||||
@@ -5004,9 +5005,9 @@ UINT32 MapScreenHandle(void)
|
||||
|
||||
// load the militia pop up box
|
||||
LoadMilitiaPopUpBox( );
|
||||
|
||||
// graphic for pool inventory
|
||||
LoadInventoryPoolGraphic( );
|
||||
|
||||
// graphic for pool inventory
|
||||
LoadInventoryPoolGraphic( );
|
||||
|
||||
//Kris: Added this because I need to blink the icons button.
|
||||
VObjectDesc.fCreateFlags = VOBJECT_CREATE_FROMFILE;
|
||||
@@ -5744,7 +5745,6 @@ UINT32 MapScreenHandle(void)
|
||||
DisplaySoldierUpdateBox( );
|
||||
}
|
||||
|
||||
|
||||
// pop up display boxes
|
||||
DisplayBoxes(FRAME_BUFFER);
|
||||
|
||||
@@ -6892,6 +6892,10 @@ void GetMapKeyboardInput( UINT32 *puiNewEvent )
|
||||
{
|
||||
fShowMoveItemMenu = FALSE;
|
||||
}
|
||||
else if ( fShowDiseaseMenu == TRUE )
|
||||
{
|
||||
fShowDiseaseMenu = FALSE;
|
||||
}
|
||||
// HEADROCK HAM 3.6: Facility Menu
|
||||
else if( fShowFacilityMenu == TRUE )
|
||||
{
|
||||
@@ -12168,7 +12172,6 @@ void ResetAllSelectedCharacterModes( void )
|
||||
sSelectedMilitiaTown = 0;
|
||||
}
|
||||
|
||||
|
||||
// cancel destination line highlight
|
||||
giDestHighLine = -1;
|
||||
|
||||
@@ -15392,7 +15395,6 @@ void HandleMilitiaRedistributionClick( void )
|
||||
}
|
||||
|
||||
|
||||
|
||||
#ifdef JA2TESTVERSION
|
||||
void DumpSectorDifficultyInfo( void )
|
||||
{
|
||||
@@ -16083,7 +16085,6 @@ void RequestContractMenu( void )
|
||||
AbortMovementPlottingMode( );
|
||||
}
|
||||
|
||||
|
||||
// in case we have multiple guys selected, turn off everyone but the guy we're negotiating with
|
||||
ChangeSelectedInfoChar( bSelectedInfoChar, TRUE );
|
||||
|
||||
|
||||
@@ -1841,13 +1841,13 @@ UINT8 GetTownSectorSize( INT8 bTownId )
|
||||
UINT8 ubSectorSize = 0;
|
||||
INT32 iCounterA =0, iCounterB = 0;
|
||||
|
||||
for( iCounterA = 0; iCounterA < ( INT32 )( MAP_WORLD_X - 1 ); iCounterA++ )
|
||||
for( iCounterA = 0; iCounterA < ( INT32 )( MAP_WORLD_X - 1 ); ++iCounterA )
|
||||
{
|
||||
for( iCounterB = 0; iCounterB < ( INT32 )( MAP_WORLD_Y - 1 ); iCounterB++ )
|
||||
for( iCounterB = 0; iCounterB < ( INT32 )( MAP_WORLD_Y - 1 ); ++iCounterB )
|
||||
{
|
||||
if( StrategicMap[CALCULATE_STRATEGIC_INDEX( iCounterA, iCounterB )].bNameId == bTownId )
|
||||
if ( StrategicMap[CALCULATE_STRATEGIC_INDEX( iCounterA, iCounterB )].bNameId == bTownId )
|
||||
{
|
||||
ubSectorSize++;
|
||||
++ubSectorSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1878,12 +1878,11 @@ UINT8 GetMilitiaCountAtLevelAnywhereInTown( UINT8 ubTownValue, UINT8 ubLevelValu
|
||||
UINT8 GetTownSectorsUnderControl( INT8 bTownId )
|
||||
{
|
||||
INT8 ubSectorsControlled = 0;
|
||||
INT32 iCounterA =0, iCounterB = 0;
|
||||
UINT16 usSector = 0;
|
||||
|
||||
for( iCounterA = 0; iCounterA < ( INT32 )( MAP_WORLD_X - 1 ); iCounterA++ )
|
||||
for ( INT32 iCounterA = 0; iCounterA < (INT32)(MAP_WORLD_X - 1); iCounterA++ )
|
||||
{
|
||||
for( iCounterB = 0; iCounterB < ( INT32 )( MAP_WORLD_Y - 1 ); iCounterB++ )
|
||||
for ( INT32 iCounterB = 0; iCounterB < (INT32)(MAP_WORLD_Y - 1); iCounterB++ )
|
||||
{
|
||||
usSector = (UINT16)CALCULATE_STRATEGIC_INDEX( iCounterA, iCounterB );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user