Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
7b0830c
Initial commit - SVN checkpoint to git branch
rftrdev Oct 11, 2022
8858559
Add checks before enabling Start Mission button
rftrdev Oct 12, 2022
feaf982
Set up ASSIGNMENT_REBELCOMMAND
rftrdev Oct 13, 2022
dea5da5
Implement "Train Militia Anywhere"
rftrdev Oct 14, 2022
0485aa2
A bit of cleanup
rftrdev Oct 14, 2022
c8465ba
Add POW/MiniEvent/RebelCommand assignment check for StartMission
rftrdev Oct 14, 2022
2e17b4f
Show "No mission available" after starting a mission
rftrdev Oct 15, 2022
b0b26d8
Fix being able to assign Radio Scan in specific cases
rftrdev Oct 15, 2022
e9c4b09
Manually align mission prep completion to top of the hour (xx:00)
rftrdev Oct 15, 2022
2b88fac
Award exp to mercs who prep a mission, regardless of whether they suc…
rftrdev Oct 17, 2022
983aa24
Add settings variable for mission refresh time
rftrdev Oct 17, 2022
d9697e9
Add merc contract check to StartMission
rftrdev Oct 17, 2022
392b70b
Merge branch '1dot13:master' into arc-missions
rftrdev Oct 17, 2022
61858e4
Move some text around
rftrdev Oct 17, 2022
3724de9
Properly reset merc assignment when mission prep completes, regardles…
rftrdev Oct 17, 2022
572933e
Display missions, both active and under preparation
rftrdev Oct 18, 2022
1e189c5
Add mission cost settings
rftrdev Oct 18, 2022
3807b7f
Add proper checks and bonuses for active missions
rftrdev Oct 18, 2022
7e55488
Clean up some todos
rftrdev Oct 19, 2022
fcd7ed5
Move text to _EnglishText
rftrdev Oct 19, 2022
c942121
Toggle admin actions off if the player can't pay upkeep
rftrdev Oct 19, 2022
1448ee0
Prevent toggling on admin actions when the player has too few supplies
rftrdev Oct 19, 2022
f3ca6cb
Merge branch '1dot13:master' into arc-missions
rftrdev Oct 20, 2022
cb3613e
Merge branch 'arc-missions' of https://github.com/rftrdev/1dot13-sour…
rftrdev Oct 20, 2022
39798ce
Copy loc changes from english to other languages
rftrdev Oct 20, 2022
5000f96
Add "Soldier Bounties" mission
rftrdev Oct 23, 2022
89285b4
Remove debug mission randomisation
rftrdev Oct 23, 2022
337bb02
Don't show "Mission prep in progress" if there are none
rftrdev Oct 23, 2022
affc2ae
Add mission help screen
rftrdev Oct 23, 2022
57ae2c6
Rename StartMission() to PrepareMission()
rftrdev Oct 23, 2022
5377963
Put Soldier Bounties mission into alphabetic order
rftrdev Oct 23, 2022
9ac0795
Put Soldier Bounties mission into alphabetic order
rftrdev Oct 23, 2022
1f20d7c
Merge branch 'arc-missions' of https://github.com/rftrdev/1dot13-sour…
rftrdev Oct 23, 2022
a35d741
Add "Disrupt ASD" mission
rftrdev Oct 25, 2022
c1b5d17
Add "Send Supplies" mission
rftrdev Oct 25, 2022
7d360d0
Add mission prep time setting
rftrdev Oct 26, 2022
54b0bf9
Ensure missions can only be started in towns that use loyalty
rftrdev Oct 26, 2022
02d6e48
Use prep time setting in text
rftrdev Oct 27, 2022
f89f25a
Split in-town and loyalty mission prep checks
rftrdev Oct 27, 2022
7ad938a
Remove debug line
rftrdev Oct 27, 2022
62861ab
Add notification when new missions are available
rftrdev Oct 28, 2022
2240448
Fix mission randomisation
rftrdev Oct 29, 2022
c56946f
Remove todo
rftrdev Oct 29, 2022
94b846e
Simplify merc returning from mission prep
rftrdev Oct 29, 2022
70c7c0b
Fix bad screen message
rftrdev Nov 1, 2022
32d565e
Change new mission screenmsg to green
rftrdev Nov 1, 2022
568ee07
Disrupt ASD now blocks upgrades
rftrdev Nov 3, 2022
0aa1561
Merge branch '1dot13:master' into arc-missions
rftrdev Nov 5, 2022
a554f0d
Remove #pragma optimize
rftrdev Nov 5, 2022
6f6d457
Undo unrelated Chinese text changes
rftrdev Nov 5, 2022
75332ea
Undo unrelated Chinese text changes
rftrdev Nov 5, 2022
f140e17
Merge branch 'arc-missions' of https://github.com/rftrdev/1dot13-sour…
rftrdev Nov 5, 2022
7c6f7d6
Revert "Undo unrelated Chinese text changes"
rftrdev Nov 5, 2022
edad33e
Properly undo unrelated Chinese text changes
rftrdev Nov 5, 2022
5dd002d
Update text
rftrdev Nov 5, 2022
76a5fa1
Remove #pragma optimize
rftrdev Nov 5, 2022
b401e39
Update gameversion
rftrdev Nov 5, 2022
f6241fe
Properly reduce ASD resources
rftrdev Nov 5, 2022
164b388
Merge branch '1dot13:master' into arc-missions
rftrdev Nov 5, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
119 changes: 119 additions & 0 deletions GameSettings.cpp

