Starsector API
Loading...
Searching...
No Matches
CorruptPLClerkSuppliesBarEvent.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.intel.bar.events;
2
3import java.awt.Color;
4
5import com.fs.starfarer.api.campaign.econ.CommodityOnMarketAPI;
6import com.fs.starfarer.api.campaign.econ.MarketAPI;
7import com.fs.starfarer.api.characters.PersonAPI;
8import com.fs.starfarer.api.impl.campaign.econ.impl.BaseIndustry;
9import com.fs.starfarer.api.impl.campaign.ids.Commodities;
10import com.fs.starfarer.api.impl.campaign.ids.Factions;
11import com.fs.starfarer.api.impl.campaign.ids.Ranks;
12import com.fs.starfarer.api.impl.campaign.ids.Tags;
13import com.fs.starfarer.api.impl.campaign.intel.contacts.ContactIntel;
14import com.fs.starfarer.api.util.Misc;
15
17
19 super();
20 }
21
22 public boolean shouldShowAtMarket(MarketAPI market) {
23 if (!super.shouldShowAtMarket(market)) return false;
25
26 if (!market.getFactionId().equals(Factions.PERSEAN)) {
27 return false;
28 }
29 if (market.getId().equals("kazeron")) return false;
30 if (market.getStabilityValue() > 7) return false;
31
32 if (!market.hasSpaceport()) return false;
33
34// boolean hasStation = false;
35// for (Industry ind : market.getIndustries()) {
36// if (ind.getSpec().hasTag(Industries.TAG_STATION)) {
37// hasStation = true;
38// break;
39// }
40// }
41// if (!hasStation) return false;
42
43
44 return true;
45 }
46
47 @Override
48 protected String getCommodityId() {
49 return Commodities.SUPPLIES;
50 }
51
52 @Override
53 protected void doExtraConfirmActions() {
54 ContactIntel.addPotentialContact(person, market, text);
55 }
56
57 @Override
58 protected void adjustPerson(PersonAPI person) {
59 super.adjustPerson(person);
60 person.setImportanceAndVoice(pickLowImportance(), random);
61 person.addTag(Tags.CONTACT_TRADE);
62 }
63
64 @Override
65 protected String getPersonPost() {
66 return Ranks.POST_SUPPLY_MANAGER;
67 }
68
69 @Override
70 protected String getPersonFaction() {
71 return Factions.PERSEAN;
72 }
73
74 @Override
75 protected String getPersonRank() {
76 return Ranks.CITIZEN;
77 }
78
79
80 @Override
81 protected int computeQuantity() {
82 int quantity = 30 + 10 * random.nextInt(4);
83
84 CommodityOnMarketAPI com = market.getCommodityData(commodity);
85 int size = com.getAvailable();
86 if (size < 1) size = 1;
87 quantity *= Math.max(1, BaseIndustry.getSizeMult(size) - 2);
88 return quantity;
89 }
90
91 @Override
92 protected float getPriceMult() {
93 return 0.75f;
94 }
95
96 @Override
97 protected String getPrompt() {
98 return "A " + getManOrWoman() + " in the port authority uniform is discreetely trying to catch your eye.";
99 }
100
101 @Override
102 protected String getOptionText() {
103 return "Talk to the port authority official";
104 }
105
106 @Override
107 protected String getMainText() {
108 return "You relent and sit with the port clerk who smiles and offers to buy you a drink. " +
109 "\"I'm familiar with your cargo manifest, of course, and thought you might be interested " +
110 "in an opportunity.\" " + Misc.ucFirst(getHeOrShe()) + " looks around, then back at you," +
111 " with a sly smile. \"Strictly off-the-books, of course. This job does allow me to, " +
112 "shall we say, exercise personal judgment.\"\n\n" +
113
114 "The port clerk speaks broadly about how cargo goes missing all the time. " +
115 "Even a generous stock of %s supplies might go missing. \"It's earmarked, of course, " +
116 "for the rich bastards from one of those Kazeron combines. " +
117 "They can afford replacements on the open market, surely.\" " +
118 Misc.ucFirst(getHeOrShe()) + " goes on to explain that %s per unit would be necessary for " +
119 getHisOrHer() + " trouble, \"Think of it as a commission,\" " + getHeOrShe() + " says.";
120 }
121
122 @Override
123 protected String [] getMainTextTokens() {
124 return new String [] { Misc.getWithDGS(quantity), Misc.getDGSCredits(unitPrice) };
125 }
126 @Override
127 protected Color [] getMainTextColors() {
128 return new Color [] { Misc.getHighlightColor(), Misc.getHighlightColor() };
129 }
130
131 @Override
132 protected String getConfirmText() {
133 return "Accept and transfer " + Misc.getDGSCredits(unitPrice * quantity) + " to the TriAnon account provided";
134 }
135
136 @Override
137 protected String getCancelText() {
138 return "Decline, explaining that you don't wish to meddle in League affairs";
139 }
140
141 @Override
142 protected String getAcceptText() {
143 return "You leave the bar to find a message ping on your TriPad from the local port authority. " +
144 "It seems you've left %s of your supplies in cargo bay twelve, " +
145 "and the bay needs to be cleared out by the end of the next work-shift.";
146 }
147
148 @Override
149 protected String [] getAcceptTextTokens() {
150 return new String [] { Misc.getWithDGS(quantity) };
151 }
152 @Override
153 protected Color [] getAcceptTextColors() {
154 return new Color [] { Misc.getHighlightColor() };
155 }
156
157
158
159}
160
161
162