Class FactionStandingUtilities
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic FactionStandingLevelcalculateFactionStandingLevel(double regard) Determines theFactionStandingLevelcorresponding to the given regard value.static booleancanEnterTargetSystem(Faction campaignFaction, FactionStandings factionStandings, PlanetarySystem currentSystem, PlanetarySystem targetSystem, LocalDate when, List<AtBContract> activeAtBContracts, FactionHints factionHints) Determines whether a campaign force is allowed to enter the specified target planetary system, based on population, ownership, outlaw status, contract relationships, and state of war.static doublegetBarrackCostsMultiplier(double regard) Retrieves the barrack costs multiplier for the specified regard value.static StringgetCharacterFullName(Person person) Constructs and returns the full display name for a given person.static doublegetContractPayMultiplier(double regard) Retrieves the contract pay multiplier corresponding to the specified regard value.static StringgetFactionName(Faction faction, int gameYear) Returns the formatted full name of aFactionfor the specified game year.static StringgetFallbackFactionKey(String dialogKey, Faction judgingFaction) Generates a fallback dialog key by replacing the judging faction's code in the original dialog key with a suitable default affix, based on the general type of the judging faction.static StringgetInCharacterText(String resourceBundle, String resourceBundleAddress, Person commander, Person secondCharacter, String factionName, String campaignName, String locationName, Integer cashValue, String commanderAddress) Generates a localized, in-character narrative text for a faction standing event, dynamically incorporating identity and pronoun information for one or two characters, as well as campaign and faction context.static intgetNegotiationModifier(double regard) Retrieves the negotiation modifier associated with the provided regard value.static doublegetRecruitmentRollsModifier(double regard) Returns the recruitment rolls modifier based on the specified regard value.static intgetRecruitmentTickets(double regard) Returns the number of recruitment tickets granted for the given regard value.static doublegetResupplyWeightModifier(double regard) Returns the resupply weight modifier for the specified regard value.static intgetStandingLevel(double regard) Retrieves the current standing level based on the provided regard value.static intgetSupportPointModifierContractStart(double regard) Returns the support point modifier applied at the start of a contract for the given regard value.static intgetSupportPointModifierPeriodic(double regard) Returns the periodic support point modifier for the specified regard value.static intgetUnitMarketRarityModifier(double regard) Returns the unit market rarity modifier for the given regard value.static booleanhasCommandCircuitAccess(double regard) Determines if the command circuit access is available at the given regard value.static booleanisBatchallAllowed(double regard) Checks if Batchalls are allowed for the provided regard value.static booleanisIsOnMission(boolean isOnPlanet, List<AtBContract> activeAtBContracts, List<Mission> activeMissions, String factionCode, PlanetarySystem currentSystem, boolean ignoreEmployer) Checks whether the campaign is presently undertaking a mission for the specified faction.static booleanisOutlawed(double regard) Checks whether the specified regard value results in outlawed status.static booleanisUseCommandCircuit(boolean overridingCommandCircuitRequirements, boolean isGM, boolean useFactionStandingCommandCircuit, FactionStandings factionStandings, List<AtBContract> activeContracts) Determines whether command circuit access should be granted based on campaign settings, GM mode, current faction standings, and a list of active contracts.
- 
Field Details- 
PIRACY_SUCCESS_INDEX_FACTION_CODE- See Also:
 
 
- 
- 
Constructor Details- 
FactionStandingUtilitiespublic FactionStandingUtilities()
 
- 
- 
Method Details- 
calculateFactionStandingLevelDetermines theFactionStandingLevelcorresponding to the given regard value.Iterates through all defined standing levels and returns the one whose regard range (inclusive of the minimum and maximum regard) contains the provided regard value. If the regard value does not fall within any defined standing level range, this method logs a warning and returns FactionStandingLevel.STANDING_LEVEL_4as a default.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the matching FactionStandingLevelfor the given regard, orSTANDING_LEVEL_4if no match is found
- Since:
- 0.50.07
 
- 
getStandingLevelpublic static int getStandingLevel(double regard) Retrieves the current standing level based on the provided regard value.- Parameters:
- regard- the regard value used to evaluate the faction standing level
- Returns:
- the corresponding standing level as an integer
- Since:
- 0.50.07
- See Also:
 
- 
getNegotiationModifierpublic static int getNegotiationModifier(double regard) Retrieves the negotiation modifier associated with the provided regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the negotiation modifier
- Since:
- 0.50.07
- See Also:
 
