1package com.fs.starfarer.api.impl.campaign.intel;
4import java.util.Random;
7import org.lwjgl.util.vector.Vector2f;
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.ReputationActionResponsePlugin.ReputationAdjustmentResult;
14import com.fs.starfarer.api.campaign.SectorEntityToken;
15import com.fs.starfarer.api.campaign.TextPanelAPI;
16import com.fs.starfarer.api.campaign.econ.MarketAPI;
17import com.fs.starfarer.api.characters.PersonAPI;
18import com.fs.starfarer.api.impl.campaign.CoreReputationPlugin;
19import com.fs.starfarer.api.impl.campaign.ids.Factions;
20import com.fs.starfarer.api.impl.campaign.ids.FleetTypes;
21import com.fs.starfarer.api.impl.campaign.ids.People;
22import com.fs.starfarer.api.impl.campaign.intel.events.PerseanLeagueHostileActivityFactor;
23import com.fs.starfarer.api.impl.campaign.missions.DelayedFleetEncounter;
24import com.fs.starfarer.api.impl.campaign.missions.hub.HubMissionWithTriggers.FleetQuality;
25import com.fs.starfarer.api.impl.campaign.missions.hub.HubMissionWithTriggers.FleetSize;
26import com.fs.starfarer.api.impl.campaign.missions.hub.HubMissionWithTriggers.OfficerNum;
27import com.fs.starfarer.api.impl.campaign.missions.hub.HubMissionWithTriggers.OfficerQuality;
28import com.fs.starfarer.api.ui.Alignment;
29import com.fs.starfarer.api.ui.SectorMapAPI;
30import com.fs.starfarer.api.ui.TooltipMakerAPI;
31import com.fs.starfarer.api.util.IntervalUtil;
32import com.fs.starfarer.api.util.Misc;
63 public static String
KEY =
"$plGHMachinations_ref";
76 protected IntervalUtil
interval =
new IntervalUtil(10f, 110f);
77 protected Random
random =
new Random();
80 protected ReputationAdjustmentResult
recent =
null;
85 if (
get() !=
null)
return;
91 TextPanelAPI text =
null;
92 if (dialog !=
null) text = dialog.getTextPanel();
107 super.advanceImpl(amount);
112 float days = Misc.getDays(amount);
116 if (!
interval.intervalElapsed())
return;
118 if (PerseanLeagueHostileActivityFactor.getKazeron(
false) ==
null) {
132 int repLoss = 5 +
random.nextInt(11);
135 RepLevel limit = RepLevel.NEUTRAL;
137 limit = RepLevel.VENGEFUL;
140 ReputationAdjustmentResult result = Misc.adjustRep(Factions.PERSEAN,
141 (
float)repLoss * -0.01f, limit,
null,
false,
false);
143 repLoss = Math.min(repLoss, (
int)Math.abs(Math.round(result.delta * 100f)));
161 recent =
new ReputationAdjustmentResult(0);
165 DelayedFleetEncounter e =
new DelayedFleetEncounter(
random,
"GensHannanMachinations");
169 e.setLocationInnerSector(
true, Factions.INDEPENDENT);
171 e.triggerCreateFleet(FleetSize.HUGE, FleetQuality.SMOD_1, Factions.PERSEAN, FleetTypes.MERC_BOUNTY_HUNTER,
new Vector2f());
172 e.triggerSetFleetOfficers(OfficerNum.MORE, OfficerQuality.HIGHER);
173 e.triggerSetFleetFaction(Factions.INDEPENDENT);
174 e.triggerMakeNoRepImpact();
175 e.triggerSetStandardAggroInterceptFlags();
176 e.triggerMakeFleetIgnoreOtherFleets();
177 e.triggerSetFleetGenericHailPermanent(
"GensHannanMachinationsHail");
185 super.notifyEnding();
203 return "Gens Hannan Machinations";
221 Color h = Misc.getHighlightColor();
222 Color g = Misc.getGrayColor();
227 if (mode == ListInfoMode.IN_DESC) initPad = opad;
242 info.addPara(
"A bounty hunter was recently hired to eliminate you", tc, initPad);
245 null,
null, info, tc, isUpdate, initPad);
247 String daysStr = days == 1 ?
"day" :
"days";
248 info.addPara(
"%s " + daysStr +
" ago", 0f, tc, h,
"" + days);
259 Color h = Misc.getHighlightColor();
260 Color g = Misc.getGrayColor();
261 Color tc = Misc.getTextColor();
265 info.addImage(
getFaction().getLogo(), width, 128, opad);
267 info.addPara(
"You've gone back on a deal with Gens Hannan, and they work behind the scenes"
268 +
"to damage your standing with the Persean League, and worse.", opad,
269 getFaction().getBaseUIColor(),
"Persean League");
272 info.addPara(
"You sources indicate that the further action by Gens Hannan "
273 +
"is unlikely at this time.", opad);
275 info.addPara(
"It's likely that at some point this work will become less of a priority, but "
276 +
"for now, their agents go about ruining your reputation with commendable "
277 +
"vigor and discretion.", opad);
280 info.addPara(
"There is no hope of reconciliation, and the gloves are off. There is a possibility "
281 +
"of your being brought into active hostility with the League, and of bounty hunters "
282 +
"being hired and equipped for the job.", opad, Misc.getNegativeHighlightColor(),
283 "active hostility with the League",
"bounty hunters");
286 info.addPara(
"You are not considered trustworthy enough for Gens Hannan to deal with again, and "
287 +
"these actions are in the way of setting an example for others.", opad);
290 PersonAPI person = People.getPerson(People.REYNARD_HANNAN);
291 if (person !=
null) {
292 TooltipMakerAPI sub = info.beginImageWithText(person.getPortraitSprite(), 64f);
293 sub.addPara(
"You may be able to negotiate an end to this by going to Kazeron and speaking with "
294 +
"Reynard Hannan.", 0f, h,
295 "speaking with Reynard Hannan");
296 info.addImageWithText(opad);
304 info.addSectionHeading(
"Recent events",
306 Alignment.MID, opad);
317 Set<String> tags = super.getIntelTags(map);
325 MarketAPI kazeron = PerseanLeagueHostileActivityFactor.getKazeron(
false);
326 if (kazeron !=
null) {
327 return kazeron.getPrimaryEntity();
static SectorAPI getSector()
static void addAdjustmentMessage(float delta, FactionAPI faction, PersonAPI person, TextPanelAPI panel, TooltipMakerAPI info, Color tc, boolean withCurrent, float pad)
void unindent(TooltipMakerAPI info)
void sendUpdateIfPlayerHasIntel(Object listInfoParam, TextPanelAPI textPanel)
Object getListInfoParam()
Color getBulletColorForMode(ListInfoMode mode)
void setImportant(Boolean important)
void bullet(TooltipMakerAPI info)
static boolean isAgreedToPayHouseHannanAgain()
void createSmallDescription(TooltipMakerAPI info, float width, float height)
void addBulletPoints(TooltipMakerAPI info, ListInfoMode mode)
String getSmallDescriptionTitle()
static float PROB_ACTION_TAKEN
FactionAPI getFactionForUIColors()
ReputationAdjustmentResult recent
SectorEntityToken getMapLocation(SectorMapAPI map)
void endMachinations(TextPanelAPI text)
static String UPDATE_PARAM_START
static boolean canRemakeDealWithHouseHannan()
static String UPDATE_PARAM_MACHINATION
Set< String > getIntelTags(SectorMapAPI map)
GensHannanMachinations(InteractionDialogAPI dialog)
static float PROB_BOUNTY_HUNTER
static String MACHINATIONS_IN_EFFECT
void advanceImpl(float amount)
static void setAgreedToPayHouseHannanAgain(boolean value)
static String AGREED_TO_PAY_HOUSE_HANNAN_AGAIN
static boolean isMachinationsInEffect()
boolean recentIsBountyHunter
static boolean isLeagueMember()
static boolean isPayingHouseHannan()