Large diffs are not rendered by default.

120 changes: 120 additions & 0 deletions GameSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -1842,6 +1842,126 @@ typedef struct

INT16 iFortificationsBonus;

// agent missions
INT32 iMissionBaseCost;
INT32 iMissionAdditionalCost;
INT16 iMissionPrepTime;
INT8 iMissionRefreshTimeDays;
INT8 iMinLoyaltyForMission;

INT8 iDeepDeploymentSuccessChance;
INT16 iDeepDeploymentRangeNS;
INT16 iDeepDeploymentRangeEW;
INT16 iDeepDeploymentRangeNS_Bonus_Covert;
INT16 iDeepDeploymentRangeEW_Bonus_Covert;
INT16 iDeepDeploymentRangeNS_Bonus_Scouting;
INT16 iDeepDeploymentRangeEW_Bonus_Scouting;
INT16 iDeepDeploymentRangeNS_Bonus_Stealthy;
INT16 iDeepDeploymentRangeEW_Bonus_Stealthy;
INT16 iDeepDeploymentRangeNS_Bonus_Survival;
INT16 iDeepDeploymentRangeEW_Bonus_Survival;
UINT8 iDeepDeploymentDuration;
UINT8 iDeepDeploymentDuration_Bonus_Covert;
UINT8 iDeepDeploymentDuration_Bonus_Scouting;
UINT8 iDeepDeploymentDuration_Bonus_Stealthy;
UINT8 iDeepDeploymentDuration_Bonus_Survival;

INT8 iDisruptAsdSuccessChance;
FLOAT fDisruptAsdIncomeReductionModifier;
FLOAT fDisruptAsdIncomeReductionModifier_Covert;
FLOAT fDisruptAsdIncomeReductionModifier_Demolitions;
FLOAT fDisruptAsdIncomeReductionModifier_Nightops;
FLOAT fDisruptAsdIncomeReductionModifier_Technician;
UINT8 iDisruptAsdDuration;
UINT8 iDisruptAsdDuration_Bonus_Covert;
UINT8 iDisruptAsdDuration_Bonus_Demolitions;
UINT8 iDisruptAsdDuration_Bonus_Nightops;
UINT8 iDisruptAsdDuration_Bonus_Technician;

INT8 iGetEnemyMovementTargetsSuccessChance;
UINT8 iGetEnemyMovementTargetsDuration;
UINT8 iGetEnemyMovementTargetsDuration_Bonus_Covert;
UINT8 iGetEnemyMovementTargetsDuration_Bonus_Radio;

