1package com.fs.starfarer.api.impl.campaign.rulecmd;
7import com.fs.starfarer.api.Global;
8import com.fs.starfarer.api.campaign.CampaignFleetAPI;
9import com.fs.starfarer.api.campaign.FactionAPI;
10import com.fs.starfarer.api.campaign.InteractionDialogAPI;
11import com.fs.starfarer.api.campaign.TextPanelAPI;
12import com.fs.starfarer.api.campaign.rules.MemoryAPI;
13import com.fs.starfarer.api.characters.MutableCharacterStatsAPI.SkillLevelAPI;
14import com.fs.starfarer.api.impl.campaign.econ.ShippingDisruption;
15import com.fs.starfarer.api.impl.campaign.fleets.EconomyFleetAssignmentAI.EconomyRouteData;
16import com.fs.starfarer.api.impl.campaign.fleets.EconomyFleetRouteManager;
17import com.fs.starfarer.api.impl.campaign.fleets.RouteManager;
18import com.fs.starfarer.api.impl.campaign.fleets.RouteManager.RouteData;
19import com.fs.starfarer.api.impl.campaign.ids.MemFlags;
20import com.fs.starfarer.api.ui.LabelAPI;
21import com.fs.starfarer.api.util.Misc;
22import com.fs.starfarer.api.util.Misc.Token;
27 if (dialog ==
null)
return false;
39 if (skill.getSkill().isAdmiralSkill()) {
47 if (!mem.
contains(
"$shownFleetDescAlready")) {
48 mem.
set(
"$shownFleetDescAlready",
true, 0);
58 if ((trader || smuggler) && route !=
null) {
59 EconomyRouteData data = (EconomyRouteData) route.getCustom();
61 Integer
id = route.getCurrentSegmentId();
63 String from = data.from.
getName();
73 cargo = EconomyRouteData.getCargoList(data.cargoDeliver);
76 cargo = EconomyRouteData.getCargoList(data.cargoReturn);
80 if (trader || smuggler) {
88 text.
addParagraph(
"--------------------------------------------------------------------------------------------------------------");
90 text.
addPara(
"Port of origin: %s", hl,
"Unknown");
94 text.
addPara(
"Current destination: %s", hl, to);
95 if (from.equals(data.to.
getName())) {
98 if (cargo.isEmpty()) {
101 text.
addPara(
"Cargo: %s", hl, cargo);
105 text.
addParagraph(
"--------------------------------------------------------------------------------------------------------------");
113 text.
addPara(
"If this fleet does not reach its destination safely, it will cause a shortage " +
114 "of the commodities it carries. " +
115 "In addition, its loss would reduce the accessibility of its port of origin by %s for up to three months.",
118 text.
addPara(
"If this fleet does not reach its destination safely, it will cause a shortage " +
119 "of the commodities it carries. " +
120 "In addition, its loss would reduce the accessbility of " + data.from.
getName() +
" by %s for up to three months.",
133 text.
addPara(
"Engaging this fleet in battle will not cause any changes to your reputation with the faction it nominally belongs to.",
136 text.
addPara(
"This fleet is operating without official sanction from the faction it nominally belongs to. " +
137 "Engaging it in battle will not cause any changes to your reputation.",
146 text.
addPara(
"Engaging this fleet in battle will not cause immediate hostilities " +
147 "with the faction it nominally belongs to, though it will slightly strain the relationship.",
150 text.
addPara(
"This fleet is either operating in a legal gray area or its behavior " +
151 "falls outside accepted norms. Engaging it in battle will not cause immediate hostilities " +
152 "with the faction it nominally belongs to, though it will slightly strain the relationship.",
static SettingsAPI getSettings()
static SectorAPI getSector()
static float getPenaltyForShippingLost(float marketSize, float unitsLost)
static final String SOURCE_ID
static final Integer ROUTE_SRC_LOAD
static final Integer ROUTE_DST_UNLOAD
static final Integer ROUTE_DST_LOAD
static RouteManager getInstance()
RouteData getRoute(String source, CampaignFleetAPI fleet)
static final String MEMORY_KEY_SMUGGLER
static final String MEMORY_KEY_LOW_REP_IMPACT
static final String MEMORY_KEY_NO_REP_IMPACT
static final String MEMORY_KEY_TRADE_FLEET
boolean execute(String ruleId, InteractionDialogAPI dialog, List< Token > params, Map< String, MemoryAPI > memoryMap)
static Color getTextColor()
static Color getNegativeHighlightColor()
static boolean isDecentralized(FactionAPI faction)
static Color getHighlightColor()
boolean getBoolean(String key)
boolean knowsWhoPlayerIs()
MutableCharacterStatsAPI getCommanderStats()
String getPersonNamePrefixAOrAn()
String getPersonNamePrefix()
boolean isNeutralFaction()
boolean isPlayerFaction()
TextPanelAPI getTextPanel()
SectorEntityToken getInteractionTarget()
CampaignFleetAPI getPlayerFleet()
MemoryAPI getMemoryWithoutUpdate()
LabelAPI addPara(String text)
void setFontSmallInsignia()
LabelAPI addParagraph(String text)
boolean contains(String key)
void set(String key, Object value)
boolean getBoolean(String key)
List< SkillLevelAPI > getSkillsCopy()
void highlightFirst(String substring)
void setHighlightColor(Color color)