1package com.fs.starfarer.api.impl.campaign.intel.group;
6import com.fs.starfarer.api.Global;
7import com.fs.starfarer.api.campaign.FactionAPI;
8import com.fs.starfarer.api.campaign.StarSystemAPI;
9import com.fs.starfarer.api.campaign.econ.MarketAPI;
10import com.fs.starfarer.api.impl.campaign.ids.Conditions;
11import com.fs.starfarer.api.impl.campaign.intel.group.FGBlockadeAction.FGBlockadeParams;
12import com.fs.starfarer.api.ui.Alignment;
13import com.fs.starfarer.api.ui.LabelAPI;
14import com.fs.starfarer.api.ui.TooltipMakerAPI;
15import com.fs.starfarer.api.util.IntervalUtil;
16import com.fs.starfarer.api.util.Misc;
21 protected IntervalUtil
interval =
new IntervalUtil(0.1f, 0.3f);
26 params.noun =
"blockade";
28 if (
params.forcesNoun ==
null) {
29 params.forcesNoun =
"blockading forces";
48 }
else if (str == 0) {
49 return blockadeParams.accessibilityPenalty * 0.5f;
57 super.advance(amount);
61 float days = Misc.getDays(amount);
87 if (!market.hasCondition(Conditions.BLOCKADED)) {
88 market.addCondition(Conditions.BLOCKADED,
this);
95 market.removeCondition(Conditions.BLOCKADED);
102 super.notifyEnding();
109 info.addImage(
getFaction().getLogo(), width, 128, opad);
115 info.addPara(Misc.ucFirst(
faction.getPersonNamePrefixAOrAn()) +
" %s " + noun +
" " +
getOfString() +
" "
116 +
"the " + system.getNameWithLowercaseTypeShort() +
".", opad,
125 Color h = Misc.getHighlightColor();
126 Color bad = Misc.getNegativeHighlightColor();
130 List<MarketAPI> targets =
params.raidParams.allowedTargets;
139 info.addSectionHeading(
"Assessment",
140 faction.getBaseUIColor(),
faction.getDarkUIColor(), Alignment.MID, opad);
144 if (remaining > 0 && remaining < 1) remaining = 1;
145 String days = (int)remaining == 1 ?
"day" :
"days";
147 if (started) days =
"more " + days;
149 LabelAPI label = info.addPara(
"The " + noun +
" will last for approximately %s " + days
150 +
", causing a %s accessibility penalty "
151 +
"for all %s colonies in the " +
153 "" + (
int) remaining,
154 "" + (
int) Math.round(
blockadeParams.accessibilityPenalty * 100f) +
"%",
155 other.getPersonNamePrefix());
156 label.setHighlight(
"" + (
int) remaining,
157 "" + (
int) Math.round(
blockadeParams.accessibilityPenalty * 100f) +
"%",
158 other.getPersonNamePrefix());
159 label.setHighlightColors(h, h, other.getBaseUIColor());
162 info.addPara(
"The " + forcesNoun +
" are not nominally hostile, but will harass shipping and "
163 +
"attempt to maintain control over the system's jump-points.", opad,
164 Misc.getHighlightColor(),
"not nominally hostile");
166 info.addPara(
"The " + forcesNoun +
" are actively hostile, but will not directly attack colonies "
167 +
"in the system and will instead "
168 +
"attempt to maintain control over the system's jump-points. If a defended planet "
169 +
"happens to be near a jump-point, however, the situation is apt to get hot very quickly.",
170 opad, Misc.getNegativeHighlightColor(),
"actively hostile");
174 "the " + noun +
" is unlikely to be effective",
175 "the " + noun +
" is likely to only be partially effective",
176 "the " + noun +
" is likely to be fully effective");
static SectorAPI getSector()
void applyBlockadeCondition()
void addPostAssessmentSection(TooltipMakerAPI info, float width, float height, float opad)
void advance(float amount)
void addAssessmentSection(TooltipMakerAPI info, float width, float height, float opad)
void addBasicDescription(TooltipMakerAPI info, float width, float height, float opad)
void unapplyBlockadeCondition()
float getAccessibilityPenalty()
BlockadeFGI(GenericRaidParams params, FGBlockadeParams blockadeParams)
FGBlockadeParams getBlockadeParams()
FGBlockadeParams blockadeParams
GenericPayloadAction createPayloadAction()
int getRelativeFGStrength(StarSystemAPI target)
float getETAUntil(String actionId)
void setRandom(Random random)
boolean addStrengthDesc(TooltipMakerAPI info, float opad, StarSystemAPI system, String forces, String outcomeFailure, String outcomeUncertain, String outcomeSuccess)
boolean isCurrent(String id)
static String TRAVEL_ACTION
StarSystemAPI getTargetSystem()
GenericPayloadAction raidAction
static String PAYLOAD_ACTION