Class Misc

java.lang.Object
com.fs.starfarer.api.util.Misc

public class Misc extends Object
  • Field Details

    • CAN_SMOD_BUILT_IN

      public static boolean CAN_SMOD_BUILT_IN
    • SIR

      public static String SIR
    • MAAM

      public static String MAAM
    • CAPTAIN

      public static String CAPTAIN
    • FLUX_PER_CAPACITOR

      public static float FLUX_PER_CAPACITOR
    • DISSIPATION_PER_VENT

      public static float DISSIPATION_PER_VENT
    • MOUNT_BALLISTIC

      public static Color MOUNT_BALLISTIC
    • MOUNT_MISSILE

      public static Color MOUNT_MISSILE
    • MOUNT_ENERGY

      public static Color MOUNT_ENERGY
    • MOUNT_UNIVERSAL

      public static Color MOUNT_UNIVERSAL
    • MOUNT_HYBRID

      public static Color MOUNT_HYBRID
    • MOUNT_SYNERGY

      public static Color MOUNT_SYNERGY
    • MOUNT_COMPOSITE

      public static Color MOUNT_COMPOSITE
    • OWNER_NEUTRAL

      public static final int OWNER_NEUTRAL
      See Also:
    • OWNER_PLAYER

      public static final int OWNER_PLAYER
      See Also:
    • FLOATY_EMP_DAMAGE_COLOR

      public static Color FLOATY_EMP_DAMAGE_COLOR
    • FLOATY_ARMOR_DAMAGE_COLOR

      public static Color FLOATY_ARMOR_DAMAGE_COLOR
    • FLOATY_SHIELD_DAMAGE_COLOR

      public static Color FLOATY_SHIELD_DAMAGE_COLOR
    • FLOATY_HULL_DAMAGE_COLOR

      public static Color FLOATY_HULL_DAMAGE_COLOR
    • GATE_FUEL_COST_MULT

      public static float GATE_FUEL_COST_MULT
    • MAX_COLONY_SIZE

      public static int MAX_COLONY_SIZE
    • OVER_MAX_INDUSTRIES_PENALTY

      public static int OVER_MAX_INDUSTRIES_PENALTY
    • FP_TO_BOMBARD_COST_APPROX_MULT

      public static float FP_TO_BOMBARD_COST_APPROX_MULT
    • FP_TO_GROUND_RAID_STR_APPROX_MULT

      public static float FP_TO_GROUND_RAID_STR_APPROX_MULT
    • UNKNOWN

      public static String UNKNOWN
    • UNSURVEYED

      public static String UNSURVEYED
    • PRELIMINARY

      public static String PRELIMINARY
    • FULL

      public static String FULL
    • STORY

      public static String STORY
      Name of "story points".
    • MAX_OFFICER_LEVEL

      public static float MAX_OFFICER_LEVEL
    • random

      public static Random random
    • ZERO

      public static final org.lwjgl.util.vector.Vector2f ZERO
    • DEG_PER_RAD

      public static float DEG_PER_RAD
    • RAD_PER_DEG

      public static float RAD_PER_DEG
    • format

      protected static DecimalFormat format
    • zeroColor

      public static Color zeroColor
    • ASTEROID_SOURCE

      public static final String ASTEROID_SOURCE
      See Also:
    • cleanerCache

      public static Map<Class,Method> cleanerCache
    • cleanCache

      public static Map<Class,Method> cleanCache
    • D_HULL_SUFFIX

      public static final String D_HULL_SUFFIX
      See Also:
    • FLEET_RETURNING_TO_DESPAWN

      public static String FLEET_RETURNING_TO_DESPAWN
    • variantToFPCache

      public static Map<String,Integer> variantToFPCache
    • variantToHullCache

      public static Map<String,String> variantToHullCache
    • MIN_TERRAIN_EFFECT_MULT

      public static float MIN_TERRAIN_EFFECT_MULT
    • BURN_PENALTY_MULT

      public static float BURN_PENALTY_MULT
    • SAME_FACTION_BONUS

      public static float SAME_FACTION_BONUS
    • PER_UNIT_SHIPPING

      public static float PER_UNIT_SHIPPING
    • musicPlugin

      public static MusicPlayerPlugin musicPlugin
    • DANGER_LEVEL_OVERRIDE

      public static String DANGER_LEVEL_OVERRIDE
    • MENTORED

      public static String MENTORED
    • IS_MERCENARY

      public static final String IS_MERCENARY
      See Also:
    • MERCENARY_HIRE_TIMESTAMP

      public static final String MERCENARY_HIRE_TIMESTAMP
      See Also:
    • CAPTAIN_UNREMOVABLE

      public static final String CAPTAIN_UNREMOVABLE
      See Also:
    • KEEP_CAPTAIN_ON_SHIP_RECOVERY

      public static final String KEEP_CAPTAIN_ON_SHIP_RECOVERY
      See Also:
    • RECOVERY_TAGS_KEY

      public static String RECOVERY_TAGS_KEY
    • MAX_PERMA_MODS

      public static int MAX_PERMA_MODS
    • SNEAK_BURN_MULT

      public static float SNEAK_BURN_MULT
    • LAST_RAIDED_AT

      public static String LAST_RAIDED_AT
    • DEFEAT_TRIGGERS

      public static String DEFEAT_TRIGGERS
    • canCheckVramNVIDIA

      protected static Boolean canCheckVramNVIDIA
    • IMPACT_VOLUME_MULT

      public static float IMPACT_VOLUME_MULT
    • FRINGE_THRESHOLD

      public static float FRINGE_THRESHOLD
  • Constructor Details

    • Misc

      public Misc()
  • Method Details

    • tokenize

      public static List<Misc.Token> tokenize(String string)
    • ucFirst

      public static String ucFirst(String str)
    • lcFirst

      public static String lcFirst(String str)
    • replaceTokensFromMemory

      public static String replaceTokensFromMemory(String text, Map<String,MemoryAPI> memoryMap)
    • getDistance

      public static float getDistance(SectorEntityToken from, SectorEntityToken to)
    • getDistanceLY

      public static float getDistanceLY(SectorEntityToken from, SectorEntityToken to)
    • getDistance

      public static float getDistance(org.lwjgl.util.vector.Vector2f v1, org.lwjgl.util.vector.Vector2f v2)
    • getDistanceSq

      public static float getDistanceSq(org.lwjgl.util.vector.Vector2f v1, org.lwjgl.util.vector.Vector2f v2)
    • getDistance

      public static float getDistance(float x1, float y1, float x2, float y2)
    • getDistanceToPlayerLY

      public static float getDistanceToPlayerLY(org.lwjgl.util.vector.Vector2f locInHyper)
    • getDistanceToPlayerLY

      public static float getDistanceToPlayerLY(SectorEntityToken other)
    • getDistanceLY

      public static float getDistanceLY(org.lwjgl.util.vector.Vector2f v1, org.lwjgl.util.vector.Vector2f v2)
    • getRounded

      public static float getRounded(float in)
    • getRoundedValue

      public static String getRoundedValue(float value)
    • getRoundedValueFloat

      public static float getRoundedValueFloat(float value)
    • getRoundedValueMaxOneAfterDecimal

      public static String getRoundedValueMaxOneAfterDecimal(float value)
    • getRoundedValueOneAfterDecimalIfNotWhole

      public static String getRoundedValueOneAfterDecimalIfNotWhole(float value)
    • logOfBase

      public static float logOfBase(float base, float num)
    • getPointAtRadius

      public static org.lwjgl.util.vector.Vector2f getPointAtRadius(org.lwjgl.util.vector.Vector2f from, float r)
    • getPointAtRadius

      public static org.lwjgl.util.vector.Vector2f getPointAtRadius(org.lwjgl.util.vector.Vector2f from, float r, Random random)
    • getPointWithinRadius

      public static org.lwjgl.util.vector.Vector2f getPointWithinRadius(org.lwjgl.util.vector.Vector2f from, float r)
    • getPointWithinRadius

      public static org.lwjgl.util.vector.Vector2f getPointWithinRadius(org.lwjgl.util.vector.Vector2f from, float r, Random random)
    • getPointWithinRadiusUniform

      public static org.lwjgl.util.vector.Vector2f getPointWithinRadiusUniform(org.lwjgl.util.vector.Vector2f from, float r, Random random)
    • getPointWithinRadiusUniform

      public static org.lwjgl.util.vector.Vector2f getPointWithinRadiusUniform(org.lwjgl.util.vector.Vector2f from, float minR, float maxR, Random random)
    • getSnapshotFPLost

      public static float getSnapshotFPLost(CampaignFleetAPI fleet)
    • getSnapshotMembersLost

      public static List<FleetMemberAPI> getSnapshotMembersLost(CampaignFleetAPI fleet)
    • startEvent

      public static CampaignEventPlugin startEvent(CampaignEventTarget eventTarget, String eventId, Object params)
    • getStoryDarkBrighterColor

      public static Color getStoryDarkBrighterColor()
    • getStoryDarkColor

      public static Color getStoryDarkColor()
    • getStoryBrightColor

      public static Color getStoryBrightColor()
    • getStoryOptionColor

      public static Color getStoryOptionColor()
    • getHighlightedOptionColor

      public static Color getHighlightedOptionColor()
    • getHighlightColor

      public static Color getHighlightColor()
    • getDarkHighlightColor

      public static Color getDarkHighlightColor()
    • getTooltipTitleAndLightHighlightColor

      public static Color getTooltipTitleAndLightHighlightColor()
    • getNegativeHighlightColor

      public static Color getNegativeHighlightColor()
    • getBallisticMountColor

      public static Color getBallisticMountColor()
    • getMissileMountColor

      public static Color getMissileMountColor()
    • getEnergyMountColor

      public static Color getEnergyMountColor()
    • getPositiveHighlightColor

      public static Color getPositiveHighlightColor()
    • getGrayColor

      public static Color getGrayColor()
    • getBrightPlayerColor

      public static Color getBrightPlayerColor()
    • getBasePlayerColor

      public static Color getBasePlayerColor()
    • getDarkPlayerColor

      public static Color getDarkPlayerColor()
    • getTextColor

      public static Color getTextColor()
    • getButtonTextColor

      public static Color getButtonTextColor()
    • getUnitsPerLightYear

      public static float getUnitsPerLightYear()
    • getProfitMarginFlat

      public static float getProfitMarginFlat()
    • getProfitMarginMult

      public static float getProfitMarginMult()
    • getEconomyInterval

      public static float getEconomyInterval()
    • getGenericRollingAverageFactor

      public static float getGenericRollingAverageFactor()
    • createEconIntervalTracker

      public static IntervalUtil createEconIntervalTracker()
    • getAndJoined

      public static String getAndJoined(List<String> strings)
    • getAndJoined

      public static String getAndJoined(String... strings)
    • getJoined

      public static String getJoined(String joiner, List<String> strings)
    • getJoined

      public static String getJoined(String joiner, String... strings)
    • findNearbyFleets

      public static List<CampaignFleetAPI> findNearbyFleets(SectorEntityToken from, float maxRange, Misc.FleetFilter filter)
    • getFleetsInOrNearSystem

      public static List<CampaignFleetAPI> getFleetsInOrNearSystem(StarSystemAPI system)
    • getMarketsInLocation

      public static List<MarketAPI> getMarketsInLocation(LocationAPI location, String factionId)
    • getBiggestMarketInLocation

      public static MarketAPI getBiggestMarketInLocation(LocationAPI location)
    • getMarketsInLocation

      public static List<MarketAPI> getMarketsInLocation(LocationAPI location)
    • getFactionMarkets

      public static List<MarketAPI> getFactionMarkets(FactionAPI faction, String econGroup)
    • getPlayerMarkets

      public static List<MarketAPI> getPlayerMarkets(boolean includeNonPlayerFaction)
    • getPlayerSystems

      public static List<StarSystemAPI> getPlayerSystems(boolean includeNonPlayerFaction)
    • getSystemsWithPlayerColonies

      public static List<StarSystemAPI> getSystemsWithPlayerColonies(boolean includeNonPlayerFaction)
    • getFactionMarkets

      public static List<MarketAPI> getFactionMarkets(String factionId)
    • getFactionMarkets

      public static List<MarketAPI> getFactionMarkets(FactionAPI faction)
    • getNearbyMarkets

      public static List<MarketAPI> getNearbyMarkets(org.lwjgl.util.vector.Vector2f locInHyper, float distLY)
    • getNumHostileMarkets

      public static int getNumHostileMarkets(FactionAPI faction, SectorEntityToken from, float maxDist)
    • getNearbyStarSystems

      public static List<StarSystemAPI> getNearbyStarSystems(SectorEntityToken token, float maxRangeLY)
    • getNearbyStarSystem

      public static StarSystemAPI getNearbyStarSystem(SectorEntityToken token, float maxRangeLY)
    • getNearestStarSystem

      public static StarSystemAPI getNearestStarSystem(SectorEntityToken token)
    • getNearbyStarSystem

      public static StarSystemAPI getNearbyStarSystem(SectorEntityToken token)
    • showRuleDialog

      public static boolean showRuleDialog(SectorEntityToken entity, String initialTrigger)
    • getAngleInDegreesStrict

      public static float getAngleInDegreesStrict(org.lwjgl.util.vector.Vector2f v)
    • getAngleInDegreesStrict

      public static float getAngleInDegreesStrict(org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to)
    • getAngleInDegrees

      public static float getAngleInDegrees(org.lwjgl.util.vector.Vector2f v)
    • getAngleInDegrees

      public static float getAngleInDegrees(org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to)
    • normalise

      public static org.lwjgl.util.vector.Vector2f normalise(org.lwjgl.util.vector.Vector2f v)
    • normalizeAngle

      public static float normalizeAngle(float angleDeg)
    • findNearestLocalMarket

      public static MarketAPI findNearestLocalMarket(SectorEntityToken token, float maxDist, BaseEventPlugin.MarketFilter filter)
    • findNearbyLocalMarkets

      public static List<MarketAPI> findNearbyLocalMarkets(SectorEntityToken token, float maxDist, BaseEventPlugin.MarketFilter filter)
    • findNearestLocalMarketWithSameFaction

      public static MarketAPI findNearestLocalMarketWithSameFaction(SectorEntityToken token, float maxDist)
    • getUnitVector

      public static org.lwjgl.util.vector.Vector2f getUnitVector(org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to)
    • getUnitVectorAtDegreeAngle

      public static org.lwjgl.util.vector.Vector2f getUnitVectorAtDegreeAngle(float degrees)
    • rotateAroundOrigin

      public static org.lwjgl.util.vector.Vector2f rotateAroundOrigin(org.lwjgl.util.vector.Vector2f v, float angle)
    • rotateAroundOrigin

      public static org.lwjgl.util.vector.Vector2f rotateAroundOrigin(org.lwjgl.util.vector.Vector2f v, float angle, org.lwjgl.util.vector.Vector2f origin)
    • isBetween

      public static boolean isBetween(float one, float two, float check)
      Angles.
      Parameters:
      one -
      two -
      check -
      Returns:
    • getShieldedCargoFraction

      public static float getShieldedCargoFraction(CampaignFleetAPI fleet)
    • interpolateColor

      public static Color interpolateColor(Color from, Color to, float progress)
    • genColor

      public static Color genColor(Color min, Color max, Random random)
    • interpolateVector

      public static org.lwjgl.util.vector.Vector2f interpolateVector(org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to, float progress)
    • interpolate

      public static float interpolate(float from, float to, float progress)
    • scaleColor

      public static Color scaleColor(Color color, float factor)
    • scaleColorOnly

      public static Color scaleColorOnly(Color color, float factor)
    • scaleAlpha

      public static Color scaleAlpha(Color color, float factor)
    • setAlpha

      public static Color setAlpha(Color color, int alpha)
    • getSizeNum

      public static float getSizeNum(ShipAPI.HullSize size)
    • unsetAll

      public static void unsetAll(String prefix, String memKey, MemoryAPI memory)
    • getTargetingRadius

      public static float getTargetingRadius(org.lwjgl.util.vector.Vector2f from, CombatEntityAPI target, boolean considerShield)
    • getClosingSpeed

      public static float getClosingSpeed(org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f v1, org.lwjgl.util.vector.Vector2f v2)
    • getFormat

      public static DecimalFormat getFormat()
    • getWithDGS

      public static String getWithDGS(float num)
      DGS = digit group separator, i.e.: 1000000 -> 1,000,000
      Parameters:
      num -
      Returns:
    • getDGSCredits

      public static String getDGSCredits(float num)
      DGS = digit group separator, i.e.: 1000000 -> 1,000,000
      Parameters:
      num -
      Returns:
    • getInterceptPointBasic

      public static org.lwjgl.util.vector.Vector2f getInterceptPointBasic(SectorEntityToken from, SectorEntityToken to)
    • setFlagWithReason

      public static boolean setFlagWithReason(MemoryAPI memory, String flagKey, String reason, boolean value, float expire)
      A flag can be set to true for several "reasons". As long as it hasn't been set back to false for all of the "reasons", it will remain set to true. For example, a fleet may be hostile because it's responding to comm relay interference, and because the player is running with the transponder off. Until both are resolved, the "hostile" flag will remain set to true. Note: a flag can not be "set" to false. If it's set to false for all the current reasons, the key is removed from memory. Returns whether the flag is still set after this method does its work.
      Parameters:
      memory -
      flagKey -
      reason -
      value -
      Returns:
    • flagHasReason

      public static boolean flagHasReason(MemoryAPI memory, String flagKey, String reason)
    • clearFlag

      public static void clearFlag(MemoryAPI memory, String flagKey)
    • makeLowRepImpact

      public static void makeLowRepImpact(CampaignFleetAPI fleet, String reason)
    • makeNoRepImpact

      public static void makeNoRepImpact(CampaignFleetAPI fleet, String reason)
    • makeHostile

      public static void makeHostile(CampaignFleetAPI fleet)
    • makeHostileToPlayerTradeFleets

      public static void makeHostileToPlayerTradeFleets(CampaignFleetAPI fleet)
    • makeHostileToAllTradeFleets

      public static void makeHostileToAllTradeFleets(CampaignFleetAPI fleet)
    • makeNonHostileToFaction

      public static void makeNonHostileToFaction(CampaignFleetAPI fleet, String factionId, float dur)
    • makeNonHostileToFaction

      public static void makeNonHostileToFaction(CampaignFleetAPI fleet, String factionId, boolean nonHostile, float dur)
    • makeHostileToFaction

      public static void makeHostileToFaction(CampaignFleetAPI fleet, String factionId, float dur)
    • makeHostileToFaction

      public static void makeHostileToFaction(CampaignFleetAPI fleet, String factionId, boolean hostile, float dur)
    • isFleetMadeHostileToFaction

      public static boolean isFleetMadeHostileToFaction(CampaignFleetAPI fleet, FactionAPI faction)
    • isFleetMadeHostileToFaction

      public static boolean isFleetMadeHostileToFaction(CampaignFleetAPI fleet, String factionId)
    • makeNotLowRepImpact

      public static void makeNotLowRepImpact(CampaignFleetAPI fleet, String reason)
    • getAgoStringForTimestamp

      public static String getAgoStringForTimestamp(long timestamp)
    • getDetailedAgoString

      public static String getDetailedAgoString(long timestamp)
    • getAtLeastStringForDays

      public static String getAtLeastStringForDays(int days)
    • getStringForDays

      public static String getStringForDays(int days)
    • getBurnLevelForSpeed

      public static float getBurnLevelForSpeed(float speed)
    • getFractionalBurnLevelForSpeed

      public static float getFractionalBurnLevelForSpeed(float speed)
    • getSpeedForBurnLevel

      public static float getSpeedForBurnLevel(float burnLevel)
    • getFuelPerDay

      public static float getFuelPerDay(CampaignFleetAPI fleet, float burnLevel)
    • getFuelPerDayAtSpeed

      public static float getFuelPerDayAtSpeed(CampaignFleetAPI fleet, float speed)
    • getLYPerDayAtBurn

      public static float getLYPerDayAtBurn(CampaignFleetAPI fleet, float burnLevel)
    • getLYPerDayAtSpeed

      public static float getLYPerDayAtSpeed(CampaignFleetAPI fleet, float speed)
    • getDistance

      public static float getDistance(org.lwjgl.util.vector.Vector3f v1, org.lwjgl.util.vector.Vector3f v2)
    • getAngleDiff

      public static float getAngleDiff(float from, float to)
    • isInArc

      public static boolean isInArc(float direction, float arc, org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to)
    • isInArc

      public static boolean isInArc(float direction, float arc, float test)
    • addNebulaFromPNG

      public static SectorEntityToken addNebulaFromPNG(String image, float centerX, float centerY, LocationAPI location, String category, String key, int tilesWide, int tilesHigh, StarAge age)
    • addNebulaFromPNG

      public static SectorEntityToken addNebulaFromPNG(String image, float centerX, float centerY, LocationAPI location, String category, String key, int tilesWide, int tilesHigh, String terrainType, StarAge age)
    • renderQuad

      public static void renderQuad(float x, float y, float width, float height, Color color, float alphaMult)
    • distanceFromLineToPoint

      public static float distanceFromLineToPoint(org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f p3)
      Shortest distance from line to a point.
      Parameters:
      p1 - line1
      p2 - line2
      p3 - point
      Returns:
    • closestPointOnLineToPoint

      public static org.lwjgl.util.vector.Vector2f closestPointOnLineToPoint(org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f p3)
    • closestPointOnSegmentToPoint

      public static org.lwjgl.util.vector.Vector2f closestPointOnSegmentToPoint(org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f p3)
    • isPointInBounds

      public static boolean isPointInBounds(org.lwjgl.util.vector.Vector2f p1, List<org.lwjgl.util.vector.Vector2f> bounds)
    • intersectSegments

      public static org.lwjgl.util.vector.Vector2f intersectSegments(org.lwjgl.util.vector.Vector2f a1, org.lwjgl.util.vector.Vector2f a2, org.lwjgl.util.vector.Vector2f b1, org.lwjgl.util.vector.Vector2f b2)
    • intersectLines

      public static org.lwjgl.util.vector.Vector2f intersectLines(org.lwjgl.util.vector.Vector2f a1, org.lwjgl.util.vector.Vector2f a2, org.lwjgl.util.vector.Vector2f b1, org.lwjgl.util.vector.Vector2f b2)
    • intersectSegmentAndCircle

      public static org.lwjgl.util.vector.Vector2f intersectSegmentAndCircle(org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f p3, float r)
      Going from p1 to p2. Returns the closer intersection.
      Parameters:
      p1 -
      p2 -
      p3 -
      r -
      Returns:
    • areSegmentsCoincident

      public static boolean areSegmentsCoincident(org.lwjgl.util.vector.Vector2f a1, org.lwjgl.util.vector.Vector2f a2, org.lwjgl.util.vector.Vector2f b1, org.lwjgl.util.vector.Vector2f b2)
    • getPerp

      public static org.lwjgl.util.vector.Vector2f getPerp(org.lwjgl.util.vector.Vector2f v)
    • getClosestTurnDirection

      public static float getClosestTurnDirection(float facing, float desired)
    • getClosestTurnDirection

      public static float getClosestTurnDirection(float facing, org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to)
    • getClosestTurnDirection

      public static float getClosestTurnDirection(org.lwjgl.util.vector.Vector2f one, org.lwjgl.util.vector.Vector2f two)
    • getDiff

      public static org.lwjgl.util.vector.Vector2f getDiff(org.lwjgl.util.vector.Vector2f v1, org.lwjgl.util.vector.Vector2f v2)
    • getSourceMarket

      public static MarketAPI getSourceMarket(CampaignFleetAPI fleet)
    • getSourceEntity

      public static SectorEntityToken getSourceEntity(CampaignFleetAPI fleet)
    • getSpawnChanceMult

      public static float getSpawnChanceMult(org.lwjgl.util.vector.Vector2f locInHyper)
    • pickHyperLocationNotNearPlayer

      public static org.lwjgl.util.vector.Vector2f pickHyperLocationNotNearPlayer(org.lwjgl.util.vector.Vector2f from, float minDist)
    • pickLocationNotNearPlayer

      public static org.lwjgl.util.vector.Vector2f pickLocationNotNearPlayer(LocationAPI where, org.lwjgl.util.vector.Vector2f from, float minDist)
    • getBattleJoinRange

      public static float getBattleJoinRange()
    • wiggle

      public static void wiggle(org.lwjgl.util.vector.Vector2f v, float max)
    • isPlayerOrCombinedPlayerPrimary

      public static boolean isPlayerOrCombinedPlayerPrimary(CampaignFleetAPI fleet)
    • isPlayerOrCombinedContainingPlayer

      public static boolean isPlayerOrCombinedContainingPlayer(CampaignFleetAPI fleet)
    • getAsteroidSource

      public static AsteroidSource getAsteroidSource(SectorEntityToken asteroid)
    • setAsteroidSource

      public static void setAsteroidSource(SectorEntityToken asteroid, AsteroidSource source)
    • clearAsteroidSource

      public static void clearAsteroidSource(SectorEntityToken asteroid)
    • isFastStart

      public static boolean isFastStart()
    • isFastStartExplorer

      public static boolean isFastStartExplorer()
    • isFastStartMerc

      public static boolean isFastStartMerc()
    • isEasy

      public static boolean isEasy()
    • isNormal

      public static boolean isNormal()
    • getHyperspaceTerrain

      public static CampaignTerrainAPI getHyperspaceTerrain()
    • getHyperspaceTerrainPlugin

      public static HyperspaceTerrainPlugin getHyperspaceTerrainPlugin()
    • isInAbyss

      public static boolean isInAbyss(org.lwjgl.util.vector.Vector2f loc)
    • isInAbyss

      public static boolean isInAbyss(SectorEntityToken entity)
    • getAbyssalDepth

      public static float getAbyssalDepth(org.lwjgl.util.vector.Vector2f loc)
    • getAbyssalDepth

      public static float getAbyssalDepth(org.lwjgl.util.vector.Vector2f loc, boolean uncapped)
    • getAbyssalSystems

      public static List<StarSystemAPI> getAbyssalSystems()
    • getAbyssalDepthOfPlayer

      public static float getAbyssalDepthOfPlayer()
    • getAbyssalDepthOfPlayer

      public static float getAbyssalDepthOfPlayer(boolean uncapped)
    • getAbyssalDepth

      public static float getAbyssalDepth(SectorEntityToken entity)
    • getAbyssalDepth

      public static float getAbyssalDepth(SectorEntityToken entity, boolean uncapped)
    • isInsideBlackHole

      public static boolean isInsideBlackHole(CampaignFleetAPI fleet, boolean includeEventHorizon)
    • getCoronaFor

      public static StarCoronaTerrainPlugin getCoronaFor(PlanetAPI star)
    • getMagneticFieldFor

      public static MagneticFieldTerrainPlugin getMagneticFieldFor(PlanetAPI planet)
    • getPulsarFor

      public static PulsarBeamTerrainPlugin getPulsarFor(PlanetAPI star)
    • hasPulsar

      public static boolean hasPulsar(StarSystemAPI system)
    • getCommissionFactionId

      public static String getCommissionFactionId()
    • getCommissionFaction

      public static FactionAPI getCommissionFaction()
    • getCommissionIntel

      public static FactionCommissionIntel getCommissionIntel()
    • caresAboutPlayerTransponder

      public static boolean caresAboutPlayerTransponder(CampaignFleetAPI fleet)
    • findClosestShipEnemyOf

      public static ShipAPI findClosestShipEnemyOf(ShipAPI ship, org.lwjgl.util.vector.Vector2f locFromForSorting, ShipAPI.HullSize smallestToNote, float maxRange, boolean considerShipRadius)
    • findClosestShipEnemyOf

      public static ShipAPI findClosestShipEnemyOf(ShipAPI ship, org.lwjgl.util.vector.Vector2f locFromForSorting, ShipAPI.HullSize smallestToNote, float maxRange, boolean considerShipRadius, Misc.FindShipFilter filter)
    • findClosestShipTo

      public static ShipAPI findClosestShipTo(ShipAPI ship, org.lwjgl.util.vector.Vector2f locFromForSorting, ShipAPI.HullSize smallestToNote, float maxRange, boolean considerShipRadius, boolean allowHulks, Misc.FindShipFilter filter)
    • mapToEnum

      public static <T extends Enum<T>> T mapToEnum(org.json.JSONObject json, String key, Class<T> enumType, T defaultOption) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • mapToEnum

      public static <T extends Enum<T>> T mapToEnum(org.json.JSONObject json, String key, Class<T> enumType, T defaultOption, boolean required) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getColor

      public static Color getColor(org.json.JSONObject json, String key) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • optColor

      public static Color optColor(org.json.JSONObject json, String key, Color defaultValue) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getVector

      public static org.lwjgl.util.vector.Vector2f getVector(org.json.JSONObject json, String arrayKey, org.lwjgl.util.vector.Vector2f def) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getVector

      public static org.lwjgl.util.vector.Vector2f getVector(org.json.JSONObject json, String arrayKey) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getVector3f

      public static org.lwjgl.util.vector.Vector3f getVector3f(org.json.JSONObject json, String arrayKey) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • optVector

      public static org.lwjgl.util.vector.Vector2f optVector(org.json.JSONObject json, String arrayKey)
    • optVector3f

      public static org.lwjgl.util.vector.Vector3f optVector3f(org.json.JSONObject json, String arrayKey) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • getVector

      public static org.lwjgl.util.vector.Vector2f getVector(org.json.JSONObject json, String arrayKey, int index) throws org.json.JSONException
      Throws:
      org.json.JSONException
    • normalizeNoise

      public static void normalizeNoise(float[][] noise)
    • initNoise

      public static float[][] initNoise(Random random, int w, int h, float spikes)
    • genFractalNoise

      public static void genFractalNoise(Random random, float[][] noise, int x1, int y1, int x2, int y2, int iter, float spikes)
    • computeAngleSpan

      public static float computeAngleSpan(float radius, float range)
    • computeAngleRadius

      public static float computeAngleRadius(float angle, float range)
    • approach

      public static float approach(float curr, float dest, float minSpeed, float diffSpeedMult, float amount)
    • cleanBuffer

      public static void cleanBuffer(Buffer toBeDestroyed)
    • getFleetwideTotalStat

      public static float getFleetwideTotalStat(CampaignFleetAPI fleet, String dynamicMemberStatId)
    • getFleetwideTotalMod

      public static float getFleetwideTotalMod(CampaignFleetAPI fleet, String dynamicMemberStatId, float base)
    • getFleetwideTotalMod

      public static float getFleetwideTotalMod(CampaignFleetAPI fleet, String dynamicMemberStatId, float base, ShipAPI ship)
    • getStarId

      public static String getStarId(PlanetAPI planet)
    • getMinSystemSurveyLevel

      public static MarketAPI.SurveyLevel getMinSystemSurveyLevel(StarSystemAPI system)
    • hasAnySurveyDataFor

      public static boolean hasAnySurveyDataFor(StarSystemAPI system)
    • setAllPlanetsKnown

      public static void setAllPlanetsKnown(String systemName)
    • setAllPlanetsKnown

      public static void setAllPlanetsKnown(StarSystemAPI system)
    • setAllPlanetsSurveyed

      public static void setAllPlanetsSurveyed(StarSystemAPI system, boolean setRuinsExplored)
    • generatePlanetConditions

      public static void generatePlanetConditions(String systemName, StarAge age)
    • generatePlanetConditions

      public static void generatePlanetConditions(StarSystemAPI system, StarAge age)
    • getEstimatedOrbitIndex

      public static int getEstimatedOrbitIndex(PlanetAPI planet)
    • getRandom

      public static Random getRandom(long seed, int level)
    • addSurveyDataFor

      public static void addSurveyDataFor(PlanetAPI planet, TextPanelAPI text)
    • setFullySurveyed

      public static void setFullySurveyed(MarketAPI market, TextPanelAPI text, boolean withNotification)
    • setPreliminarySurveyed

      public static void setPreliminarySurveyed(MarketAPI market, TextPanelAPI text, boolean withNotification)
    • setSeen

      public static void setSeen(MarketAPI market, TextPanelAPI text, boolean withNotification)
    • getStringWithTokenReplacement

      public static String getStringWithTokenReplacement(String format, SectorEntityToken entity, Map<String,MemoryAPI> memoryMap)
    • renderQuadAlpha

      public static void renderQuadAlpha(float x, float y, float width, float height, Color color, float alphaMult)
    • fadeAndExpire

      public static void fadeAndExpire(SectorEntityToken entity)
    • fadeAndExpire

      public static void fadeAndExpire(SectorEntityToken entity, float seconds)
    • fadeInOutAndExpire

      public static void fadeInOutAndExpire(SectorEntityToken entity, float in, float dur, float out)
    • fadeIn

      public static void fadeIn(SectorEntityToken entity, float in)
    • addCargoPods

      public static CustomCampaignEntityAPI addCargoPods(LocationAPI where, org.lwjgl.util.vector.Vector2f loc)
    • addDebrisField

      public static SectorEntityToken addDebrisField(LocationAPI loc, DebrisFieldTerrainPlugin.DebrisFieldParams params, Random random)
    • isUnboardable

      public static boolean isUnboardable(FleetMemberAPI member)
    • isUnboardable

      public static boolean isUnboardable(ShipHullSpecAPI hullSpec)
    • isShipRecoverable

      public static boolean isShipRecoverable(FleetMemberAPI member, CampaignFleetAPI recoverer, boolean own, boolean useOfficerRecovery, float chanceMult)
    • findNearestJumpPointTo

      public static JumpPointAPI findNearestJumpPointTo(SectorEntityToken entity)
    • findNearestJumpPointTo

      public static JumpPointAPI findNearestJumpPointTo(SectorEntityToken entity, boolean allowWormhole)
    • findNearestJumpPointThatCouldBeExitedFrom

      public static JumpPointAPI findNearestJumpPointThatCouldBeExitedFrom(SectorEntityToken entity)
    • findNearestPlanetTo

      public static SectorEntityToken findNearestPlanetTo(SectorEntityToken entity, boolean requireGasGiant, boolean allowStars)
    • shouldConvertFromStub

      public static final boolean shouldConvertFromStub(LocationAPI containingLocation, org.lwjgl.util.vector.Vector2f location)
    • genRandomSeed

      public static long genRandomSeed()
      How Java generates a seed for a new java.util.Random() instance.
      Returns:
    • seedUniquifier

      public static long seedUniquifier()
    • genUID

      public static String genUID()
    • colorsToString

      public static String colorsToString(List<Color> colors)
    • colorsFromString

      public static List<Color> colorsFromString(String in)
    • getJumpPointTo

      public static JumpPointAPI getJumpPointTo(PlanetAPI star)
    • findNearestJumpPoint

      public static JumpPointAPI findNearestJumpPoint(SectorEntityToken from)
    • getDHullId

      public static String getDHullId(ShipHullSpecAPI spec)
    • getMod

      public static HullModSpecAPI getMod(String id)
    • getDistanceFromArc

      public static float getDistanceFromArc(float direction, float arc, float angle)
    • initConditionMarket

      public static void initConditionMarket(PlanetAPI planet)
    • initEconomyMarket

      public static void initEconomyMarket(PlanetAPI planet)
    • getSurveyLevelString

      public static String getSurveyLevelString(MarketAPI.SurveyLevel level, boolean withBrackets)
    • getPlanetSurveyClass

      public static String getPlanetSurveyClass(PlanetAPI planet)
    • setDefenderOverride

      public static void setDefenderOverride(SectorEntityToken entity, DefenderDataOverride override)
    • setSalvageSpecial

      public static void setSalvageSpecial(SectorEntityToken entity, Object data)
    • setPrevSalvageSpecial

      public static void setPrevSalvageSpecial(SectorEntityToken entity, Object data)
    • getSalvageSpecial

      public static Object getSalvageSpecial(SectorEntityToken entity)
    • getPrevSalvageSpecial

      public static Object getPrevSalvageSpecial(SectorEntityToken entity)
    • getSystemsInRange

      public static List<StarSystemAPI> getSystemsInRange(SectorEntityToken from, Set<StarSystemAPI> exclude, boolean nonEmpty, float maxRange)
    • getPulsarInSystem

      public static PlanetAPI getPulsarInSystem(StarSystemAPI system)
    • systemHasPlanets

      public static boolean systemHasPlanets(StarSystemAPI system)
    • getCampaignShipScaleMult

      public static float getCampaignShipScaleMult(ShipAPI.HullSize size)
    • createStringPicker

      public static WeightedRandomPicker<String> createStringPicker(Object... params)
    • createStringPicker

      public static WeightedRandomPicker<String> createStringPicker(Random random, Object... params)
    • setWarningBeaconGlowColor

      public static void setWarningBeaconGlowColor(SectorEntityToken beacon, Color color)
    • setWarningBeaconPingColor

      public static void setWarningBeaconPingColor(SectorEntityToken beacon, Color color)
    • setWarningBeaconColors

      public static void setWarningBeaconColors(SectorEntityToken beacon, Color glow, Color ping)
    • getNearbyFleets

      public static List<CampaignFleetAPI> getNearbyFleets(SectorEntityToken from, float maxDist)
    • getVisibleFleets

      public static List<CampaignFleetAPI> getVisibleFleets(SectorEntityToken from, boolean includeSensorContacts)
    • isSameCargo

      public static boolean isSameCargo(CargoAPI baseOne, CargoAPI baseTwo)
    • getDistressJumpPoint

      public static JumpPointAPI getDistressJumpPoint(StarSystemAPI system)
    • clearTarget

      public static void clearTarget(CampaignFleetAPI fleet, boolean forgetTransponder)
    • giveStandardReturnToSourceAssignments

      public static void giveStandardReturnToSourceAssignments(CampaignFleetAPI fleet)
    • isFleetReturningToDespawn

      public static boolean isFleetReturningToDespawn(CampaignFleetAPI fleet)
    • giveStandardReturnToSourceAssignments

      public static void giveStandardReturnToSourceAssignments(CampaignFleetAPI fleet, boolean withClear)
    • giveStandardReturnAssignments

      public static void giveStandardReturnAssignments(CampaignFleetAPI fleet, SectorEntityToken where, String text, boolean withClear)
    • adjustRep

      public static void adjustRep(float repChangeFaction, RepLevel limit, String factionId, float repChangePerson, RepLevel personLimit, PersonAPI person, TextPanelAPI text)
    • interruptAbilitiesWithTag

      public static void interruptAbilitiesWithTag(CampaignFleetAPI fleet, String tag)
    • getInterceptPoint

      public static org.lwjgl.util.vector.Vector2f getInterceptPoint(CampaignFleetAPI from, SectorEntityToken to)
    • getInterceptPoint

      public static org.lwjgl.util.vector.Vector2f getInterceptPoint(SectorEntityToken from, SectorEntityToken to, float maxSpeedFrom)
    • stopPlayerFleet

      public static void stopPlayerFleet()
    • getListOfResources

      public static String getListOfResources(Map<String,Integer> res, List<String> quantities)
    • setColor

      public static void setColor(Color color)
    • setColor

      public static void setColor(Color color, float alphaMult)
    • setColor

      public static void setColor(Color color, int alpha)
    • doesMarketHaveMissionImportantPeopleOrIsMarketMissionImportant

      public static boolean doesMarketHaveMissionImportantPeopleOrIsMarketMissionImportant(SectorEntityToken entity)
    • makeImportant

      public static void makeImportant(SectorEntityToken entity, String reason)
    • makeImportant

      public static void makeImportant(SectorEntityToken entity, String reason, float dur)
    • makeImportant

      public static void makeImportant(PersonAPI person, String reason)
    • makeImportant

      public static void makeImportant(PersonAPI person, String reason, float dur)
    • makeImportant

      public static void makeImportant(MemoryAPI memory, String reason)
    • makeImportant

      public static void makeImportant(MemoryAPI memory, String reason, float dur)
    • isImportantForReason

      public static boolean isImportantForReason(MemoryAPI memory, String reason)
    • makeUnimportant

      public static void makeUnimportant(SectorEntityToken entity, String reason)
    • makeUnimportant

      public static void makeUnimportant(PersonAPI person, String reason)
    • makeUnimportant

      public static void makeUnimportant(MemoryAPI memory, String reason)
    • cleanUpMissionMemory

      public static void cleanUpMissionMemory(MemoryAPI memory, String prefix)
    • clearAreaAroundPlayer

      public static void clearAreaAroundPlayer(float minDist)
    • getSalvageSeed

      public static long getSalvageSeed(SectorEntityToken entity)
    • getSalvageSeed

      public static long getSalvageSeed(SectorEntityToken entity, boolean nonRandom)
    • getNameBasedSeed

      public static long getNameBasedSeed(SectorEntityToken entity)
    • forgetAboutTransponder

      public static void forgetAboutTransponder(CampaignFleetAPI fleet)
    • setAbandonedStationMarket

      public static void setAbandonedStationMarket(String marketId, SectorEntityToken station)
    • getDesiredMoveDir

      public static float getDesiredMoveDir(CampaignFleetAPI fleet)
    • isPermaKnowsWhoPlayerIs

      public static boolean isPermaKnowsWhoPlayerIs(CampaignFleetAPI fleet)
    • getSimulatorPlugin

      public static SimulatorPlugin getSimulatorPlugin()
    • getImmigrationPlugin

      public static ImmigrationPlugin getImmigrationPlugin(MarketAPI market)
    • getAICoreAdminPlugin

      public static AICoreAdminPlugin getAICoreAdminPlugin(String commodityId)
    • getAICoreOfficerPlugin

      public static AICoreOfficerPlugin getAICoreOfficerPlugin(String commodityId)
    • getAbandonMarketPlugin

      public static AbandonMarketPlugin getAbandonMarketPlugin(MarketAPI market)
    • getStabilizeMarketPlugin

      public static StabilizeMarketPlugin getStabilizeMarketPlugin(MarketAPI market)
    • getInflater

      public static FleetInflater getInflater(CampaignFleetAPI fleet, Object params)
    • playerHasStorageAccess

      public static boolean playerHasStorageAccess(MarketAPI market)
    • getMarketSizeProgress

      public static float getMarketSizeProgress(MarketAPI market)
    • getStorageFeeFraction

      public static float getStorageFeeFraction()
    • getStorageCostPerMonth

      public static int getStorageCostPerMonth(MarketAPI market)
    • getStorage

      public static SubmarketPlugin getStorage(MarketAPI market)
    • getLocalResources

      public static SubmarketPlugin getLocalResources(MarketAPI market)
    • getStorageCargo

      public static CargoAPI getStorageCargo(MarketAPI market)
    • getLocalResourcesCargo

      public static CargoAPI getLocalResourcesCargo(MarketAPI market)
    • getStorageTotalValue

      public static float getStorageTotalValue(MarketAPI market)
    • getStorageCargoValue

      public static float getStorageCargoValue(MarketAPI market)
    • getStorageShipValue

      public static float getStorageShipValue(MarketAPI market)
    • addStorageInfo

      public static boolean addStorageInfo(TooltipMakerAPI tooltip, Color color, Color dark, MarketAPI market, boolean includeLocalResources, boolean addSectionIfEmpty)
      Returns true if it added anything to the tooltip.
      Returns:
    • getTokenReplaced

      public static String getTokenReplaced(String in, SectorEntityToken entity)
    • getOutpostPenalty

      public static float getOutpostPenalty()
    • getAdminSalary

      public static float getAdminSalary(PersonAPI admin)
    • getOfficerSalary

      public static float getOfficerSalary(PersonAPI officer)
    • getOfficerSalary

      public static float getOfficerSalary(PersonAPI officer, boolean mercenary)
    • getHullIdForVariantId

      public static String getHullIdForVariantId(String variantId)
    • getFPForVariantId

      public static int getFPForVariantId(String variantId)
    • getFactionPersonalityPicker

      public static FactionPersonalityPickerPlugin getFactionPersonalityPicker()
    • getAdjustedStrength

      public static float getAdjustedStrength(float fp, MarketAPI market)
    • getAdjustedFP

      public static float getAdjustedFP(float fp, MarketAPI market)
    • getShipQuality

      public static float getShipQuality(MarketAPI market)
    • getShipQuality

      public static float getShipQuality(MarketAPI market, String factionId)
    • getShipPickMode

      public static FactionAPI.ShipPickMode getShipPickMode(MarketAPI market)
    • getShipPickMode

      public static FactionAPI.ShipPickMode getShipPickMode(MarketAPI market, String factionId)
    • isBusy

      public static boolean isBusy(CampaignFleetAPI fleet)
    • getStationEntity

      public static SectorEntityToken getStationEntity(MarketAPI market, CampaignFleetAPI fleet)
    • getStationFleet

      public static CampaignFleetAPI getStationFleet(MarketAPI market)
    • getStationFleet

      public static CampaignFleetAPI getStationFleet(SectorEntityToken station)
    • getStationBaseFleet

      public static CampaignFleetAPI getStationBaseFleet(MarketAPI market)
    • getStationBaseFleet

      public static CampaignFleetAPI getStationBaseFleet(SectorEntityToken station)
    • getStationMarket

      public static MarketAPI getStationMarket(CampaignFleetAPI station)
    • getStationIndustry

      public static Industry getStationIndustry(MarketAPI market)
    • isActiveModule

      public static boolean isActiveModule(ShipVariantAPI variant)
    • isActiveModule

      public static boolean isActiveModule(ShipAPI ship)
    • addCreditsMessage

      public static void addCreditsMessage(String format, int credits)
    • getSystemJumpPointHyperExitLocation

      public static org.lwjgl.util.vector.Vector2f getSystemJumpPointHyperExitLocation(JumpPointAPI jp)
    • isNear

      public static boolean isNear(SectorEntityToken entity, org.lwjgl.util.vector.Vector2f hyperLoc)
    • getDays

      public static float getDays(float amount)
    • getProbabilityMult

      public static float getProbabilityMult(float desired, float current, float deviationMult)
    • isHyperspaceAnchor

      public static boolean isHyperspaceAnchor(SectorEntityToken entity)
    • getStarSystemForAnchor

      public static StarSystemAPI getStarSystemForAnchor(SectorEntityToken anchor)
    • showCost

      public static void showCost(TextPanelAPI text, Color color, Color dark, String[] res, int[] quantities)
    • showCost

      public static void showCost(TextPanelAPI text, String title, boolean withAvailable, Color color, Color dark, String[] res, int[] quantities)
    • showCost

      public static void showCost(TextPanelAPI text, String title, boolean withAvailable, float widthOverride, Color color, Color dark, String[] res, int[] quantities, boolean[] consumed)
    • isPlayerFactionSetUp

      public static boolean isPlayerFactionSetUp()
    • getFleetType

      public static String getFleetType(CampaignFleetAPI fleet)
    • isPatrol

      public static boolean isPatrol(CampaignFleetAPI fleet)
    • isSmuggler

      public static boolean isSmuggler(CampaignFleetAPI fleet)
    • isTrader

      public static boolean isTrader(CampaignFleetAPI fleet)
    • isPirate

      public static boolean isPirate(CampaignFleetAPI fleet)
    • isScavenger

      public static boolean isScavenger(CampaignFleetAPI fleet)
    • isRaider

      public static boolean isRaider(CampaignFleetAPI fleet)
    • isWarFleet

      public static boolean isWarFleet(CampaignFleetAPI fleet)
    • getNearestStationInSupportRange

      public static Pair<SectorEntityToken,CampaignFleetAPI> getNearestStationInSupportRange(CampaignFleetAPI from)
      pair.one can be null if a stand-alone, non-market station is being returned in pair.two.
      Parameters:
      from -
      Returns:
    • isStationInSupportRange

      public static boolean isStationInSupportRange(CampaignFleetAPI fleet, CampaignFleetAPI station)
    • getMemberStrength

      public static float getMemberStrength(FleetMemberAPI member)
    • getMemberStrength

      public static float getMemberStrength(FleetMemberAPI member, boolean withHull, boolean withQuality, boolean withCaptain)
    • increaseMarketHostileTimeout

      public static void increaseMarketHostileTimeout(MarketAPI market, float days)
    • removeRadioChatter

      public static void removeRadioChatter(MarketAPI market)
    • getDesignTypeColor

      public static Color getDesignTypeColor(String designType)
    • getDesignTypeColorDim

      public static Color getDesignTypeColorDim(String designType)
    • addDesignTypePara

      public static LabelAPI addDesignTypePara(TooltipMakerAPI tooltip, String design, float pad)
    • getFleetRadiusTerrainEffectMult

      public static float getFleetRadiusTerrainEffectMult(CampaignFleetAPI fleet)
    • getBurnMultForTerrain

      public static float getBurnMultForTerrain(CampaignFleetAPI fleet)
    • addHitGlow

      public static void addHitGlow(LocationAPI location, org.lwjgl.util.vector.Vector2f loc, org.lwjgl.util.vector.Vector2f vel, float size, Color color)
    • addHitGlow

      public static void addHitGlow(LocationAPI location, org.lwjgl.util.vector.Vector2f loc, org.lwjgl.util.vector.Vector2f vel, float size, float dur, Color color)
    • addGlowyParticle

      public static ParticleControllerAPI[] addGlowyParticle(LocationAPI location, org.lwjgl.util.vector.Vector2f loc, org.lwjgl.util.vector.Vector2f vel, float size, float rampUp, float dur, Color color)
    • getShippingCapacity

      public static int getShippingCapacity(MarketAPI market, boolean inFaction)
    • getStrengthDesc

      public static String getStrengthDesc(float strAdjustedFP)
    • isMilitary

      public static boolean isMilitary(MarketAPI market)
    • hasHeavyIndustry

      public static boolean hasHeavyIndustry(MarketAPI market)
    • hasOrbitalStation

      public static boolean hasOrbitalStation(MarketAPI market)
    • getClaimingFaction

      public static FactionAPI getClaimingFaction(SectorEntityToken planet)
    • computeTotalShutdownRefund

      public static int computeTotalShutdownRefund(MarketAPI market)
    • computeShutdownRefund

      public static int computeShutdownRefund(MarketAPI market, Industry industry)
    • addWarningBeacon

      public static SectorEntityToken addWarningBeacon(SectorEntityToken center, BaseThemeGenerator.OrbitGap gap, String beaconTag)
    • getTradeMode

      public static CampaignUIAPI.CoreUITradeMode getTradeMode(MemoryAPI memory)
    • isSpacerStart

      public static boolean isSpacerStart()
    • getSpaceport

      public static Industry getSpaceport(MarketAPI market)
    • setBrightness

      public static Color setBrightness(Color color, int brightness)
    • scaleColorSaturate

      public static Color scaleColorSaturate(Color color, float factor)
    • getMaxOfficers

      public static int getMaxOfficers(CampaignFleetAPI fleet)
    • getNumNonMercOfficers

      public static int getNumNonMercOfficers(CampaignFleetAPI fleet)
    • getMercs

      public static List<OfficerDataAPI> getMercs(CampaignFleetAPI fleet)
    • getMaxIndustries

      public static int getMaxIndustries(MarketAPI market)
    • getNumIndustries

      public static int getNumIndustries(MarketAPI market)
    • getNumImprovedIndustries

      public static int getNumImprovedIndustries(MarketAPI market)
    • getNumStableLocations

      public static int getNumStableLocations(StarSystemAPI system)
    • getCurrentlyBeingConstructed

      public static Industry getCurrentlyBeingConstructed(MarketAPI market)
    • getRelColor

      public static Color getRelColor(float rel)
    • getMusicPlayerPlugin

      public static MusicPlayerPlugin getMusicPlayerPlugin()
    • getDangerLevel

      public static int getDangerLevel(CampaignFleetAPI fleet)
    • getHitGlowSize

      public static float getHitGlowSize(float baseSize, float baseDamage, ApplyDamageResultAPI result)
    • getHitGlowSize

      public static float getHitGlowSize(float baseSize, float baseDamage, DamageType type, float sd, float ad, float hd, float ed)
    • getNumEliteSkills

      public static int getNumEliteSkills(PersonAPI person)
    • isMentored

      public static boolean isMentored(PersonAPI person)
    • setMentored

      public static void setMentored(PersonAPI person, boolean mentored)
    • isMercenary

      public static boolean isMercenary(PersonAPI person)
    • setMercHiredNow

      public static void setMercHiredNow(PersonAPI person)
    • getMercDaysSinceHired

      public static float getMercDaysSinceHired(PersonAPI person)
    • setMercenary

      public static void setMercenary(PersonAPI person, boolean mercenary)
    • isUnremovable

      public static boolean isUnremovable(PersonAPI person)
    • setUnremovable

      public static void setUnremovable(PersonAPI person, boolean unremovable)
    • isKeepOnShipRecovery

      public static boolean isKeepOnShipRecovery(PersonAPI person)
    • setKeepOnShipRecovery

      public static void setKeepOnShipRecovery(PersonAPI person, boolean keepOnRecovery)
    • isAutomated

      public static boolean isAutomated(MutableShipStatsAPI stats)
    • isAutomated

      public static boolean isAutomated(FleetMemberAPI member)
    • isAutomated

      public static boolean isAutomated(ShipVariantAPI variant)
    • isAutomated

      public static boolean isAutomated(ShipAPI ship)
    • getAllowedRecoveryTags

      public static Set<String> getAllowedRecoveryTags()
    • getMaxPermanentMods

      public static int getMaxPermanentMods(ShipAPI ship)
    • getMaxPermanentMods

      public static int getMaxPermanentMods(FleetMemberAPI member, MutableCharacterStatsAPI stats)
    • getBuildInBonusXP

      public static float getBuildInBonusXP(HullModSpecAPI mod, ShipAPI.HullSize size)
    • getOPCost

      public static int getOPCost(HullModSpecAPI mod, ShipAPI.HullSize size)
    • isSpecialMod

      public static boolean isSpecialMod(ShipVariantAPI variant, HullModSpecAPI spec)
    • hasSModdableBuiltIns

      public static boolean hasSModdableBuiltIns(ShipVariantAPI variant)
    • getCurrSpecialMods

      public static int getCurrSpecialMods(ShipVariantAPI variant)
    • getCurrSpecialModsList

      public static List<HullModSpecAPI> getCurrSpecialModsList(ShipVariantAPI variant)
    • isSlowMoving

      public static boolean isSlowMoving(CampaignFleetAPI fleet)
    • getGoSlowBurnLevel

      public static int getGoSlowBurnLevel(CampaignFleetAPI fleet)
    • applyDamage

      public static void applyDamage(FleetMemberAPI member, Random random, Misc.FleetMemberDamageLevel level, boolean withCRDamage, String crDamageId, String crDamageReason, boolean withMessage, TextPanelAPI textPanel, String messageText)
    • applyDamage

      public static void applyDamage(FleetMemberAPI member, Random random, float damageMult, boolean withCRDamage, String crDamageId, String crDamageReason, boolean withMessage, TextPanelAPI textPanel, String messageText)
    • getBonusXPForRecovering

      public static float getBonusXPForRecovering(FleetMemberAPI member)
    • getBonusXPForScuttling

      public static float[] getBonusXPForScuttling(FleetMemberAPI member)
    • getSpawnFPMult

      public static float getSpawnFPMult(CampaignFleetAPI fleet)
    • setSpawnFPMult

      public static void setSpawnFPMult(CampaignFleetAPI fleet, float mult)
    • isDecentralized

      public static boolean isDecentralized(FactionAPI faction)
    • getPersonalityName

      public static String getPersonalityName(PersonAPI person)
    • setRaidedTimestamp

      public static void setRaidedTimestamp(MarketAPI market)
    • getDaysSinceLastRaided

      public static float getDaysSinceLastRaided(MarketAPI market)
    • computeEconUnitChangeFromTradeModChange

      public static int computeEconUnitChangeFromTradeModChange(CommodityOnMarketAPI com, int quantity)
    • affectAvailabilityWithinReason

      public static void affectAvailabilityWithinReason(CommodityOnMarketAPI com, int quantity)
    • isOpenlyPopulated

      public static boolean isOpenlyPopulated(StarSystemAPI system)
    • hasAtLeastOneOfTags

      public static boolean hasAtLeastOneOfTags(Collection<String> tags, String... other)
    • hasUnexploredRuins

      public static boolean hasUnexploredRuins(MarketAPI market)
    • hasRuins

      public static boolean hasRuins(MarketAPI market)
    • getRuinsSpec

      public static MarketConditionSpecAPI getRuinsSpec(MarketAPI market)
    • getRuinsType

      public static String getRuinsType(MarketAPI market)
      Assumes the market *does* have ruins.
      Parameters:
      market -
      Returns:
    • hasFarmland

      public static boolean hasFarmland(MarketAPI market)
    • addDefeatTrigger

      public static void addDefeatTrigger(CampaignFleetAPI fleet, String trigger)
    • removeDefeatTrigger

      public static void removeDefeatTrigger(CampaignFleetAPI fleet, String trigger)
    • getDefeatTriggers

      public static List<String> getDefeatTriggers(CampaignFleetAPI fleet, boolean createIfNecessary)
    • clearDefeatTriggersIfNeeded

      public static void clearDefeatTriggersIfNeeded(CampaignFleetAPI fleet)
    • shouldShowDamageFloaty

      public static boolean shouldShowDamageFloaty(ShipAPI source, ShipAPI target)
    • canCheckVram

      public static boolean canCheckVram()
    • getVramFreeKB

      public static int getVramFreeKB()
      Reminder: call this on startup to see what the max is.
      Returns:
    • getVramMaximumKB

      public static int getVramMaximumKB()
    • getVramDedicatedKB

      public static int getVramDedicatedKB()
    • getVramUsedKB

      public static int getVramUsedKB()
    • playSound

      public static void playSound(ApplyDamageResultAPI result, org.lwjgl.util.vector.Vector2f loc, org.lwjgl.util.vector.Vector2f vel, String lightShields, String solidShields, String heavyShields, String lightHull, String solidHull, String heavyHull)
    • getShipWeight

      public static float getShipWeight(ShipAPI ship)
    • getShipWeight

      public static float getShipWeight(ShipAPI ship, boolean adjustForNonCombat)
    • getIncapacitatedTime

      public static float getIncapacitatedTime(ShipAPI ship)
    • isAvoidingPlayerHalfheartedly

      public static boolean isAvoidingPlayerHalfheartedly(CampaignFleetAPI fleet)
    • isPirateFaction

      public static boolean isPirateFaction(FactionAPI faction)
      In vanilla, pirates and Luddic Path.
      Parameters:
      faction -
      Returns:
    • getAOrAnFor

      public static String getAOrAnFor(String word)
      Probably wrong sometimes...
      Returns:
      "a" or "an" for word.
    • moveToMarket

      public static void moveToMarket(PersonAPI person, MarketAPI destination, boolean alwaysAddToCommDirectory)
    • makeStoryCritical

      public static void makeStoryCritical(String marketId, String reason)
    • makeStoryCritical

      public static void makeStoryCritical(MarketAPI market, String reason)
    • makeStoryCritical

      public static void makeStoryCritical(MemoryAPI memory, String reason)
    • makeNonStoryCritical

      public static void makeNonStoryCritical(MarketAPI market, String reason)
    • makeNonStoryCritical

      public static void makeNonStoryCritical(MemoryAPI memory, String reason)
    • isStoryCritical

      public static boolean isStoryCritical(MarketAPI market)
    • isStoryCritical

      public static boolean isStoryCritical(MemoryAPI memory)
    • isInsignificant

      public static boolean isInsignificant(CampaignFleetAPI fleet)
      Whether it prevents salvage, surveying, etc. But NOT things that require only being seen to ruin them, such as SpySat deployments.
      Parameters:
      fleet -
      Returns:
    • shouldNotWantRunFromPlayerEvenIfWeaker

      public static boolean shouldNotWantRunFromPlayerEvenIfWeaker(CampaignFleetAPI fleet)
      Mainly for avoiding stuff like "pirate fleet with 4 rustbuckets will run away from the player's 4 regular-quality frigates". Fleets that this evaluates to true for will avoid the player slowly.
      Parameters:
      fleet -
      Returns:
    • findKth

      public static float findKth(float[] arr, int k)
    • getAdjustedBaseRange

      public static float getAdjustedBaseRange(float base, ShipAPI ship, WeaponAPI weapon)
    • bezier

      public static org.lwjgl.util.vector.Vector2f bezier(org.lwjgl.util.vector.Vector2f p0, org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, float t)
    • bezierCubic

      public static org.lwjgl.util.vector.Vector2f bezierCubic(org.lwjgl.util.vector.Vector2f p0, org.lwjgl.util.vector.Vector2f p1, org.lwjgl.util.vector.Vector2f p2, org.lwjgl.util.vector.Vector2f p3, float t)
    • isInsideSlipstream

      public static boolean isInsideSlipstream(org.lwjgl.util.vector.Vector2f loc, float radius)
    • isInsideSlipstream

      public static boolean isInsideSlipstream(org.lwjgl.util.vector.Vector2f loc, float radius, LocationAPI location)
    • isInsideSlipstream

      public static boolean isInsideSlipstream(SectorEntityToken entity)
    • isOutsideSector

      public static boolean isOutsideSector(org.lwjgl.util.vector.Vector2f loc)
    • crossesAnySlipstream

      public static boolean crossesAnySlipstream(LocationAPI location, org.lwjgl.util.vector.Vector2f from, org.lwjgl.util.vector.Vector2f to)
    • computeCoreWorldsExtent

      public static void computeCoreWorldsExtent()
    • getCoreMin

      public static org.lwjgl.util.vector.Vector2f getCoreMin()
    • getCoreMax

      public static org.lwjgl.util.vector.Vector2f getCoreMax()
    • getCoreCenter

      public static org.lwjgl.util.vector.Vector2f getCoreCenter()
    • turnTowardsPointV2

      public static boolean turnTowardsPointV2(MissileAPI missile, org.lwjgl.util.vector.Vector2f point, float angVel)
    • turnTowardsFacingV2

      public static boolean turnTowardsFacingV2(MissileAPI missile, float desiredFacing, float relativeAngVel)
    • turnTowardsFacingV2

      public static boolean turnTowardsFacingV2(ShipAPI ship, float desiredFacing, float relativeAngVel)
    • getUntrustwortyCount

      public static int getUntrustwortyCount()
    • incrUntrustwortyCount

      public static void incrUntrustwortyCount()
    • adjustRep

      public static ReputationActionResponsePlugin.ReputationAdjustmentResult adjustRep(PersonAPI person, float delta, TextPanelAPI text)
    • adjustRep

      public static ReputationActionResponsePlugin.ReputationAdjustmentResult adjustRep(PersonAPI person, float delta, RepLevel limit, TextPanelAPI text)
    • adjustRep

      public static ReputationActionResponsePlugin.ReputationAdjustmentResult adjustRep(PersonAPI person, float delta, RepLevel limit, TextPanelAPI text, boolean addMessageOnNoChange, boolean withMessage)
    • adjustRep

      public static ReputationActionResponsePlugin.ReputationAdjustmentResult adjustRep(String factionId, float delta, TextPanelAPI text)
    • adjustRep

      public static ReputationActionResponsePlugin.ReputationAdjustmentResult adjustRep(String factionId, float delta, RepLevel limit, TextPanelAPI text)
    • adjustRep

      public static ReputationActionResponsePlugin.ReputationAdjustmentResult adjustRep(String factionId, float delta, RepLevel limit, TextPanelAPI text, boolean addMessageOnNoChange, boolean withMessage)
    • getHullSizeStr

      public static String getHullSizeStr(ShipAPI.HullSize size)
    • getColorDist

      public static float getColorDist(Color one, Color two)
    • isFringe

      public static boolean isFringe(SectorEntityToken entity)
    • isFringe

      public static boolean isFringe(StarSystemAPI system)
    • isFringe

      public static boolean isFringe(org.lwjgl.util.vector.Vector2f loc)
    • getFringeFactor

      public static float getFringeFactor(org.lwjgl.util.vector.Vector2f loc)
    • isHiddenBase

      public static boolean isHiddenBase(MarketAPI market)
    • isReversePolarity

      public static boolean isReversePolarity(SectorEntityToken entity)
    • genEntityCatalogId

      public static String genEntityCatalogId(Misc.CatalogEntryType type)
    • genEntityCatalogId

      public static String genEntityCatalogId(int cycleOverride, int monthOverride, int dayOverride, Misc.CatalogEntryType type)
    • genEntityCatalogId

      public static String genEntityCatalogId(String firstChar, int cycleOverride, int monthOverride, int dayOverride, Misc.CatalogEntryType type)
    • getAveragePlanetRadius

      public static float getAveragePlanetRadius(PlanetSpecAPI spec)
    • canPlanetTypeRollHabitable

      public static boolean canPlanetTypeRollHabitable(PlanetSpecAPI spec)
    • canPlanetTypeRollCondition

      public static boolean canPlanetTypeRollCondition(PlanetSpecAPI spec, String id)
    • getMaxMarketSize

      public static int getMaxMarketSize(MarketAPI market)
    • countEnemyWeightInArc

      public static float countEnemyWeightInArc(ShipAPI ship, float dir, float arc, float maxRange, boolean ignoreFightersAndModules)
    • countEnemyWeightInArcAroundLocation

      public static float countEnemyWeightInArcAroundLocation(ShipAPI ship, org.lwjgl.util.vector.Vector2f loc, float dir, float arc, float maxRange, ShipAPI ignore, boolean ignoreFightersAndModules)
    • countEnemyWeightInArcAroundLocation

      public static float countEnemyWeightInArcAroundLocation(int owner, org.lwjgl.util.vector.Vector2f loc, float dir, float arc, float maxRange, ShipAPI ignore, boolean ignoreFightersAndModules, boolean awareOnly)
    • getFloatArray

      public static float[] getFloatArray(String key)
    • getWeaponSkin

      public static SpriteAPI getWeaponSkin(ShipAPI ship, String weaponId, Misc.WeaponSkinType type)
    • getWeaponSkin

      public static SpriteAPI getWeaponSkin(String cat, String weaponId, ShipAPI ship, Misc.WeaponSkinType type)