1package com.fs.starfarer.api.impl.campaign.intel.bar.events;
3import java.util.LinkedHashSet;
7import com.fs.starfarer.api.Global;
8import com.fs.starfarer.api.campaign.CargoAPI;
9import com.fs.starfarer.api.campaign.InteractionDialogAPI;
10import com.fs.starfarer.api.campaign.OptionPanelAPI;
11import com.fs.starfarer.api.campaign.PlanetAPI;
12import com.fs.starfarer.api.campaign.TextPanelAPI;
13import com.fs.starfarer.api.campaign.econ.MarketAPI;
14import com.fs.starfarer.api.campaign.rules.MemoryAPI;
15import com.fs.starfarer.api.characters.FullName.Gender;
16import com.fs.starfarer.api.characters.PersonAPI;
17import com.fs.starfarer.api.impl.campaign.DebugFlags;
18import com.fs.starfarer.api.impl.campaign.ids.Factions;
19import com.fs.starfarer.api.impl.campaign.ids.Ranks;
20import com.fs.starfarer.api.impl.campaign.ids.Tags;
21import com.fs.starfarer.api.impl.campaign.procgen.themes.MiscellaneousThemeGenerator;
22import com.fs.starfarer.api.util.Misc;
23import com.fs.starfarer.api.util.WeightedRandomPicker;
27 public static enum OptionId {
39 return (PlanetAPI)
Global.
getSector().getMemoryWithoutUpdate().get(MiscellaneousThemeGenerator.PLANETARY_SHIELD_PLANET_KEY);
48 if (!super.shouldShowAtMarket(
market))
return false;
51 if (
market.getFactionId().equals(Factions.LUDDIC_CHURCH) ||
52 market.getFactionId().equals(Factions.LUDDIC_PATH)) {
71 if (this.market ==
market)
return;
74 if (
person.getGender() == Gender.MALE) {
81 pilot.setRankId(Ranks.PILOT);
82 pilot.setPostId(Ranks.POST_CITIZEN);
84 WeightedRandomPicker<MarketAPI> picker =
new WeightedRandomPicker<MarketAPI>(
random);
85 for (MarketAPI curr :
Global.
getSector().getEconomy().getMarketsInGroup(
null)) {
86 if (curr ==
market)
continue;
87 if (curr.isPlayerOwned())
continue;
88 if (curr.isHidden())
continue;
89 if (curr.isInvalidMissionTarget())
continue;
90 if (curr.getStabilityValue() <= 0)
continue;
92 float w = curr.getSize();
93 if (curr.isFreePort()) w += 10f;
97 if (picker.isEmpty()) picker.add(
market, 1f);
109 text.addPara(
"A rough-looking veteran spacer with cybernetic eyes seems to be staring intently at you; " +
110 "it's a little unnerving.");
115 dialog.getOptionPanel().addOption(
"Ask the veteran spacer what " +
getHeOrShe() +
"'s looking at",
this,
133 if (!(optionData instanceof OptionId)) {
136 OptionId option = (OptionId) optionData;
150 text.addPara(
"\"Ain't nothing, I'm just reading my mail,\" " +
getHeOrShe() +
151 " growls back. Then laughs, and taps " +
getHisOrHer() +
" temple. " +
152 "\"Swear I'll never get proper used to these things.\"");
153 options.addOption(
"Offer to apologize for the misunderstanding by buying " +
getHimOrHer() +
" a drink", OptionId.APOLOGIZE);
154 options.addOption(
"Suggest that " +
getHeOrShe() +
" read the manual then leave", OptionId.LEAVE);
157 text.addPara(
"The old space-hand opens up as one drink turns to two or three. " +
158 Misc.ucFirst(
getHeOrShe()) +
" tells stories of old injuries earned, including that of " +
159 getHisOrHer() +
" lost eyes.\n\n\"Was just two survivors from that mission, me and the pilot. " +
160 "Lucky bastards, we two.\" It all began when " +
getHeOrShe() +
" was hired on to " +
161 "a salvage fleet trawling decivilized systems outside the Core Worlds. " +
162 "The loot was good, and any brigand they couldn't fight, they could flee." +
163 "\n\nThen the officers found something new in a data-cache. " +
164 "Rumours flew among the crew, who were told nothing, as the fleet suddenly left a rich " +
165 "asteroid belt to make for the outer system jump-point. " +
166 "They fared two hyperspace storms before arriving at a distant star system.");
168 options.addOption(
"Continue", OptionId.CONTINUE_1);
171 text.addPara(
"There they found a planet all shining and red. \"It weren't anything natural. " +
172 "It was all... shapes, angles, glowing like plasma. That's truth,\" " +
getHeOrShe() +
173 " says quietly, \"I've seen Gates, sure, and orbital works big as you like. Ain't " +
174 "never seen anything Domain-made glow like that across a whole planet's face. " +
175 "Not anything that weren't a weapon, I mean.\"");
177 options.addOption(
"Continue", OptionId.CONTINUE_2);
180 text.addPara(
"\"While we were gawkin', the prox alarm goes and it's battle stations\", " +
getHeOrShe() +
181 " continues. Hostile ships came fast upon the salvage fleet, flitting with agility " +
182 "belying advanced tech. They had equally advanced weapons, too, and with those they " +
183 "attacked with no mercy. \"It weren't pirates, nor military,\" here the spacer loses " +
184 getHisOrHer() +
" cheer at a good story. \"Ludd's hells, I swear to you it weren't anything human.\"");
186 text.addPara(
"The spacer explains that just " +
getHeOrShe() +
" and the pilot got away in an " +
187 "escape pod which was only \"mostly\" malfunctioning. \"The miracle wasn't that I " +
188 "fixed it, it's that they could thaw enough of me out at the end of it for me to keep " +
189 "livin', if you call this livin'.\"");
191 options.addOption(
"\"Where was this system with the red planet?\"", OptionId.WHERE_WAS_SYSTEM);
193 case WHERE_WAS_SYSTEM:
194 text.addPara(
"You emphasize your interest in the subject by having the spacer's drink refreshed. " +
196 "I wouldn't wish my fate on you or anyone. Besides, I have no idea.\" A pause, then, " +
197 "\"" +
pilot.getNameString() +
" would - that's the pilot,\" " +
getHeOrShe() +
" finally admits.");
199 text.addPara(
"The old spacer tells you that " +
pilot.getName().getFirst() +
" did not live the experience in such " +
200 "stride as " +
getHimOrHerself() +
", and has taken to drinking themselves senseless " +
202 "\"Some folks, I don't think they react well " +
203 "to the emergency cryo-pods. Like a bit o' their brain is still froze up and not coming back.\"");
206 Set<String> tags =
new LinkedHashSet<String>();
207 tags.add(Tags.INTEL_MISSIONS);
211 true, icon,
null, tags);
213 options.addOption(
"Continue", OptionId.CONTINUE_3);
216 text.addPara(
"You consider a trip to " +
pilotMarket.getName() +
" to see if you can get the exact location of " +
217 "this mysterious planet with its unknown technology. You also realize that the old spacer " +
218 "has fallen asleep in " +
getHisOrHer() +
" seat, cybernetic eyes blanked out in standby mode.");
223 options.addOption(
"Leave the old spacer to " +
getHisOrHer() +
" rest", OptionId.LEAVE);
238 boolean success =
false;
239 if (planet !=
null) {
248 text.addPara(
"For a minute there, you were caught by the story, but you now see that following up " +
249 "on it would be a fool's errand.");
255 return Factions.INDEPENDENT;
260 return Ranks.SPACE_SAILOR;
265 return Ranks.CITIZEN;
static SettingsAPI getSettings()
static SectorAPI getSector()
void notifyWasInteractedWith(PortsideBarEvent event)
static BarEventManager getInstance()
transient boolean noContinue
transient TextPanelAPI text
transient OptionPanelAPI options
transient Map< String, MemoryAPI > memoryMap
transient InteractionDialogAPI dialog
void addPromptAndOption(InteractionDialogAPI dialog, Map< String, MemoryAPI > memoryMap)
static PlanetAPI getTargetPlanet()
String getPersonPortrait()
void init(InteractionDialogAPI dialog, Map< String, MemoryAPI > memoryMap)
void regen(MarketAPI market)
MarketAPI getPilotMarket()
String getPersonFaction()
PlanetaryShieldBarEvent()
void optionSelected(String optionText, Object optionData)
boolean shouldShowAtMarket(MarketAPI market)
String getSpriteName(String category, String id)