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.impl.PlayerFleetPersonnelTracker; 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.util.Misc; 011 012public class MercsOnTheRunBarEvent extends BaseGetCommodityBarEvent { 013 014 public MercsOnTheRunBarEvent() { 015 super(); 016 } 017 018 public boolean shouldShowAtMarket(MarketAPI market) { 019 //if (true) return true; 020 021 if (!super.shouldShowAtMarket(market)) return false; 022 regen(market); 023 024 if (market.getFactionId().equals(Factions.PIRATES)) { 025 return false; 026 } 027 028 //if (market.getStabilityValue() >= 7) return false; 029 030 return true; 031 } 032 033 034 @Override 035 protected void doExtraConfirmActions() { 036 PlayerFleetPersonnelTracker.getInstance().update(); 037 PlayerFleetPersonnelTracker.getInstance().getMarineData().addXP((float)quantity); 038 } 039 040 @Override 041 protected String getCommodityId() { 042 return Commodities.MARINES; 043 } 044 045 @Override 046 protected String getPersonFaction() { 047 return Factions.INDEPENDENT; 048 } 049 050 @Override 051 protected String getPersonRank() { 052 return Ranks.GROUND_SERGEANT; 053 } 054 055 @Override 056 protected int computeQuantity() { 057 //int quantity = 10; 058 int quantity = 30 + random.nextInt(21); 059 return quantity; 060 } 061 062 @Override 063 protected float getPriceMult() { 064 return 0.75f; 065 } 066 067 @Override 068 protected String getPrompt() { 069 return "A table of tattooed roughs who bear - to your discerning eye, mil-grade cybermods - are drinking alarming amounts of liquor."; 070 } 071 072 @Override 073 protected String getOptionText() { 074 return "Join the table of tattooed roughs and see if their contract is up"; 075 } 076 077 @Override 078 protected String getMainText() { 079 return "You prove yourself worth speaking to by partaking in a round of \"Atmo Drops\", " + 080 "a drink based largely on consuming eye-watering liquor as quickly as possible, " + 081 "with the mercenary band. They're drunk for sure, but are composed enough to speak " + 082 "around the precise details of why they're being investigated by local authorities.\n\n" + 083 "After a couple of the mercs head up to order a round of \"Orbital Bombardments\"," + 084 " their leader pulls you aside and sketches out a proposal. \"We've got %s suits, " + 085 "we fight in vac or black. I'll give you our contract for %s, " + 086 "and that's giving it away. Put us to work, or sell it off elsewhere, doesn't matter to " + 087 "me if you can get us outta this fix. What'dya say?\""; 088 } 089 090 @Override 091 protected String [] getMainTextTokens() { 092 return new String [] { Misc.getWithDGS(quantity), Misc.getDGSCredits(unitPrice * quantity) }; 093 } 094 @Override 095 protected Color [] getMainTextColors() { 096 return new Color [] { Misc.getHighlightColor(), Misc.getHighlightColor() }; 097 } 098 099 @Override 100 protected String getConfirmText() { 101 return "Buy the mercenary marine contract and sneak them off " + market.getName(); 102 } 103 104 @Override 105 protected String getCancelText() { 106 return "Decline the proposal, but stay for an \"Orbital Bombardment\" to soften the blow"; 107 } 108 109 @Override 110 protected String getAcceptText() { 111 return "Some clever device provided by the mercs convinces the automated scanners that two " + 112 "particular cargo containers are half-filled with mildly radioactive silicate gravel " + 113 "and nothing else. Your logistics officer sneaks them aboard with no problems."; 114 } 115 116 @Override 117 protected String [] getAcceptTextTokens() { 118 return new String [] { }; 119 } 120 @Override 121 protected Color [] getAcceptTextColors() { 122 return new Color [] { }; 123 } 124 125 @Override 126 protected String getDeclineText() { 127 return "You wake up the next day in a small room above the bar with no particular memory of how " + 128 "you got there. How many more rounds was it with the mercs, one? Three?"; 129 } 130 131// @Override 132// protected String [] getAcceptTextTokens() { 133// return new String [] { }; 134// } 135// @Override 136// protected Color [] getAcceptTextColors() { 137// return new Color [] { }; 138// } 139 140 141} 142 143 144