Starsector API
Loading...
Searching...
No Matches
HumanShipShroudedHullmod.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.combat.dweller;
2
3import com.fs.starfarer.api.combat.MutableShipStatsAPI;
4import com.fs.starfarer.api.combat.ShipAPI;
5import com.fs.starfarer.api.combat.ShipAPI.HullSize;
6import com.fs.starfarer.api.impl.campaign.ids.HullMods;
7import com.fs.starfarer.api.ui.TooltipMakerAPI;
8import com.fs.starfarer.api.util.Misc;
9
11
12 public static float CREW_CASUALTIES = 50f;
14
15 public static boolean ALLOW_ON_PHASE_SHIPS = false;
16
17
18 public boolean isApplicableToShip(ShipAPI ship) {
19 if (ship.getVariant().getHullMods().contains(HullMods.FRAGMENT_SWARM)) {
20 return false;
21 }
23 if (ship != null && ship.getHullSpec().isPhase()) {
24 return false;
25 }
26 }
27 return true;
28 }
29
30 public String getUnapplicableReason(ShipAPI ship) {
31 if (ship.getVariant().getHullMods().contains(HullMods.FRAGMENT_SWARM)) {
32 return "Incompatible with Fragment Swarm";
33 }
34 return "Can not be installed on a phase ship";
35 }
36
37 protected boolean increasesCrewCasualties() {
38 return true;
39 }
40
41 @Override
42 protected boolean addStrategyAI() {
43 return false;
44 }
45
46 @Override
47 protected DwellerShipCreator getShipCreator(String hullId) {
48 return CREATOR;
49 }
50
51 @Override
52 public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
53 super.applyEffectsBeforeShipCreation(hullSize, stats, id);
56 }
58 }
59
61 return true;
62 }
63 protected boolean deductFlux(ShipAPI ship, float fluxCost) {
65 return true;
66 }
67 if (!ship.getFluxTracker().increaseFlux(fluxCost, false)) {
68 return false;
69 }
70 return true;
71 }
72
73
74 public void addCrewCasualties(TooltipMakerAPI tooltip, float opad) {
75 tooltip.addPara("Crew casualties in combat are increased by %s.", opad, Misc.getHighlightColor(),
76 "" + (int) CREW_CASUALTIES + "%");
77 }
78
79}
80
81
82
83
84
85
86
87
88
89
90
91
92
93
void modifyPercent(String source, float value)
void modifyMult(String source, float value)
void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id)
static Color getHighlightColor()
Definition Misc.java:792
boolean increaseFlux(float fluxAmount, boolean hardFlux)
LabelAPI addPara(String format, float pad, Color hl, String... highlights)