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, the counterattacks and assaults it makes 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 and reinforces by the "Enemy Facility Activity" option's worth of steps, unless a fight is under way there, it is cut off from its supply lines, or it is under siege.
  • Counterattacks and assaults. Started by the contract's facility attacks (see StratConFacilityAttacks). Losing one outright hands the facility to the enemy; ignoring one does too, except that one held by the employer is left to an off-screen roll.
  • Enemy engineers. 1 a month per point of the contract's Scale, each on a random day, as a point of interest. If not dealt with before they leave, they become an enemy outpost (see StratConEnemyEngineersBehavior). They need Facility Operations.
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
    • 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 for enemy engineers: places those due today, each in a random sector with room. One that finds no room is dropped. None are placed while Facility Operations is off, or while a Garrison Duty or Retainer contract is peaceful, between raids; those due then are simply dropped.

      A contract whose engineers were never scheduled - one from before they were scheduled up front - is scheduled from today (see scheduleEnemyEngineers(mekhq.campaign.mission.contract.AbstractContract, mekhq.campaign.digitalGM.stratCon.StratConCampaignState, java.time.LocalDate)).

      Parameters:
      campaign - the current campaign
      contract - the contract
      campaignState - the contract's StratCon campaign state
      Since:
      0.51.01
    • scheduleEnemyEngineers

      public static void scheduleEnemyEngineers(AbstractContract contract, StratConCampaignState campaignState, @Nullable LocalDate fromDate)
      Schedules a contract's enemy engineers from the given day to the contract's end, replacing any scheduled from that day on: 1 a month per point of Scale, each on a random day within its month. Does nothing without a settled start date.
      Parameters:
      contract - the contract
      campaignState - the contract's StratCon campaign state
      fromDate - the first day to schedule on; the contract's start date when it is accepted
      Since:
      0.51.01