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 ShieldModulation {
008        
009        public static final float FLUX_UPKEEP_REDUCTION = 25f;
010        public static final float SHIELD_DAMAGE_REDUCTION = 20f;
011        
012        public static final float FLUX_SHUNT_DISSIPATION = 15f;
013        
014        public static final float SHIELD_HE_REDUCTION = 30f;
015        
016
017        public static class Level1 implements ShipSkillEffect {
018
019                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
020                        stats.getShieldUpkeepMult().modifyMult(id, 1f - FLUX_UPKEEP_REDUCTION / 100f);
021                }
022                
023                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
024                        stats.getShieldUpkeepMult().unmodify(id);
025                }
026                
027                public String getEffectDescription(float level) {
028                        return "-" + (int)(FLUX_UPKEEP_REDUCTION) + "% flux generated by raised shields";
029                }
030                
031                public String getEffectPerLevelDescription() {
032                        return null;
033                }
034                
035                public ScopeDescription getScopeDescription() {
036                        return ScopeDescription.PILOTED_SHIP;
037                }
038        }
039
040        public static class Level2 implements ShipSkillEffect {
041                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
042                        stats.getShieldDamageTakenMult().modifyMult(id, 1f - SHIELD_DAMAGE_REDUCTION / 100f);
043                }
044                
045                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
046                        stats.getShieldDamageTakenMult().unmodify(id);
047                }
048                
049                public String getEffectDescription(float level) {
050                        return "-" + (int)(SHIELD_DAMAGE_REDUCTION) + "% damage taken by shields";
051                }
052                
053                public String getEffectPerLevelDescription() {
054                        return null;
055                }
056
057                public ScopeDescription getScopeDescription() {
058                        return ScopeDescription.PILOTED_SHIP;
059                }
060        }
061        
062        public static class Level3 implements ShipSkillEffect {
063
064                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
065                        stats.getHardFluxDissipationFraction().modifyFlat(id, FLUX_SHUNT_DISSIPATION / 100f);
066                }
067                
068                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
069                        stats.getHardFluxDissipationFraction().unmodify(id);
070                }       
071                
072                public String getEffectDescription(float level) {
073                        return "" + (int)(FLUX_SHUNT_DISSIPATION) + "% hard flux dissipation while shields are active";
074                }
075                
076                public String getEffectPerLevelDescription() {
077                        return null;
078                }
079                
080                public ScopeDescription getScopeDescription() {
081                        return ScopeDescription.PILOTED_SHIP;
082                }
083        }
084        
085        public static class Level4 implements ShipSkillEffect {
086                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
087                        stats.getHighExplosiveShieldDamageTakenMult().modifyMult(id, 1f - SHIELD_HE_REDUCTION / 100f);
088                }
089                
090                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
091                        stats.getHighExplosiveShieldDamageTakenMult().unmodify(id);
092                }
093                
094                public String getEffectDescription(float level) {
095                        return "-" + (int)(SHIELD_HE_REDUCTION) + "% high-explosive damage taken by shields";
096                }
097                
098                public String getEffectPerLevelDescription() {
099                        return null;
100                }
101
102                public ScopeDescription getScopeDescription() {
103                        return ScopeDescription.PILOTED_SHIP;
104                }
105        }
106
107//      public static class Level4 implements ShipSkillEffect {
108//              
109//              public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
110//                      stats.getHardFluxDissipationFraction().modifyFlat(id, FLUX_SHUNT_DISSIPATION / 100f);
111//              }
112//              
113//              public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
114//                      stats.getHardFluxDissipationFraction().unmodify(id);
115//              }       
116//              
117//              public String getEffectDescription(float level) {
118//                      return "" + (int)(FLUX_SHUNT_DISSIPATION) + "% hard flux dissipation while shields are active";
119//              }
120//              
121//              public String getEffectPerLevelDescription() {
122//                      return null;
123//              }
124//              
125//              public ScopeDescription getScopeDescription() {
126//                      return ScopeDescription.PILOTED_SHIP;
127//              }
128//      }
129        
130}