Class StratConEnemyFacilityActivity
java.lang.Object
mekhq.campaign.digitalGM.stratCon.facility.StratConEnemyFacilityActivity
What the enemy does with facilities between the player's fights: monthly upkeep of its own facilities,
counterattacks on facilities the player or their employer holds, and enemy engineers building new outposts.
- Monthly upkeep. At the start of each month, every enemy facility repairs one condition step and reinforces one garrison step, unless a fight is under way there, it is cut off from its supply lines, or it is under siege.
- Counterattacks. When one of the contract's ordinary scenarios comes due, it may instead become a counterattack on a facility held by the player or their employer. A counterattack is a Crisis, placed on the facility's hex with a deployment deadline of 3 to 7 days. Losing or ignoring it hands the facility to the enemy, except that one held by the employer is left to an off-screen roll when ignored. If a month passes without a counterattack, the next ordinary scenario is always one, if there is anything to counterattack.
- Enemy engineers. Once a month per 3 points of the contract's scale (per 9 when support points are
factored into scale), enemy engineers appear on a random day as a point of interest. If not dealt with before
they leave, they become an enemy outpost (see
StratConEnemyEngineersBehavior).
The "Enemy Facility Activity" campaign option scales all three; at 0, the enemy does none of them.
- Since:
- 0.51.01
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyMonthlyUpkeep(StratConTrackState track, Campaign campaign) Gives every enemy facility in a sector its monthly upkeep: for each step (seegetUpkeepSteps(double, int)), one condition step repaired and one garrison step reinforced.static doublegetActivity(Campaign campaign) static intlaunchCounterattacks(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState, int scenarioCount) Turns as many of the day's due ordinary scenarios into counterattacks as the rules call for (seeisCounterattack(double, long, int)), each on a different facility held by the player or their employer.static voidprocessEnemyEngineers(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState) The contract-level daily step: schedules the next month's enemy engineers once the last month's schedule runs out, and places those due today on a random sector with room.static voidreportIgnoredCounterattack(Campaign campaign, StratConTrackState track, StratConCoords coords, StratConFacility facility) Reports how an ignored counterattack went, once it has been settled (seeresolveIgnoredCounterattack(mekhq.campaign.digitalGM.stratCon.StratConTrackState, mekhq.campaign.digitalGM.stratCon.facility.StratConFacility, mekhq.campaign.digitalGM.stratCon.StratConCampaignState)).static booleanresolveIgnoredCounterattack(StratConTrackState track, StratConFacility facility, StratConCampaignState campaignState) Settles a counterattack nobody deployed against.static voidresolveLostCounterattack(Campaign campaign, StratConTrackState track, StratConCoords coords, StratConFacility facility) Settles a counterattack the player lost outright: the facility goes to the enemy.
-
Method Details
-
getActivity
- Parameters:
campaign- the current campaign- Returns:
- the "Enemy Facility Activity" option, kept between 0 and
MAXIMUM_ACTIVITY; 0 with Facility Operations off, so turning that off restores play as it was before, and 0 in mapless play, where there are no facilities - Since:
- 0.51.01
-
applyMonthlyUpkeep
Gives every enemy facility in a sector its monthly upkeep: for each step (seegetUpkeepSteps(double, int)), one condition step repaired and one garrison step reinforced. Your employer's facilities get one step each month, however active the enemy is, since only facilities you hold take your Fortify and Reinforce orders. A facility being fought over, cut off or besieged gets none. Each facility the player can see that changed is reported.- Parameters:
track- the sectorcampaign- the current campaign- Since:
- 0.51.01
-
launchCounterattacks
public static int launchCounterattacks(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState, int scenarioCount) Turns as many of the day's due ordinary scenarios into counterattacks as the rules call for (seeisCounterattack(double, long, int)), each on a different facility held by the player or their employer. Each counterattack takes the place of one ordinary scenario, so the contract's pace is unchanged.- Parameters:
campaign- the current campaigncontract- the contractcampaignState- the contract's StratCon campaign statescenarioCount- how many ordinary scenarios are due today- Returns:
- how many of them became counterattacks, and so should not be generated as ordinary scenarios
- Since:
- 0.51.01
-
resolveLostCounterattack
public static void resolveLostCounterattack(Campaign campaign, StratConTrackState track, StratConCoords coords, StratConFacility facility) Settles a counterattack the player lost outright: the facility goes to the enemy.- Parameters:
campaign- the current campaigntrack- the facility's sectorcoords- the facility's hexfacility- the facility, if it still stands- Since:
- 0.51.01
-
resolveIgnoredCounterattack
public static boolean resolveIgnoredCounterattack(StratConTrackState track, StratConFacility facility, StratConCampaignState campaignState) Settles a counterattack nobody deployed against. A facility the player holds is lost. One the employer holds is left to an off-screen roll (seeisOffScreenDefenseHeld(mekhq.campaign.digitalGM.stratCon.facility.StratConFacility, megamek.common.enums.SkillLevel, megamek.common.enums.SkillLevel, mekhq.campaign.mission.contract.contractData.ContractMoraleLevel, int)); it loses a garrison step whatever the result.- Parameters:
track- the facility's sectorfacility- the facilitycampaignState- the contract's StratCon campaign state- Returns:
trueif the facility was lost- Since:
- 0.51.01
-
reportIgnoredCounterattack
public static void reportIgnoredCounterattack(Campaign campaign, StratConTrackState track, StratConCoords coords, StratConFacility facility) Reports how an ignored counterattack went, once it has been settled (seeresolveIgnoredCounterattack(mekhq.campaign.digitalGM.stratCon.StratConTrackState, mekhq.campaign.digitalGM.stratCon.facility.StratConFacility, mekhq.campaign.digitalGM.stratCon.StratConCampaignState)).- Parameters:
campaign- the current campaigntrack- the facility's sectorcoords- the facility's hexfacility- the facility- Since:
- 0.51.01
-
processEnemyEngineers
public static void processEnemyEngineers(Campaign campaign, AbstractContract contract, StratConCampaignState campaignState) The contract-level daily step: schedules the next month's enemy engineers once the last month's schedule runs out, and places those due today on a random sector with room. One that finds no room is dropped.- Parameters:
campaign- the current campaigncontract- the contractcampaignState- the contract's StratCon campaign state- Since:
- 0.51.01
-