Starsector API
Loading...
Searching...
No Matches
ShieldAlwaysOn.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.hullmods;
2
3import com.fs.starfarer.api.combat.BaseHullMod;
4import com.fs.starfarer.api.combat.MutableShipStatsAPI;
5import com.fs.starfarer.api.combat.ShipAPI;
6import com.fs.starfarer.api.combat.ShipCommand;
7import com.fs.starfarer.api.combat.ShipAPI.HullSize;
8
9public class ShieldAlwaysOn extends BaseHullMod {
10
11 public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
12 }
13
14 public String getDescriptionParam(int index, HullSize hullSize) {
15 return null;
16 }
17
18 @Override
19 public void advanceInCombat(ShipAPI ship, float amount) {
20 super.advanceInCombat(ship, amount);
21
22 if (!ship.isAlive()) return;
23
24 //CombatEngineAPI engine = Global.getCombatEngine();
25
26 // so the ship AI can't control it
29
30 String id = "shield_always_on";
31 ship.getMutableStats().getOverloadTimeMod().modifyMult(id, 2f); // frigate hull size; makes it 8 sec base
32
35 } else {
37 if (!ship.getShield().isOn()) {
38 ship.getShield().toggleOn();
39 }
40 if (ship.getFluxLevel() > 0.99f) {
42 }
43 }
44
45 }
46}
47
48
49
50
51
52
53
54
55
56
57
void modifyMult(String source, float value)
void modifyMult(String source, float value)
void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id)
void advanceInCombat(ShipAPI ship, float amount)
String getDescriptionParam(int index, HullSize hullSize)
void beginOverloadWithTotalBaseDuration(float totalDur)
MutableShipStatsAPI getMutableStats()
void blockCommandForOneFrame(ShipCommand command)