1package com.fs.starfarer.api.impl.campaign.intel;
6import org.lwjgl.input.Keyboard;
8import com.fs.starfarer.api.Global;
9import com.fs.starfarer.api.campaign.FactionAPI;
10import com.fs.starfarer.api.campaign.InteractionDialogAPI;
11import com.fs.starfarer.api.campaign.SectorEntityToken;
12import com.fs.starfarer.api.campaign.TextPanelAPI;
13import com.fs.starfarer.api.campaign.econ.CommodityOnMarketAPI;
14import com.fs.starfarer.api.campaign.econ.MonthlyReport;
15import com.fs.starfarer.api.campaign.econ.MonthlyReport.FDNode;
16import com.fs.starfarer.api.campaign.listeners.EconomyTickListener;
17import com.fs.starfarer.api.impl.campaign.ids.Factions;
18import com.fs.starfarer.api.impl.campaign.ids.Tags;
19import com.fs.starfarer.api.impl.campaign.intel.events.SindrianDiktatHostileActivityFactor;
20import com.fs.starfarer.api.impl.campaign.rulecmd.HA_CMD;
21import com.fs.starfarer.api.impl.campaign.shared.SharedData;
22import com.fs.starfarer.api.ui.ButtonAPI;
23import com.fs.starfarer.api.ui.IntelUIAPI;
24import com.fs.starfarer.api.ui.LabelAPI;
25import com.fs.starfarer.api.ui.SectorMapAPI;
26import com.fs.starfarer.api.ui.TooltipMakerAPI;
27import com.fs.starfarer.api.ui.TooltipMakerAPI.TooltipCreator;
28import com.fs.starfarer.api.util.Misc;
32 public static enum AgreementEndingType {
38 public static String
KEY =
"$sindrianDiktatDeal_ref";
48 protected AgreementEndingType
endType =
null;
88 return "Sindrian Diktat Fuel Accord";
131 if (mode == ListInfoMode.IN_DESC) initPad = opad;
158 info.
addPara(
"You are no longer abiding by your agreement with the Sindrian Diktat.", opad);
164 LabelAPI label = info.
addPara(
"You've made an agreement with the Sindrian Diktat, paying a sizeable "
165 +
"fee, %s of your gross fuel exports, in exchange for them not bombarding "
166 +
"your fuel production facilities from orbit.",
167 opad, h,
"" + (
int) Math.round(feeFraction * 100f) +
"%");
168 label.
setHighlight(
"Sindrian Diktat",
"" + (
int) Math.round(feeFraction * 100f) +
"%");
171 info.
addPara(
"You can end this agreement, but there "
172 +
"would be no possibility of re-negotiating a similar one in the future.", opad);
176 (
int)(width), 20f, opad * 1f);
187 Set<String> tags = super.getIntelTags(map);
214 if (dialog !=
null) {
218 if (type == AgreementEndingType.BROKEN) {
235 super.buttonPressConfirmed(buttonId, ui);
242 prompt.
addPara(
"The terms of the agreement are so onerous that your reputation at large "
243 +
"would not suffer for unilaterally breaking it, "
244 +
"though your standing with the Sindrian Diktat specifically "
245 +
"would of course be affected.", 0f,
256 return super.doesButtonHaveConfirmDialog(buttonId);
265 if (iterIndex != numIter - 1)
return;
271 if (marketsNode ==
null)
return;
274 int credits = (int) (exportIncome * feeFraction);
276 if (credits <= 0)
return;
279 node.upkeep += credits;
287 total += curr.income;
290 for (FDNode child : curr.getChildren().values()) {
300 if (marketsNode.name ==
null) {
301 marketsNode.name =
"Colonies";
306 FDNode paymentNode = report.
getNode(marketsNode,
"diktat_fuel_fees");
307 paymentNode.name =
"Sindrian Diktat fuel accord fees";
310 if (paymentNode.tooltipCreator ==
null) {
312 public boolean isTooltipExpandable(Object tooltipParam) {
315 public float getTooltipWidth(Object tooltipParam) {
318 public void createTooltip(
TooltipMakerAPI tooltip,
boolean expanded, Object tooltipParam) {
319 tooltip.
addPara(
"Fees paid to the Sindrian Diktat in exchange for their refraining "
320 +
"from interfering in your fuel production business. From orbit.", 0f);
static SettingsAPI getSettings()
static SectorAPI getSector()
FDNode getNode(String ... path)
MonthlyReportNodeTooltipCreator getMonthlyReportTooltip()
static final String DIKTAT
boolean isSendingUpdate()
void sendUpdate(Object listInfoParam, TextPanelAPI textPanel)
void unindent(TooltipMakerAPI info)
Object getListInfoParam()
Color getBulletColorForMode(ListInfoMode mode)
void setImportant(Boolean important)
void bullet(TooltipMakerAPI info)
FDNode getMonthlyReportNode()
void createSmallDescription(TooltipMakerAPI info, float width, float height)
void createConfirmationPrompt(Object buttonId, TooltipMakerAPI prompt)
boolean doesButtonHaveConfirmDialog(Object buttonId)
void reportEconomyTick(int iterIndex)
void reportEconomyMonthEnd()
float computeFuelExportIncome(FDNode curr)
String getImportantIcon()
String getSmallDescriptionTitle()
void addBulletPoints(TooltipMakerAPI info, ListInfoMode mode)
String getAcceptedPostfix()
SectorEntityToken getMapLocation(SectorMapAPI map)
AgreementEndingType endType
static String UPDATE_PARAM_ACCEPTED
String getBrokenPostfix()
FactionAPI getFactionForUIColors()
static float REP_FOR_BREAKING_DEAL
void buttonPressConfirmed(Object buttonId, IntelUIAPI ui)
Set< String > getIntelTags(SectorMapAPI map)
SindrianDiktatFuelDeal(InteractionDialogAPI dialog)
void endAgreement(AgreementEndingType type, InteractionDialogAPI dialog)
static void setMadeDeal(boolean value)
static void setBrokeDeal(boolean broke)
static void avertOrEndDiktatAttackAsNecessary()
static SharedData getData()
MonthlyReport getCurrentReport()
static Color getTextColor()
static Color getGrayColor()
static void adjustRep(float repChangeFaction, RepLevel limit, String factionId, float repChangePerson, RepLevel personLimit, PersonAPI person, TextPanelAPI text)
static Color getHighlightColor()
String getSpriteName(String category, String id)
float getFloat(String key)
TextPanelAPI getTextPanel()
IntelManagerAPI getIntelManager()
FactionAPI getFaction(String factionId)
MemoryAPI getMemoryWithoutUpdate()
ListenerManagerAPI getListenerManager()
void addIntel(IntelInfoPlugin plugin)
void addListener(Object listener)
void removeListener(Object listener)
void set(String key, Object value)
void setHighlight(int start, int end)
void setHighlightColors(Color ... colors)