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 Details

    • init

      void init(HullModSpecAPI spec)
    • applyEffectsBeforeShipCreation

      void applyEffectsBeforeShipCreation(ShipAPI.HullSize hullSize, MutableShipStatsAPI stats, String id)
    • applyEffectsAfterShipCreation

      void applyEffectsAfterShipCreation(ShipAPI ship, String id)
      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

      String getDescriptionParam(int index, ShipAPI.HullSize hullSize)
    • getDescriptionParam

      String getDescriptionParam(int index, ShipAPI.HullSize hullSize, ShipAPI ship)
    • applyEffectsToFighterSpawnedByShip

      void applyEffectsToFighterSpawnedByShip(ShipAPI fighter, ShipAPI ship, String id)
    • isApplicableToShip

      boolean isApplicableToShip(ShipAPI ship)
    • getUnapplicableReason

      String getUnapplicableReason(ShipAPI ship)
    • 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

      void advanceInCampaign(FleetMemberAPI member, float amount)
      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

      void advanceInCombat(ShipAPI ship, float amount)
      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

      boolean hasSModEffectSection(ShipAPI.HullSize hullSize, ShipAPI ship, boolean isForModSpec)
    • 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

      String getSModDescriptionParam(int index, ShipAPI.HullSize hullSize)
    • getSModDescriptionParam

      String getSModDescriptionParam(int index, ShipAPI.HullSize hullSize, ShipAPI ship)
    • getTooltipWidth

      float getTooltipWidth()
    • isSModEffectAPenalty

      boolean isSModEffectAPenalty()
    • showInRefitScreenModPickerFor

      boolean showInRefitScreenModPickerFor(ShipAPI ship)
    • getRequiredItem

      default CargoStackAPI getRequiredItem()
    • applyEffectsAfterShipAddedToCombatEngine

      default void applyEffectsAfterShipAddedToCombatEngine(ShipAPI ship, String id)
      Only called once. Not called again if the ship is removed and then added back to the engine.