Starsector API
Loading...
Searching...
No Matches
GAKallichore.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.missions.academy;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.FactionAPI;
7import com.fs.starfarer.api.campaign.SectorEntityToken;
8import com.fs.starfarer.api.campaign.StarSystemAPI;
9import com.fs.starfarer.api.campaign.econ.MarketAPI;
10import com.fs.starfarer.api.characters.PersonAPI;
11import com.fs.starfarer.api.impl.campaign.ids.Factions;
12import com.fs.starfarer.api.impl.campaign.ids.FleetTypes;
13import com.fs.starfarer.api.impl.campaign.ids.People;
14import com.fs.starfarer.api.impl.campaign.ids.Tags;
15import com.fs.starfarer.api.ui.TooltipMakerAPI;
16import com.fs.starfarer.api.util.Misc;
17
18public class GAKallichore extends GABaseMission {
19
20 public static enum Stage {
21 TALK_TO_ARROYO,
22 VISIT_ARROYO,
23 TALK_TO_GARGOYLE,
24 GET_HACK_HARDWARE,
25 INSTALL_HACK,
26 RETRIEVE_ARCHIVE,
27 RETURN_TO_ACADEMY,
28 COMPLETED,
29 }
30
31 protected PersonAPI baird;
32 protected PersonAPI arroyo;
34 protected PersonAPI loke;
36
37 @Override
38 protected boolean create(MarketAPI createdAt, boolean barEvent) {
39 // if already accepted by the player, abort
40 if (!setGlobalReference("$gaKA_ref", "$gaKA_inProgress")) {
41 return false;
42 }
43
44 setName("The Kallichore Archive");
45
50 if (baird == null) return false;
51 if (arroyo == null) return false;
52 if (gargoyle == null) return false;
53 if (loke == null) return false;
54
55 // if the player destroyed Aztlan Relay before this point, uhh. Need to do something, probably.
56 relay = Global.getSector().getEntityById("aztlan_relay");
57 if (relay == null) return false;
58
61 if (mayasura == null || galatia == null) return false;
62
63 MarketAPI coatl = Global.getSector().getEconomy().getMarket("coatl");
64 if (coatl == null) return false;
65
67
68 setStartingStage(Stage.TALK_TO_ARROYO);
69 addSuccessStages(Stage.COMPLETED);
70
71 makeImportant(arroyo, "$gaKA_contact", Stage.TALK_TO_ARROYO);
72 makeImportant(arroyo.getMarket(), "$gaKA_visitChalet", Stage.VISIT_ARROYO);
73 makeImportant(gargoyle, "$gaKA_contact", Stage.TALK_TO_GARGOYLE);
74 makeImportant(loke.getMarket(), "$gaKA_getHack", Stage.GET_HACK_HARDWARE);
75 makeImportant(relay, "$gaKA_installHack", Stage.INSTALL_HACK);
76 makeImportant(gargoyle, "$gaKA_contactRetrieve", Stage.RETRIEVE_ARCHIVE);
77 makeImportant(baird.getMarket(), "$gaKA_returnHere", Stage.RETURN_TO_ACADEMY);
78
79 setStageOnGlobalFlag(Stage.VISIT_ARROYO, "$gaKA_visitArroyo");
80 setStageOnGlobalFlag(Stage.TALK_TO_GARGOYLE, "$gaKA_talkToGargoyle");
81 setStageOnGlobalFlag(Stage.GET_HACK_HARDWARE, "$gaKA_getHackHardware");
82 setStageOnGlobalFlag(Stage.INSTALL_HACK, "$gaKA_installHack");
83 setStageOnGlobalFlag(Stage.RETRIEVE_ARCHIVE, "$gaKA_retrieveArchive");
84 setStageOnGlobalFlag(Stage.RETURN_TO_ACADEMY, "$gaKA_returnToAcademy");
85 setStageOnGlobalFlag(Stage.COMPLETED, "$gaKA_completed");
86
87
88 beginStageTrigger(Stage.TALK_TO_ARROYO);
90 endTrigger();
91 beginStageTrigger(Stage.TALK_TO_GARGOYLE);
93 endTrigger();
94
95 beginStageTrigger(Stage.RETURN_TO_ACADEMY);
97 endTrigger();
98
99
100 beginStageTrigger(Stage.RETURN_TO_ACADEMY);
102 triggerCreateFleet(FleetSize.VERY_LARGE, FleetQuality.DEFAULT,
103 Factions.HEGEMONY, FleetTypes.TASK_FORCE, fleetLocation);
109 triggerPickLocationAtClosestToEntityJumpPoint(mayasura, fleetLocation, 4000f);
110 triggerPickLocationTowardsEntity(null, 30f, 5000f); // towards the jump-point we just picked
112 triggerFleetSetPatrolActionText("standing off with Port Tse Station");
114 triggerOrderFleetPatrol(fleetLocation);
117 endTrigger();
118
119 beginWithinHyperspaceRangeTrigger(gargoyle.getMarket(), 1f, true, Stage.RETURN_TO_ACADEMY);
120 triggerCreateFleet(FleetSize.LARGE, FleetQuality.SMOD_1,
122 triggerSetFleetOfficers(OfficerNum.MORE, OfficerQuality.HIGHER);
124 //triggerMakeNoRepImpact(); // this happens in dialog instead
129 triggerSpawnFleetAtPickedLocation("$gaKA_patrol", null);
132 triggerFleetMakeImportant(null, Stage.RETURN_TO_ACADEMY);
133 endTrigger();
134
135 triggerCreateMediumPatrol(coatl, Factions.HEGEMONY, relay, Stage.INSTALL_HACK, 0f);
136
137 beginStageTrigger(Stage.COMPLETED);
142 endTrigger();
143
144
145 // post-hack (and probably post-mission) consequences
146 float baseDelay = 90f;
147 //baseDelay = 0f;
148 beginStageTrigger(Stage.RETRIEVE_ARCHIVE);
149 triggerSetGlobalMemoryValueAfterDelay(genDelay(baseDelay), "$gaKA_triTachyonVisit", true);
150 triggerSetGlobalMemoryValueAfterDelay(genDelay(baseDelay), "$gaKA_hegemonyVisit", true);
151 endTrigger();
152
153 beginStageTrigger(Stage.COMPLETED);
154 //triggerSetGlobalMemoryValueAfterDelay(genDelay(2f), "$gaKA_missionCompleted", true);
155 triggerSetGlobalMemoryValue("$gaKA_missionCompleted", true);
156 endTrigger();
157
158
159// //debug trigger to unhide comm entries and set mission stage to retrieving data
160// beginStageTrigger(Stage.TALK_TO_ARROYO);
161// triggerUnhideCommListing(gargoyle);
162// triggerSetGlobalMemoryValue("$gaKA_retrieveArchive", true);
163// endTrigger();
164// // end debug trigger
165
166
167 return true;
168
169 }
170
171 protected void updateInteractionDataImpl() {
172 set("$gaKA_stage", getCurrentStage());
173 }
174
175 @Override
176 public void addDescriptionForNonEndStage(TooltipMakerAPI info, float width, float height) {
177 float opad = 10f;
178 Color h = Misc.getHighlightColor();
180 if (currentStage == Stage.RETURN_TO_ACADEMY) {
181 info.addPara("You've recovered the data archive of the Academy's previous Provost, Tomas Kallichore, " +
182 "which contains the results of failed gate activation experiments.", opad);
183 } else {
184 info.addPara("Recover the data archive of the Academy's previous Provost, Tomas Kallichore, " +
185 "which contains the results of failed gate activation experiments.", opad);
186 info.addPara("The archive is " +
187 "currently in the ultra-secure data vaults of the Hegemony Ministry of Technology Standards.", opad,
188 heg.getBaseUIColor(), "Hegemony");
189 }
190
191 if (currentStage == Stage.TALK_TO_ARROYO) {
192 info.addPara(getGoTalkToPersonText(arroyo) + ". He has a relationship with Provost Baird that "
193 + "can be leveraged to compel his cooperation.", opad);
194 } else if (currentStage == Stage.VISIT_ARROYO) {
195 info.addPara("Visit " + arroyo.getNameString() + " in person, at his planetside chalet.", opad);
196 } else if (currentStage == Stage.TALK_TO_GARGOYLE) {
197 info.addPara(getGoTalkToPersonText(gargoyle) + ", a hacker, to arrange a break in to the data vaults. " +
198 "Arroyo is sure a job \"as stupid as you're proposing\" " +
199 "will prove irresistible.", opad);
200 } else if (currentStage == Stage.GET_HACK_HARDWARE) {
201 info.addPara(getGoToMarketText(loke.getMarket()) + " and pick up the hack device from a " +
202 "storage unit.", opad);
203 } else if (currentStage == Stage.INSTALL_HACK) {
204 info.addPara(getGoToSystemTextShort(relay.getStarSystem()) + " and install the hack transmitter " +
205 "on " + relay.getName() + ".", opad);
206 } else if (currentStage == Stage.RETRIEVE_ARCHIVE) {
208 " and retrieve Kallichore's archive from Gargoyle.", opad);
209 } else if (currentStage == Stage.RETURN_TO_ACADEMY) {
210 info.addPara("Return to the Galatia Academy and talk to Provost Baird.", opad);
211 }
212 }
213
214 @Override
215 public boolean addNextStepText(TooltipMakerAPI info, Color tc, float pad) {
216 Color h = Misc.getHighlightColor();
217 if (currentStage == Stage.TALK_TO_ARROYO) {
218 info.addPara(getGoTalkToPersonText(arroyo), tc, pad);
219 return true;
220 } else if (currentStage == Stage.VISIT_ARROYO) {
221 info.addPara("Visit " + arroyo.getNameString() + " in person, at his planetside chalet", tc, pad);
222 return true;
223 } else if (currentStage == Stage.TALK_TO_GARGOYLE) {
224 info.addPara(getGoTalkToPersonText(gargoyle), tc, pad);
225 return true;
226 } else if (currentStage == Stage.GET_HACK_HARDWARE) {
227 info.addPara(getGoToMarketText(loke.getMarket()) + " and pick up the hack device", tc, pad);
228 return true;
229 } else if (currentStage == Stage.INSTALL_HACK) {
230 info.addPara(getGoToSystemTextShort(relay.getStarSystem()) + " and install the hack transmitter " +
231 "on the " + relay.getName() + "", tc, pad);
232 return true;
233 } else if (currentStage == Stage.RETRIEVE_ARCHIVE) {
235 " and retrieve Kallichore's archive", tc, pad);
236 } else if (currentStage == Stage.RETURN_TO_ACADEMY) {
237 info.addPara("Return to the Galatia Academy and talk to Provost Baird", tc, pad);
238 }
239 return false;
240 }
241
242 @Override
243 public String getPostfixForState() {
244 if (startingStage != null) {
245 return "";
246 }
247 return super.getPostfixForState();
248 }
249
250}
251
252
253
254
255
static SectorAPI getSector()
Definition Global.java:65
boolean addNextStepText(TooltipMakerAPI info, Color tc, float pad)
void addDescriptionForNonEndStage(TooltipMakerAPI info, float width, float height)
boolean create(MarketAPI createdAt, boolean barEvent)
void makeImportant(PersonAPI person, String flag, Enum ... stages)
void triggerCreateMediumPatrol(MarketAPI from, String factionId, SectorEntityToken entityToPatrol, Object stage, float extraSuspicion)
void beginWithinHyperspaceRangeTrigger(SectorEntityToken entity, float rangeLY, boolean requirePlayerInHyperspace, Object ... stages)
void triggerMovePersonToMarket(PersonAPI person, MarketAPI market, boolean alwaysAddToComms)
void triggerPickLocationAtClosestToEntityJumpPoint(StarSystemAPI system, SectorEntityToken entity)
void triggerPickLocationTowardsEntity(SectorEntityToken entity, float arc, float dist)
void triggerCreateFleet(FleetSize size, FleetQuality quality, String factionId, String type, StarSystemAPI roughlyWhere)
static Color getHighlightColor()
Definition Misc.java:792
FactionAPI getFaction(String factionId)
SectorEntityToken getEntityById(String id)
LabelAPI addPara(String format, float pad, Color hl, String... highlights)