Class StratConEnemyFacilityActivity

java.lang.Object
mekhq.campaign.digitalGM.stratCon.facility.StratConEnemyFacilityActivity

public final class StratConEnemyFacilityActivity extends Object
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 Details

    • getActivity

      public static double getActivity(Campaign campaign)
      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

      public static void applyMonthlyUpkeep(StratConTrackState track, Campaign campaign)
      Gives every enemy facility in a sector its monthly upkeep: for each step (see getUpkeepSteps(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 sector
      campaign - 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 (see isCounterattack(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 campaign
      contract - the contract
      campaignState - the contract's StratCon campaign state
      scenarioCount - 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 campaign
      track - the facility's sector
      coords - the facility's hex
      facility - 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 (see isOffScreenDefenseHeld(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 sector
      facility - the facility
      campaignState - the contract's StratCon campaign state
      Returns:
      true if the facility was lost
      Since:
      0.51.01
    • reportIgnoredCounterattack

      public static void reportIgnoredCounterattack(Campaign campaign, StratConTrackState track, StratConCoords coords, StratConFacility facility)
      Parameters:
      campaign - the current campaign
      track - the facility's sector
      coords - the facility's hex
      facility - 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 campaign
      contract - the contract
      campaignState - the contract's StratCon campaign state
      Since:
      0.51.01