Package com.fs.starfarer.api.combat
Interface HullModEffect
- All Known Implementing Classes:
AblativeArmor
,AdaptivePhaseCoils
,AdditionalBerthing
,AdvancedGroundSupport
,AndradaMods
,AssaultPackage
,Automated
,AuxiliaryFuelTanks
,BallisticRangefinder
,BaseHullMod
,BaseLogisticsHullMod
,BDeck
,CompromisedStorage
,CompromisedStructure
,ConvertedHangar
,DamagedFlightDeck
,DamagedWeaponMounts
,DefectiveManufactory
,DefensiveTargetingArray
,DegradedLifeSupport
,DegradedShields
,DesignCompromises
,DistributedFireControl
,DoNotBackOff
,DriveFieldStabilizer
,DwellerHullmod
,ECMPackage
,EfficiencyOverhaul
,EnergyBoltCoherer
,ErraticInjector
,EscortPackage
,ExpandedCargoHolds
,ExpandedDeckCrew
,ExperimentalPhaseCoils
,FaultyAutomatedSystems
,FighterChassisStorage
,FlightControl
,FragileSubsystems
,FragmentCoordinatorHullmod
,FragmentSwarmHullmod
,GlitchedSensorArray
,GroundSupport
,HeavyBallisticsIntegration
,HighEfficiencyDriveField
,HighResSensors
,HighScatterAmp
,HumanShipShroudedHullmod
,IncreasedMaintenance
,MalfunctioningComms
,MilitarizedSubsystems
,MissileAutoloader
,NavRelay
,NeuralIntegrator
,NeuralInterface
,OperationsCenter
,PDIntegration
,PeriodicMissileReload
,PhaseAnchor
,PhaseField
,RecoveryShuttles
,RepairGantry
,RuggedConstruction
,SecondaryFabricatorHullmod
,ShardSpawner
,SharedFluxSink
,ShieldAlwaysOn
,ShieldShunt
,ShroudedLensHullmod
,ShroudedMantleHullmod
,ShroudedThunderheadHullmod
,StealthMinefield
,StealthMinefieldLT
,TerminatorCore
,ThreatHullmod
,TowCable
,VastHangar
public interface HullModEffect
Note: the effect class is instantiated once per application session.
Storing campaign data in data members of an implementing class is a bad idea (will likely cause memory leaks),
use SectorAPI.getPersistentData() instead.
- Author:
- Alex Mosolov Copyright 2015 Fractal Softworks, LLC
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPostDescriptionSection
(TooltipMakerAPI tooltip, ShipAPI.HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec) ship may be null, will be for modspecs.void
addRequiredItemSection
(TooltipMakerAPI tooltip, FleetMemberAPI member, ShipVariantAPI currentVariant, MarketAPI dockedAt, float width, boolean isForModSpec) void
addSModEffectSection
(TooltipMakerAPI tooltip, ShipAPI.HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec, boolean isForBuildInList) void
addSModSection
(TooltipMakerAPI tooltip, ShipAPI.HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec, boolean isForBuildInList) void
advanceInCampaign
(FleetMemberAPI member, float amount) Not called while paused.void
advanceInCombat
(ShipAPI ship, float amount) Not called while paused.boolean
Hullmods that return true here should only ever be built-in, as cost changes aren't handled when these mods can be added or removed to/from the variant.default void
Only called once.void
applyEffectsAfterShipCreation
(ShipAPI ship, String id) Effects applied here should NOT affect ship stats as this does not get called from the campaign.void
applyEffectsBeforeShipCreation
(ShipAPI.HullSize hullSize, MutableShipStatsAPI stats, String id) void
applyEffectsToFighterSpawnedByShip
(ShipAPI fighter, ShipAPI ship, String id) boolean
canBeAddedOrRemovedNow
(ShipAPI ship, MarketAPI marketOrNull, CampaignUIAPI.CoreUITradeMode mode) Ship may be null from autofit.getCanNotBeInstalledNowReason
(ShipAPI ship, MarketAPI marketOrNull, CampaignUIAPI.CoreUITradeMode mode) getDescriptionParam
(int index, ShipAPI.HullSize hullSize) getDescriptionParam
(int index, ShipAPI.HullSize hullSize, ShipAPI ship) int
Should return 0 to 4; -1 for "use default".int
Sort order within the mod's display category.default CargoStackAPI
getSModDescriptionParam
(int index, ShipAPI.HullSize hullSize) getSModDescriptionParam
(int index, ShipAPI.HullSize hullSize, ShipAPI ship) float
getUnapplicableReason
(ShipAPI ship) boolean
boolean
hasSModEffectSection
(ShipAPI.HullSize hullSize, ShipAPI ship, boolean isForModSpec) void
init
(HullModSpecAPI spec) boolean
isApplicableToShip
(ShipAPI ship) boolean
boolean
shouldAddDescriptionToTooltip
(ShipAPI.HullSize hullSize, ShipAPI ship, boolean isForModSpec) ship may be null, will be for modspecs.boolean
-
Method Details
-
init
-
applyEffectsBeforeShipCreation
void applyEffectsBeforeShipCreation(ShipAPI.HullSize hullSize, MutableShipStatsAPI stats, String id) -
applyEffectsAfterShipCreation
Effects applied here should NOT affect ship stats as this does not get called from the campaign. Apply stat changes in applyEffectsBeforeShipCreation() instead, as that does affect the campaign.- Parameters:
ship
-id
-
-
getDescriptionParam
-
getDescriptionParam
-
applyEffectsToFighterSpawnedByShip
-
isApplicableToShip
-
getUnapplicableReason
-
canBeAddedOrRemovedNow
boolean canBeAddedOrRemovedNow(ShipAPI ship, MarketAPI marketOrNull, CampaignUIAPI.CoreUITradeMode mode) Ship may be null from autofit.- Parameters:
ship
-marketOrNull
-mode
-- Returns:
-
getCanNotBeInstalledNowReason
String getCanNotBeInstalledNowReason(ShipAPI ship, MarketAPI marketOrNull, CampaignUIAPI.CoreUITradeMode mode) -
advanceInCampaign
Not called while paused. But, called when the fleet data needs to be re-synced, with amount=0 (such as if, say, a fleet member is moved around. in the fleet screen.)- Parameters:
member
-amount
-
-
advanceInCombat
Not called while paused.- Parameters:
ship
-amount
-
-
affectsOPCosts
boolean affectsOPCosts()Hullmods that return true here should only ever be built-in, as cost changes aren't handled when these mods can be added or removed to/from the variant.- Returns:
-
shouldAddDescriptionToTooltip
boolean shouldAddDescriptionToTooltip(ShipAPI.HullSize hullSize, ShipAPI ship, boolean isForModSpec) ship may be null, will be for modspecs. hullsize will always be CAPITAL_SHIP for modspecs.- Parameters:
hullSize
-ship
-isForModSpec
-- Returns:
-
addPostDescriptionSection
void addPostDescriptionSection(TooltipMakerAPI tooltip, ShipAPI.HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec) ship may be null, will be for modspecs. hullsize will always be CAPITAL_SHIP for modspecs.- Parameters:
tooltip
-hullSize
-ship
-width
-isForModSpec
-
-
getBorderColor
Color getBorderColor() -
getNameColor
Color getNameColor() -
getDisplaySortOrder
int getDisplaySortOrder()Sort order within the mod's display category. Not used when category == 4, since then the order is determined by the order in which the player added the hullmods.- Returns:
-
getDisplayCategoryIndex
int getDisplayCategoryIndex()Should return 0 to 4; -1 for "use default". The default categories are: 0: built-in mods in the base hull 1: perma-mods that are not story point mods 2: d-mods 3: mods built in via story points 4: regular mods- Returns:
-
hasSModEffectSection
-
addSModSection
void addSModSection(TooltipMakerAPI tooltip, ShipAPI.HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec, boolean isForBuildInList) -
addSModEffectSection
void addSModEffectSection(TooltipMakerAPI tooltip, ShipAPI.HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec, boolean isForBuildInList) -
hasSModEffect
boolean hasSModEffect() -
addRequiredItemSection
void addRequiredItemSection(TooltipMakerAPI tooltip, FleetMemberAPI member, ShipVariantAPI currentVariant, MarketAPI dockedAt, float width, boolean isForModSpec) -
getSModDescriptionParam
-
getSModDescriptionParam
-
getTooltipWidth
float getTooltipWidth() -
isSModEffectAPenalty
boolean isSModEffectAPenalty() -
showInRefitScreenModPickerFor
-
getRequiredItem
-
applyEffectsAfterShipAddedToCombatEngine
Only called once. Not called again if the ship is removed and then added back to the engine.
-