1package com.fs.starfarer.api.impl.campaign.rulecmd.salvage.special;
3import com.fs.starfarer.api.Global;
4import com.fs.starfarer.api.campaign.CampaignFleetAPI;
5import com.fs.starfarer.api.campaign.InteractionDialogAPI;
6import com.fs.starfarer.api.characters.PersonAPI;
7import com.fs.starfarer.api.impl.campaign.ids.Commodities;
8import com.fs.starfarer.api.impl.campaign.rulecmd.AddRemoveCommodity;
9import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.SalvageSpecialInteraction.SalvageSpecialData;
10import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.SalvageSpecialInteraction.SalvageSpecialPlugin;
14 public static final String
OPEN =
"open";
15 public static final String
NOT_NOW =
"not_now";
17 public static enum SleeperSpecialType {
30 public static class SleeperPodsSpecialData
implements SalvageSpecialData {
31 public SleeperSpecialType type;
35 public SleeperPodsSpecialData(SleeperSpecialType type,
PersonAPI officer) {
37 this.officer = officer;
40 public SleeperPodsSpecialData(SleeperSpecialType type,
int min,
int max) {
46 public SalvageSpecialPlugin createSpecialPlugin() {
51 private SleeperPodsSpecialData data;
53 private int quantity = 1;
60 super.init(
dialog, specialData);
62 data = (SleeperPodsSpecialData) specialData;
77 quantity = data.min +
random.nextInt(data.max - data.min + 1);
79 if (data.type == SleeperSpecialType.ORGANS) {
81 if (quantity < 1) quantity = 1;
89 if (crewBerths < 0) crewBerths = 0;
92 SleeperSpecialType type = data.type;
94 if (type == SleeperSpecialType.CREW) quantity = Math.min(crewBerths, quantity);
95 if (type == SleeperSpecialType.MARINES) quantity = Math.min(crewBerths, quantity);
97 if (type == SleeperSpecialType.ADMIN || type == SleeperSpecialType.OFFICER) quantity = 1;
123 addText(
"While making a preliminary assessment, your salvage crews " +
124 "find some occupied sleeper pods still running on backup power.");
136 addText(
"While making a preliminary assessment, your salvage crews " +
137 "find some occupied mil-grade sleeper pods still running on backup power.");
149 addText(
"While making a preliminary assessment, your salvage crews " +
150 "find a single occupied sleeper pod still running on backup power.");
163 addText(
"While making a preliminary assessment, your salvage crews " +
164 "find some occupied sleeper pods still running on backup power.");
176 if (
OPEN.equals(optionData)) {
180 addText(
"One by one, the pods begin to open as the thawing process completes. " +
181 "Most of the occupants come through alive, if somewhat dazed.");
188 addText(
"One by one, the pods begin to open as the thawing process completes. " +
189 "Most of the occupants come through alive, if somewhat dazed.");
196 addText(
"The thawing process completes, and the pod opens. " +
197 "It contains an experienced officer, who joins you out of gratitude for being rescued.");
204 addText(
"The thawing process completes, and the pod opens. " +
205 "It contains an experienced planetary administrator, who joins you out of gratitude for being rescued.");
211 addText(
"One by one, the pods begin to open as the thawing process completes. " +
212 "Unfortunately, it's been too long, or something went wrong along the way, and there are no survivors - at least, not with any brain activity.");
222 }
else if (
NOT_NOW.equals(optionData)) {
static SectorAPI getSector()
static final String MARINES
static final String ORGANS
static void addAdminGainText(PersonAPI admin, TextPanelAPI text)
static void addOfficerGainText(PersonAPI officer, TextPanelAPI text)
static void addCommodityGainText(String commodityId, int quantity, TextPanelAPI text)
void setDone(boolean done)
InteractionDialogAPI dialog
void addText(String format)
void setShowAgain(boolean showAgain)
void setEndWithContinue(boolean endWithContinue)
CampaignFleetAPI playerFleet
static void incrNumExceptionalCreated()
static final String NOT_NOW
void optionSelected(String optionText, Object optionData)
void init(InteractionDialogAPI dialog, Object specialData)
FleetDataAPI getFleetData()
void addCommodity(String commodityId, float quantity)
void addAdmin(PersonAPI admin)
void addOfficer(PersonAPI person)
void addOption(String text, Object data)
CampaignFleetAPI getPlayerFleet()
CharacterDataAPI getCharacterData()