INT8 iImproveLocalShopsSuccessChance;
UINT8 iImproveLocalShopsDuration;

INT8 iReduceStrategicDecisionSpeedSuccessChance;
FLOAT fReduceStrategicDecisionSpeedModifier;
FLOAT fReduceStrategicDecisionSpeedModifier_Covert;
FLOAT fReduceStrategicDecisionSpeedModifier_Deputy;
FLOAT fReduceStrategicDecisionSpeedModifier_Snitch;
UINT8 iReduceStrategicDecisionSpeedDuration;
UINT8 iReduceStrategicDecisionSpeedDuration_Bonus_Covert;
UINT8 iReduceStrategicDecisionSpeedDuration_Bonus_Deputy;
UINT8 iReduceStrategicDecisionSpeedDuration_Bonus_Snitch;

INT8 iReduceUnalertedEnemyVisionSuccessChance;
FLOAT fReduceUnlaertedEnemyVisionModifier;
FLOAT fReduceUnlaertedEnemyVisionModifier_Covert;
FLOAT fReduceUnlaertedEnemyVisionModifier_Radio;
FLOAT fReduceUnlaertedEnemyVisionModifier_Stealthy;
UINT8 iReduceUnalertedEnemyVisionDuration;
UINT8 iReduceUnalertedEnemyVisionDuration_Bonus_Covert;
UINT8 iReduceUnalertedEnemyVisionDuration_Bonus_Radio;

INT8 iSabotageInfantryEquipmentSuccessChance;
INT8 iSabotageInfantryEquipmentModifier;
INT8 iSabotageInfantryEquipmentModifier_Auto_Weapons;
INT8 iSabotageInfantryEquipmentModifier_Covert;
INT8 iSabotageInfantryEquipmentModifier_Demolitions;
INT8 iSabotageInfantryEquipmentModifier_Gunslinger;
INT8 iSabotageInfantryEquipmentModifier_Ranger;
INT8 iSabotageInfantryEquipmentModifier_Sniper;
UINT8 iSabotageInfantryEquipmentDuration;
UINT8 iSabotageInfantryEquipmentDuration_Bonus_Auto_Weapons;
UINT8 iSabotageInfantryEquipmentDuration_Bonus_Covert;
UINT8 iSabotageInfantryEquipmentDuration_Bonus_Demolitions;
UINT8 iSabotageInfantryEquipmentDuration_Bonus_Gunslinger;
UINT8 iSabotageInfantryEquipmentDuration_Bonus_Ranger;
UINT8 iSabotageInfantryEquipmentDuration_Bonus_Sniper;

INT8 iSabotageMechanicalUnitsSuccessChance;
INT8 iSabotageMechanicalUnitsStatLoss;
INT8 iSabotageMechanicalUnitsStatLoss_Covert;
INT8 iSabotageMechanicalUnitsStatLoss_Demolitions;
INT8 iSabotageMechanicalUnitsStatLoss_Heavy_Weapons;
UINT8 iSabotageMechanicalUnitsDuration;
UINT8 iSabotageMechanicalUnitsDuration_Bonus_Covert;
UINT8 iSabotageMechanicalUnitsDuration_Bonus_Demolitions;
UINT8 iSabotageMechanicalUnitsDuration_Bonus_Heavy_Weapons;

INT8 iSendSuppliesToTownSuccessChance;
UINT8 iSendSuppliesToTownDuration;
INT32 iSendSuppliesToTownLoyaltyGain;
INT8 iSendSuppliesToTownInterval;

INT8 iTrainMilitiaAnywhereSuccessChance;
INT8 iTrainMilitiaAnywhereMaxTrainers;
INT8 iTrainMilitiaAnywhereMaxTrainers_Teaching;
UINT8 iTrainMilitiaAnywhereDuration;
UINT8 iTrainMilitiaAnywhereDuration_Bonus_Covert;
UINT8 iTrainMilitiaAnywhereDuration_Bonus_Survival;
UINT8 iTrainMilitiaAnywhereDuration_Bonus_Teaching;

