1package com.fs.starfarer.api.combat;
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.CampaignUIAPI.CoreUITradeMode;
7import com.fs.starfarer.api.campaign.CargoStackAPI;
8import com.fs.starfarer.api.campaign.econ.Industry;
9import com.fs.starfarer.api.campaign.econ.MarketAPI;
10import com.fs.starfarer.api.characters.PersonAPI;
11import com.fs.starfarer.api.combat.ShipAPI.HullSize;
12import com.fs.starfarer.api.fleet.FleetMemberAPI;
13import com.fs.starfarer.api.impl.campaign.HullModItemManager;
14import com.fs.starfarer.api.impl.campaign.ids.HullMods;
15import com.fs.starfarer.api.impl.campaign.ids.Industries;
16import com.fs.starfarer.api.loading.HullModSpecAPI;
17import com.fs.starfarer.api.ui.Alignment;
18import com.fs.starfarer.api.ui.TooltipMakerAPI;
19import com.fs.starfarer.api.util.Misc;
31 if (stats ==
null || stats.
getVariant() ==
null ||
spec ==
null)
return false;
36 if (ship ==
null || ship.
getVariant() ==
null ||
spec ==
null)
return false;
41 if (ship ==
null || ship.
getVariant() ==
null ||
spec ==
null)
return false;
92 if (
spec ==
null)
return true;
95 if (!reqSpaceport)
return true;
97 if (marketOrNull ==
null)
return false;
98 if (mode == CoreUITradeMode.NONE || mode ==
null)
return false;
109 if (
spec ==
null)
return null;
112 if (!reqSpaceport)
return null;
116 String verb =
"installed";
120 if (has) verb =
"removed";
122 return "Can only be " + verb +
" at a colony with a spaceport or an orbital station";
150 return spec !=
null &&
159 final String [] params =
new String [] {
177 boolean sMod =
isSMod(ship);
188 if (isForBuildInList) {
194 if (isForBuildInList) {
203 if (isForBuildInList) {
208 if (!sMod && !isForBuildInList) {
219 tooltip.
addPara(
"This effect only applies if this built-in hullmod is enhanced using a %s. Doing this does not count against the maximum number of s-mods a ship can have.",
220 opad, s,
"story point");
222 String cheap =
"Cheap hullmods have stronger effects.";
224 cheap =
"Cheaper hullmods have stronger effects, more expensive hullmods may have penalties.";
226 tooltip.
addPara(
"This effect only applies if this hullmod is built into the hull using a story point. " + cheap,
227 opad, s,
"story point");
237 tooltip.
addPara(
"Aside from removing its ordnance point cost, "
238 +
"this hullmod gains no extra effect from being built into the hull using "
239 +
"a story point.", opad, s,
"story point");
268 if (!mod.
hasTag(category))
continue;
269 if (
id.equals(currMod))
continue;
277 if (stats ==
null)
return false;
279 if (member ==
null)
return false;
282 if (fc ==
null)
return false;
287 if (ship ==
null)
return false;
289 if (member ==
null)
return false;
292 if (fc ==
null)
return false;
330 float width,
boolean isForModSpec) {
342 tooltip.
addPara(
"Requires " + aOrAn +
" %s to install.",
344 }
else if (currentVariant !=
null && member !=
null) {
353 member, currentVariant, dockedAt);
356 if (available < 0) available = 0;
static SettingsAPI getSettings()
static boolean CODEX_TOOLTIP_MODE
void advanceInCombat(ShipAPI ship, float amount)
boolean isSMod(MutableShipStatsAPI stats)
String getUnapplicableReason(ShipAPI ship)
void applyEffectsToFighterSpawnedByShip(ShipAPI fighter, ShipAPI ship, String id)
boolean isBuiltIn(ShipAPI ship)
void addPostDescriptionSection(TooltipMakerAPI tooltip, HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec)
void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id)
boolean shipHasOtherModInCategory(ShipAPI ship, String currMod, String category)
boolean shouldAddDescriptionToTooltip(HullSize hullSize, ShipAPI ship, boolean isForModSpec)
int getDisplayCategoryIndex()
void advanceInCampaign(FleetMemberAPI member, float amount)
boolean isInPlayerFleet(MutableShipStatsAPI stats)
boolean isInPlayerFleet(ShipAPI ship)
String getDescriptionParam(int index, HullSize hullSize)
void addSModEffectSection(TooltipMakerAPI tooltip, HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec, boolean isForBuildInList)
boolean hasSModEffectSection(HullSize hullSize, ShipAPI ship, boolean isForModSpec)
boolean isSModEffectAPenalty()
boolean isSMod(ShipAPI ship)
String getDescriptionParam(int index, HullSize hullSize, ShipAPI ship)
String getSModDescriptionParam(int index, HullSize hullSize)
void addSModSection(TooltipMakerAPI tooltip, HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec, boolean isForBuildInList)
String getSModDescriptionParam(int index, HullSize hullSize, ShipAPI ship)
boolean canBeAddedOrRemovedNow(ShipAPI ship, MarketAPI marketOrNull, CoreUITradeMode mode)
void applyEffectsAfterShipCreation(ShipAPI ship, String id)
void init(HullModSpecAPI spec)
boolean isApplicableToShip(ShipAPI ship)
boolean showInRefitScreenModPickerFor(ShipAPI ship)
void addRequiredItemSection(TooltipMakerAPI tooltip, FleetMemberAPI member, ShipVariantAPI currentVariant, MarketAPI dockedAt, float width, boolean isForModSpec)
int getDisplaySortOrder()
String getCanNotBeInstalledNowReason(ShipAPI ship, MarketAPI marketOrNull, CoreUITradeMode mode)
int getNumAvailableMinusUnconfirmed(CargoStackAPI req, FleetMemberAPI member, ShipVariantAPI currentVariant, MarketAPI dockedAt)
static HullModItemManager getInstance()
static final String TAG_REQ_SPACEPORT
static final String TAG_STATION
static final String TAG_SPACEPORT
static Color getStoryOptionColor()
static Color getStoryDarkColor()
static Color getNegativeHighlightColor()
static Color setAlpha(Color color, int alpha)
static Color getBasePlayerColor()
static String getAOrAnFor(String word)
static boolean CAN_SMOD_BUILT_IN
static Color getHighlightColor()
static Color scaleColorOnly(Color color, float factor)
static Color getPositiveHighlightColor()
HullModSpecAPI getHullModSpec(String modId)
List< Industry > getIndustries()
default CargoStackAPI getRequiredItem()
ShipVariantAPI getVariant()
FleetMemberAPI getFleetMember()
ShipHullSpecAPI getHullSpec()
FleetMemberAPI getFleetMember()
ShipVariantAPI getVariant()
List< String > getBuiltInMods()
Collection< String > getHullMods()
LinkedHashSet< String > getSMods()
boolean hasHullMod(String id)
ShipHullSpecAPI getHullSpec()
LinkedHashSet< String > getSModdedBuiltIns()
PersonAPI getFleetCommander()
PersonAPI getFleetCommanderForStats()
String getSModDescription(HullSize hullSize)
boolean hasTag(String tag)
String getSModEffectFormat()