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 TargetAnalysis {
008        
009        public static float DAMAGE_TO_MODULES_BONUS = 100;
010//      public static float DAMAGE_TO_SHIELDS_BONUS = 15;
011//      public static float HIT_STRENGTH_BONUS = 50;
012        
013        public static float DAMAGE_TO_FRIGATES = 5;
014        public static float DAMAGE_TO_DESTROYERS = 10;
015        public static float DAMAGE_TO_CRUISERS = 15;
016        public static float DAMAGE_TO_CAPITALS = 20;
017        
018
019        public static class Level1 implements ShipSkillEffect {
020                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
021                        stats.getDamageToDestroyers().modifyPercent(id, DAMAGE_TO_DESTROYERS);
022                }
023                
024                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
025                        stats.getDamageToDestroyers().unmodifyPercent(id);
026                }
027                
028                public String getEffectDescription(float level) {
029                        return "+" + (int)(DAMAGE_TO_DESTROYERS) + "% damage to destroyers";
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 Level1A implements ShipSkillEffect {
042                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
043                        stats.getDamageToFrigates().modifyPercent(id, DAMAGE_TO_FRIGATES);
044                }
045                
046                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
047                        stats.getDamageToFrigates().unmodifyPercent(id);
048                }
049                
050                public String getEffectDescription(float level) {
051                        return "+" + (int)(DAMAGE_TO_FRIGATES) + "% damage to frigates";
052                }
053                
054                public String getEffectPerLevelDescription() {
055                        return null;
056                }
057                
058                public ScopeDescription getScopeDescription() {
059                        return ScopeDescription.PILOTED_SHIP;
060                }
061        }
062        
063        public static class Level2 implements ShipSkillEffect {
064                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
065                        stats.getDamageToCruisers().modifyPercent(id, DAMAGE_TO_CRUISERS);
066                }
067                
068                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
069                        stats.getDamageToCruisers().unmodifyPercent(id);
070                }
071                
072                public String getEffectDescription(float level) {
073                        return "+" + (int)(DAMAGE_TO_CRUISERS) + "% damage to cruisers";
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 Level3 implements ShipSkillEffect {
086                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
087                        stats.getDamageToCapital().modifyPercent(id, DAMAGE_TO_CAPITALS);
088                }
089                
090                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
091                        stats.getDamageToCapital().unmodifyPercent(id);
092                }
093                
094                public String getEffectDescription(float level) {
095                        return "+" + (int)(DAMAGE_TO_CAPITALS) + "% damage to capital ships";
096                }
097                
098                public String getEffectPerLevelDescription() {
099                        return null;
100                }
101                
102                public ScopeDescription getScopeDescription() {
103                        return ScopeDescription.PILOTED_SHIP;
104                }
105        }
106        
107        
108        
109        
110        public static class Level4 implements ShipSkillEffect {
111
112                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
113                        stats.getDamageToTargetEnginesMult().modifyPercent(id, DAMAGE_TO_MODULES_BONUS);
114                        stats.getDamageToTargetWeaponsMult().modifyPercent(id, DAMAGE_TO_MODULES_BONUS);
115                }
116                
117                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
118                        stats.getDamageToTargetEnginesMult().unmodify(id);
119                        stats.getDamageToTargetWeaponsMult().unmodify(id);
120                }
121                
122                public String getEffectDescription(float level) {
123                        return "+" + (int)(DAMAGE_TO_MODULES_BONUS) + "% damage to weapons and engines";
124                }
125                
126                public String getEffectPerLevelDescription() {
127                        return null;
128                }
129                
130                public ScopeDescription getScopeDescription() {
131                        return ScopeDescription.PILOTED_SHIP;
132                }
133        }
134
135//      public static class Level2 implements ShipSkillEffect {
136//
137//              public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
138//                      stats.getDamageToTargetShieldsMult().modifyPercent(id, DAMAGE_TO_SHIELDS_BONUS);
139//              }
140//              
141//              public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
142//                      stats.getDamageToTargetShieldsMult().unmodify(id);
143//              }
144//              
145//              public String getEffectDescription(float level) {
146//                      return "+" + (int)(DAMAGE_TO_SHIELDS_BONUS) + "% damage to shields";
147//              }
148//              
149//              public String getEffectPerLevelDescription() {
150//                      return null;
151//              }
152//
153//              public ScopeDescription getScopeDescription() {
154//                      return ScopeDescription.PILOTED_SHIP;
155//              }
156//
157//      }
158//      
159//      public static class Level3 implements ShipSkillEffect {
160//
161//              public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
162//                      stats.getHitStrengthBonus().modifyPercent(id, HIT_STRENGTH_BONUS);
163//              }
164//              
165//              public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
166//                      stats.getHitStrengthBonus().unmodify(id);
167//              }       
168//              
169//              public String getEffectDescription(float level) {
170//                      return "+" + (int)(HIT_STRENGTH_BONUS) + "% hit strength for armor damage reduction calculation only";
171//              }
172//              
173//              public String getEffectPerLevelDescription() {
174//                      return null;
175//              }
176//              
177//              public ScopeDescription getScopeDescription() {
178//                      return ScopeDescription.PILOTED_SHIP;
179//              }
180//      }
181        
182}