Starsector API
Loading...
Searching...
No Matches
GAIntro2.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.missions.academy;
2
3import java.awt.Color;
4import java.util.List;
5import java.util.Map;
6
7import com.fs.starfarer.api.campaign.InteractionDialogAPI;
8import com.fs.starfarer.api.campaign.econ.MarketAPI;
9import com.fs.starfarer.api.campaign.rules.MemoryAPI;
10import com.fs.starfarer.api.characters.PersonAPI;
11import com.fs.starfarer.api.impl.campaign.ids.People;
12import com.fs.starfarer.api.ui.TooltipMakerAPI;
13import com.fs.starfarer.api.util.Misc;
14import com.fs.starfarer.api.util.Misc.Token;
15
16public class GAIntro2 extends GABaseMission {
17
18 public static enum Stage {
19 GO_TO_ACADEMY,
20 COMPLETED,
21 }
22
23 protected int gaIntro2_credits;
24 protected PersonAPI baird;
25 protected PersonAPI sebestyen;
26 protected boolean pointAtSebestyen = false;
27
28 @Override
29 protected boolean create(MarketAPI createdAt, boolean barEvent) {
30
31 //System.out.print("attempting to start gaIntro2");
32
33 // if already accepted by the player, abort
34 if (!setGlobalReference("$gaIntro2_ref")) {
35 //System.out.print("aborting because missions is already accepted");
36 return false;
37 }
38
39 baird = getImportantPerson(People.BAIRD);
40 if (baird == null) return false;
41
42 sebestyen = getImportantPerson(People.SEBESTYEN);
43 if (sebestyen == null) return false;
44
45 setStartingStage(Stage.GO_TO_ACADEMY);
46 //setStartingStage(Stage.GO_TO_ACADEMY_SEB);
47 addSuccessStages(Stage.COMPLETED);
48
49 setStoryMission();
50
51 //System.out.print("galatia found");
52
53 gaIntro2_credits = 18000; // so its a fixed number, sue me.
54
55 setStartingStage(Stage.GO_TO_ACADEMY);
56 addSuccessStages(Stage.COMPLETED);
57
58
59 makeImportant(baird.getMarket(), "$gaIntro2_returnHere", Stage.GO_TO_ACADEMY);
60 setStageOnGlobalFlag(Stage.GO_TO_ACADEMY, "$gaIntro2_started"); // so it isn't offered again
61
62 //setStageOnGlobalFlag(Stage.GO_TO_ACADEMY_SEB, "$gaIntro2_started"); // so it isn't offered again
63 setStageOnGlobalFlag(Stage.COMPLETED, "$gaIntro2_completed");
64
65 setRepFactionChangesNone();
66 setRepPersonChangesNone();
67
68 //System.out.print("starting gaIntro2 for real");
69
70 return true;
71 }
72
73 protected boolean callAction(String action, String ruleId, InteractionDialogAPI dialog, List<Token> params, Map<String, MemoryAPI> memoryMap) {
74
75 if ("makeSebestyenImportant".equals(action)) {
76 if (!pointAtSebestyen) {
77 makeImportant(sebestyen, null, Stage.GO_TO_ACADEMY);
78 makePrimaryObjective(sebestyen);
79 makeUnimportant(baird.getMarket());
80 pointAtSebestyen = true;
81 }
82 return true;
83 }
84 return false;
85 }
86
87 protected void updateInteractionDataImpl() {
88 set("$gaIntro2_stage", getCurrentStage());
89 set("$gaIntro2_credits", Misc.getWithDGS(gaIntro2_credits));
90 }
91
92 @Override
93 public void addDescriptionForNonEndStage(TooltipMakerAPI info, float width, float height) {
94 float opad = 10f;
95 //Color h = Misc.getHighlightColor();
96 if (currentStage == Stage.GO_TO_ACADEMY) {
97 if (pointAtSebestyen) {
98 info.addPara("Return the data core to Academician Sebestyen. He'll get you your reward.", opad);
99 addStandardMarketDesc("Sebestyen is located " + sebestyen.getMarket().getOnOrAt(), sebestyen.getMarket(), info, opad);
100 }
101 else
102 {
103 info.addPara("Return the data core to the Galatia Academy for a reward.", opad);
104 }
105 }
106 }
107
108 @Override
109 public boolean addNextStepText(TooltipMakerAPI info, Color tc, float pad) {
110 //Color h = Misc.getHighlightColor();
111 if (currentStage == Stage.GO_TO_ACADEMY) {
112
113 if (pointAtSebestyen) {
114 info.addPara("Return the data core to Academician Sebestyen at the Galatia Academy in the Galatia system", tc, pad);
115 }
116 else
117 {
118 info.addPara("Go to the Galatia Academy in the Galatia system", tc, pad);
119 }
120 return true;
121 }
122 return false;
123 }
124
125 @Override
126 public String getBaseName() {
127 return "Return the Data Core";
128 }
129
130 @Override
131 public String getPostfixForState() {
132 if (startingStage != null) {
133 return "";
134 }
135 return super.getPostfixForState();
136 }
137}
138
139
140
141
142
void addDescriptionForNonEndStage(TooltipMakerAPI info, float width, float height)
Definition GAIntro2.java:93
boolean create(MarketAPI createdAt, boolean barEvent)
Definition GAIntro2.java:29
boolean callAction(String action, String ruleId, InteractionDialogAPI dialog, List< Token > params, Map< String, MemoryAPI > memoryMap)
Definition GAIntro2.java:73
boolean addNextStepText(TooltipMakerAPI info, Color tc, float pad)