Class StratConFacilityOperations
java.lang.Object
mekhq.campaign.digitalGM.stratCon.facility.StratConFacilityOperations
The rules for the orders a player gives deployed formations at facilities (see
FacilityOperation), and for
what the player does with a facility they capture (see FacilityCaptureChoice). All of it applies only with
the Facility Operations campaign option; without it, deploying onto an enemy facility starts an assault, as it
always has.
Every order costs support points, paid when it is given. Raid and Assault start a scenario on the facility at
once. Sabotage is rolled at once, and only a caught saboteur fights. Fortify and Reinforce take effect at once.
Recon and Build take time: the formation stays deployed until the order completes, and the order is stored on the
sector until then. A siege is stored the same way, but has no set end (see StratConFacilitySiege).
- Since:
- 0.51.01
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe extra enemy force caught saboteurs face. -
Method Summary
Modifier and TypeMethodDescriptionstatic FacilityCaptureChoiceaskCaptureChoice(Campaign campaign, StratConFacility facility) Asks the player what to do with a facility they have just captured.static FacilityCaptureChoiceaskCaptureChoice(Campaign campaign, StratConFacility facility, boolean canRaze) AsaskCaptureChoice(Campaign, StratConFacility), but leaving out Raze when the facility must not be destroyed (seecanRaze(mekhq.campaign.digitalGM.stratCon.StratConTrackState, mekhq.campaign.digitalGM.stratCon.StratConCoords)).static booleancanRaze(StratConTrackState track, StratConCoords coords) static intcountBuiltFacilities(StratConCampaignState campaignState) static List<StratConFacilityDefinition> getEligibleFormationIds(Campaign campaign, StratConTrackState track, StratConCoords coords, FacilityOperation operation) static StratConFacilitygetKnownFacility(StratConTrackState track, StratConCoords coords) static StringgetObjectiveModifierId(FacilityOperation operation) static List<FacilityOperation> getOperationsFor(StratConTrackState track, StratConCoords coords) static intgetSupportPointCost(FacilityOperation operation) static intgetSupportPointCost(StratConCampaignState campaignState, FacilityOperation operation) static StringgetUnavailableReasonKey(Campaign campaign, AbstractContract contract, StratConTrackState track, StratConCoords coords, FacilityOperation operation) Checks whether an order can be given on a hex at all, leaving aside which formation would carry it out.static booleanstatic booleanisKnownToPlayer(StratConTrackState track, StratConFacility facility) The one test of whether the player knows a facility is there, used alike by the map, the facility window, the Facilities overview and the orders: their side holds it, they have located it, or the whole sector is revealed (by a facility that reveals it, or by the GM).static booleanissueOrder(Campaign campaign, AbstractContract contract, StratConTrackState track, StratConCoords coords, int formationId, FacilityOperation operation, StratConFacilityDefinition buildDefinition) Gives an order, paying its support points.static voidpayBuiltFacilityUpkeep(StratConTrackState track, Campaign campaign) Charges the month's upkeep for each facility the player's side has built in a sector (seeBUILT_FACILITY_UPKEEP).static voidprocessOrders(StratConTrackState track, Campaign campaign) Moves the sector's timed orders on by a day.static voidresolveCapture(Campaign campaign, AbstractContract contract, StratConTrackState track, StratConCoords coords, FacilityCaptureChoice choice) Carries out the player's choice for a facility they have just captured, which is now Allied.static voidresolveRaidLoot(Campaign campaign, AbstractContract contract, StratConFacility facility) Settles what a won raid brings in beyond the damage it did: extra Employer Support from a well-stocked facility.
-
Field Details
-
SABOTAGE_CAUGHT_MODIFIER
The extra enemy force caught saboteurs face.- See Also:
-
-
Method Details
-
isEnabled
- Parameters:
campaign- the current campaign- Returns:
trueif players give facility orders, rather than deploying onto a facility to assault it- Since:
- 0.51.01
-
getSupportPointCost
public static int getSupportPointCost(@Nullable StratConCampaignState campaignState, FacilityOperation operation) - Parameters:
campaignState- the contract's StratCon campaign state, ornullfor the base costoperation- an order- Returns:
- what the order costs in support points right now: for a Build, the base cost plus one for each facility your side has built and still holds, or is building
- Since:
- 0.51.01
-
countBuiltFacilities
- Parameters:
campaignState- the contract's StratCon campaign state- Returns:
- how many facilities your side has built and still holds, plus those being built, across the contract
- Since:
- 0.51.01
-
getSupportPointCost
- Parameters:
operation- an order- Returns:
- what the order costs in support points before anything raises it (see
getSupportPointCost(StratConCampaignState, FacilityOperation)) - Since:
- 0.51.01
-
getObjectiveModifierId
- Parameters:
operation- an order that can lead to a fight on a facility- Returns:
- the ID of the scenario modifier holding that fight's objective; an assault's for an order that never fights
- Since:
- 0.51.01
-
getOperationsFor
public static List<FacilityOperation> getOperationsFor(StratConTrackState track, StratConCoords coords) - Parameters:
track- a sectorcoords- a hex in it- Returns:
- the orders that make sense on that hex, whether or not they can be given right now: the enemy facility orders on an enemy facility, Fortify and Reinforce on the player's side's facility, and Build on a hex with nothing on it, along with Interdict Supply if it carries a road
- Since:
- 0.51.01
-
getKnownFacility
@Nullable public static StratConFacility getKnownFacility(StratConTrackState track, StratConCoords coords) - Parameters:
track- a sectorcoords- a hex in it- Returns:
- the facility on the hex if the player knows it is there (see
isKnownToPlayer(mekhq.campaign.digitalGM.stratCon.StratConTrackState, mekhq.campaign.digitalGM.stratCon.facility.StratConFacility)), ornullif there is none or the player can't see it. An enemy facility the player hasn't found is treated as absent, so orders can't be used to find it. - Since:
- 0.51.01
-
isKnownToPlayer
The one test of whether the player knows a facility is there, used alike by the map, the facility window, the Facilities overview and the orders: their side holds it, they have located it, or the whole sector is revealed (by a facility that reveals it, or by the GM).- Parameters:
track- the facility's sectorfacility- the facility- Returns:
trueif the player knows the facility is there- Since:
- 0.51.01
-
getEligibleFormationIds
public static List<Integer> getEligibleFormationIds(Campaign campaign, StratConTrackState track, StratConCoords coords, FacilityOperation operation) - Parameters:
campaign- the current campaigntrack- the sectorcoords- the hex the order acts onoperation- the order- Returns:
- the IDs of the formations that could carry out the order, in ID order: those deployed on the hex, or next to it for an order that allows that, that are neither in a scenario nor carrying out another order
- Since:
- 0.51.01
-
getBuildableDefinitions
- Returns:
- the facility definitions a Build order can raise: those of a field-built type (see
BUILDABLE_TYPES) with a profile for the player's side - Since:
- 0.51.01
-
issueOrder
public static boolean issueOrder(Campaign campaign, AbstractContract contract, StratConTrackState track, StratConCoords coords, int formationId, FacilityOperation operation, @Nullable StratConFacilityDefinition buildDefinition) Gives an order, paying its support points. An order that cannot be given, or whose scenario could not be generated, changes nothing and costs nothing.- Parameters:
campaign- the current campaigncontract- the contract whose map holds the sectortrack- the sectorcoords- the hex the order acts onformationId- the ID of the formation carrying it outoperation- the orderbuildDefinition- forFacilityOperation.BUILD, what to build; otherwise ignored- Returns:
trueif the order was given- Since:
- 0.51.01
-
processOrders
Moves the sector's timed orders on by a day. An order is abandoned if its formation has left, or, for a build, if anything else has turned up on the hex; the support points it cost are not returned. An order due today completes.- Parameters:
track- the sectorcampaign- the current campaign- Since:
- 0.51.01
-
payBuiltFacilityUpkeep
Charges the month's upkeep for each facility the player's side has built in a sector (seeBUILT_FACILITY_UPKEEP). A facility the player cannot pay for falls into disrepair: its condition drops one step. Both are reported.- Parameters:
track- the sectorcampaign- the current campaign- Since:
- 0.51.01
-
askCaptureChoice
Asks the player what to do with a facility they have just captured. Without a GUI to ask through, they hold it.- Parameters:
campaign- the current campaignfacility- the captured facility- Returns:
- the player's choice
- Since:
- 0.51.01
-
askCaptureChoice
public static FacilityCaptureChoice askCaptureChoice(Campaign campaign, StratConFacility facility, boolean canRaze) AsaskCaptureChoice(Campaign, StratConFacility), but leaving out Raze when the facility must not be destroyed (seecanRaze(mekhq.campaign.digitalGM.stratCon.StratConTrackState, mekhq.campaign.digitalGM.stratCon.StratConCoords)).- Parameters:
campaign- the current campaignfacility- the captured facilitycanRaze- whether Raze may be offered- Returns:
- the player's choice
- Since:
- 0.51.01
-
canRaze
- Parameters:
track- a sectorcoords- a facility's hex- Returns:
falseif a strategic objective on the hex needs the facility to still stand - one the player must control - so razing it would fail the objective for good- Since:
- 0.51.01
-
resolveCapture
public static void resolveCapture(Campaign campaign, AbstractContract contract, StratConTrackState track, StratConCoords coords, FacilityCaptureChoice choice) Carries out the player's choice for a facility they have just captured, which is now Allied.FacilityCaptureChoice.HOLD: the player holds it, at full garrison.FacilityCaptureChoice.RAZE: it is destroyed, raising Escalation by 3d6 for a civilian facility (a Space Port, Data Center or Industrial Center), or 1d6 otherwise.FacilityCaptureChoice.HAND_OVER: it stays with the employer, at full garrison, and the contract's combat bonus is paid.
- Parameters:
campaign- the current campaigncontract- the contract whose map holds the sectortrack- the sectorcoords- the facility's hexchoice- the player's choice- Since:
- 0.51.01
-
resolveRaidLoot
public static void resolveRaidLoot(Campaign campaign, AbstractContract contract, StratConFacility facility) Settles what a won raid brings in beyond the damage it did: extra Employer Support from a well-stocked facility.- Parameters:
campaign- the current campaigncontract- the contract whose map holds the facilityfacility- the raided facility- Since:
- 0.51.01
-