Interface FactionAPI

All Superinterfaces:
HasMemory

public interface FactionAPI extends HasMemory
Author:
Alex Mosolov Copyright 2012 Fractal Softworks, LLC
  • Method Details

    • adjustRelationship

      void adjustRelationship(String id, float delta)
    • adjustRelationship

      boolean adjustRelationship(String id, float delta, RepLevel limit)
    • setRelationship

      void setRelationship(String id, float newValue)
    • setRelationship

      void setRelationship(String id, RepLevel level)
    • ensureAtBest

      boolean ensureAtBest(String id, RepLevel level)
    • ensureAtWorst

      boolean ensureAtWorst(String id, RepLevel level)
    • getRelationshipLevel

      RepLevel getRelationshipLevel(FactionAPI faction)
    • getRelationshipLevel

      RepLevel getRelationshipLevel(String id)
    • isAtWorst

      boolean isAtWorst(String id, RepLevel level)
    • isAtWorst

      boolean isAtWorst(FactionAPI other, RepLevel level)
    • isAtBest

      boolean isAtBest(String id, RepLevel level)
    • isAtBest

      boolean isAtBest(FactionAPI other, RepLevel level)
    • isHostileTo

      boolean isHostileTo(FactionAPI other)
    • isHostileTo

      boolean isHostileTo(String other)
    • getRelationship

      float getRelationship(String id)
    • 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

      List<String> getStockFleetIds()
    • getMemory

      MemoryAPI getMemory()
      Specified by:
      getMemory in interface HasMemory
    • pickShipAndAddToFleet

      float pickShipAndAddToFleet(String role, FactionAPI.ShipPickParams params, CampaignFleetAPI fleet)
      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

      String getFleetTypeName(String type)
    • getDisplayNameLong

      String getDisplayNameLong()
    • getDisplayNameLongWithArticle

      String getDisplayNameLongWithArticle()
    • getEntityNamePrefix

      String getEntityNamePrefix()
    • getRelColor

      Color getRelColor(String otherFactionId)
    • getIllegalCommodities

      Set<String> getIllegalCommodities()
    • isIllegal

      boolean isIllegal(String commodityId)
    • isIllegal

      boolean isIllegal(CargoStackAPI stack)
    • pickShip

    • pickShip

      List<ShipRolePick> pickShip(String role, FactionAPI.ShipPickParams params, ShipFilter filter, Random random)
    • makeCommodityIllegal

      void makeCommodityIllegal(String commodityId)
    • makeCommodityLegal

      void makeCommodityLegal(String commodityId)
    • getTariffFraction

      float getTariffFraction()
    • getTollFraction

      float getTollFraction()
    • getFineFraction

      float getFineFraction()
    • getInternalCommsChannel

      String getInternalCommsChannel()
    • createRandomPerson

      PersonAPI createRandomPerson()
    • createRandomPerson

      PersonAPI createRandomPerson(FullName.Gender gender)
    • getLogo

      String getLogo()
    • getCustom

      org.json.JSONObject getCustom()
    • getMemoryWithoutUpdate

      MemoryAPI getMemoryWithoutUpdate()
      Specified by:
      getMemoryWithoutUpdate in interface HasMemory
    • getRelColor

      Color getRelColor(RepLevel level)
    • getRelToPlayer

      RelationshipAPI getRelToPlayer()
    • getRank

      String getRank(String id)
    • getPost

      String getPost(String id)
    • getDisplayNameIsOrAre

      String getDisplayNameIsOrAre()
    • pickPersonality

      String pickPersonality()
    • getCustomBoolean

      boolean getCustomBoolean(String key)
    • getCustomString

      String getCustomString(String key)
    • 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

      Set<String> getVariantsForRole(String roleId)
    • createRandomPerson

      PersonAPI createRandomPerson(FullName.Gender gender, Random random)
    • createRandomPerson

      PersonAPI createRandomPerson(Random random)
    • getCustomFloat

      float getCustomFloat(String key)
    • getSecondarySegments

      int getSecondarySegments()
    • getDisplayNameOverride

      String getDisplayNameOverride()
    • setDisplayNameOverride

      void setDisplayNameOverride(String displayNameOverride)
    • getDisplayNameWithArticleOverride

      String getDisplayNameWithArticleOverride()
    • setDisplayNameWithArticleOverride

      void setDisplayNameWithArticleOverride(String displayNameWithArticleOverride)
    • getDisplayIsOrAreOverride

      String getDisplayIsOrAreOverride()
    • setDisplayIsOrAreOverride

      void setDisplayIsOrAreOverride(String displayIsOrAreOverride)
    • getShipNamePrefixOverride

      String getShipNamePrefixOverride()
    • setShipNamePrefixOverride

      void setShipNamePrefixOverride(String shipNamePrefixOverride)
    • getPersonNamePrefixAOrAnOverride

      String getPersonNamePrefixAOrAnOverride()
    • setPersonNamePrefixAOrAnOverride

      void setPersonNamePrefixAOrAnOverride(String personNamePrefixAOrAnOverride)
    • getFactionLogoOverride

      String getFactionLogoOverride()
    • setFactionLogoOverride

      void setFactionLogoOverride(String factionLogoOverride)
    • getFactionCrestOverride

      String getFactionCrestOverride()
    • setFactionCrestOverride

      void setFactionCrestOverride(String factionCrestOverride)
    • getPortraits

    • getKnownShips

      Set<String> getKnownShips()
    • addKnownShip

      void addKnownShip(String hullId, boolean setTimestamp)
    • removeKnownShip

      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. 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

      Set<String> getKnownWeapons()
    • addKnownWeapon

      void addKnownWeapon(String weaponId, boolean setTimestamp)
    • removeKnownWeapon

      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. 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

      Set<String> getKnownFighters()
    • addKnownFighter

      void addKnownFighter(String wingId, boolean setTimestamp)
    • removeKnownFighter

      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. 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

      Set<String> getKnownIndustries()
    • addKnownIndustry

      void addKnownIndustry(String industryId)
    • removeKnownIndustry

      void removeKnownIndustry(String industryId)
    • knowsShip

      boolean knowsShip(String hullId)
    • knowsWeapon

      boolean knowsWeapon(String weaponId)
    • knowsFighter

      boolean knowsFighter(String wingId)
    • knowsIndustry

      boolean knowsIndustry(String industryId)
    • getPriorityShips

      Set<String> getPriorityShips()
    • addPriorityShip

      void addPriorityShip(String hullId)
    • removePriorityShip

      void removePriorityShip(String hullId)
    • isShipPriority

      boolean isShipPriority(String hullId)
    • getPriorityWeapons

      Set<String> getPriorityWeapons()
    • addPriorityWeapon

      void addPriorityWeapon(String weaponId)
    • removePriorityWeapon

      void removePriorityWeapon(String weaponId)
    • isWeaponPriority

      boolean isWeaponPriority(String weaponId)
    • getPriorityFighters

      Set<String> getPriorityFighters()
    • addPriorityFighter

      void addPriorityFighter(String wingId)
    • removePriorityFighter

      void removePriorityFighter(String wingId)
    • isFighterPriority

      boolean isFighterPriority(String wingId)
    • 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

      void addKnownHullMod(String modId)
    • removeKnownHullMod

      void removeKnownHullMod(String modId)
    • knowsHullMod

      boolean knowsHullMod(String modId)
    • getKnownHullMods

      Set<String> getKnownHullMods()
    • addPriorityHullMod

      void addPriorityHullMod(String modId)
    • removePriorityHullMod

      void removePriorityHullMod(String modId)
    • isHullModPriority

      boolean isHullModPriority(String modId)
    • getPriorityHullMods

      Set<String> getPriorityHullMods()
    • getDoctrine

      FactionDoctrineAPI getDoctrine()
    • getVariantOverrides

      Map<String,Float> getVariantOverrides()
    • getOverriddenHulls

      LinkedHashSet<String> getOverriddenHulls()
      Hulls that are restricted to specific variants, defined in "variantOverrides" section of the .faction file.
      Returns:
    • getHullFrequency

      Map<String,Float> getHullFrequency()
    • getAlwaysKnownShips

      Set<String> 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

      void addUseWhenImportingShip(String hullId)
    • removeUseWhenImportingShip

      void removeUseWhenImportingShip(String hullId)
    • useWhenImportingShip

      boolean useWhenImportingShip(String hullId)
    • 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

      Map<String,Long> getWeaponTimestamps()
    • getFighterTimestamps

      Map<String,Long> getFighterTimestamps()
    • getShipTimestamps

      Map<String,Long> getShipTimestamps()
    • setShipTimestampToNow

      void setShipTimestampToNow(String hullId)
    • setWeaponTimestampToNow

      void setWeaponTimestampToNow(String weaponId)
    • setFighterTimestampToNow

      void setFighterTimestampToNow(String wingId)
    • isShipKnownAt

      boolean isShipKnownAt(String hullId, Long timestamp)
    • isWeaponKnownAt

      boolean isWeaponKnownAt(String weaponId, Long timestamp)
    • isFighterKnownAt

      boolean isFighterKnownAt(String wing, Long timestamp)
    • getNumAvailableForRole

      int getNumAvailableForRole(String roleId, FactionAPI.ShipPickMode mode)
    • getDisplayNameHasOrHave

      String getDisplayNameHasOrHave()
    • getDisplayNameWithArticleWithoutArticle

      String getDisplayNameWithArticleWithoutArticle()
    • pickRandomShipName

      String pickRandomShipName(Random random)
    • getApproximateMaxFPPerFleet

      float getApproximateMaxFPPerFleet(FactionAPI.ShipPickMode mode)
      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

      Map<String,String> getMusicMap()
    • getBarSound

      String getBarSound()
    • getRepInt

      int getRepInt(String id)
    • pickVoice

      String pickVoice(PersonImportance importance, Random random)
    • getShipNamePrefix

      String getShipNamePrefix()
    • getWeaponSellFrequency

      Map<String,Float> getWeaponSellFrequency()
    • getFighterSellFrequency

      Map<String,Float> getFighterSellFrequency()
    • getHullmodSellFrequency

      Map<String,Float> getHullmodSellFrequency()
    • getFactionSpec

      FactionSpecAPI getFactionSpec()
    • initSpecIfNeeded

      void initSpecIfNeeded()
    • getCustomJSONObject

      org.json.JSONObject getCustomJSONObject(String key)
    • getVariantWeightForRole

      float getVariantWeightForRole(String roleId, FactionAPI.ShipPickMode mode)
    • getSecondaryColorOverride

      Color getSecondaryColorOverride()
    • setSecondaryColorOverride

      void setSecondaryColorOverride(Color secondaryOverride)
    • getSecondaryColorSegmentsOverride

      int getSecondaryColorSegmentsOverride()
    • setSecondaryColorSegmentsOverride

      void setSecondaryColorSegmentsOverride(int secondaryColorSegmentsOverride)
    • pickRandomShipName

      String pickRandomShipName(String prefix)
    • getRestrictToVariants

      LinkedHashSet<String> getRestrictToVariants()