- 
getResupplyWeightModifierpublic static double getResupplyWeightModifier(double regard) Returns the resupply weight modifier for the specified regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the resupply weight modifier as a double
- Since:
- 0.50.07
- See Also:
 
- 
hasCommandCircuitAccesspublic static boolean hasCommandCircuitAccess(double regard) Determines if the command circuit access is available at the given regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- trueif command circuit access is granted;- falseotherwise
- Since:
- 0.50.07
- See Also:
 
- 
isOutlawedpublic static boolean isOutlawed(double regard) Checks whether the specified regard value results in outlawed status.- Parameters:
- regard- the regard value to evaluate
- Returns:
- trueif outlawed;- falseotherwise
- Since:
- 0.50.07
- See Also:
 
- 
isBatchallAllowedpublic static boolean isBatchallAllowed(double regard) Checks if Batchalls are allowed for the provided regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- trueif Batchall is allowed;- falseotherwise
- Since:
- 0.50.07
- See Also:
 
- 
getRecruitmentTicketspublic static int getRecruitmentTickets(double regard) Returns the number of recruitment tickets granted for the given regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the number of recruitment tickets
- Since:
- 0.50.07
- See Also:
 
- 
getRecruitmentRollsModifierpublic static double getRecruitmentRollsModifier(double regard) Returns the recruitment rolls modifier based on the specified regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the recruitment rolls modifier
- Since:
- 0.50.07
- See Also:
 
- 
getBarrackCostsMultiplierpublic static double getBarrackCostsMultiplier(double regard) Retrieves the barrack costs multiplier for the specified regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the barrack costs multiplier as a double
- Since:
- 0.50.07
- See Also:
 
- 
getUnitMarketRarityModifierpublic static int getUnitMarketRarityModifier(double regard) Returns the unit market rarity modifier for the given regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the unit market rarity modifier
- Since:
- 0.50.07
- See Also:
 
- 
getContractPayMultiplierpublic static double getContractPayMultiplier(double regard) Retrieves the contract pay multiplier corresponding to the specified regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the contract pay multiplier as a double
- Since:
- 0.50.07
- See Also:
 
- 
getSupportPointModifierContractStartpublic static int getSupportPointModifierContractStart(double regard) Returns the support point modifier applied at the start of a contract for the given regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the support point modifier for contract start
- Since:
- 0.50.07
- See Also:
 
- 
getSupportPointModifierPeriodicpublic static int getSupportPointModifierPeriodic(double regard) Returns the periodic support point modifier for the specified regard value.- Parameters:
- regard- the regard value to evaluate
- Returns:
- the periodic support point modifier
- Since:
- 0.50.07
- See Also:
 
- 
isUseCommandCircuitpublic static boolean isUseCommandCircuit(boolean overridingCommandCircuitRequirements, boolean isGM, boolean useFactionStandingCommandCircuit, FactionStandings factionStandings, List<AtBContract> activeContracts) Determines whether command circuit access should be granted based on campaign settings, GM mode, current faction standings, and a list of active contracts.Access is immediately granted if both command circuit requirements are overridden and GM mode is active. If not, and if faction standing is used as a criterion, the method evaluates the player's highest faction regard across all active contracts, granting access if this level meets the threshold. If there are no active contracts, access is denied. - Parameters:
- overridingCommandCircuitRequirements-- trueif command circuit requirements are overridden
- isGM-- trueif GM mode is enabled
- useFactionStandingCommandCircuit-- trueif faction standing is used to determine access
- factionStandings- player faction standing data
- activeContracts- list of currently active contracts to evaluate for access
- Returns:
- trueif command circuit access should be used;- falseotherwise
- Since:
- 0.50.07
 
- 
canEnterTargetSystempublic static boolean canEnterTargetSystem(Faction campaignFaction, FactionStandings factionStandings, @Nullable PlanetarySystem currentSystem, PlanetarySystem targetSystem, LocalDate when, List<AtBContract> activeAtBContracts, FactionHints factionHints) Determines whether a campaign force is allowed to enter the specified target planetary system, based on population, ownership, outlaw status, contract relationships, and state of war.The rules for entry are as follows: - If the target system is empty (population zero), entry is always permitted.
- If the target system is owned by any faction that is either an employer or a contract target, entry is allowed.
- If the player is outlawed in their current system, they may always exit to another system (unless currentSystemisnull).
- If the player is outlawed in the target system, entry is denied.
- If the campaign faction is at war with all system factions, entry is denied.
- If none of the above conditions block entry, it is permitted.
 - Parameters:
