Interface IStratConPointOfInterestBehavior
- All Known Implementing Classes:
AbstractStratConRolledPointOfInterestBehavior,StratConAmbushPointOfInterestBehavior,StratConAssassinationLeadBehavior,StratConCivilDisobedienceBehavior,StratConCivilianInfrastructureBehavior,StratConContestedPointOfInterestBehavior,StratConHighProfileTargetBehavior,StratConPirateCaptainBehavior,StratConPlunderTargetBehavior,StratConSabotageTargetBehavior,StratConScheduledParadeBehavior,StratConShowOfForceBehavior,StratConTargetIntelligenceBehavior,StratConTrainingManeuversBehavior
public interface IStratConPointOfInterestBehavior
The rules that make one type of StratCon point of interest behave differently from another. A definition names its
behavior by ID (see
StratConPointOfInterestDefinition.getBehaviorId()), and the behavior is looked up in
StratConPointOfInterestBehaviors.
Behaviors are code, never saved: a saved point of interest records only its type ID, so a new type needs no change to how campaigns are saved. Every hook has a default, so an implementation overrides only what its type cares about.
- Since:
- 0.51.01
-
Method Summary
Modifier and TypeMethodDescriptiondefault StringgetAdditionalInfo(StratConPointOfInterest pointOfInterest, StratConTrackState track) default StringgetObjectiveDescription(StratConPointOfInterest pointOfInterest, StratConTrackState track) Describes what the player must do to meet a strategic objective tied to this point of interest, for the objectives list - for example "Recover the flight recorder from the crash site".default intgetScanRangeIncrease(StratConPointOfInterest pointOfInterest, StratConTrackState track) How much this point of interest widens the scan range of every player force scouting its sector, the way a sensor facility does.default intgetScenarioOddsModifier(StratConPointOfInterest pointOfInterest, StratConTrackState track) How much this point of interest shifts the odds of a scenario breaking out when a force deploys anywhere in its sector.default booleanisObjectiveCompleted(StratConPointOfInterest pointOfInterest, StratConTrackState track) Decides whether a strategic objective tied to this point of interest has been met.default booleanisObjectiveFailed(StratConPointOfInterest pointOfInterest, StratConTrackState track) Decides whether a strategic objective tied to this point of interest can no longer be met.default voidonExpired(StratConPointOfInterest pointOfInterest, StratConTrackState track, Campaign campaign) Called when the point of interest reaches its expiry date, before it is marked as expired or removed.default PointOfInterestDeploymentOutcomeonFormationDeployed(StratConPointOfInterest pointOfInterest, StratConTrackState track, int formationId, Campaign campaign) Called when a player formation deploys onto the point of interest's hex from the map, after the hex has been scouted and before any scenario is looked for or rolled.default voidonLinkedScenarioEnded(StratConPointOfInterest pointOfInterest, StratConTrackState track, boolean isVictory, Campaign campaign) Called when the scenario this point of interest's fate is waiting on (seeStratConPointOfInterestRules.linkScenario(mekhq.campaign.digitalGM.stratCon.pointOfInterest.StratConPointOfInterest, mekhq.campaign.digitalGM.stratCon.StratConScenario)) ends.default voidonNewDay(StratConPointOfInterest pointOfInterest, StratConTrackState track, Campaign campaign) Called once per day for every active point of interest, after any whose expiry date has come have expired.default voidonRevealed(StratConPointOfInterest pointOfInterest, StratConTrackState track, Campaign campaign) Called when a player force scouts the point of interest's hex for the first time.default voidonScheduled(List<StratConScheduledPointOfInterest> scheduledPointsOfInterest, AbstractContract contract) Called once, when a contract that uses this type as its special point of interest is accepted, with every point of interest of this type the contract has scheduled.
-
Method Details
-
onScheduled
default void onScheduled(List<StratConScheduledPointOfInterest> scheduledPointsOfInterest, AbstractContract contract) Called once, when a contract that uses this type as its special point of interest is accepted, with every point of interest of this type the contract has scheduled. A type that settles something up front - which assassination targets are the real one rather than a body double, or which target intelligence leads to a facility - records it in each one's initial state (seeStratConScheduledPointOfInterest.getInitialState()), which is copied onto the point of interest when it is placed. By default, nothing.- Parameters:
scheduledPointsOfInterest- the contract's scheduled points of interest of this type, not yet placedcontract- the contract being accepted- Since:
- 0.51.01
-
onRevealed
default void onRevealed(StratConPointOfInterest pointOfInterest, StratConTrackState track, Campaign campaign) Called when a player force scouts the point of interest's hex for the first time.- Parameters:
pointOfInterest- the point of interest just revealedtrack- the sector it sits incampaign- the current campaign- Since:
- 0.51.01
-
onFormationDeployed
default PointOfInterestDeploymentOutcome onFormationDeployed(StratConPointOfInterest pointOfInterest, StratConTrackState track, int formationId, Campaign campaign) Called when a player formation deploys onto the point of interest's hex from the map, after the hex has been scouted and before any scenario is looked for or rolled. Only called while the point of interest is active, and not when a formation is committed to a scenario that already exists.The returned outcome shapes the usual random scenario roll. To replace that roll with a scenario of the type's own, create the scenario on this hex here and return
PointOfInterestDeploymentOutcome.SUPPRESS_SCENARIO: the deploying formation is then assigned to it like any scenario found on the hex.- Parameters:
pointOfInterest- the point of interest on the hextrack- the sector it sits informationId- the ID of the deploying formationcampaign- the current campaign- Returns:
- what this point of interest does to the random scenario roll; by default, nothing
- Since:
- 0.51.01
-
onNewDay
default void onNewDay(StratConPointOfInterest pointOfInterest, StratConTrackState track, Campaign campaign) Called once per day for every active point of interest, after any whose expiry date has come have expired. A point of interest waiting on a linked scenario does not expire, but still gets this hook.- Parameters:
pointOfInterest- the point of interesttrack- the sector it sits incampaign- the current campaign- Since:
- 0.51.01
-
onExpired
default void onExpired(StratConPointOfInterest pointOfInterest, StratConTrackState track, Campaign campaign) Called when the point of interest reaches its expiry date, before it is marked as expired or removed. A behavior may still resolve or remove it here, in which case it is neither marked as expired nor removed.- Parameters:
pointOfInterest- the point of interest expiringtrack- the sector it sits incampaign- the current campaign- Since:
- 0.51.01
-
onLinkedScenarioEnded
default void onLinkedScenarioEnded(StratConPointOfInterest pointOfInterest, StratConTrackState track, boolean isVictory, Campaign campaign) Called when the scenario this point of interest's fate is waiting on (seeStratConPointOfInterestRules.linkScenario(mekhq.campaign.digitalGM.stratCon.pointOfInterest.StratConPointOfInterest, mekhq.campaign.digitalGM.stratCon.StratConScenario)) ends. The link is cleared before this is called.A scenario that is ignored, or removed from the map without being played, ends in defeat - noticed on the next day's point of interest step.
- Parameters:
pointOfInterest- the point of interest the scenario was linked totrack- the sector it sits inisVictory-trueif the scenario was an overall victory for the player; a draw is notcampaign- the current campaign- Since:
- 0.51.01
-
getScanRangeIncrease
How much this point of interest widens the scan range of every player force scouting its sector, the way a sensor facility does. By default, its definition'sscan range increase, but only while it is active and held by the player or an ally - a sensor you do not hold scouts for someone else.- Parameters:
pointOfInterest- the point of interesttrack- the sector it sits in- Returns:
- the number of hexes to add to the sector's scan range
- Since:
- 0.51.01
-
getScenarioOddsModifier
default int getScenarioOddsModifier(StratConPointOfInterest pointOfInterest, StratConTrackState track) How much this point of interest shifts the odds of a scenario breaking out when a force deploys anywhere in its sector. By default, its definition'sscenario odds modifierwhile it is active, whoever holds it: it describes the ground, not the side.- Parameters:
pointOfInterest- the point of interesttrack- the sector it sits in- Returns:
- the modifier to add to the sector's scenario odds
- Since:
- 0.51.01
-
isObjectiveCompleted
default boolean isObjectiveCompleted(StratConPointOfInterest pointOfInterest, StratConTrackState track) Decides whether a strategic objective tied to this point of interest has been met. By default, it is met once the point of interest has been resolved.- Parameters:
pointOfInterest- the point of interest the objective is tied totrack- the sector it sits in- Returns:
trueif the objective has been met- Since:
- 0.51.01
-
isObjectiveFailed
default boolean isObjectiveFailed(StratConPointOfInterest pointOfInterest, StratConTrackState track) Decides whether a strategic objective tied to this point of interest can no longer be met. By default, it fails once the point of interest has expired unresolved. (An objective whose point of interest has been removed from the map entirely is failed by the objective itself.)- Parameters:
pointOfInterest- the point of interest the objective is tied totrack- the sector it sits in- Returns:
trueif the objective has failed- Since:
- 0.51.01
-
getObjectiveDescription
@Nullable default String getObjectiveDescription(StratConPointOfInterest pointOfInterest, StratConTrackState track) Describes what the player must do to meet a strategic objective tied to this point of interest, for the objectives list - for example "Recover the flight recorder from the crash site". Shown only once the player can see the point of interest; until then the list shows a generic "locate a point of interest".- Parameters:
pointOfInterest- the point of interest the objective is tied totrack- the sector it sits in- Returns:
- the objective text, or
nullfor the generic "investigate [name]" - Since:
- 0.51.01
-
getAdditionalInfo
@Nullable default String getAdditionalInfo(StratConPointOfInterest pointOfInterest, StratConTrackState track) - Parameters:
pointOfInterest- the point of interest being describedtrack- the sector it sits in- Returns:
- extra HTML-safe text for the selected-hex info panel, or
nullfor none - Since:
- 0.51.01
-