Enum Class FacilityTrait
- All Implemented Interfaces:
Serializable,Comparable<FacilityTrait>,Constable
Something particular about one facility, rolled when it is placed, so that two facilities of the same type need not
play the same. The player sees a facility's traits once they have detailed intel on it.
A garrison trait describes the troops holding the facility, so it is lost when the facility changes sides. A site trait describes the place itself and stays with it.
- Since:
- 0.51.01
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionPrototype gear: fights at an enemy facility face better-equipped troops, and capturing it brings in Employer Support once, as the gear is traded to your employer.Built to take punishment: an attacker who wins short of capturing it does no damage, and sabotage only one step.Its troops would rather not be there: an enemy facility under siege surrenders one garrison step sooner; an employer's facility defends itself worse when you stay away from a counterattack.One garrison step fewer than its tier allows.Held by veterans: fights at an enemy facility face better-skilled troops; an employer's facility defends itself better when you stay away from a counterattack.Full stores: a won raid on an enemy one brings in extra Employer Support, and one your side holds provides extra Employer Support each month. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intEmployer Support capturing a facility with experimental weapons brings in.static final intThe most traits a facility is given.static final intThe off-screen defence modifier for a veteran (or, negated, a poor-morale) garrison.static final intExtra Employer Support a well-stocked facility your side holds provides each month.static final intEmployer Support a won raid on a well-stocked enemy facility brings in. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidassignRandomTraits(StratConFacility facility) Rolls how many traits a newly placed facility gets and picks them (seegetTraitCount(int)andpickTraits(mekhq.campaign.digitalGM.stratCon.facility.StratConFacility.FacilityTier, int, java.util.function.IntUnaryOperator)), giving them to the facility.static intgetTraitCount(int roll) booleanbooleanstatic List<FacilityTrait> pickTraits(StratConFacility.FacilityTier tier, int count, IntUnaryOperator randomizer) Picks traits for a newly placed facility, skipping any its tier does not allow and any that conflict with one already picked.static List<FacilityTrait> pickTraits(StratConFacility.FacilityTier tier, int count, IntUnaryOperator randomizer, Set<FacilityTrait> excluded) AspickTraits(FacilityTier, int, IntUnaryOperator), but never picking any of the excluded traits.static FacilityTraitReturns the enum constant of this class with the specified name.static FacilityTrait[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNDERMANNED
One garrison step fewer than its tier allows. Never rolled on an Outpost, which would be left empty. -
VETERAN_GARRISON
Held by veterans: fights at an enemy facility face better-skilled troops; an employer's facility defends itself better when you stay away from a counterattack. -
POOR_MORALE
Its troops would rather not be there: an enemy facility under siege surrenders one garrison step sooner; an employer's facility defends itself worse when you stay away from a counterattack. -
HARDENED
Built to take punishment: an attacker who wins short of capturing it does no damage, and sabotage only one step. -
WELL_STOCKED
Full stores: a won raid on an enemy one brings in extra Employer Support, and one your side holds provides extra Employer Support each month. -
EXPERIMENTAL_WEAPONS
Prototype gear: fights at an enemy facility face better-equipped troops, and capturing it brings in Employer Support once, as the gear is traded to your employer.
-
-
Field Details
-
WELL_STOCKED_RAID_SUPPORT
public static final int WELL_STOCKED_RAID_SUPPORTEmployer Support a won raid on a well-stocked enemy facility brings in.- Since:
- 0.51.01
- See Also:
-
WELL_STOCKED_MONTHLY_SUPPORT
public static final int WELL_STOCKED_MONTHLY_SUPPORTExtra Employer Support a well-stocked facility your side holds provides each month.- Since:
- 0.51.01
- See Also:
-
EXPERIMENTAL_WEAPONS_CAPTURE_SUPPORT
public static final int EXPERIMENTAL_WEAPONS_CAPTURE_SUPPORTEmployer Support capturing a facility with experimental weapons brings in.- Since:
- 0.51.01
- See Also:
-
OFF_SCREEN_DEFENSE_MODIFIER
public static final int OFF_SCREEN_DEFENSE_MODIFIERThe off-screen defence modifier for a veteran (or, negated, a poor-morale) garrison.- Since:
- 0.51.01
- See Also:
-
MAXIMUM_TRAITS
public static final int MAXIMUM_TRAITSThe most traits a facility is given.- Since:
- 0.51.01
- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isGarrisonTrait
public boolean isGarrisonTrait()- Returns:
trueif the trait describes the facility's troops, and so is lost when it changes sides- Since:
- 0.51.01
-
isAllowedFor
- Parameters:
tier- a facility's tier- Returns:
trueif a facility of that tier can be given this trait- Since:
- 0.51.01
-
getConflictingTrait
- Returns:
- the trait that cannot sit alongside this one, or
nullif any may - Since:
- 0.51.01
-
getTraitCount
public static int getTraitCount(int roll) - Parameters:
roll- a 2d6 roll- Returns:
- how many traits a newly placed facility gets: none on 6 or less, one on 7 to 9, two on 10 or more
- Since:
- 0.51.01
-
assignRandomTraits
Rolls how many traits a newly placed facility gets and picks them (seegetTraitCount(int)andpickTraits(mekhq.campaign.digitalGM.stratCon.facility.StratConFacility.FacilityTier, int, java.util.function.IntUnaryOperator)), giving them to the facility. Call it once the facility's tier is set; its garrison is trimmed to what the traits allow.- Parameters:
facility- the facility just placed- Since:
- 0.51.01
-
pickTraits
public static List<FacilityTrait> pickTraits(StratConFacility.FacilityTier tier, int count, IntUnaryOperator randomizer) Picks traits for a newly placed facility, skipping any its tier does not allow and any that conflict with one already picked.- Parameters:
tier- the facility's tiercount- how many traits to pick (seegetTraitCount(int))randomizer- gives a random index below its argument- Returns:
- the traits, in the order picked
- Since:
- 0.51.01
-
pickTraits
public static List<FacilityTrait> pickTraits(StratConFacility.FacilityTier tier, int count, IntUnaryOperator randomizer, Set<FacilityTrait> excluded) AspickTraits(FacilityTier, int, IntUnaryOperator), but never picking any of the excluded traits.- Parameters:
tier- the facility's tiercount- how many traits to pick (seegetTraitCount(int))randomizer- gives a random index below its argumentexcluded- traits that may not be picked- Returns:
- the traits, in the order picked
- Since:
- 0.51.01
-