INT8 iSoldierBountiesKingpinSuccessChance;
UINT8 iSoldierBountiesKingpinDuration;
UINT8 iSoldierBountiesKingpinDuration_Bonus_Covert;
UINT8 iSoldierBountiesKingpinDuration_Bonus_Demolitions;
UINT16 iSoldierBountiesKingpinPayout_Admin;
UINT16 iSoldierBountiesKingpinPayout_Troop;
UINT16 iSoldierBountiesKingpinPayout_Elite;
UINT16 iSoldierBountiesKingpinPayout_Robot;
UINT16 iSoldierBountiesKingpinPayout_Jeep;
UINT16 iSoldierBountiesKingpinPayout_Tank;
UINT16 iSoldierBountiesKingpinPayout_Officer;
INT16 iSoldierBountiesKingpinPayout_Limit;
INT16 iSoldierBountiesKingpinPayout_Limit_Demolitions;
INT16 iSoldierBountiesKingpinPayout_Limit_Snitch;
FLOAT fSoldierBountiesKingpinPayout_Bonus_Covert;
FLOAT fSoldierBountiesKingpinPayout_Bonus_Deputy;
FLOAT fSoldierBountiesKingpinPayout_Bonus_Snitch;

} REBELCOMMAND_SETTINGS;

typedef struct
Expand Down
2 changes: 1 addition & 1 deletion GameVersion.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,6 @@

CHAR8 czVersionNumber[16] = { "Build 22.11.04" }; //YY.MM.DD
CHAR16 zTrackingNumber[16] = { L"Z" };
CHAR16 zRevisionNumber[16] = { L"Revision 9404" };
CHAR16 zRevisionNumber[16] = { L"Revision 9405" };

// SAVE_GAME_VERSION is defined in header, change it there
4 changes: 4 additions & 0 deletions Laptop/finances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,10 @@ void ProcessTransactionString(STR16 pString, FinanceUnitPtr pFinance)
case REBEL_COMMAND_SPENDING:
swprintf(pString, L"%s", pTransactionText[REBEL_COMMAND_SPENDING]);
break;

case REBEL_COMMAND_BOUNTY_PAYOUT:
swprintf(pString, L"%s", pTransactionText[REBEL_COMMAND_BOUNTY_PAYOUT]);
break;
}
}

Expand Down
1 change: 1 addition & 0 deletions Laptop/finances.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ enum
MINI_EVENT, // rftr: mini events
REBEL_COMMAND, // rftr: rebel command
REBEL_COMMAND_SPENDING, // rftr: rebel command
REBEL_COMMAND_BOUNTY_PAYOUT, // rftr: rebel command soldier bounties
TEXT_NUM_FINCANCES
};

Expand Down
20 changes: 17 additions & 3 deletions Strategic/ASD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
#include "Sound Control.h"
#include "renderworld.h"
#include "Isometric Utils.h"
#include "Rebel Command.h"
#endif


Expand Down Expand Up @@ -548,9 +549,22 @@ UINT32 ASDResourceCostMoney( UINT8 aType )
return gGameExternalOptions.gASDResource_Cost[aType];
}

INT32 GetStrategicAIResourceCount( UINT8 aType )
{
if (aType < 0 || aType >= ASD_RESOURCE_MAX)
return 0;

return gASDResource[aType];
}

