1package com.fs.starfarer.api.impl.campaign.rulecmd.salvage.special;
5import com.fs.starfarer.api.Global;
6import com.fs.starfarer.api.campaign.InteractionDialogAPI;
7import com.fs.starfarer.api.campaign.PlanetAPI;
8import com.fs.starfarer.api.campaign.SectorEntityToken;
9import com.fs.starfarer.api.campaign.StarSystemAPI;
10import com.fs.starfarer.api.campaign.econ.MarketAPI.SurveyLevel;
11import com.fs.starfarer.api.characters.MarketConditionSpecAPI;
12import com.fs.starfarer.api.impl.campaign.ids.Conditions;
13import com.fs.starfarer.api.impl.campaign.ids.Entities;
14import com.fs.starfarer.api.impl.campaign.intel.misc.SurveyDataForPlanetIntel;
15import com.fs.starfarer.api.impl.campaign.procgen.themes.DerelictThemeGenerator;
16import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.SalvageSpecialInteraction.SalvageSpecialData;
17import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.SalvageSpecialInteraction.SalvageSpecialPlugin;
18import com.fs.starfarer.api.plugins.SurveyPlugin;
19import com.fs.starfarer.api.util.Misc;
25 public static enum SurveyDataSpecialType {
30 @Deprecated PLANET_INTERESTING_PROPERTY,
31 @Deprecated SYSTEM_PRELIMINARY_SURVEY,
32 @Deprecated AUTO_PICK,
33 @Deprecated AUTO_PICK_NOT_SYSTEM,
37 public static class SurveyDataSpecialData
implements SalvageSpecialData {
38 public SurveyDataSpecialType type =
null;
39 public String entityId =
null;
41 @Deprecated
public String secondaryId =
null;
43 public boolean includeRuins =
true;
44 public SurveyDataSpecialData(SurveyDataSpecialType type) {
48 public SalvageSpecialPlugin createSpecialPlugin() {
53 private SurveyDataSpecialData data;
60 super.init(
dialog, specialData);
62 data = (SurveyDataSpecialData) specialData;
66 if (data.type == SurveyDataSpecialType.PLANET_SURVEY_DATA && data.entityId ==
null) {
70 data.entityId = planet.
getId();
74 if (data.entityId !=
null) {
77 if (
entity ==
null && system ==
null) {
79 data.type = SurveyDataSpecialType.SCRAMBLED;
82 data.type = SurveyDataSpecialType.SCRAMBLED;
90 case PLANET_SURVEY_DATA:
101 addText(
"The $shortName's memory banks have been scrubbed clean by hard radiation, and the systems are largely inert and non-functional.");
107 if (data.entityId ==
null) {
119 String name = planet.
getName();
123 loc = loc.replaceFirst(
"located ",
"");
125 String text1 =
"The $shortName's memory banks are partially accessible, " +
126 "and contain full survey data for " + name +
", " + world +
" located " + loc +
".";
128 String text1ForIntel =
"While exploring $aOrAn $nameInText, your crews found " +
129 "partially accessible memory banks that contain full survey data for " +
130 name +
", " + world +
" located " + loc +
".";
134 text1 =
"Your salvage crews find a functional memory bank in the debris. " +
135 "It contains full survey data for " + name +
", " + world +
" located " + loc +
".";
139 if (conditionId !=
null) {
142 text1 +=
" The world is notable for ";
143 text1ForIntel +=
" The world is notable for ";
145 text1 +=
"being habitable.";
146 text1ForIntel +=
"being habitable.";
148 text1 +=
"having " + spec.
getName().toLowerCase() +
".";
149 text1ForIntel +=
"having " + spec.
getName().toLowerCase() +
".";
169 long xp = plugin.
getXP();
195 super.optionSelected(optionText, optionData);
static SettingsAPI getSettings()
static SectorAPI getSector()
static final String HABITABLE
static final String DEBRIS_FIELD_SHARED
static PlanetAPI findInterestingPlanet(List< StarSystemAPI > systems, Set< PlanetAPI > exclude)
static String getInterestingCondition(PlanetAPI planet, boolean includeRuins)
void setDone(boolean done)
InteractionDialogAPI dialog
void addText(String format)
String getString(String format)
static String getLocatedString(SectorEntityToken target)
void optionSelected(String optionText, Object optionData)
void initPlanetSurveyData()
void init(InteractionDialogAPI dialog, Object specialData)
static List< StarSystemAPI > getSystemsInRange(SectorEntityToken from, Set< StarSystemAPI > exclude, boolean nonEmpty, float maxRange)
static void addSurveyDataFor(PlanetAPI planet, TextPanelAPI text)
static void setFullySurveyed(MarketAPI market, TextPanelAPI text, boolean withNotification)
MarketConditionSpecAPI getMarketConditionSpec(String conditionId)
Object getNewPluginInstance(String id)
String getTypeNameWithWorld()
CampaignFleetAPI getPlayerFleet()
PersonAPI getPlayerPerson()
StarSystemAPI getStarSystem(String name)
SectorEntityToken getEntityById(String id)
String getCustomEntityType()
SurveyLevel getSurveyLevel()
void addXP(long xp, TextPanelAPI textPanel, boolean withMessage, boolean allowBonusXP, boolean withLevelUp)
MutableCharacterStatsAPI getStats()
void init(CampaignFleetAPI fleet, PlanetAPI planet)