1package com.fs.starfarer.api.impl.campaign.econ.impl;
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.SubmarketPlugin;
7import com.fs.starfarer.api.campaign.econ.CommoditySpecAPI;
8import com.fs.starfarer.api.combat.MutableStat;
9import com.fs.starfarer.api.impl.campaign.ids.Commodities;
10import com.fs.starfarer.api.impl.campaign.ids.Stats;
11import com.fs.starfarer.api.impl.campaign.intel.events.ht.HyperspaceTopographyEventIntel;
12import com.fs.starfarer.api.impl.campaign.intel.events.ht.HyperspaceTopographyEventIntel.Stage;
13import com.fs.starfarer.api.impl.campaign.submarkets.LocalResourcesSubmarketPlugin;
14import com.fs.starfarer.api.ui.TooltipMakerAPI;
15import com.fs.starfarer.api.util.Misc;
16import com.fs.starfarer.api.util.Pair;
73 if (intel !=
null && intel.
isStageActive(Stage.SLIPSTREAM_DETECTION)) {
112 if (loss < 0) loss = 0;
127 tooltip.
addPara(
"Increases the range at which slipstreams are detected around the colony by %s, once "
136 return mode != IndustryTooltipMode.NORMAL ||
isFunctional();
141 if (mode != IndustryTooltipMode.NORMAL ||
isFunctional()) {
150 String totalStr =
"+" + (int)Math.round(total * 100f) +
"%";
154 totalStr =
"" + (int)Math.round(total * 100f) +
"%";
159 tooltip.
addPara(
"Accessibility bonus: %s", opad, h, totalStr);
161 tooltip.
addPara(
"Accessibility penalty: %s", opad, h, totalStr);
164 tooltip.
addPara(
"As long as demand is met, allows the colony to stockpile fuel, supplies, and crew, even " +
165 "if it does not produce them locally. The stockpile levels exceed those generated by equivalent local production.", opad);
205 String pre =
"Alpha-level AI core currently assigned. ";
206 if (mode == AICoreDescriptionMode.MANAGE_CORE_DIALOG_LIST || mode == AICoreDescriptionMode.INDUSTRY_TOOLTIP) {
207 pre =
"Alpha-level AI core. ";
210 String aStr =
"" + (int)Math.round(a * 100f) +
"%";
212 if (mode == AICoreDescriptionMode.INDUSTRY_TOOLTIP) {
215 text.
addPara(pre +
"Reduces upkeep cost by %s. Reduces demand by %s unit. " +
216 "Greatly increases stockpiles.", 0f, highlight,
223 tooltip.
addPara(pre +
"Reduces upkeep cost by %s. Reduces demand by %s unit. " +
224 "Greatly increases stockpiles.", opad, highlight,
236 return "Requires a functional spaceport";
259 String aStr =
"" + (int)Math.round(a * 100f) +
"%";
261 if (mode == ImprovementDescriptionMode.INDUSTRY_TOOLTIP) {
262 info.
addPara(
"Accessibility increased by %s.", 0f, highlight, aStr);
264 info.
addPara(
"Increases accessibility by %s.", 0f, highlight, aStr);
268 super.addImproveDesc(info, mode);
static SettingsAPI getSettings()
void modifyFlat(String source, float value)
void unmodifyFlat(String source)
void modifyFlat(String source, float value)
void unmodifyFlat(String source)
static int DEMAND_REDUCTION
Map< String, MutableCommodityQuantity > supply
String getImprovementsDescForModifiers()
Map< String, MutableCommodityQuantity > demand
String getNameForModifier()
MutableStat demandReduction
Pair< String, Integer > getMaxDeficit(String ... commodityIds)
void addAlphaCoreDescription(TooltipMakerAPI tooltip, AICoreDescriptionMode mode)
static float UPKEEP_MULT_PER_DEFICIT
void addPostDescriptionSection(TooltipMakerAPI tooltip, IndustryTooltipMode mode)
void applyAlphaCoreSupplyAndDemandModifiers()
String getUnavailableReason()
static float ALPHA_CORE_ACCESSIBILITY
void applyAlphaCoreModifiers()
void addPostDemandSection(TooltipMakerAPI tooltip, boolean hasDemand, IndustryTooltipMode mode)
boolean isAvailableToBuild()
void applyNoAICoreModifiers()
static float BASE_ACCESSIBILITY
static float IMPROVE_ACCESSIBILITY
Pair< String, Integer > getUpkeepAffectingDeficit()
float getUpkeepPenalty(Pair< String, Integer > deficit)
boolean hasPostDemandSection(boolean hasDemand, IndustryTooltipMode mode)
void addImproveDesc(TooltipMakerAPI info, ImprovementDescriptionMode mode)
void applyImproveModifiers()
static final String SUPPLIES
static final String VOLATILES
static final String RARE_METALS
static final String SLIPSTREAM_REVEAL_RANGE_LY_MOD
boolean isStageActive(Object stageId)
static float WAYSTATION_BONUS
static HyperspaceTopographyEventIntel get()
MutableStat getStockpilingBonus(String cid)
static Color getNegativeHighlightColor()
static SubmarketPlugin getLocalResources(MarketAPI market)
static Color getHighlightColor()
CommoditySpecAPI getCommoditySpec(String commodityId)
float getFloat(String key)
MutableMarketStatsAPI getStats()
StatBonus getAccessibilityMod()
void setHasWaystation(boolean hasWaystation)
DynamicStatsAPI getDynamic()
StatBonus getMod(String id)