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 PointDefense {
008        
009        public static float FIGHTER_DAMAGE_BONUS = 50f;
010        public static float MISSILE_DAMAGE_BONUS = 50f;
011//      public static float FIGHTER_DAMAGE_BONUS = 75f;
012//      public static float MISSILE_DAMAGE_BONUS = 75f;
013        
014        public static float PD_RANGE_BONUS_FLAT = 200f;
015        
016        
017        
018        public static class Level1 implements ShipSkillEffect {
019
020                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
021                        stats.getDamageToFighters().modifyFlat(id, FIGHTER_DAMAGE_BONUS / 100f);
022                }
023                
024                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
025                        stats.getDamageToFighters().unmodify(id);
026                }       
027                
028                public String getEffectDescription(float level) {
029                        return "+" + (int)(FIGHTER_DAMAGE_BONUS) + "% damage to fighters";
030                }
031                
032                public String getEffectPerLevelDescription() {
033                        return null;
034                }
035                
036                public ScopeDescription getScopeDescription() {
037                        return ScopeDescription.PILOTED_SHIP;
038                }
039        }
040        
041        public static class Level2 implements ShipSkillEffect {
042
043                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
044                        stats.getDamageToMissiles().modifyFlat(id, MISSILE_DAMAGE_BONUS / 100f);
045                }
046                
047                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
048                        stats.getDamageToMissiles().unmodify(id);
049                }       
050                
051                public String getEffectDescription(float level) {
052                        return "+" + (int)(MISSILE_DAMAGE_BONUS) + "% damage to missiles";
053                }
054                
055                public String getEffectPerLevelDescription() {
056                        return null;
057                }
058                
059                public ScopeDescription getScopeDescription() {
060                        return ScopeDescription.PILOTED_SHIP;
061                }
062        }
063        
064        public static class Level3 implements ShipSkillEffect {
065                
066                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
067                        stats.getNonBeamPDWeaponRangeBonus().modifyFlat(id, PD_RANGE_BONUS_FLAT);
068                        stats.getBeamPDWeaponRangeBonus().modifyFlat(id, PD_RANGE_BONUS_FLAT);
069                }
070                
071                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
072                        stats.getNonBeamPDWeaponRangeBonus().unmodifyFlat(id);
073                        stats.getBeamPDWeaponRangeBonus().unmodifyFlat(id);
074                }       
075                
076                public String getEffectDescription(float level) {
077                        //return "+" + (int)(PD_RANGE_BONUS_FLAT) + " range ";
078                        return "Extends the range of point-defense weapons by " + (int)(PD_RANGE_BONUS_FLAT) + "";
079                }
080                
081                public String getEffectPerLevelDescription() {
082                        return null;
083                }
084                
085                public ScopeDescription getScopeDescription() {
086                        return ScopeDescription.PILOTED_SHIP;
087                }
088        }
089}