1package com.fs.starfarer.api.impl.campaign.intel;
7import org.lwjgl.input.Keyboard;
9import com.fs.starfarer.api.Global;
10import com.fs.starfarer.api.campaign.FactionAPI;
11import com.fs.starfarer.api.campaign.InteractionDialogAPI;
12import com.fs.starfarer.api.campaign.RepLevel;
13import com.fs.starfarer.api.campaign.SectorEntityToken;
14import com.fs.starfarer.api.campaign.TextPanelAPI;
15import com.fs.starfarer.api.campaign.econ.MarketAPI;
16import com.fs.starfarer.api.campaign.econ.MonthlyReport;
17import com.fs.starfarer.api.campaign.econ.MonthlyReport.FDNode;
18import com.fs.starfarer.api.campaign.listeners.CommissionEndedListener;
19import com.fs.starfarer.api.campaign.listeners.EconomyTickListener;
20import com.fs.starfarer.api.characters.PersonAPI;
21import com.fs.starfarer.api.impl.campaign.econ.EstablishedPolity;
22import com.fs.starfarer.api.impl.campaign.ids.Factions;
23import com.fs.starfarer.api.impl.campaign.ids.People;
24import com.fs.starfarer.api.impl.campaign.ids.Tags;
25import com.fs.starfarer.api.impl.campaign.intel.contacts.ContactIntel;
26import com.fs.starfarer.api.impl.campaign.intel.events.EstablishedPolityScript;
27import com.fs.starfarer.api.impl.campaign.rulecmd.HA_CMD;
28import com.fs.starfarer.api.impl.campaign.shared.SharedData;
29import com.fs.starfarer.api.ui.ButtonAPI;
30import com.fs.starfarer.api.ui.IntelUIAPI;
31import com.fs.starfarer.api.ui.LabelAPI;
32import com.fs.starfarer.api.ui.SectorMapAPI;
33import com.fs.starfarer.api.ui.TooltipMakerAPI;
34import com.fs.starfarer.api.ui.TooltipMakerAPI.TooltipCreator;
35import com.fs.starfarer.api.util.Misc;
39 public static enum AgreementEndingType {
111 public static String
KEY =
"$plMembership_ref";
153 super.notifyEnding();
175 return "Persean League Membership";
231 if (mode == ListInfoMode.IN_DESC) initPad = opad;
276 info.
addPara(
"Your agreement with the League is no longer in force.", opad, c,
"League");
281 info.
addPara(
"You've negotiated a good membership deal from a position of strength. "
282 +
"The League will support you politically, which "
283 +
"for example makes it untenable for the Hegemony to insist on AI inspections "
284 +
"in your space.", opad, c,
"League");
287 info.
addPara(
"Part of your arrangement involves unofficial payments directly to the accounts "
288 +
"of House Hannan, as payment for facilitating this agreement.", opad);
292 (
int)(width), 20f, opad * 1f);
297 info.
addPara(
"You've joined the Persean League, though it's whispered that you only did so to avoid "
298 +
"harassment, and your membership dues are nothing more than protection payments. "
299 +
"However, the League still supports you politically, which "
300 +
"for example makes it untenable for the Hegemony to insist on AI inspections "
301 +
"in your space.", opad, c,
"Persean League");
304 info.
addPara(
"Due to being new members of the League, your colonies enjoy an "
305 +
"increased flow of trade, resulting in a %s accessibility bonus.",
309 info.
addPara(
"Your League membership is contingent on maintaining an active Persean League commission. If "
310 +
"you resign it, or if it is annulled for any reason, your membership will end as well.", opad);
313 info.
addPara(
"You are paying membership dues to the League.", opad);
320 (
int)(width), 20f, opad * 1f);
331 Set<String> tags = super.getIntelTags(map);
359 node.income += credits;
360 }
else if (credits < 0) {
361 node.upkeep -= credits;
369 if (marketsNode.name ==
null) {
370 marketsNode.name =
"Colonies";
375 FDNode paymentNode = report.
getNode(marketsNode,
"persean_league_membership");
376 paymentNode.name =
"Persean League membership dues";
381 if (paymentNode.tooltipCreator ==
null) {
383 public boolean isTooltipExpandable(Object tooltipParam) {
386 public float getTooltipWidth(Object tooltipParam) {
389 public void createTooltip(
TooltipMakerAPI tooltip,
boolean expanded, Object tooltipParam) {
390 tooltip.
addPara(
"Monthly dues for keeping your Persean League membership in good standing.", 0f);
401 return (
int) (perTick * numIter);
406 float f = 1f / numIter;
418 payment += (int) (market.getGrossIncome() * f) * feeFraction;
442 if (dialog !=
null) {
446 if (baseMembership) {
459 if (reynard !=
null) {
479 super.buttonPressConfirmed(buttonId, ui);
490 LabelAPI label = prompt.
addPara(
"You've negotiated a good membership deal from a position of strength. If "
491 +
"you leave, you will not be allowed to rejoin, but the " +
493 +
"from harassing your interests." + extra, 0f,
499 prompt.
addPara(
"However, Gens Hannan will not be pleased with their payments being stopped.",
505 float rejoinPad = 10f;
509 +
" drastic action against your colonies." + extra, 0f);
515 +
" harassing your interests in the near future.", 0f,
523 prompt.
addPara(
"Given your history, it is likely that you would not be allowed "
524 +
"to rejoin the League at any point in the future.",
526 "would not be allowed to rejoin");
530 prompt.
addPara(
"Gens Hannan will not be pleased. While they are unlikely to be unable to obtain your outright "
531 +
"explulsion from the League, their influence is significant and will likely be used "
532 +
"to continually undermine your standing. ", 0f,
534 "continually undermine your standing");
536 prompt.
addPara(
"You will also lose Reynard Hannan as a contact.", 10f,
538 "lose Reynard Hannan");
548 return super.doesButtonHaveConfirmDialog(buttonId);
static SettingsAPI getSettings()
static SectorAPI getSector()
FDNode getNode(String ... path)
MonthlyReportNodeTooltipCreator getMonthlyReportTooltip()
static float ACCESSIBILITY_BONUS
static final String PERSEAN
static String REYNARD_HANNAN
static PersonAPI getPerson(String id)
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)
static final String PL_MEMBERSHIP_GOOD_DEAL
static boolean isLeagueMember()
AgreementEndingType endType
static final String LEFT_LEAGUE_WHEN_GOOD_DEAL
String getAcceptedPostfix()
static final String PAYING_HOUSE_HANNAN
void reportEconomyTick(int iterIndex)
void createConfirmationPrompt(Object buttonId, TooltipMakerAPI prompt)
static void setDefeatedPunEx(boolean value)
void reportCommissionEnded(FactionCommissionIntel intel)
Set< String > getIntelTags(SectorMapAPI map)
static int getNumTimesLeftLeague()
void addBulletPoints(TooltipMakerAPI info, ListInfoMode mode)
String getBrokenPostfix()
static int computeCreditsPerTick()
static final String DEFEATED_PUN_EX
SectorEntityToken getMapLocation(SectorMapAPI map)
static final String DEFEATED_BLOCKADE
void createSmallDescription(TooltipMakerAPI info, float width, float height)
static String BUTTON_RENEGE_HANNAN
static final String NUM_TIMES_LEFT_LEAGUE
static int TIMES_LEFT_LEAGUE_FOR_NO_REJOIN
void reportEconomyMonthEnd()
static final String IS_LEAGUE_MEMBER
boolean doesButtonHaveConfirmDialog(Object buttonId)
static void setLeagueMember(boolean member)
static void stopPayingHouseHannan(boolean trustBroken, InteractionDialogAPI dialog)
void buttonPressConfirmed(Object buttonId, IntelUIAPI ui)
PerseanLeagueMembership(InteractionDialogAPI dialog)
void endMembership(AgreementEndingType type, InteractionDialogAPI dialog)
static boolean isDefeatedBlockadeOrPunEx()
static void setLeftLeagueWhenGoodDeal(boolean value)
FactionAPI getFactionForUIColors()
static void incrLeftLeagueCount()
static boolean isLeftLeagueWhenGoodDeal()
String getExpiredPostfix()
FDNode getMonthlyReportNode()
String getSmallDescriptionTitle()
static boolean isGoodDeal()
static boolean isPayingHouseHannan()
static String UPDATE_PARAM_ACCEPTED
static void setPayingHouseHannan(boolean value)
String getImportantIcon()
static void setDefeatedBlockade(boolean value)
int computeCreditsPerMonth()
static boolean canSendPerseanLeaguePunitiveExpedition()
static void sendPerseanLeaguePunitiveExpedition(InteractionDialogAPI dialog)
static SharedData getData()
MonthlyReport getCurrentReport()
static Color getTextColor()
static String getDGSCredits(float num)
static Color getNegativeHighlightColor()
static void incrUntrustwortyCount()
static Color getGrayColor()
static void adjustRep(float repChangeFaction, RepLevel limit, String factionId, float repChangePerson, RepLevel personLimit, PersonAPI person, TextPanelAPI text)
static Color getHighlightColor()
static List< MarketAPI > getPlayerMarkets(boolean includeNonPlayerFaction)
boolean isAtWorst(RepLevel level)
String getSpriteName(String category, String id)
float getFloat(String key)
String getDisplayNameWithArticleWithoutArticle()
void setSecondaryColorOverride(Color secondaryOverride)
String getDisplayNameWithArticle()
RelationshipAPI getRelToPlayer()
void setSecondaryColorSegmentsOverride(int secondaryColorSegmentsOverride)
TextPanelAPI getTextPanel()
MemoryAPI getPlayerMemoryWithoutUpdate()
FactionAPI getPlayerFaction()
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)
boolean getBoolean(String key)
void setHighlight(int start, int end)
void setHighlightColors(Color ... colors)