001package com.fs.starfarer.api.combat;
002
003import java.util.List;
004
005import com.fs.starfarer.api.combat.listeners.CombatListenerManagerAPI;
006import com.fs.starfarer.api.fleet.FleetMemberAPI;
007import com.fs.starfarer.api.util.DynamicStatsAPI;
008
009
010/**
011 * @author Alex Mosolov
012 *
013 * Copyright 2012 Fractal Softworks, LLC
014 */
015public interface MutableShipStatsAPI {
016        
017        /**
018         * Only returns non-null during combat.
019         * @return entity (ShipAPI, MissileAPI, something else) if these mutable stats have one associated with them, null otherwise.
020         */
021        public CombatEntityAPI getEntity();
022        
023        /**
024         * Could be null, or a faked-up one for the stats of fighter wings deployed in combat.
025         * @return
026         */
027        public FleetMemberAPI getFleetMember();
028        
029        
030        public MutableStat getMaxSpeed();
031        public MutableStat getAcceleration();
032        public MutableStat getDeceleration();
033        public MutableStat getMaxTurnRate();
034        public MutableStat getTurnAcceleration();
035        
036        public MutableStat getFluxCapacity();
037        public MutableStat getFluxDissipation();
038        
039        /**
040         * Check made once per second on average. Range is 0 (no chance) to 1 (100% chance).
041         */
042        public MutableStat getWeaponMalfunctionChance();
043        
044        /**
045         * Check made once per second on average. Range is 0 (no chance) to 1 (100% chance).
046         */
047        public MutableStat getEngineMalfunctionChance();
048        
049        
050        /**
051         * Chance that a regular malfunction is critical (i.e. deals damage and permanently disables weapon or engine).
052         * More than half the engine nozzles can not suffer a critical malfunction.
053         * @return
054         */
055        public MutableStat getCriticalMalfunctionChance();
056
057        public MutableStat getShieldMalfunctionChance();
058        public MutableStat getShieldMalfunctionFluxLevel();
059        
060        /**
061         * Base value is 0, modified by crew etc. modifyPercent will do nothing since the base value is 0.
062         * Range is 0 to 1.
063         * @return
064         */
065        public MutableStat getMaxCombatReadiness();
066        
067        /**
068         * As percentage, i.e 0 to 100.
069         * @return
070         */
071        public StatBonus getCRPerDeploymentPercent();
072        
073        /**
074         * In seconds.
075         * @return
076         */
077        public StatBonus getPeakCRDuration();
078        
079        /**
080         * As percentage, i.e 0 to 100.
081         * @return
082         */
083        public StatBonus getCRLossPerSecondPercent();
084        
085
086        /**
087         * Use getEmpDamageTaken() instead.
088         * @return
089         */
090        @Deprecated public MutableStat getFluxDamageTakenMult();
091        public MutableStat getEmpDamageTakenMult();
092        
093        
094        public MutableStat getHullDamageTakenMult();
095        public MutableStat getArmorDamageTakenMult();
096        public MutableStat getShieldDamageTakenMult();
097        public MutableStat getEngineDamageTakenMult();
098        public MutableStat getWeaponDamageTakenMult();
099        
100        /**
101         * Applies to damage taken by hull and armor.
102         * @return
103         */
104        public MutableStat getBeamDamageTakenMult();
105        /**
106         * Applies to damage taken by hull and armor.
107         * @return
108         */
109        public MutableStat getMissileDamageTakenMult();
110        /**
111         * Applies to damage taken by hull and armor.
112         * @return
113         */
114        public MutableStat getProjectileDamageTakenMult();
115        /**
116         * Applies to damage taken by hull and armor.
117         * @return
118         */
119        public MutableStat getEnergyDamageTakenMult();
120        /**
121         * Applies to damage taken by hull and armor.
122         * @return
123         */
124        public MutableStat getKineticDamageTakenMult();
125        /**
126         * Applies to damage taken by hull and armor.
127         * @return
128         */
129        public MutableStat getHighExplosiveDamageTakenMult();
130        /**
131         * Applies to damage taken by hull and armor.
132         * @return
133         */
134        public MutableStat getFragmentationDamageTakenMult();
135        
136        /**
137         * Applies to damage taken by shields.
138         * @return
139         */
140        public MutableStat getBeamShieldDamageTakenMult();
141        /**
142         * Applies to damage taken by shields.
143         * @return
144         */
145        public MutableStat getMissileShieldDamageTakenMult();
146        /**
147         * Applies to damage taken by shields.
148         * @return
149         */
150        public MutableStat getProjectileShieldDamageTakenMult();
151        /**
152         * Applies to damage taken by shields.
153         * @return
154         */
155        public MutableStat getEnergyShieldDamageTakenMult();
156        /**
157         * Applies to damage taken by shields.
158         * @return
159         */
160        public MutableStat getKineticShieldDamageTakenMult();
161        /**
162         * Applies to damage taken by shields.
163         * @return
164         */
165        public MutableStat getHighExplosiveShieldDamageTakenMult();
166        /**
167         * Applies to damage taken by shields.
168         * @return
169         */
170        public MutableStat getFragmentationShieldDamageTakenMult();
171        
172        
173        
174        public MutableStat getBeamWeaponDamageMult();
175        public MutableStat getEnergyWeaponDamageMult();
176        public MutableStat getBallisticWeaponDamageMult();
177        public MutableStat getMissileWeaponDamageMult();
178        
179        public StatBonus getEnergyWeaponFluxCostMod();
180        public StatBonus getBallisticWeaponFluxCostMod();
181        public StatBonus getMissileWeaponFluxCostMod();
182        public MutableStat getBeamWeaponFluxCostMult();
183        
184        public MutableStat getShieldUpkeepMult();
185        public MutableStat getShieldAbsorptionMult();
186        public MutableStat getShieldTurnRateMult();
187        public MutableStat getShieldUnfoldRateMult();
188        
189        public MutableStat getMissileRoFMult();
190        public MutableStat getBallisticRoFMult();
191        public MutableStat getEnergyRoFMult();
192        
193        public StatBonus getPhaseCloakActivationCostBonus();
194        public StatBonus getPhaseCloakUpkeepCostBonus();
195
196        public StatBonus getEnergyWeaponRangeBonus();
197        public StatBonus getBallisticWeaponRangeBonus();
198        public StatBonus getMissileWeaponRangeBonus();
199        public StatBonus getBeamWeaponRangeBonus();
200        
201        /**
202         * Does not include beam weapons, which have a separate bonus.
203         * @return
204         */
205        public StatBonus getWeaponTurnRateBonus();
206        public StatBonus getBeamWeaponTurnRateBonus();
207        //public StatBonus getRepairTimeBonus();
208        public MutableStat getCombatEngineRepairTimeMult();
209        public MutableStat getCombatWeaponRepairTimeMult();
210        public StatBonus getWeaponHealthBonus();
211        public StatBonus getEngineHealthBonus();
212        public StatBonus getArmorBonus();
213        public StatBonus getHullBonus();
214        
215        public StatBonus getShieldArcBonus();
216        
217        public StatBonus getBallisticAmmoBonus();
218        public StatBonus getEnergyAmmoBonus();
219        public StatBonus getMissileAmmoBonus();
220        
221        public MutableStat getEccmChance();
222        public MutableStat getMissileGuidance();
223        
224        public StatBonus getSightRadiusMod();
225        
226        public MutableStat getHullCombatRepairRatePercentPerSecond();
227        public MutableStat getMaxCombatHullRepairFraction();
228        @Deprecated public MutableStat getHullRepairRatePercentPerSecond();
229        @Deprecated public MutableStat getMaxHullRepairFraction();
230        
231        /**
232         * For hit strength only.
233         * @return
234         */
235        public StatBonus getEffectiveArmorBonus();
236        
237        /**
238         * Affects damage reduction by target's armor.
239         * @return
240         */
241        public StatBonus getHitStrengthBonus();
242        public MutableStat getDamageToTargetEnginesMult();
243        public MutableStat getDamageToTargetWeaponsMult();
244        public MutableStat getDamageToTargetShieldsMult();
245        public MutableStat getDamageToTargetHullMult();
246        
247        /**
248         * Clamped to a maximum of 1. Green crew at 0.
249         * @return
250         */
251        public MutableStat getAutofireAimAccuracy();
252        
253        public MutableStat getMaxRecoilMult();
254        public MutableStat getRecoilPerShotMult();
255        public MutableStat getRecoilDecayMult();
256        
257        public StatBonus getOverloadTimeMod();
258        
259        public MutableStat getZeroFluxSpeedBoost();
260        public MutableStat getZeroFluxMinimumFluxLevel();
261        
262        public MutableStat getCrewLossMult();
263        
264        //public MutableStat getPhaseCloakUpkeepMult();
265        public MutableStat getHardFluxDissipationFraction();
266        
267        public StatBonus getFuelMod();
268        public StatBonus getFuelUseMod();
269        public StatBonus getMinCrewMod();
270        public StatBonus getMaxCrewMod();
271        public StatBonus getCargoMod();
272        public StatBonus getHangarSpaceMod();
273        
274        public StatBonus getMissileMaxSpeedBonus();
275        public StatBonus getMissileAccelerationBonus();
276        public StatBonus getMissileMaxTurnRateBonus();
277        public StatBonus getMissileTurnAccelerationBonus();
278        
279        public MutableStat getProjectileSpeedMult();
280        public MutableStat getVentRateMult();
281        
282        //public MutableStat getBaseSupplyUsePerDay();
283        //public MutableStat getBaseRepairRatePercentPerDay();
284        public MutableStat getBaseCRRecoveryRatePercentPerDay();
285        
286        public MutableStat getMaxBurnLevel();
287        
288        
289        /**
290         * Only applicable for ships with flight decks. Modifies the amount of time it
291         * takes a flight deck to spawn a replacement fighter.
292         * @return
293         */
294        public MutableStat getFighterRefitTimeMult();
295
296        MutableStat getRepairRatePercentPerDay();
297
298        
299        //MutableStat getSupplyConsumptionAtMaxCRMult();
300
301        MutableStat getSensorProfile();
302
303        MutableStat getSensorStrength();
304
305        
306        
307        DynamicStatsAPI getDynamic();
308
309        MutableStat getSuppliesToRecover();
310
311        MutableStat getSuppliesPerMonth();
312
313        MutableStat getWeaponRangeThreshold();
314        MutableStat getWeaponRangeMultPastThreshold();
315
316        MutableStat getTimeMult();
317
318        StatBonus getBeamPDWeaponRangeBonus();
319        StatBonus getNonBeamPDWeaponRangeBonus();
320
321        MutableStat getMinArmorFraction();
322
323        MutableStat getMaxArmorDamageReduction();
324
325        MutableStat getNumFighterBays();
326
327        StatBonus getMissileHealthBonus();
328
329        StatBonus getPhaseCloakCooldownBonus();
330        StatBonus getSystemCooldownBonus();
331        StatBonus getSystemFluxCostBonus();
332        StatBonus getSystemRegenBonus();
333        StatBonus getSystemUsesBonus();
334        StatBonus getSystemRangeBonus();
335        
336        MutableStat getKineticArmorDamageTakenMult();
337        MutableStat getDamageToFighters();
338        MutableStat getDamageToMissiles();
339
340        MutableStat getDamageToFrigates();
341        MutableStat getDamageToDestroyers();
342        MutableStat getDamageToCruisers();
343        MutableStat getDamageToCapital();
344
345        StatBonus getCriticalMalfunctionDamageMod();
346
347        MutableStat getBreakProb();
348
349        StatBonus getFighterWingRange();
350
351        ShipVariantAPI getVariant();
352
353        MutableStat getRecoilPerShotMultSmallWeaponsOnly();
354
355        MutableStat getEnergyWeaponFluxBasedBonusDamageMagnitude();
356        MutableStat getEnergyWeaponFluxBasedBonusDamageMinLevel();
357
358        MutableStat getAllowZeroFluxAtAnyLevel();
359
360        CombatListenerManagerAPI getListenerManager();
361        void addListener(Object listener);
362        void removeListener(Object listener);
363        void removeListenerOfClass(Class<?> c);
364        boolean hasListener(Object listener);
365        boolean hasListenerOfClass(Class<?> c);
366        <T> List<T> getListeners(Class<T> c);
367
368        MutableStat getBallisticProjectileSpeedMult();
369
370        MutableStat getEnergyProjectileSpeedMult();
371
372        MutableStat getMissileAmmoRegenMult();
373        MutableStat getEnergyAmmoRegenMult();
374        MutableStat getBallisticAmmoRegenMult();
375
376        MutableStat getShieldSoftFluxConversion();
377
378        StatBonus getBeamSpeedMod();
379
380}
381
382
383
384
385