Starsector API
Loading...
Searching...
No Matches
NeuralIntegrator.java
Go to the documentation of this file.
1package com.fs.starfarer.api.impl.hullmods;
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.combat.ShipHullSpecAPI.ShipTypeHints;
7import com.fs.starfarer.api.impl.campaign.ids.Stats;
8import com.fs.starfarer.api.util.Misc;
9
10public class NeuralIntegrator extends NeuralInterface {
11
12 public static float DP_INCREASE_PERCENT = 10f;
13
14 @Override
15 public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
16 super.applyEffectsBeforeShipCreation(hullSize, stats, id);
17
18 stats.getSuppliesToRecover().modifyPercent(id, DP_INCREASE_PERCENT);
19 stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MOD).modifyPercent(id, DP_INCREASE_PERCENT);
20 }
21
22 public boolean isApplicableToShip(ShipAPI ship) {
23 if (!Misc.isAutomated(ship)) {
24 return false;
25 }
26 if (ship.getHullSpec().getHints().contains(ShipTypeHints.NO_NEURAL_LINK)) {
27 return false;
28 }
29 return true;
30 }
31
32 public String getUnapplicableReason(ShipAPI ship) {
33 if (!Misc.isAutomated(ship)) {
34 return "Can only be installed on automated ships, install Neural Interface instead";
35 }
36 if (ship.getHullSpec().getHints().contains(ShipTypeHints.NO_NEURAL_LINK)) {
37 return "Can not be installed on this ship";
38 }
39 return null;
40 }
41}
42
43
44
45
void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id)