001package com.fs.starfarer.api.impl.hullmods;
002
003import com.fs.starfarer.api.combat.MutableShipStatsAPI;
004import com.fs.starfarer.api.combat.ShipAPI;
005import com.fs.starfarer.api.combat.ShipAPI.HullSize;
006import com.fs.starfarer.api.combat.ShipHullSpecAPI.ShipTypeHints;
007import com.fs.starfarer.api.impl.campaign.ids.Stats;
008import com.fs.starfarer.api.util.Misc;
009
010public class NeuralIntegrator extends NeuralInterface {
011
012        public static float DP_INCREASE_PERCENT = 10f;
013        
014        @Override
015        public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
016                super.applyEffectsBeforeShipCreation(hullSize, stats, id);
017                
018                stats.getSuppliesToRecover().modifyPercent(id, DP_INCREASE_PERCENT);
019                stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MOD).modifyPercent(id, DP_INCREASE_PERCENT);
020        }
021
022        public boolean isApplicableToShip(ShipAPI ship) {
023                if (!Misc.isAutomated(ship)) {
024                        return false;
025                }
026                if (ship.getHullSpec().getHints().contains(ShipTypeHints.NO_NEURAL_LINK)) {
027                        return false;
028                }
029                return true;
030        }
031        
032        public String getUnapplicableReason(ShipAPI ship) {
033                if (!Misc.isAutomated(ship)) {
034                        return "Can only be installed on automated ships, install Neural Interface instead";
035                }
036                if (ship.getHullSpec().getHints().contains(ShipTypeHints.NO_NEURAL_LINK)) {
037                        return "Can not be installed on this ship";
038                }
039                return null;
040        }
041}
042
043
044
045