001package com.fs.starfarer.api.impl.campaign.skills; 002 003import java.awt.Color; 004 005import com.fs.starfarer.api.Global; 006import com.fs.starfarer.api.characters.CharacterStatsSkillEffect; 007import com.fs.starfarer.api.characters.DescriptionSkillEffect; 008import com.fs.starfarer.api.characters.MutableCharacterStatsAPI; 009import com.fs.starfarer.api.impl.campaign.ids.Stats; 010import com.fs.starfarer.api.util.Misc; 011 012public class OfficerTraining { 013 014 public static final float MAX_LEVEL_BONUS = 1; 015 public static final float MAX_ELITE_SKILLS_BONUS = 1; 016 public static final float CP_BONUS = 2f; 017 018 public static class Level0 implements DescriptionSkillEffect { 019 public String getString() { 020 int base = (int)Global.getSettings().getInt("officerMaxLevel"); 021 return "*The base maximum officer level is " + base + "."; 022 } 023 public Color[] getHighlightColors() { 024 Color h = Misc.getDarkHighlightColor(); 025 return new Color[] {h}; 026 } 027 public String[] getHighlights() { 028 int base = (int)Global.getSettings().getInt("officerMaxLevel"); 029 return new String [] {"" + base}; 030 } 031 public Color getTextColor() { 032 return null; 033 } 034 } 035 036 public static class Level1 implements CharacterStatsSkillEffect { 037 038 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 039 stats.getDynamic().getMod(Stats.OFFICER_MAX_LEVEL_MOD).modifyFlat(id, MAX_LEVEL_BONUS); 040 } 041 042 public void unapply(MutableCharacterStatsAPI stats, String id) { 043 stats.getDynamic().getMod(Stats.OFFICER_MAX_LEVEL_MOD).unmodify(id); 044 } 045 046 public String getEffectDescription(float level) { 047 return "+" + (int) MAX_LEVEL_BONUS + " to maximum level* of officers under your command"; 048 } 049 050 public String getEffectPerLevelDescription() { 051 return null; 052 } 053 054 public ScopeDescription getScopeDescription() { 055 return ScopeDescription.NONE; 056 } 057 } 058 059 public static class Level2 implements CharacterStatsSkillEffect { 060 061 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 062 stats.getDynamic().getMod(Stats.OFFICER_MAX_ELITE_SKILLS_MOD).modifyFlat(id, MAX_ELITE_SKILLS_BONUS); 063 } 064 065 public void unapply(MutableCharacterStatsAPI stats, String id) { 066 stats.getDynamic().getMod(Stats.OFFICER_MAX_ELITE_SKILLS_MOD).unmodify(id); 067 } 068 069 public String getEffectDescription(float level) { 070 return "+" + (int) MAX_ELITE_SKILLS_BONUS + " to maximum number of elite skills for officers under your command"; 071 } 072 073 public String getEffectPerLevelDescription() { 074 return null; 075 } 076 077 public ScopeDescription getScopeDescription() { 078 return ScopeDescription.NONE; 079 } 080 } 081 082 public static class Level3 implements CharacterStatsSkillEffect { 083 084 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 085 stats.getCommandPoints().modifyFlat(id, CP_BONUS); 086 } 087 088 public void unapply(MutableCharacterStatsAPI stats, String id) { 089 stats.getCommandPoints().unmodify(id); 090 } 091 092 public String getEffectDescription(float level) { 093 return "+" + (int) CP_BONUS + " command points"; 094 } 095 096 public String getEffectPerLevelDescription() { 097 return null; 098 } 099 100 public ScopeDescription getScopeDescription() { 101 return ScopeDescription.FLEET; 102 } 103 } 104 105}