Starsector API
Loading...
Searching...
No Matches
FleetParamsV3.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.campaign.fleets;
2
3import java.util.List;
4import java.util.Random;
5
6import org.lwjgl.util.vector.Vector2f;
7
8import com.fs.starfarer.api.Global;
9import com.fs.starfarer.api.campaign.FactionAPI.ShipPickMode;
10import com.fs.starfarer.api.campaign.FactionDoctrineAPI;
11import com.fs.starfarer.api.campaign.econ.MarketAPI;
12import com.fs.starfarer.api.characters.PersonAPI;
13import com.fs.starfarer.api.combat.ShipVariantAPI;
14import com.fs.starfarer.api.impl.campaign.missions.hub.HubMissionWithTriggers;
15import com.fs.starfarer.api.util.Misc;
16
28public class FleetParamsV3 {
33 public MarketAPI source;
34
35 public Vector2f locInHyper;
36 public float quality;
37 public String factionId;
38 public String fleetType;
39
40 public float combatPts;
41 public float freighterPts;
42 public float tankerPts;
43 public float transportPts;
44 public float linerPts;
45 public float utilityPts;
46
47
51 public int maxShipSize = 1000;
52
56 public int minShipSize = 0;
57
58 public float qualityMod = 0f;
59 public Float qualityOverride = null;
60 public Integer averageSMods = null;
61 public boolean withOfficers = true;
62// public boolean applyDoctrineFleetSize = true;
63// public boolean applyMarketSizeToFleetSize = true;
64// public boolean applyShipsDeficit = true;
65 public Boolean ignoreMarketFleetSizeMult = null;
66 public Boolean onlyApplyFleetSizeToCombatShips = null;
67 public Boolean doNotPrune = null;
68 public Boolean doNotAddShipsBeforePruning = null;
69 public ShipPickMode modeOverride = null;
70
71 public int officerLevelBonus = 0;
72 public int officerNumberBonus = 0;
73 public Integer maxOfficersToAdd = null;
74 public float officerNumberMult = 1;
75 public int officerLevelLimit = 0;
76 public int commanderLevelLimit = 0;
77// public int maxOfficers = -1;
78// public int minOfficers = -1;
79 public Random random = null;
80 public PersonAPI commander;
81
82 public Boolean noCommanderSkills;
85 public FactionDoctrineAPI doctrineOverride = null;
86 //public Boolean forceNoTimestamp;
87 public Long timestamp;
88
89 public Integer maxNumShips;
90 public Boolean onlyRetainFlagship;
91 public String flagshipVariantId;
92 public ShipVariantAPI flagshipVariant;
93 //public Boolean allowEmptyFleet = null;
94
95 public HubMissionWithTriggers.OfficerQuality aiCores = null;
96 public boolean doNotIntegrateAICores = false;
97
98 // Used in FleetFactoryV3 to pass some data between methods. Do not use directly.
99 public transient ShipPickMode mode;
100 public transient boolean banPhaseShipsEtc;
101 public transient Boolean blockFallback = null;
102
103 public Boolean allWeapons = null;
104
108 public List<String> addShips;
109
110 public FleetParamsV3(MarketAPI source, Vector2f locInHyper, String factionId, Float qualityOverride, String fleetType,
111 float combatPts, float freighterPts, float tankerPts,
112 float transportPts, float linerPts,
113 float utilityPts, float qualityMod) {
114 if (source != null) {
116 if (factionId != null) {
117 this.factionId = factionId;
118 }
119 this.qualityOverride = qualityOverride;
120 this.locInHyper = locInHyper;
121 } else {
124 }
125 }
126
127 public FleetParamsV3() {
128
129 }
130
138
139 public FleetParamsV3(MarketAPI source, String fleetType,
140 float combatPts, float freighterPts, float tankerPts,
141 float transportPts, float linerPts,
142 float utilityPts, float qualityMod) {
144 }
145
146 public void init(MarketAPI source, String fleetType, String factionId,
147 float combatPts, float freighterPts, float tankerPts,
148 float transportPts, float linerPts,
149 float utilityPts, float qualityMod) {
150 init(source.getLocationInHyperspace(), null, null,
152 this.factionId = source.getFactionId();
153 if (factionId != null) {
154 this.factionId = factionId;
155 }
156 this.source = source;
157 timestamp = Global.getSector().getClock().getTimestamp();
159 }
160
161 public void init(Vector2f locInHyper, String factionId, Float qualityOverride, String fleetType,
162 float combatPts, float freighterPts, float tankerPts,
163 float transportPts, float linerPts,
164 float utilityPts, float qualityMod) {
165 this.locInHyper = locInHyper;
166 this.factionId = factionId;
167 this.qualityOverride = qualityOverride;
168 this.fleetType = fleetType;
169 this.combatPts = combatPts;
170 this.freighterPts = freighterPts;
171 this.tankerPts = tankerPts;
172 this.transportPts = transportPts;
173 this.linerPts = linerPts;
174 this.utilityPts = utilityPts;
175 this.qualityMod = qualityMod;
176 }
177
178 public void setSource(MarketAPI source, boolean updateQuality) {
179 this.source = source;
180 if (updateQuality) {
182 }
183 }
184
185
187 if (source != null) {
188 this.quality = Misc.getShipQuality(source, factionId);
189 }
190
191// this.quality = 0f;
192// if (producer != null) {
193// this.quality = producer.getStats().getDynamic().getMod(Stats.PRODUCTION_QUALITY_MOD).computeEffective(0f);
194// }
195// if (source != null) {
196// this.quality += source.getStats().getDynamic().getMod(Stats.FLEET_QUALITY_MOD).computeEffective(0f);
197// //this.quality += source.getFaction().getDoctrine().getShipQualityContribution();
198// } else if (factionId != null) {
199// this.quality += Global.getSector().getFaction(factionId).getDoctrine().getShipQualityContribution();
200// }
201 }
202
203 public float getTotalPts() {
205 }
206
207
208}
209
210
211
212
213
214
215
216
217
218
219
static SectorAPI getSector()
Definition Global.java:59
void init(Vector2f locInHyper, String factionId, Float qualityOverride, String fleetType, float combatPts, float freighterPts, float tankerPts, float transportPts, float linerPts, float utilityPts, float qualityMod)
HubMissionWithTriggers.OfficerQuality aiCores
FleetParamsV3(Vector2f locInHyper, String factionId, Float qualityOverride, String fleetType, float combatPts, float freighterPts, float tankerPts, float transportPts, float linerPts, float utilityPts, float qualityMod)
void setSource(MarketAPI source, boolean updateQuality)
FleetParamsV3(MarketAPI source, Vector2f locInHyper, String factionId, Float qualityOverride, String fleetType, float combatPts, float freighterPts, float tankerPts, float transportPts, float linerPts, float utilityPts, float qualityMod)
void init(MarketAPI source, String fleetType, String factionId, float combatPts, float freighterPts, float tankerPts, float transportPts, float linerPts, float utilityPts, float qualityMod)
FleetParamsV3(MarketAPI source, String fleetType, float combatPts, float freighterPts, float tankerPts, float transportPts, float linerPts, float utilityPts, float qualityMod)