001package com.fs.starfarer.api.impl.campaign.skills; 002 003import com.fs.starfarer.api.Global; 004import com.fs.starfarer.api.characters.CharacterStatsSkillEffect; 005import com.fs.starfarer.api.characters.MutableCharacterStatsAPI; 006import com.fs.starfarer.api.impl.campaign.ids.Stats; 007 008public class CommandAndControl { 009 010 public static final float BASE_SECONDS_PER_POINT = Global.getSettings().getFloat("baseSecondsPerCommandPoint"); 011 public static final float RATE_BONUS = 50f; 012 public static final float CP_BONUS = 3f; 013 014 public static final float CM_BONUS = 5f; 015 public static final float EW_BONUS = 5f; 016 017 018 public static class Level1A implements CharacterStatsSkillEffect { 019 020 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 021 stats.getCommandPoints().modifyFlat(id, CP_BONUS); 022 } 023 024 public void unapply(MutableCharacterStatsAPI stats, String id) { 025 stats.getCommandPoints().unmodify(id); 026 } 027 028 public String getEffectDescription(float level) { 029 return "+" + (int) CP_BONUS + " command points"; 030 } 031 032 public String getEffectPerLevelDescription() { 033 return null; 034 } 035 036 public ScopeDescription getScopeDescription() { 037 return ScopeDescription.FLEET; 038 } 039 } 040 041 public static class Level1B implements CharacterStatsSkillEffect { 042 043 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 044 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).modifyFlat(id, RATE_BONUS / 100f); 045 } 046 047 public void unapply(MutableCharacterStatsAPI stats, String id) { 048 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).unmodify(id); 049 } 050 051 public String getEffectDescription(float level) { 052 return "" + (int) RATE_BONUS + "% faster command point recovery"; 053 } 054 055 public String getEffectPerLevelDescription() { 056 return null; 057 } 058 059 public ScopeDescription getScopeDescription() { 060 return ScopeDescription.FLEET; 061 } 062 } 063 064 065 066 067 068 069 070 public static class Level3A implements CharacterStatsSkillEffect { 071 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 072 stats.getDynamic().getMod(Stats.COORDINATED_MANEUVERS_MAX).modifyFlat(id, CM_BONUS); 073 } 074 public void unapply(MutableCharacterStatsAPI stats, String id) { 075 stats.getDynamic().getMod(Stats.COORDINATED_MANEUVERS_MAX).unmodify(id); 076 } 077 public String getEffectDescription(float level) { 078 return "" + (int) CM_BONUS + "% maximum bonus from Coordinated Maneuvers"; 079 } 080 public String getEffectPerLevelDescription() { 081 return null; 082 } 083 public ScopeDescription getScopeDescription() { 084 return ScopeDescription.NONE; 085 } 086 } 087 088 public static class Level3B implements CharacterStatsSkillEffect { 089 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 090 stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_MAX).modifyFlat(id, EW_BONUS); 091 } 092 public void unapply(MutableCharacterStatsAPI stats, String id) { 093 stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_MAX).unmodify(id); 094 } 095 public String getEffectDescription(float level) { 096 return "" + (int) CM_BONUS + "% maximum bonus from Electronic Warfare"; 097 } 098 public String getEffectPerLevelDescription() { 099 return null; 100 } 101 public ScopeDescription getScopeDescription() { 102 return ScopeDescription.NONE; 103 } 104 } 105 106}