001package com.fs.starfarer.api.impl.campaign.intel.bar.events; 002 003import java.awt.Color; 004 005import com.fs.starfarer.api.campaign.econ.MarketAPI; 006import com.fs.starfarer.api.characters.PersonAPI; 007import com.fs.starfarer.api.impl.campaign.ids.Commodities; 008import com.fs.starfarer.api.impl.campaign.ids.Factions; 009import com.fs.starfarer.api.impl.campaign.ids.Ranks; 010import com.fs.starfarer.api.impl.campaign.ids.Tags; 011import com.fs.starfarer.api.impl.campaign.intel.contacts.ContactIntel; 012import com.fs.starfarer.api.util.Misc; 013 014public class DiktatLobsterBarEvent extends BaseGetCommodityBarEvent { 015 016 public DiktatLobsterBarEvent() { 017 super(); 018 } 019 020 public boolean shouldShowAtMarket(MarketAPI market) { 021 if (!super.shouldShowAtMarket(market)) return false; 022 regen(market); 023 024 if (!market.getFactionId().equals(Factions.DIKTAT)) { 025 return false; 026 } 027 028 return true; 029 } 030 031 @Override 032 protected void doExtraConfirmActions() { 033 ContactIntel.addPotentialContact(person, market, text); 034 } 035 036 @Override 037 protected void adjustPerson(PersonAPI person) { 038 super.adjustPerson(person); 039 person.setImportanceAndVoice(pickMediumImportance(), random); 040 person.addTag(Tags.CONTACT_MILITARY); 041 } 042 043 @Override 044 protected String getPersonPost() { 045 return Ranks.POST_AGENT; 046 } 047 048 @Override 049 protected String getCommodityId() { 050 return Commodities.LOBSTER; 051 } 052 053 @Override 054 protected String getPersonFaction() { 055 return Factions.DIKTAT; 056 } 057 058 @Override 059 protected String getPersonRank() { 060 return Ranks.GROUND_CAPTAIN; 061 } 062 063 @Override 064 protected int computeQuantity() { 065 int quantity = 50 + 50 * random.nextInt(4); 066 return quantity; 067 } 068 069 @Override 070 protected float getPriceMult() { 071 return 0.75f; 072 } 073 074 @Override 075 protected String getPrompt() { 076 return "A grinning security officer is gesturing excitedly to a nearby patron."; 077 } 078 079 @Override 080 protected String getOptionText() { 081 return "Sidle up to the security officer and see what they're so pleased about"; 082 } 083 084 @Override 085 protected String getMainText() { 086 String heOrShe = getHeOrShe(); 087 String himOrHer = getHimOrHer(); 088 String hisOrHer = getHisOrHer(); 089 090 return "\"Why, just today an amazing opportunity fell into my lap. " + 091 "And yours as well, how wonderful!\" " + heOrShe + " sweeps " + hisOrHer + " arm regally " + 092 "to encompass the scale of your shared luck, somehow managing not to spill the drinks of " + 093 "several patrons.\n\n" 094 + "You are told the story of tiresome property seizures from " + 095 "'disloyal elements'.\n\n" 096 + " \"It's not so much trouble to, you know. Play along? " + 097 "But they insist on carrying on, and on... not that I mind the perks of the job, of course.\""; 098 } 099 100 @Override 101 protected String getMainText2() { 102 String heOrShe = getHeOrShe(); 103 String himOrHer = getHimOrHer(); 104 String hisOrHer = getHisOrHer(); 105 106 return 107 "What this amounts to, you are told, is that the District 4 Gendarmerie's evidence " + 108 "locker - and maintenance bay, and several interrogation rooms - are filled with cases " + 109 "of cryo-stabilized Volturnian Lobster, nearly %s units in all. The officers eat like " + 110 "royalty, yes, but there's only so much one can take and the coolant cells won't last " + 111 "another week without replacement, so.\n\n" 112 + Misc.ucFirst(heOrShe) + " turns to " + 113 "you. %s will satisfy the district commandant as well as your new friend here, " + 114 "and the entire cargo can be transferred to your holds without the bother of tariffs.\n\n" + 115 116 "\"What do you say, will you help maintain a little law and order?\""; 117 } 118 119 @Override 120 protected String [] getMainText2Tokens() { 121 return new String [] { Misc.getWithDGS(quantity), Misc.getDGSCredits(unitPrice * quantity) }; 122 } 123 @Override 124 protected Color [] getMainText2Colors() { 125 return new Color [] { Misc.getHighlightColor(), Misc.getHighlightColor() }; 126 } 127 128 @Override 129 protected String getConfirmText() { 130 return "Accept the offer and transfer " + Misc.getDGSCredits(unitPrice * quantity) + " to the provided TriAnon account"; 131 } 132 133 @Override 134 protected String getCancelText() { 135 return "Decline the offer apologetically, citing a terrible shellfish allergy"; 136 } 137 138 @Override 139 protected String getAcceptText() { 140 return null; 141 } 142 143 @Override 144 protected String [] getAcceptTextTokens() { 145 return new String [] {}; 146 } 147 @Override 148 protected Color [] getAcceptTextColors() { 149 return new Color [] {}; 150 } 151 152} 153 154 155