Package com.fs.starfarer.api.campaign
Interface FactionAPI
- All Superinterfaces:
HasMemory
- Author:
- Alex Mosolov Copyright 2012 Fractal Softworks, LLC
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
static class
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addKnownFighter
(String wingId, boolean setTimestamp) void
addKnownHullMod
(String modId) void
addKnownIndustry
(String industryId) void
addKnownShip
(String hullId, boolean setTimestamp) void
addKnownWeapon
(String weaponId, boolean setTimestamp) void
addPriorityFighter
(String wingId) void
addPriorityHullMod
(String modId) void
addPriorityShip
(String hullId) void
addPriorityWeapon
(String weaponId) void
addUseWhenImportingShip
(String hullId) void
adjustRelationship
(String id, float delta) boolean
adjustRelationship
(String id, float delta, RepLevel limit) void
Should be called after direct manipulation of the faction's known/always known/priority ship hulls.createRandomPerson
(FullName.Gender gender) createRandomPerson
(FullName.Gender gender, Random random) createRandomPerson
(Random random) boolean
ensureAtBest
(String id, RepLevel level) boolean
ensureAtWorst
(String id, RepLevel level) Hulls that will be in fleets even when the market's ship & weapons supply is from another faction.float
Used to figure out how many fleet points raids/expeditions etc divide out for each "large" fleet.Brighter/slightly cyan version of getBaseUIColor()getColor()
getCrest()
org.json.JSONObject
boolean
getCustomBoolean
(String key) float
getCustomFloat
(String key) org.json.JSONObject
getCustomString
(String key) float
getFleetTypeName
(String type) getId()
getLogo()
int
getNumAvailableForRole
(String roleId, FactionAPI.ShipPickMode mode) Hulls that are restricted to specific variants, defined in "variantOverrides" section of the .faction file.getPortraits
(FullName.Gender gender) float
getRelationshipLevel
(FactionAPI faction) getRelColor
(RepLevel level) getRelColor
(String otherFactionId) int
int
int
float
float
getVariantsForRole
(String roleId) float
getVariantWeightForRole
(String roleId, FactionAPI.ShipPickMode mode) void
boolean
isAtBest
(FactionAPI other, RepLevel level) boolean
boolean
isAtWorst
(FactionAPI other, RepLevel level) boolean
boolean
boolean
boolean
boolean
boolean
isFighterKnownAt
(String wing, Long timestamp) boolean
isFighterPriority
(String wingId) boolean
isHostileTo
(FactionAPI other) boolean
isHostileTo
(String other) boolean
isHullModPriority
(String modId) boolean
isIllegal
(CargoStackAPI stack) boolean
boolean
boolean
boolean
isShipKnownAt
(String hullId, Long timestamp) boolean
isShipPriority
(String hullId) boolean
boolean
isWeaponKnownAt
(String weaponId, Long timestamp) boolean
isWeaponPriority
(String weaponId) boolean
knowsFighter
(String wingId) boolean
knowsHullMod
(String modId) boolean
knowsIndustry
(String industryId) boolean
boolean
knowsWeapon
(String weaponId) void
makeCommodityIllegal
(String commodityId) void
makeCommodityLegal
(String commodityId) pickRandomShipName
(String prefix) pickRandomShipName
(Random random) pickShip
(String role, FactionAPI.ShipPickParams params) pickShip
(String role, FactionAPI.ShipPickParams params, ShipFilter filter, Random random) float
pickShipAndAddToFleet
(String role, FactionAPI.ShipPickParams params, CampaignFleetAPI fleet) May add more than one ship if a fallback specifies to add multiple ships.float
pickShipAndAddToFleet
(String role, FactionAPI.ShipPickParams params, CampaignFleetAPI fleet, Random random) pickVoice
(PersonImportance importance, Random random) void
removeKnownFighter
(String wingId) All of the blueprints specified in the .faction file are re-added to the faction every time a savegame is loaded.void
removeKnownHullMod
(String modId) void
removeKnownIndustry
(String industryId) void
removeKnownShip
(String hullId) All of the blueprints specified in the .faction file are re-added to the faction every time a savegame is loaded.void
removeKnownWeapon
(String weaponId) All of the blueprints specified in the .faction file are re-added to the faction every time a savegame is loaded.void
removePriorityFighter
(String wingId) void
removePriorityHullMod
(String modId) void
removePriorityShip
(String hullId) void
removePriorityWeapon
(String weaponId) void
removeUseWhenImportingShip
(String hullId) void
setAutoEnableKnownFighters
(boolean autoEnableKnownFighters) void
setAutoEnableKnownHullmods
(boolean autoEnableKnownHullmods) void
setAutoEnableKnownShips
(boolean autoEnableKnownShips) void
setAutoEnableKnownWeapons
(boolean autoEnableKnownWeapons) void
setDisplayIsOrAreOverride
(String displayIsOrAreOverride) void
setDisplayNameOverride
(String displayNameOverride) void
setDisplayNameWithArticleOverride
(String displayNameWithArticleOverride) void
setFactionCrestOverride
(String factionCrestOverride) void
setFactionLogoOverride
(String factionLogoOverride) void
setFighterTimestampToNow
(String wingId) void
setPersonNamePrefixAOrAnOverride
(String personNamePrefixAOrAnOverride) void
setRelationship
(String id, float newValue) void
setRelationship
(String id, RepLevel level) void
setSecondaryColorOverride
(Color secondaryOverride) void
setSecondaryColorSegmentsOverride
(int secondaryColorSegmentsOverride) void
setShipNamePrefixOverride
(String shipNamePrefixOverride) void
setShipTimestampToNow
(String hullId) void
setShowInIntelTab
(boolean isShowInIntelTab) void
setWeaponTimestampToNow
(String weaponId) boolean
useWhenImportingShip
(String hullId)
-
Method Details
-
adjustRelationship
-
adjustRelationship
-
setRelationship
-
setRelationship
-
ensureAtBest
-
ensureAtWorst
-
getRelationshipLevel
-
getRelationshipLevel
-
isAtWorst
-
isAtWorst
-
isAtBest
-
isAtBest
-
isHostileTo
-
isHostileTo
-
getRelationship
-
getId
String getId() -
getDisplayName
String getDisplayName() -
getDisplayNameWithArticle
String getDisplayNameWithArticle() -
getColor
Color getColor() -
getBaseUIColor
Color getBaseUIColor() -
getGridUIColor
Color getGridUIColor() -
getDarkUIColor
Color getDarkUIColor() -
getSecondaryUIColor
Color getSecondaryUIColor() -
getBrightUIColor
Color getBrightUIColor()Brighter/slightly cyan version of getBaseUIColor()- Returns:
-
isNeutralFaction
boolean isNeutralFaction() -
isPlayerFaction
boolean isPlayerFaction() -
getStockFleetIds
-
getMemory
MemoryAPI getMemory() -
pickShipAndAddToFleet
May add more than one ship if a fallback specifies to add multiple ships. (For example, 2 small freighters if a medium freighter isn't available.) Returns a total weight of ships added to the fleet. Generally will return 1 when ships were added, 0 when they weren't, and a number >1 when adding, say, a medium ship instead of a small one because no small ones are available.- Parameters:
role
-maxFP
-fleet
-- Returns:
-
getFleetTypeName
-
getDisplayNameLong
String getDisplayNameLong() -
getDisplayNameLongWithArticle
String getDisplayNameLongWithArticle() -
getEntityNamePrefix
String getEntityNamePrefix() -
getRelColor
-
getIllegalCommodities
-
isIllegal
-
isIllegal
-
pickShip
-
pickShip
List<ShipRolePick> pickShip(String role, FactionAPI.ShipPickParams params, ShipFilter filter, Random random) -
makeCommodityIllegal
-
makeCommodityLegal
-
getTariffFraction
float getTariffFraction() -
getTollFraction
float getTollFraction() -
getFineFraction
float getFineFraction() -
getInternalCommsChannel
String getInternalCommsChannel() -
createRandomPerson
PersonAPI createRandomPerson() -
createRandomPerson
-
getLogo
String getLogo() -
getCustom
org.json.JSONObject getCustom() -
getMemoryWithoutUpdate
MemoryAPI getMemoryWithoutUpdate()- Specified by:
getMemoryWithoutUpdate
in interfaceHasMemory
-
getRelColor
-
getRelToPlayer
RelationshipAPI getRelToPlayer() -
getRank
-
getPost
-
getDisplayNameIsOrAre
String getDisplayNameIsOrAre() -
pickPersonality
String pickPersonality() -
getCustomBoolean
-
getCustomString
-
isShowInIntelTab
boolean isShowInIntelTab() -
setShowInIntelTab
void setShowInIntelTab(boolean isShowInIntelTab) -
getCrest
String getCrest() -
getPersonNamePrefix
String getPersonNamePrefix() -
getPersonNamePrefixAOrAn
String getPersonNamePrefixAOrAn() -
pickRandomShipName
String pickRandomShipName() -
pickShipAndAddToFleet
float pickShipAndAddToFleet(String role, FactionAPI.ShipPickParams params, CampaignFleetAPI fleet, Random random) -
getVariantsForRole
-
createRandomPerson
-
createRandomPerson
-
getCustomFloat
-
getSecondarySegments
int getSecondarySegments() -
getDisplayNameOverride
String getDisplayNameOverride() -
setDisplayNameOverride
-
getDisplayNameWithArticleOverride
String getDisplayNameWithArticleOverride() -
setDisplayNameWithArticleOverride
-
getDisplayIsOrAreOverride
String getDisplayIsOrAreOverride() -
setDisplayIsOrAreOverride
-
getShipNamePrefixOverride
String getShipNamePrefixOverride() -
setShipNamePrefixOverride
-
getPersonNamePrefixAOrAnOverride
String getPersonNamePrefixAOrAnOverride() -
setPersonNamePrefixAOrAnOverride
-
getFactionLogoOverride
String getFactionLogoOverride() -
setFactionLogoOverride
-
getFactionCrestOverride
String getFactionCrestOverride() -
setFactionCrestOverride
-
getPortraits
-
getKnownShips
-
addKnownShip
-
removeKnownShip
All of the blueprints specified in the .faction file are re-added to the faction every time a savegame is loaded. To make blueprint removal permanent, the list of things-to-remove needs to be stored and they need to be re-removed on every game load. -
getKnownWeapons
-
addKnownWeapon
-
removeKnownWeapon
All of the blueprints specified in the .faction file are re-added to the faction every time a savegame is loaded. To make blueprint removal permanent, the list of things-to-remove needs to be stored and they need to be re-removed on every game load. -
getKnownFighters
-
addKnownFighter
-
removeKnownFighter
All of the blueprints specified in the .faction file are re-added to the faction every time a savegame is loaded. To make blueprint removal permanent, the list of things-to-remove needs to be stored and they need to be re-removed on every game load. -
getKnownIndustries
-
addKnownIndustry
-
removeKnownIndustry
-
knowsShip
-
knowsWeapon
-
knowsFighter
-
knowsIndustry
-
getPriorityShips
-
addPriorityShip
-
removePriorityShip
-
isShipPriority
-
getPriorityWeapons
-
addPriorityWeapon
-
removePriorityWeapon
-
isWeaponPriority
-
getPriorityFighters
-
addPriorityFighter
-
removePriorityFighter
-
isFighterPriority
-
isAutoEnableKnownWeapons
boolean isAutoEnableKnownWeapons() -
setAutoEnableKnownWeapons
void setAutoEnableKnownWeapons(boolean autoEnableKnownWeapons) -
isAutoEnableKnownShips
boolean isAutoEnableKnownShips() -
setAutoEnableKnownShips
void setAutoEnableKnownShips(boolean autoEnableKnownShips) -
isAutoEnableKnownFighters
boolean isAutoEnableKnownFighters() -
setAutoEnableKnownFighters
void setAutoEnableKnownFighters(boolean autoEnableKnownFighters) -
isAutoEnableKnownHullmods
boolean isAutoEnableKnownHullmods() -
setAutoEnableKnownHullmods
void setAutoEnableKnownHullmods(boolean autoEnableKnownHullmods) -
addKnownHullMod
-
removeKnownHullMod
-
knowsHullMod
-
getKnownHullMods
-
addPriorityHullMod
-
removePriorityHullMod
-
isHullModPriority
-
getPriorityHullMods
-
getDoctrine
FactionDoctrineAPI getDoctrine() -
getVariantOverrides
-
getOverriddenHulls
LinkedHashSet<String> getOverriddenHulls()Hulls that are restricted to specific variants, defined in "variantOverrides" section of the .faction file.- Returns:
-
getHullFrequency
-
getAlwaysKnownShips
Hulls that will be in fleets even when the market's ship & weapons supply is from another faction. Generally faction-specific skins of base hulls known to all factions.- Returns:
-
addUseWhenImportingShip
-
removeUseWhenImportingShip
-
useWhenImportingShip
-
clearShipRoleCache
void clearShipRoleCache()Should be called after direct manipulation of the faction's known/always known/priority ship hulls. Automatically called by the add/removeXXXShip methods. -
getPersonalityPicker
WeightedRandomPicker<String> getPersonalityPicker() -
getProduction
FactionProductionAPI getProduction() -
getWeaponTimestamps
-
getFighterTimestamps
-
getShipTimestamps
-
setShipTimestampToNow
-
setWeaponTimestampToNow
-
setFighterTimestampToNow
-
isShipKnownAt
-
isWeaponKnownAt
-
isFighterKnownAt
-
getNumAvailableForRole
-
getDisplayNameHasOrHave
String getDisplayNameHasOrHave() -
getDisplayNameWithArticleWithoutArticle
String getDisplayNameWithArticleWithoutArticle() -
pickRandomShipName
-
getApproximateMaxFPPerFleet
Used to figure out how many fleet points raids/expeditions etc divide out for each "large" fleet. When going above 30 ships, fleets replace some smaller ships with larger ones. This FP limit is where that still produces fleets that aren't *too* top-heavy.- Returns:
-
getMusicMap
-
getBarSound
String getBarSound() -
getRepInt
-
pickVoice
-
getShipNamePrefix
String getShipNamePrefix() -
getWeaponSellFrequency
-
getFighterSellFrequency
-
getHullmodSellFrequency
-
getFactionSpec
FactionSpecAPI getFactionSpec() -
initSpecIfNeeded
void initSpecIfNeeded() -
getCustomJSONObject
-
getVariantWeightForRole
-
getSecondaryColorOverride
Color getSecondaryColorOverride() -
setSecondaryColorOverride
-
getSecondaryColorSegmentsOverride
int getSecondaryColorSegmentsOverride() -
setSecondaryColorSegmentsOverride
void setSecondaryColorSegmentsOverride(int secondaryColorSegmentsOverride) -
pickRandomShipName
-
getRestrictToVariants
LinkedHashSet<String> getRestrictToVariants()
-