001package com.fs.starfarer.api.impl.campaign.skills;
002
003import com.fs.starfarer.api.characters.ShipSkillEffect;
004import com.fs.starfarer.api.combat.MutableShipStatsAPI;
005import com.fs.starfarer.api.combat.ShipAPI.HullSize;
006
007public class PowerGridModulation {
008        
009        public static final float FLUX_CAPACITY_BONUS = 10f;
010        public static final float VENT_RATE_BONUS = 25f;
011        public static final float FLUX_DISSIPATION_BONUS = 10f;
012        
013        
014
015        public static class Level1 implements ShipSkillEffect {
016
017                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
018                        stats.getFluxCapacity().modifyPercent(id, FLUX_CAPACITY_BONUS);
019                }
020                
021                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
022                        stats.getFluxCapacity().unmodify(id);
023                }
024                
025                public String getEffectDescription(float level) {
026                        return "+" + (int)(FLUX_CAPACITY_BONUS) + "% flux capacity";
027                }
028                
029                public String getEffectPerLevelDescription() {
030                        return null;
031                }
032
033                public ScopeDescription getScopeDescription() {
034                        return ScopeDescription.PILOTED_SHIP;
035                }
036        }
037
038        public static class Level2 implements ShipSkillEffect {
039                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
040                        stats.getVentRateMult().modifyFlat(id, VENT_RATE_BONUS * 0.01f);
041                }
042                
043                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
044                        stats.getVentRateMult().unmodify(id);
045                }
046                
047                public String getEffectDescription(float level) {
048                        return "+" + (int) VENT_RATE_BONUS + "% flux dissipation rate while venting";
049                }
050                
051                public String getEffectPerLevelDescription() {
052                        return null;
053                }
054
055                public ScopeDescription getScopeDescription() {
056                        return ScopeDescription.PILOTED_SHIP;
057                }
058        }
059        
060        public static class Level3 implements ShipSkillEffect {
061                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
062                        stats.getFluxDissipation().modifyPercent(id, FLUX_DISSIPATION_BONUS);
063                }
064                
065                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
066                        stats.getFluxDissipation().unmodify(id);
067                }
068                
069                public String getEffectDescription(float level) {
070                        return "+" + (int)(FLUX_DISSIPATION_BONUS) + "% flux dissipation rate";
071                }
072                
073                public String getEffectPerLevelDescription() {
074                        return null;
075                }
076
077                public ScopeDescription getScopeDescription() {
078                        return ScopeDescription.PILOTED_SHIP;
079                }
080        }
081        
082}