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.MutableCharacterStatsAPI; 007import com.fs.starfarer.api.characters.SkillSpecAPI; 008import com.fs.starfarer.api.impl.campaign.ids.Stats; 009import com.fs.starfarer.api.ui.TooltipMakerAPI; 010import com.fs.starfarer.api.util.Misc; 011 012public class ForceConcentration { 013 014 // these actually get applied in CoordinatedManeuversScript, based on the ship having 015 // Stats.HAS_FORCE_CONCENTRATION_BONUS > 0 016 public static float ZERO_FLUX_SPEED_BONUS_SMALL = 25f; 017 public static float ZERO_FLUX_SPEED_BONUS = 100f; 018 public static float ZERO_FLUX_ACCEL_BONUS = ZERO_FLUX_SPEED_BONUS; 019 public static float ZERO_FLUX_TURN_BONUS = 20f; 020 public static float ZERO_FLUX_TURN_ACCEL_BONUS = ZERO_FLUX_TURN_BONUS * 2f; 021 022 public static float COMMAND_POINT_REGEN_PERCENT = 100f; 023 024 025 026// public static class Level1 implements ShipSkillEffect { 027// 028// public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 029// //stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).modifyFlat(id, EXTRA_MODS); 030// } 031// 032// public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 033// //stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).unmodifyFlat(id); 034// } 035// 036// public String getEffectDescription(float level) { 037// return "Able to build " + EXTRA_MODS + " more permanent hullmod* into ships"; 038// } 039// 040// public String getEffectPerLevelDescription() { 041// return null; 042// } 043// 044// public ScopeDescription getScopeDescription() { 045// return ScopeDescription.FLEET; 046// } 047// } 048 049 050 public static class Level2 implements CharacterStatsSkillEffect { 051 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 052 //stats.getDynamic().getMod(Stats.HAS_FORCE_CONCENTRATION_BONUS_MOD).modifyFlat(id, 1f); 053 } 054 055 public void unapply(MutableCharacterStatsAPI stats, String id) { 056 //stats.getDynamic().getMod(Stats.HAS_FORCE_CONCENTRATION_BONUS_MOD).unmodifyFlat(id); 057 } 058 059 public String getEffectDescription(float level) { 060 return "+" + (int)ZERO_FLUX_SPEED_BONUS + " to 0-flux speed boost and a high maneuverability bonus if no enemy presence nearby, +" + 061 (int)ZERO_FLUX_SPEED_BONUS_SMALL + " to 0-flux boost otherwise"; 062 } 063 064 public String getEffectPerLevelDescription() { 065 return null; 066 } 067 068 public ScopeDescription getScopeDescription() { 069 return ScopeDescription.ALL_SHIPS; 070 } 071 } 072 073 public static class Level3 implements CharacterStatsSkillEffect { 074 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 075 stats.getDynamic().getMod(Stats.CAN_DEPLOY_LEFT_RIGHT_MOD).modifyFlat(id, 1f); 076 } 077 078 public void unapply(MutableCharacterStatsAPI stats, String id) { 079 stats.getDynamic().getMod(Stats.CAN_DEPLOY_LEFT_RIGHT_MOD).unmodifyFlat(id); 080 } 081 082 public String getEffectDescription(float level) { 083 return "Able to deploy ships of all size classes from the flanks in all combat scenarios"; 084 } 085 086 public String getEffectPerLevelDescription() { 087 return null; 088 } 089 090 public ScopeDescription getScopeDescription() { 091 return ScopeDescription.ALL_SHIPS; 092 } 093 } 094 095 public static class Level4 extends BaseSkillEffectDescription implements CharacterStatsSkillEffect { 096 097 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 098 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).modifyFlat(id, COMMAND_POINT_REGEN_PERCENT / 100f); 099 } 100 101 public void unapply(MutableCharacterStatsAPI stats, String id) { 102 stats.getDynamic().getStat(Stats.COMMAND_POINT_RATE_COMMANDER).unmodify(id); 103 } 104 105 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill, 106 TooltipMakerAPI info, float width) { 107 init(stats, skill); 108 109 float opad = 10f; 110 Color c = Misc.getBasePlayerColor(); 111 //info.addPara("Affects: %s", opad + 5f, Misc.getGrayColor(), c, "fleet"); 112 info.addPara("Affects: %s", opad + 5f, Misc.getGrayColor(), c, "fleet"); 113 info.addSpacer(opad); 114 info.addPara("%s faster command point recovery", 0f, hc, hc, 115 "" + (int) COMMAND_POINT_REGEN_PERCENT + "%"); 116 } 117 118 public String getEffectDescription(float level) { 119 return null; 120 } 121 122 public String getEffectPerLevelDescription() { 123 return null; 124 } 125 126 public ScopeDescription getScopeDescription() { 127 return ScopeDescription.FLEET; 128 } 129 } 130} 131 132 133 134 135