- campaignFaction- the campaign's primary faction
- factionStandings- the standings of the campaign with all factions
- currentSystem- the planetary system currently occupied
- targetSystem- the planetary system to test entry for
- when- the date of attempted entry (population/ownership may change over time)
- activeAtBContracts- list of currently active contracts
- factionHints- the details of the current factional relations
- Returns:
- trueif entry to the target system is allowed;- falseotherwise
- Since:
- 0.50.07
 
- 
isIsOnMissionpublic static boolean isIsOnMission(boolean isOnPlanet, List<AtBContract> activeAtBContracts, List<Mission> activeMissions, String factionCode, PlanetarySystem currentSystem, boolean ignoreEmployer) Checks whether the campaign is presently undertaking a mission for the specified faction.This method verifies all the following conditions to determine mission status: - The campaign must currently be located on a planet.
- There must be at least one active AtB (Against the Bot) contract.
- At least one such AtB contract must have both an employer code matching the specified faction and a system matching the current location.
- Alternatively, the presence of any active mission also qualifies as being on a mission for the faction. This is to ensure compatibility with non-AtB campaigns.
 Returns trueif these checks indicate the campaign is actively on a mission or contract corresponding to the specified faction.- Parameters:
- isOnPlanet- whether the campaign is currently on a planet
- activeAtBContracts- list of all currently active AtB contracts
- activeMissions- list of all currently active missions
- factionCode- the code identifying the relevant faction
- currentSystem- the planetary system in which the campaign is currently located
- ignoreEmployer- whether the contract employer faction should be ignored
- Returns:
- trueif the campaign is on a qualifying mission for the given faction;- falseotherwise
- Since:
- 0.50.07
 
- 
getFactionNameReturns the formatted full name of aFactionfor the specified game year.If the faction's name starts with the localized "clan" prefix, the method returns the full name as-is. Otherwise, the localized "the" article is prefixed to the base name. This helps ensure proper grammatical usage for varying factions based on localization and faction naming conventions. - Parameters:
- faction- the- Factionwhose name should be formatted
- gameYear- the year for which the faction's full name is relevant
- Returns:
- the formatted faction name, including the appropriate localized prefix if necessary
- Since:
- 0.50.07
 
- 
getCharacterFullNameConstructs and returns the full display name for a given person.The name is assembled in the following order: if present: rank title, given name, bloodname (if available), or surname (if bloodname is not present). This attempts to produce a canonical or ceremonial name as used in settings with titles and bloodnames. 
- 
getInCharacterTextpublic static String getInCharacterText(@Nullable String resourceBundle, String resourceBundleAddress, @Nullable Person commander, @Nullable Person secondCharacter, String factionName, String campaignName, String locationName, @Nullable Integer cashValue, String commanderAddress) Generates a localized, in-character narrative text for a faction standing event, dynamically incorporating identity and pronoun information for one or two characters, as well as campaign and faction context.This method prepares a set of arguments including hyperlinked titles, given names, context-aware pronouns (subject, object, possessive), and additional identifiers for the commander and (optionally) a secondary individual. It also includes campaign-specific details like the campaign and faction name. The arguments are formatted into a resource bundle string for display within campaign dialogs. - Parameters:
- resourceBundle- the resource bundle address for localization
- resourceBundleAddress- the resource bundle reference key
- commander- the main commander or subject of the censure event; may be- nullif no commander is cited in the dialog.
- secondCharacter- optional secondary character affected by the event; may be- nullif there isn't a second character in the scene.
- factionName- the name of any relevant faction
- campaignName- the name of the current campaign
- locationName- the name of the relevant system or planet; may be- nullif there isn't any locational information in the scene.
- Returns:
- a formatted narrative Stringpopulated with character and context
- Since:
- 0.50.07
 
- 
getFallbackFactionKeyGenerates a fallback dialog key by replacing the judging faction's code in the original dialog key with a suitable default affix, based on the general type of the judging faction.If the judging faction is a Clan, Periphery, or Inner Sphere, the corresponding constant affix is substituted. This is useful for providing default or generic dialog text when no faction-specific version is available. - Parameters:
- dialogKey- the original dialog key, typically with a faction code suffix
- judgingFaction- the- Factionbeing used to determine the fallback key
- Returns:
- a fallback dialog key string with the appropriate affix for the faction type
- Since:
- 0.50.07
 
 
-