Starsector API
Loading...
Searching...
No Matches
OrbitalStation.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.econ.impl;
2
3import java.awt.Color;
4
5import org.json.JSONException;
6import org.json.JSONObject;
7
8import com.fs.starfarer.api.Global;
9import com.fs.starfarer.api.campaign.AICoreOfficerPlugin;
10import com.fs.starfarer.api.campaign.BattleAPI;
11import com.fs.starfarer.api.campaign.CampaignEventListener.FleetDespawnReason;
12import com.fs.starfarer.api.campaign.CampaignFleetAPI;
13import com.fs.starfarer.api.campaign.CustomCampaignEntityAPI;
14import com.fs.starfarer.api.campaign.FleetInflater;
15import com.fs.starfarer.api.campaign.SectorEntityToken;
16import com.fs.starfarer.api.campaign.econ.CommoditySpecAPI;
17import com.fs.starfarer.api.campaign.econ.Industry;
18import com.fs.starfarer.api.campaign.econ.MarketAPI.MarketInteractionMode;
19import com.fs.starfarer.api.campaign.listeners.FleetEventListener;
20import com.fs.starfarer.api.characters.PersonAPI;
21import com.fs.starfarer.api.combat.ShipVariantAPI;
22import com.fs.starfarer.api.fleet.FleetMemberAPI;
23import com.fs.starfarer.api.fleet.FleetMemberType;
24import com.fs.starfarer.api.impl.campaign.events.OfficerManagerEvent;
25import com.fs.starfarer.api.impl.campaign.fleets.DefaultFleetInflater;
26import com.fs.starfarer.api.impl.campaign.fleets.DefaultFleetInflaterParams;
27import com.fs.starfarer.api.impl.campaign.fleets.FleetFactoryV3;
28import com.fs.starfarer.api.impl.campaign.fleets.FleetParamsV3;
29import com.fs.starfarer.api.impl.campaign.ids.Abilities;
30import com.fs.starfarer.api.impl.campaign.ids.Commodities;
31import com.fs.starfarer.api.impl.campaign.ids.Entities;
32import com.fs.starfarer.api.impl.campaign.ids.Factions;
33import com.fs.starfarer.api.impl.campaign.ids.FleetTypes;
34import com.fs.starfarer.api.impl.campaign.ids.HullMods;
35import com.fs.starfarer.api.impl.campaign.ids.Industries;
36import com.fs.starfarer.api.impl.campaign.ids.MemFlags;
37import com.fs.starfarer.api.impl.campaign.ids.Stats;
38import com.fs.starfarer.api.impl.campaign.ids.Tags;
39import com.fs.starfarer.api.impl.campaign.procgen.themes.RemnantOfficerGeneratorPlugin;
40import com.fs.starfarer.api.impl.campaign.rulecmd.salvage.MarketCMD.RaidDangerLevel;
41import com.fs.starfarer.api.ui.TooltipMakerAPI;
42import com.fs.starfarer.api.util.Misc;
43import com.fs.starfarer.api.util.Pair;
44
45
46
47public class OrbitalStation extends BaseIndustry implements FleetEventListener {
48
49 public static float DEFENSE_BONUS_BASE = 0.5f;
50 public static float DEFENSE_BONUS_BATTLESTATION = 1f;
51 public static float DEFENSE_BONUS_FORTRESS = 2f;
52
53 public static float IMPROVE_STABILITY_BONUS = 1f;
54
55 public void apply() {
56 super.apply(false);
57
58 int size = 3;
59
60 boolean battlestation = getSpec().hasTag(Industries.TAG_BATTLESTATION);
61 boolean starfortress = getSpec().hasTag(Industries.TAG_STARFORTRESS);
62 if (battlestation) {
63 size = 5;
64 } else if (starfortress) {
65 size = 7;
66 }
67
69
71
72 demand(Commodities.CREW, size);
74
75 float bonus = DEFENSE_BONUS_BASE;
76 if (battlestation) bonus = DEFENSE_BONUS_BATTLESTATION;
77 else if (starfortress) bonus = DEFENSE_BONUS_FORTRESS;
79 .modifyMult(getModId(), 1f + bonus, getNameForModifier());
80
82
83 if (!isFunctional()) {
84 supply.clear();
85 unapply();
86 } else {
88 }
89 }
90
91 @Override
92 public void unapply() {
93 super.unapply();
94
96
98
100 }
101
102 protected void applyCRToStation() {
103 if (stationFleet != null) {
104 float cr = getCR();
106 member.getRepairTracker().setCR(cr);
107 }
109 if (inflater != null) {
110 if (stationFleet.isInflated()) {
112 }
114 if (inflater instanceof DefaultFleetInflater) {
116 ((DefaultFleetInflaterParams)dfi.getParams()).allWeapons = true;
117 }
118 }
119 }
120 }
121
122 protected float getCR() {
123 float deficit = getMaxDeficit(Commodities.CREW, Commodities.SUPPLIES).two;
126
127 if (deficit < 0) deficit = 0f;
128 if (demand < 1) {
129 demand = 1;
130 deficit = 0f;
131 }
132
133
134 float q = Misc.getShipQuality(market);
135 if (q < 0) q = 0;
136 if (q > 1) q = 1;
137
138 float d = (demand - deficit) / demand;
139 if (d < 0) d = 0;
140 if (d > 1) d = 1;
141
142 //float cr = 0.2f + 0.4f * d + 0.4f * q;
143 //float cr = 0.2f + 0.8f * Math.min(d, q);
144 float cr = 0.5f + 0.5f * Math.min(d, q);
145 if (cr > 1) cr = 1;
146
147 return cr;
148 }
149
150
151 protected boolean hasPostDemandSection(boolean hasDemand, IndustryTooltipMode mode) {
152 //return mode == IndustryTooltipMode.NORMAL && isFunctional();
153 return mode != IndustryTooltipMode.NORMAL || isFunctional();
154 }
155
156 @Override
157 protected void addPostDemandSection(TooltipMakerAPI tooltip, boolean hasDemand, IndustryTooltipMode mode) {
158 //if (mode == IndustryTooltipMode.NORMAL && isFunctional()) {
159 if (mode != IndustryTooltipMode.NORMAL || isFunctional()) {
160 Color h = Misc.getHighlightColor();
161 float opad = 10f;
162
163 float cr = getCR();
164 tooltip.addPara("Station combat readiness: %s", opad, h, "" + Math.round(cr * 100f) + "%");
165
166 addStabilityPostDemandSection(tooltip, hasDemand, mode);
167
168 boolean battlestation = getSpec().hasTag(Industries.TAG_BATTLESTATION);
169 boolean starfortress = getSpec().hasTag(Industries.TAG_STARFORTRESS);
170 float bonus = DEFENSE_BONUS_BASE;
171 if (battlestation) bonus = DEFENSE_BONUS_BATTLESTATION;
172 else if (starfortress) bonus = DEFENSE_BONUS_FORTRESS;
174 }
175 }
176
177 @Override
178 protected Object readResolve() {
179 super.readResolve();
180// if (tracker == null) {
181// tracker = new IntervalUtil(0.7f, 1.3f);
182// }
183 return this;
184 }
185
186
187
189 return stationFleet;
190 }
194
195
197 protected boolean usingExistingStation = false;
199
200 //protected IntervalUtil tracker = new IntervalUtil(0.7f, 1.3f);
201
202 @Override
203 public void advance(float amount) {
204 super.advance(amount);
205
206 if (Global.getSector().getEconomy().isSimMode()) return;
207
208
209 if (stationEntity == null) {
210 spawnStation();
211 }
212
213 if (stationFleet != null) {
214 stationFleet.setAI(null);
215 if (stationFleet.getOrbit() == null && stationEntity != null) {
217 }
218 }
219
220// if (stationFleet != null) {
221// if (stationFleet.getAI() != null) {
222// System.out.println("wefwefew");
223// }
224// System.out.println("Station orbit: "+ stationFleet.getAI());
226// if (stationFleet.getOrbitFocus() == null) {
227// System.out.println("wefwefe");
228// }
229// }
230
231// if (stationEntity != null && stationFleet != null) {
232// stationFleet.setFacing(stationEntity.getFacing());
233// }
234
235// if (isFunctional()) {
236// if (stationEntity == null) {
237// spawnStation(false);
238// }
239// } else {
240// if (stationEntity != null) {
241// removeStationEntityAndFleetIfNeeded();
242// }
243// }
244
245// if (stationFleet != null) {
246// //stationFleet.advance(amount);
247// if (stationEntity != null) {
248// stationFleet.setOrbit(null);
249// stationFleet.setLocation(stationEntity.getLocation().x, stationEntity.getLocation().y);
250// stationFleet.setContainingLocation(stationEntity.getContainingLocation());
251// }
252// }
253// if (stationFleet != null && stationFleet.isInCurrentLocation()) {
254// System.out.println("inf: " + stationFleet.getInflater());
255// }
256
257// float days = Global.getSector().getClock().convertToDays(amount);
258// tracker.advance(days);
259// if (tracker.intervalElapsed()) {
260// if (stationFleet != null) {
261// stationFleet.deflate();
262// }
263// }
264 }
265
266
267 @Override
268 protected void buildingFinished() {
269 super.buildingFinished();
270
271 if (stationEntity != null && stationFleet != null) {
273 } else {
274 spawnStation();
275 }
276 }
277
278 @Override
279 public void notifyBeingRemoved(MarketInteractionMode mode, boolean forUpgrade) {
280 super.notifyBeingRemoved(mode, forUpgrade);
281
282 if (!forUpgrade) {
284 }
285 }
286
287 @Override
288 protected void upgradeFinished(Industry previous) {
289 super.upgradeFinished(previous);
290
291 if (previous instanceof OrbitalStation) {
292 OrbitalStation prev = (OrbitalStation) previous;
296
297 if (stationFleet != null) {
300 }
301
302 if (stationEntity != null && stationFleet != null) {
304 } else {
305 spawnStation();
306 }
307 }
308 }
309
311 if (stationEntity != null) {
314
316
320
321 // commented out so that MarketCMD doesn't NPE if you destroy a market through bombardment of a station
322 //stationEntity.setMarket(null);
323
325 ((CustomCampaignEntityAPI)stationEntity).setFleetForVisual(null);
326 float origRadius = ((CustomCampaignEntityAPI)stationEntity).getCustomEntitySpec().getDefaultRadius();
327 ((CustomCampaignEntityAPI)stationEntity).setRadius(origRadius);
328 }
329
330 if (stationFleet != null) {
333 }
334
335 stationEntity = null;
336 stationFleet = null;
337 }
338 }
339
340
341 @Override
342 public void notifyColonyRenamed() {
343 super.notifyColonyRenamed();
344 if (!usingExistingStation && stationFleet != null && stationEntity != null) {
345 stationFleet.setName(market.getName() + " Station");
346 stationEntity.setName(market.getName() + " Station");
347 }
348 }
349
350
351
352 protected void spawnStation() {
353 FleetParamsV3 fParams = new FleetParamsV3(null, null,
355 1f,
357 0,
358 0, 0, 0, 0, 0, 0);
359 fParams.allWeapons = true;
360
362
363// if (market.getId().equals("jangala")) {
364// System.out.println("wefwefew");
365// }
366
368 //stationFleet.setName(getCurrentName());
370
371
373
374 //stationFleet.getMemoryWithoutUpdate().set(MemFlags.MEMORY_KEY_MAKE_ALLOW_DISENGAGE, true);
375
376 // needed for AI fleets to engage it, as they engage the hidden station fleet, unlike
377 // the player that interacts with the stationEntity
382
383 stationFleet.setAI(null);
385
386
388
389 if (stationEntity instanceof CustomCampaignEntityAPI) {
392 }
393 }
394
398
399
401 }
402
403
405 if (stationEntity == null) {
407 if (entity.hasTag(Tags.STATION) && !entity.hasTag("NO_ORBITAL_STATION")) { // added NO_ORBITAL_STATION per modder request
408 stationEntity = entity;
410 break;
411 }
412 }
413 }
414
415 if (stationEntity == null) {
419 float orbitRadius = primary.getRadius() + 150f;
420 stationEntity.setCircularOrbitWithSpin(primary, (float) Math.random() * 360f, orbitRadius, orbitRadius / 10f, 5f, 5f);
423 }
424 }
425
426
428 if (stationFleet == null) return;
429
431
432 String fleetName = null;
433 String variantId = null;
434 float radius = 60f;
435
436 try {
437 JSONObject json = new JSONObject(getSpec().getData());
438 variantId = json.getString("variant");
439 radius = (float) json.getDouble("radius");
440 fleetName = json.getString("fleetName");
441 } catch (JSONException e) {
442 throw new RuntimeException(e);
443 }
444
445 if (stationEntity != null) {
446 fleetName = stationEntity.getName();
447 }
448
449
450 stationFleet.setName(fleetName);
451
452// try {
453// FleetMemberAPI member = Global.getFactory().createFleetMember(FleetMemberType.SHIP, variantId);
454// } catch (Throwable t) {
455// throw new RuntimeException("Market: " + market.getId() + ", variantId: " + variantId + ", " +
456// "message: [" + t.getMessage() + "]");
457// }
458
460 //String name = stationFleet.getFleetData().pickShipName(member, null);
461 String name = fleetName;
462 member.setShipName(name);
463
465
466// int level = 20;
467// PersonAPI commander = OfficerManagerEvent.createOfficer(
468// Global.getSector().getFaction(market.getFactionId()), level, true);
469// commander.getStats().setSkillLevel(Skills.GUNNERY_IMPLANTS, 3);
470// stationFleet.setCommander(commander);
471// stationFleet.getFlagship().setCaptain(commander);
472
473 //stationFleet.getFlagship().getRepairTracker().setCR(stationFleet.getFlagship().getRepairTracker().getMaxCR());
475
476 //stationFleet.setMarket(market);
477
478 //JSONObject
479
481 ((CustomCampaignEntityAPI)stationEntity).setRadius(radius);
483 ((CustomCampaignEntityAPI)stationEntity).setRadius(radius);
484 }
485
486 boolean skeletonMode = !isFunctional();
487
488 if (skeletonMode) {
492
493 for (int i = 1; i < member.getStatus().getNumStatuses(); i++) {
494 ShipVariantAPI variant = member.getVariant();
495 if (i > 0) {
496 String slotId = member.getVariant().getModuleSlots().get(i - 1);
497 variant = variant.getModuleVariant(slotId);
498 } else {
499 continue;
500 }
501
502 if (!variant.hasHullMod(HullMods.VASTBULK)) {
503 member.getStatus().setDetached(i, true);
504 member.getStatus().setPermaDetached(i, true);
505 member.getStatus().setHullFraction(i, 0f);
506 }
507 }
508
509 } else {
512// stationFleet.setBattle(null);
513// stationFleet.setNoEngaging(0);
517 }
518 }
519
520 protected int getHumanCommanderLevel() {
521 boolean battlestation = getSpec().hasTag(Industries.TAG_BATTLESTATION);
522 boolean starfortress = getSpec().hasTag(Industries.TAG_STARFORTRESS);
523
524 if (starfortress) {
525 return Global.getSettings().getInt("tier3StationOfficerLevel");
526 } else if (battlestation) {
527 return Global.getSettings().getInt("tier2StationOfficerLevel");
528 }
529 return Global.getSettings().getInt("tier1StationOfficerLevel");
530 }
531
532 protected void matchCommanderToAICore(String aiCore) {
533 if (stationFleet == null) return;
534
535// if (market.isPlayerOwned()) {
536// System.out.println("wefwefew");
537// }
538
539 PersonAPI commander = null;
540 if (Commodities.ALPHA_CORE.equals(aiCore)) {
541// commander = OfficerManagerEvent.createOfficer(
542// Global.getSector().getFaction(Factions.REMNANTS), level, SkillPickPreference.NON_CARRIER);
543// commander.getStats().setSkillLevel(Skills.GUNNERY_IMPLANTS, 3);
544
546 commander = plugin.createPerson(Commodities.ALPHA_CORE, Factions.REMNANTS, null);
547 if (stationFleet.getFlagship() != null) {
549 }
550 } else {
551 //if (stationFleet.getCommander() == null || !stationFleet.getCommander().isDefault()) {
552// if (stationFleet.getFlagship() == null || stationFleet.getFlagship().getCaptain() == null ||
553// !stationFleet.getFlagship().getCaptain().isDefault()) {
554// commander = Global.getFactory().createPerson();
555// }
556
557 if (stationFleet.getFlagship() != null) {
558 int level = getHumanCommanderLevel();
560 if (level > 0) {
561 if (current.isAICore() || current.getStats().getLevel() != level) {
563 Global.getSector().getFaction(market.getFactionId()), level, true);
564 }
565 } else {
566 if (stationFleet.getFlagship() == null || stationFleet.getFlagship().getCaptain() == null ||
568 commander = Global.getFactory().createPerson();
569 }
570 }
571 }
572
573 }
574
575// if (commander != null) {
576// PersonAPI current = stationFleet.getFlagship().getCaptain();
577// if (current.isAICore() == commander.isAICore() &&
578// current.isDefault() == commander.isDefault() &&
579// current.getStats().getLevel() == commander.getStats().getLevel()) {
580// commander = null;
581// }
582// }
583
584 if (commander != null) {
585 //stationFleet.setCommander(commander); // don't want a "this is a flagship" star showing in the fleet list
586 if (stationFleet.getFlagship() != null) {
589 }
590 }
591 }
592
593
594 public void reportBattleOccurred(CampaignFleetAPI fleet, CampaignFleetAPI primaryWinner, BattleAPI battle) {
595
596 }
597
598
599 @Override
600 protected void disruptionFinished() {
601 super.disruptionFinished();
602
604 }
605
606 @Override
607 protected void notifyDisrupted() {
608 super.notifyDisrupted();
609
611 }
612
613 public void reportFleetDespawnedToListener(CampaignFleetAPI fleet, FleetDespawnReason reason, Object param) {
614 if (fleet != stationFleet) return; // shouldn't happen...
615
616 disrupt(this);
617
618 // bug where somehow a station fleet can become empty as a result of combat
619 // then its despawn() gets called every frame
622 }
624 }
625
626 public static void disrupt(Industry station) {
627 station.setDisrupted(station.getSpec().getBuildTime() * 0.5f, true);
628 }
629
630 public boolean isAvailableToBuild() {
631 //if (getSpec().hasTag(Industries.TAG_PARENT)) return true;
632
633 boolean canBuild = false;
634 for (Industry ind : market.getIndustries()) {
635 if (ind == this) continue;
636 if (!ind.isFunctional()) continue;
637 if (ind.getSpec().hasTag(Industries.TAG_SPACEPORT)) {
638 canBuild = true;
639 break;
640 }
641 }
642 return canBuild;
643 }
644
645 public String getUnavailableReason() {
646 return "Requires a functional spaceport";
647 }
648
649
650 @Override
651 protected int getBaseStabilityMod() {
652 boolean battlestation = getSpec().hasTag(Industries.TAG_BATTLESTATION);
653 boolean starfortress = getSpec().hasTag(Industries.TAG_STARFORTRESS);
654 int stabilityMod = 1;
655 if (battlestation) {
656 stabilityMod = 2;
657 } else if (starfortress) {
658 stabilityMod = 3;
659 }
660 return stabilityMod;
661 }
662
663 @Override
667
668
669 @Override
670 protected void applyAlphaCoreModifiers() {
671 }
672
673 @Override
674 protected void applyNoAICoreModifiers() {
675 }
676
677 @Override
681
682 protected void addAlphaCoreDescription(TooltipMakerAPI tooltip, AICoreDescriptionMode mode) {
683 float opad = 10f;
684 Color highlight = Misc.getHighlightColor();
685
686 String pre = "Alpha-level AI core currently assigned. ";
687 if (mode == AICoreDescriptionMode.MANAGE_CORE_DIALOG_LIST || mode == AICoreDescriptionMode.INDUSTRY_TOOLTIP) {
688 pre = "Alpha-level AI core. ";
689 }
690 if (mode == AICoreDescriptionMode.INDUSTRY_TOOLTIP) {
692 TooltipMakerAPI text = tooltip.beginImageWithText(coreSpec.getIconName(), 48);
693 text.addPara(pre + "Reduces upkeep cost by %s. Reduces demand by %s unit. " +
694 "Increases station combat effectiveness.", 0f, highlight,
695 "" + (int)((1f - UPKEEP_MULT) * 100f) + "%", "" + DEMAND_REDUCTION);
696 tooltip.addImageWithText(opad);
697 return;
698 }
699
700 tooltip.addPara(pre + "Reduces upkeep cost by %s. Reduces demand by %s unit. " +
701 "Increases station combat effectiveness.", opad, highlight,
702 "" + (int)((1f - UPKEEP_MULT) * 100f) + "%", "" + DEMAND_REDUCTION);
703
704 }
705
706 @Override
707 public boolean canImprove() {
708 return true;
709 }
710
711 protected void applyImproveModifiers() {
712 if (isImproved()) {
713 market.getStability().modifyFlat("orbital_station_improve", IMPROVE_STABILITY_BONUS,
715 } else {
716 market.getStability().unmodifyFlat("orbital_station_improve");
717 }
718 }
719
720 public void addImproveDesc(TooltipMakerAPI info, ImprovementDescriptionMode mode) {
721 float opad = 10f;
722 Color highlight = Misc.getHighlightColor();
723
724
725 if (mode == ImprovementDescriptionMode.INDUSTRY_TOOLTIP) {
726 info.addPara("Stability increased by %s.", 0f, highlight, "" + (int) IMPROVE_STABILITY_BONUS);
727 } else {
728 info.addPara("Increases stability by %s.", 0f, highlight, "" + (int) IMPROVE_STABILITY_BONUS);
729 }
730
731 info.addSpacer(opad);
732 super.addImproveDesc(info, mode);
733 }
734
735
736 protected boolean isMiltiarized() {
737 boolean battlestation = getSpec().hasTag(Industries.TAG_BATTLESTATION);
738 boolean starfortress = getSpec().hasTag(Industries.TAG_STARFORTRESS);
739 return battlestation || starfortress;
740 }
741
742 @Override
743 public RaidDangerLevel adjustCommodityDangerLevel(String commodityId, RaidDangerLevel level) {
744 if (!isMiltiarized()) return level;
745 return level.next();
746 }
747
748 @Override
749 public RaidDangerLevel adjustItemDangerLevel(String itemId, String data, RaidDangerLevel level) {
750 if (!isMiltiarized()) return level;
751 return level.next();
752 }
753
754}
755
756
757
758
759
static SettingsAPI getSettings()
Definition Global.java:57
static FactoryAPI getFactory()
Definition Global.java:41
static SectorAPI getSector()
Definition Global.java:65
void modifyFlat(String source, float value)
void modifyMult(String source, float value)
void modifyFlat(String source, float value)
Map< String, MutableCommodityQuantity > supply
void addStabilityPostDemandSection(TooltipMakerAPI tooltip, boolean hasDemand, IndustryTooltipMode mode)
void addGroundDefensesImpactSection(TooltipMakerAPI tooltip, float bonus, String ...commodities)
Map< String, MutableCommodityQuantity > demand
Pair< String, Integer > getMaxDeficit(String ... commodityIds)
void addImproveDesc(TooltipMakerAPI info, ImprovementDescriptionMode mode)
void reportFleetDespawnedToListener(CampaignFleetAPI fleet, FleetDespawnReason reason, Object param)
boolean hasPostDemandSection(boolean hasDemand, IndustryTooltipMode mode)
RaidDangerLevel adjustCommodityDangerLevel(String commodityId, RaidDangerLevel level)
RaidDangerLevel adjustItemDangerLevel(String itemId, String data, RaidDangerLevel level)
void addAlphaCoreDescription(TooltipMakerAPI tooltip, AICoreDescriptionMode mode)
void addPostDemandSection(TooltipMakerAPI tooltip, boolean hasDemand, IndustryTooltipMode mode)
void reportBattleOccurred(CampaignFleetAPI fleet, CampaignFleetAPI primaryWinner, BattleAPI battle)
void notifyBeingRemoved(MarketInteractionMode mode, boolean forUpgrade)
AvailableOfficer createOfficer(boolean isMerc, MarketAPI market, Random random)
static CampaignFleetAPI createFleet(FleetParamsV3 params)
static AICoreOfficerPlugin getAICoreOfficerPlugin(String commodityId)
Definition Misc.java:4230
static Color getHighlightColor()
Definition Misc.java:792
static float getShipQuality(MarketAPI market)
Definition Misc.java:4505
FleetMemberAPI createFleetMember(FleetMemberType type, String variantOrWingId)
CommoditySpecAPI getCommoditySpec(String commodityId)
PersonAPI createPerson(String aiCoreId, String factionId, Random random)
void setAbortDespawn(Boolean abortDespawn)
List< FleetMemberAPI > getMembersWithFightersCopy()
void setAI(CampaignFleetAIAPI campaignFleetAI)
void setNoFactionInName(boolean noFactionInName)
void addFleetMember(FleetMemberAPI member)
List< FleetMemberAPI > getMembersListCopy()
void addEventListener(FleetEventListener listener)
void removeEventListener(FleetEventListener listener)
void addEntity(SectorEntityToken entity)
CustomCampaignEntityAPI addCustomEntity(String id, String name, String type, String factionId)
void removeEntity(SectorEntityToken entity)
FactionAPI getFaction(String factionId)
void setCircularOrbit(SectorEntityToken focus, float angle, float orbitRadius, float orbitDays)
void setCircularOrbitWithSpin(SectorEntityToken focus, float angle, float orbitRadius, float orbitDays, float minSpin, float maxSpin)
Set< SectorEntityToken > getConnectedEntities()
MutableStatWithTempMods getStability()
void set(String key, Object value)
MutableCharacterStatsAPI getStats()
ShipVariantAPI getModuleVariant(String slotId)
void setCaptain(PersonAPI commander)
void setFlagship(boolean isFlagship)
void setDetached(int index, Boolean detached)
void setPermaDetached(int index, Boolean detached)
LabelAPI addPara(String format, float pad, Color hl, String... highlights)
UIComponentAPI addSpacer(float height)
TooltipMakerAPI beginImageWithText(String spriteName, float imageHeight)
UIPanelAPI addImageWithText(float pad)