1package com.fs.starfarer.api.impl.hullmods;
5import com.fs.starfarer.api.combat.BaseHullMod;
6import com.fs.starfarer.api.combat.MutableShipStatsAPI;
7import com.fs.starfarer.api.combat.ShipAPI;
8import com.fs.starfarer.api.combat.ShipAPI.HullSize;
9import com.fs.starfarer.api.combat.WeaponAPI;
10import com.fs.starfarer.api.combat.WeaponAPI.WeaponType;
11import com.fs.starfarer.api.combat.listeners.WeaponBaseRangeModifier;
12import com.fs.starfarer.api.ui.Alignment;
13import com.fs.starfarer.api.ui.TooltipMakerAPI;
14import com.fs.starfarer.api.util.Misc;
24 if (!Misc.isAutomated(stats)) {
31 ship.addListener(
new EnergyBoltCohererRangeModifier());
34 public static class EnergyBoltCohererRangeModifier
implements WeaponBaseRangeModifier {
35 public EnergyBoltCohererRangeModifier() {
38 public float getWeaponBaseRangePercentMod(ShipAPI ship, WeaponAPI weapon) {
41 public float getWeaponBaseRangeMultMod(ShipAPI ship, WeaponAPI weapon) {
44 public float getWeaponBaseRangeFlatMod(ShipAPI ship, WeaponAPI weapon) {
45 if (weapon.isBeam())
return 0f;
46 if (weapon.getType() == WeaponType.ENERGY || weapon.getType() == WeaponType.HYBRID) {
47 if (Misc.isAutomated(ship)) {
67 public void addPostDescriptionSection(TooltipMakerAPI tooltip, HullSize hullSize, ShipAPI ship,
float width,
boolean isForModSpec) {
70 Color h = Misc.getHighlightColor();
71 Color bad = Misc.getNegativeHighlightColor();
74 if (!Misc.isAutomated(ship)) {
75 tooltip.addPara(
"Originally designed by the Tri-Tachyon Corporation for use on its combat droneships, "
76 +
"the coherence field strength has to be dialed down to allow operation on crewed vessels.", opad);
77 tooltip.addPara(
"Increases the base range of all non-beam Energy and Hybrid weapons by %s.", opad, h,
79 tooltip.addPara(
"The coherence field is unstable under combat conditions, with stresses on the hull "
80 +
"resulting in spot failures that release bursts of lethal radiation. "
81 +
"Crew casualties in combat are increased by %s.", opad, h,
84 tooltip.addPara(
"Increases the base range of all non-beam Energy and Hybrid weapons by %s.", opad, h,
88 tooltip.addSectionHeading(
"Interactions with other modifiers", Alignment.MID, opad);
89 tooltip.addPara(
"Since the base range is increased, this range modifier"
90 +
" - unlike most other flat modifiers in the game - "
91 +
"is increased by percentage modifiers from other hullmods and skills.", opad);
void addPostDescriptionSection(TooltipMakerAPI tooltip, HullSize hullSize, ShipAPI ship, float width, boolean isForModSpec)
static float CREWED_RANGE_BONUS
void applyEffectsAfterShipCreation(ShipAPI ship, String id)
String getDescriptionParam(int index, HullSize hullSize)
void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id)
static float CREW_CASUALTIES
boolean shouldAddDescriptionToTooltip(HullSize hullSize, ShipAPI ship, boolean isForModSpec)