001package com.fs.starfarer.api.impl.campaign.skills; 002 003import java.awt.Color; 004 005import com.fs.starfarer.api.characters.DescriptionSkillEffect; 006import com.fs.starfarer.api.characters.FleetStatsSkillEffect; 007import com.fs.starfarer.api.fleet.MutableFleetStatsAPI; 008import com.fs.starfarer.api.impl.campaign.ids.Stats; 009 010public class Sensors { 011 012 public static float DETECTED_BONUS = 25f; 013 public static float SENSOR_BONUS = 25f; 014 015 public static float SLOW_BURN_BONUS = 3f; 016 017 public static float GO_DARK_MULT = 0.5f; 018 public static float SENSOR_BURST_PENALTY_MULT = 0.5f; 019 020 021 022 public static class Level0 implements DescriptionSkillEffect { 023 public String getString() { 024 //int base = (int) RingSystemTerrainPlugin.MAX_SNEAK_BURN_LEVEL; 025// return "*A slow-moving fleet is harder to detect in some types of terrain, and can avoid some hazards. " + 026// "Several abilities also make the fleet move slowly when they are activated. The base burn " + 027// "level at which a fleet is considered to be slow-moving is " + base + "."; 028 //int reduction = (int)Math.round((1f - Misc.SNEAK_BURN_MULT) * 100f); 029 return "*A slow-moving fleet is harder to detect in some types of terrain, and can avoid some hazards. " + 030 "Some abilities also make the fleet move slowly when activated. A fleet is considered " + 031 "slow-moving at a burn level of half that of its slowest ship."; 032 } 033 public Color[] getHighlightColors() { 034 return null; 035// Color h = Misc.getHighlightColor(); 036// h = Misc.getDarkHighlightColor(); 037// return new Color[] {h}; 038 } 039 public String[] getHighlights() { 040 return null; 041// int base = (int) RingSystemTerrainPlugin.MAX_SNEAK_BURN_LEVEL; 042// return new String [] {"" + base}; 043 } 044 public Color getTextColor() { 045 return null; 046 } 047 } 048// public static class Level1 implements FleetStatsSkillEffect { 049// public void apply(MutableFleetStatsAPI stats, String id, float level) { 050// stats.getDynamic().getMod(Stats.CAN_SEE_NASCENT_POINTS).modifyFlat(id, 1); 051// } 052// 053// public void unapply(MutableFleetStatsAPI stats, String id) { 054// stats.getDynamic().getMod(Stats.CAN_SEE_NASCENT_POINTS).unmodify(id); 055// } 056// 057// public String getEffectDescription(float level) { 058// return "Can detect nascent gravity wells around star systems"; 059// } 060// 061// public String getEffectPerLevelDescription() { 062// return null; 063// } 064// 065// public ScopeDescription getScopeDescription() { 066// return ScopeDescription.FLEET; 067// } 068// } 069 070 public static class Level1 implements FleetStatsSkillEffect { 071 public void apply(MutableFleetStatsAPI stats, String id, float level) { 072 stats.getDetectedRangeMod().modifyMult(id, 1f - DETECTED_BONUS / 100f, "Sensors skill"); 073 } 074 075 public void unapply(MutableFleetStatsAPI stats, String id) { 076 stats.getDetectedRangeMod().unmodify(id); 077 } 078 079 public String getEffectDescription(float level) { 080 return "-" + (int) DETECTED_BONUS + "% detected-at range"; 081 } 082 083 public String getEffectPerLevelDescription() { 084 return null; 085 } 086 087 public ScopeDescription getScopeDescription() { 088 return ScopeDescription.FLEET; 089 } 090 } 091 092 public static class Level2 implements FleetStatsSkillEffect { 093 public void apply(MutableFleetStatsAPI stats, String id, float level) { 094 stats.getSensorRangeMod().modifyPercent(id, SENSOR_BONUS, "Sensors skill"); 095 } 096 097 public void unapply(MutableFleetStatsAPI stats, String id) { 098 stats.getSensorRangeMod().unmodify(id); 099 } 100 101 public String getEffectDescription(float level) { 102 return "+" + (int) SENSOR_BONUS + "% sensor range"; 103 } 104 105 public String getEffectPerLevelDescription() { 106 return null; 107 } 108 109 public ScopeDescription getScopeDescription() { 110 return ScopeDescription.FLEET; 111 } 112 } 113 114 public static class Level3 implements FleetStatsSkillEffect { 115 public void apply(MutableFleetStatsAPI stats, String id, float level) { 116 stats.getDynamic().getMod(Stats.MOVE_SLOW_SPEED_BONUS_MOD).modifyFlat(id, SLOW_BURN_BONUS); 117 } 118 119 public void unapply(MutableFleetStatsAPI stats, String id) { 120 stats.getDynamic().getMod(Stats.MOVE_SLOW_SPEED_BONUS_MOD).unmodifyFlat(id); 121 } 122 123 public String getEffectDescription(float level) { 124 return "+" + (int) SLOW_BURN_BONUS + " to burn level at which the fleet is considered to be moving slowly*"; 125 } 126 127 public String getEffectPerLevelDescription() { 128 return null; 129 } 130 131 public ScopeDescription getScopeDescription() { 132 return ScopeDescription.FLEET; 133 } 134 } 135 136// public static class Level2B implements FleetStatsSkillEffect { 137// public void apply(MutableFleetStatsAPI stats, String id, float level) { 138// stats.getDynamic().getStat(Stats.GO_DARK_DETECTED_AT_MULT).modifyMult(id, GO_DARK_MULT); 139// } 140// 141// public void unapply(MutableFleetStatsAPI stats, String id) { 142// stats.getDynamic().getStat(Stats.GO_DARK_DETECTED_AT_MULT).unmodify(id); 143// } 144// 145// public String getEffectDescription(float level) { 146// return "Doubles the effectiveness of the \"Go Dark\" ability"; 147// } 148// 149// public String getEffectPerLevelDescription() { 150// return null; 151// } 152// 153// public ScopeDescription getScopeDescription() { 154// return ScopeDescription.FLEET; 155// } 156// } 157// 158// 159// public static class Level3B implements FleetStatsSkillEffect { 160// public void apply(MutableFleetStatsAPI stats, String id, float level) { 161// stats.getDynamic().getStat(Stats.SENSOR_BURST_BURN_PENALTY_MULT).modifyMult(id, SENSOR_BURST_PENALTY_MULT); 162// } 163// 164// public void unapply(MutableFleetStatsAPI stats, String id) { 165// stats.getDynamic().getStat(Stats.SENSOR_BURST_BURN_PENALTY_MULT).unmodify(id); 166// } 167// 168// public String getEffectDescription(float level) { 169// return "Halves the burn level penalty of the \"Active Sensor Burst\" ability"; 170// } 171// 172// public String getEffectPerLevelDescription() { 173// return null; 174// } 175// 176// public ScopeDescription getScopeDescription() { 177// return ScopeDescription.FLEET; 178// } 179// } 180} 181 182 183