001package com.fs.starfarer.api.impl.campaign.skills;
002
003import java.awt.Color;
004
005import com.fs.starfarer.api.characters.CharacterStatsSkillEffect;
006import com.fs.starfarer.api.characters.DescriptionSkillEffect;
007import com.fs.starfarer.api.characters.MutableCharacterStatsAPI;
008import com.fs.starfarer.api.characters.ShipSkillEffect;
009import com.fs.starfarer.api.combat.MutableShipStatsAPI;
010import com.fs.starfarer.api.combat.ShipAPI.HullSize;
011import com.fs.starfarer.api.impl.campaign.ids.Stats;
012import com.fs.starfarer.api.util.Misc;
013
014public class BestOfTheBest {
015
016        public static int EXTRA_MODS = 1;
017        public static float DEPLOYMENT_BONUS = 0.1f;
018        
019
020        public static class Level0 implements DescriptionSkillEffect {
021                public String getString() {
022                        int max = Misc.MAX_PERMA_MODS;
023                        return "*The base maximum number of permanent hullmods you're able to build into a ship is " +
024                                        max + "."
025                                        ;
026                }
027                public Color[] getHighlightColors() {
028                        Color h = Misc.getHighlightColor();
029                        h = Misc.getDarkHighlightColor();
030                        return new Color[] {h, h, h};
031                }
032                public String[] getHighlights() {
033                        int max = Misc.MAX_PERMA_MODS;
034                        return new String [] {"" + max};
035                }
036                public Color getTextColor() {
037                        return null;
038                }
039        }
040        
041        
042        public static class Level1 implements ShipSkillEffect {
043
044                public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) {
045                        stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).modifyFlat(id, EXTRA_MODS);
046                }
047
048                public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) {
049                        stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).unmodifyFlat(id);
050                }
051                
052                public String getEffectDescription(float level) {
053                        return "Able to build " + EXTRA_MODS + " more permanent hullmod* into ships";
054                }
055                
056                public String getEffectPerLevelDescription() {
057                        return null;
058                }
059
060                public ScopeDescription getScopeDescription() {
061                        return ScopeDescription.FLEET;
062                }
063        }
064        
065        public static class Level2 implements CharacterStatsSkillEffect {
066                public void apply(MutableCharacterStatsAPI stats, String id, float level) {
067                        stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MIN_FRACTION_OF_BATTLE_SIZE_BONUS_MOD).modifyFlat(id, DEPLOYMENT_BONUS);
068                }
069
070                public void unapply(MutableCharacterStatsAPI stats, String id) {
071                        stats.getDynamic().getMod(Stats.DEPLOYMENT_POINTS_MIN_FRACTION_OF_BATTLE_SIZE_BONUS_MOD).unmodifyFlat(id);
072                }
073
074                public String getEffectDescription(float level) {
075//                      return "Deployment points increased as if holding an objective worth " + 
076//                                              (int)Math.round(DEPLOYMENT_BONUS * 100f) + "% of the battle size (equivalent to a Comm Relay)";
077                        return "Deployment points bonus from objectives is at least " + 
078                        (int)Math.round(DEPLOYMENT_BONUS * 100f) + "% of the battle size, even if holding no objectives";
079                }
080
081                public String getEffectPerLevelDescription() {
082                        return null;
083                }
084
085                public ScopeDescription getScopeDescription() {
086                        return ScopeDescription.ALL_SHIPS;
087                }
088        }
089}
090
091
092
093
094