// add resources to the AIs resource pool
void AddStrategicAIResources( UINT8 aType, INT32 aAmount )
{
if (aType == ASD_MONEY)
{
aAmount *= RebelCommand::GetASDIncomeModifier();
}

gASDResource[aType] = max( 0, gASDResource[aType] + aAmount );

if ( aType == ASD_HELI )
Expand Down Expand Up @@ -1500,7 +1514,7 @@ UINT32 ASDResourceCostFuel( UINT8 aType )
// if ASD has tanks, it can allow the queen to upgrade soldiers to tanks
BOOLEAN ASDSoldierUpgradeToTank( )
{
if ( gGameExternalOptions.fASDActive && gGameExternalOptions.fASDAssignsTanks )
if ( gGameExternalOptions.fASDActive && gGameExternalOptions.fASDAssignsTanks && RebelCommand::GetASDCanDeployUnits() )
{
if ( gASD_Flags & ASDFACT_TANK_UNLOCKED )
{
Expand All @@ -1517,7 +1531,7 @@ BOOLEAN ASDSoldierUpgradeToTank( )

BOOLEAN ASDSoldierUpgradeToJeep( )
{
if ( gGameExternalOptions.fASDActive && gGameExternalOptions.fASDAssignsJeeps )
if ( gGameExternalOptions.fASDActive && gGameExternalOptions.fASDAssignsJeeps && RebelCommand::GetASDCanDeployUnits() )
{
if ( gASD_Flags & ASDFACT_JEEP_UNLOCKED )
{
Expand All @@ -1534,7 +1548,7 @@ BOOLEAN ASDSoldierUpgradeToJeep( )

BOOLEAN ASDSoldierUpgradeToRobot( )
{
if ( gGameExternalOptions.fASDActive && gGameExternalOptions.fASDAssignsRobots )
if ( gGameExternalOptions.fASDActive && gGameExternalOptions.fASDAssignsRobots && RebelCommand::GetASDCanDeployUnits() )
{
if ( gASD_Flags & ASDFACT_ROBOT_UNLOCKED )
{
Expand Down
2 changes: 2 additions & 0 deletions Strategic/ASD.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ void SetASDFlag( UINT32 aFlag );
UINT32 ASDResourceDeliveryTime( UINT8 aType );
UINT32 ASDResourceCostMoney( UINT8 aType );

INT32 GetStrategicAIResourceCount( UINT8 aType );

// add resources to the AIs resource pool
void AddStrategicAIResources( UINT8 aType, INT32 aAmount );

Expand Down
39 changes: 29 additions & 10 deletions Strategic/Assignments.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,11 @@ BOOLEAN BasicCanCharacterAssignment( SOLDIERTYPE * pSoldier, BOOLEAN fNotInComba
return( FALSE );
}

if (pSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND)
{
return( FALSE );
}

return( TRUE );
}

Expand Down Expand Up @@ -1658,6 +1663,9 @@ BOOLEAN BasicCanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
// check if sam site
if( fSamSitePresent == FALSE )
{
if (RebelCommand::CanTrainMilitiaAnywhere())
return( TRUE );

// nope
return ( FALSE );
}
Expand Down Expand Up @@ -1971,6 +1979,9 @@ BOOLEAN CanCharacterTrainMilitia( SOLDIERTYPE *pSoldier )
}
}

if (RebelCommand::CanTrainMilitiaAnywhere() && GetTownIdForSector(pSoldier->sSectorX, pSoldier->sSectorY) == BLANK_SECTOR)
ubFacilityTrainersAllowed = RebelCommand::GetMaxTrainersForTrainMilitiaAnywhere();

// Count number of trainers already operating here
if ( CountMilitiaTrainersInSoldiersSector( pSoldier, TOWN_MILITIA ) >= ubFacilityTrainersAllowed )
{
Expand Down Expand Up @@ -2033,6 +2044,9 @@ BOOLEAN DoesSectorMercIsInHaveSufficientLoyaltyToTrainMilitia( SOLDIERTYPE *pSol
{
return( TRUE );
}

if (RebelCommand::CanTrainMilitiaAnywhere())
return(TRUE);

return( FALSE );
}
Expand Down Expand Up @@ -2085,7 +2099,7 @@ BOOLEAN IsMilitiaTrainableFromSoldiersSectorMaxed( SOLDIERTYPE *pSoldier, INT8 i
// is there a town really here
if( bTownId == BLANK_SECTOR )
{
fSamSitePresent = IsThisSectorASAMSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ );
fSamSitePresent = IsThisSectorASAMSector( pSoldier->sSectorX, pSoldier->sSectorY, pSoldier->bSectorZ ) || RebelCommand::CanTrainMilitiaAnywhere();

// if there is a sam site here
if( fSamSitePresent )
Expand Down Expand Up @@ -2491,7 +2505,7 @@ BOOLEAN CanCharacterSleep( SOLDIERTYPE *pSoldier, BOOLEAN fExplainWhyNot )
}

// POW?
if( pSoldier->bAssignment == ASSIGNMENT_POW || pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
if( pSoldier->bAssignment == ASSIGNMENT_POW || pSoldier->bAssignment == ASSIGNMENT_MINIEVENT || pSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND )
{
return( FALSE );
}
Expand Down Expand Up @@ -2709,7 +2723,7 @@ INT8 CanCharacterSquad( SOLDIERTYPE *pSoldier, INT8 bSquadValue )
return ( CHARACTER_CANT_JOIN_SQUAD );
}

if ( pSoldier->bAssignment == ASSIGNMENT_POW || (pSoldier->bAssignment == ASSIGNMENT_MINIEVENT && pSoldier->ubHoursRemainingOnMiniEvent > 0))
if ( pSoldier->bAssignment == ASSIGNMENT_POW || (pSoldier->bAssignment == ASSIGNMENT_MINIEVENT && pSoldier->ubHoursRemainingOnMiniEvent > 0) || (pSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND) )
{
// not allowed to be put on a squad
return( CHARACTER_CANT_JOIN_SQUAD );
Expand Down Expand Up @@ -5830,7 +5844,7 @@ void FatigueCharacter( SOLDIERTYPE *pSoldier )
}

// POW?
if( pSoldier->bAssignment == ASSIGNMENT_POW || pSoldier->bAssignment == ASSIGNMENT_MINIEVENT )
if( pSoldier->bAssignment == ASSIGNMENT_POW || pSoldier->bAssignment == ASSIGNMENT_MINIEVENT || pSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND )
{
return;
}
Expand Down Expand Up @@ -6136,7 +6150,8 @@ void HandleTrainingInSector( INT16 sMapX, INT16 sMapY, INT8 bZ )
}

// check if we're doing a sector where militia can be trained
if( ( (StrategicMap[CALCULATE_STRATEGIC_INDEX(sMapX, sMapY) ].bNameId != BLANK_SECTOR ) || ( fSamSiteInSector == TRUE ) ) && (bZ == 0) )
const BOOL canTrainMilitiaAnywhere = RebelCommand::CanTrainMilitiaAnywhere();
if( (canTrainMilitiaAnywhere || (StrategicMap[CALCULATE_STRATEGIC_INDEX(sMapX, sMapY) ].bNameId != BLANK_SECTOR ) || ( fSamSiteInSector == TRUE ) ) && (bZ == 0) )
{
// init town trainer list
memset( TownTrainer, 0, sizeof( TownTrainer ) );
Expand Down Expand Up @@ -7898,7 +7913,7 @@ BOOLEAN TrainTownInSector( SOLDIERTYPE *pTrainer, INT16 sMapX, INT16 sMapY, INT1

// get town index
ubTownId = StrategicMap[CALCULATE_STRATEGIC_INDEX(pTrainer->sSectorX, pTrainer->sSectorY ) ].bNameId;
if( fSamSiteInSector == FALSE )
if( fSamSiteInSector == FALSE && !RebelCommand::CanTrainMilitiaAnywhere())
{
AssertNE(ubTownId, BLANK_SECTOR);
}
Expand Down Expand Up @@ -10708,7 +10723,7 @@ void HandleShadingOfLinesForAssignmentMenus( void )
}

// radio scan
if( pSoldier->CanUseRadio() )
if( BasicCanCharacterAssignment( pSoldier, TRUE ) && pSoldier->CanUseRadio() )
{
// unshade line
UnShadeStringInBox( ghAssignmentBox, ASSIGN_MENU_RADIO_SCAN );
Expand Down Expand Up @@ -16312,7 +16327,7 @@ void HandleRestFatigueAndSleepStatus( void )
continue;
}

if( ( pSoldier->bAssignment == ASSIGNMENT_POW ) || ( pSoldier->bAssignment == IN_TRANSIT ) || ( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT ) )
if( ( pSoldier->bAssignment == ASSIGNMENT_POW ) || ( pSoldier->bAssignment == IN_TRANSIT ) || ( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT ) || ( pSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND ) )
{
continue;
}
Expand Down Expand Up @@ -16461,7 +16476,7 @@ void HandleRestFatigueAndSleepStatus( void )
continue;
}

if( ( pSoldier->bAssignment == ASSIGNMENT_POW ) || ( pSoldier->bAssignment == IN_TRANSIT ) || ( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT ) )
if( ( pSoldier->bAssignment == ASSIGNMENT_POW ) || ( pSoldier->bAssignment == IN_TRANSIT ) || ( pSoldier->bAssignment == ASSIGNMENT_MINIEVENT ) || ( pSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND ) )
{
continue;
}
Expand Down Expand Up @@ -19442,7 +19457,8 @@ BOOLEAN CanCharacterRepairAnotherSoldiersStuff( SOLDIERTYPE *pSoldier, SOLDIERTY
( AM_A_ROBOT( pSoldier ) ) ||
( pSoldier->ubWhatKindOfMercAmI == MERC_TYPE__EPC ) ||
( pOtherSoldier->bAssignment == ASSIGNMENT_DEAD ) ||
( pOtherSoldier->bAssignment == ASSIGNMENT_MINIEVENT ) )
( pOtherSoldier->bAssignment == ASSIGNMENT_MINIEVENT ) ||
( pOtherSoldier->bAssignment == ASSIGNMENT_REBELCOMMAND ) )
{
return( FALSE );
}
Expand Down Expand Up @@ -20165,6 +20181,9 @@ BOOLEAN CanCharacterTrainMilitiaWithErrorReport( SOLDIERTYPE *pSoldier )
}
}

if (RebelCommand::CanTrainMilitiaAnywhere() && GetTownIdForSector(pSoldier->sSectorX, pSoldier->sSectorY) == BLANK_SECTOR)
ubFacilityTrainersAllowed = RebelCommand::GetMaxTrainersForTrainMilitiaAnywhere();

// If we are here, then TrainersAllowed > 0.
// Otherwise we'd have failed the BasicCanTrain check
if ( CountMilitiaTrainersInSoldiersSector( pSoldier, TOWN_MILITIA ) >= ubFacilityTrainersAllowed )
Expand Down
1 change: 1 addition & 0 deletions Strategic/Assignments.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ enum
ADMINISTRATION, // merc boosts the effectiveness of other mercs
EXPLORATION, // merc searches the sector for undiscovered items
ASSIGNMENT_MINIEVENT,
ASSIGNMENT_REBELCOMMAND,
NUM_ASSIGNMENTS,
};

Expand Down
5 changes: 5 additions & 0 deletions Strategic/Game Event Hook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
#include "Player Command.h" // added by Flugente
#include "LuaInitNPCs.h" // added by Flugente
#include "MiniEvents.h"
#include "Rebel Command.h"
#endif

#include "connect.h"
Expand Down Expand Up @@ -680,6 +681,10 @@ BOOLEAN ExecuteStrategicEvent( STRATEGICEVENT *pEvent )
CheckMiniEvents(pEvent->uiParam);
}
break;

case EVENT_REBELCOMMAND:
RebelCommand::HandleStrategicEvent(pEvent->uiParam);
break;
}
gfPreventDeletionOfAnyEvent = fOrigPreventFlag;
return TRUE;
Expand Down
Loading