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 SpecialModifications { 015 016 public static int VENTS_BONUS = 10; 017 public static int CAPACITORS_BONUS = 10; 018 public static int EXTRA_MODS = 1; 019 public static float BUILD_IN_XP_BONUS = 0.20f; 020 021 022 public static class Level0 implements DescriptionSkillEffect { 023 public String getString() { 024 int max = Misc.MAX_PERMA_MODS; 025 return "*The base maximum number of permanent hullmods you're able to build into a ship is " + 026 max + "." 027 ; 028 } 029 public Color[] getHighlightColors() { 030 Color h = Misc.getHighlightColor(); 031 h = Misc.getDarkHighlightColor(); 032 return new Color[] {h, h, h}; 033 } 034 public String[] getHighlights() { 035 int max = Misc.MAX_PERMA_MODS; 036 return new String [] {"" + max}; 037 } 038 public Color getTextColor() { 039 return null; 040 } 041 } 042 043 044 public static class Level1 implements CharacterStatsSkillEffect { 045 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 046 stats.getMaxCapacitorsBonus().modifyFlat(id, CAPACITORS_BONUS); 047 } 048 049 public void unapply(MutableCharacterStatsAPI stats, String id) { 050 stats.getMaxCapacitorsBonus().unmodify(id); 051 } 052 053 public String getEffectDescription(float level) { 054 return "+" + (int) CAPACITORS_BONUS + " maximum flux capacitors"; 055 } 056 057 public String getEffectPerLevelDescription() { 058 return null; 059 } 060 061 public ScopeDescription getScopeDescription() { 062 return ScopeDescription.ALL_SHIPS; 063 } 064 } 065 066 public static class Level2 implements CharacterStatsSkillEffect { 067 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 068 //stats.getShipOrdnancePointBonus().modifyPercent(id, 50f); 069 stats.getMaxVentsBonus().modifyFlat(id, VENTS_BONUS); 070 } 071 072 public void unapply(MutableCharacterStatsAPI stats, String id) { 073 //stats.getShipOrdnancePointBonus().unmodifyPercent(id); 074 stats.getMaxVentsBonus().unmodify(id); 075 } 076 077 public String getEffectDescription(float level) { 078 return "+" + (int) VENTS_BONUS + " maximum flux vents"; 079 } 080 081 public String getEffectPerLevelDescription() { 082 return null; 083 } 084 085 public ScopeDescription getScopeDescription() { 086 return ScopeDescription.ALL_SHIPS; 087 } 088 } 089 090 public static class Level3 implements CharacterStatsSkillEffect { 091 public void apply(MutableCharacterStatsAPI stats, String id, float level) { 092 stats.getDynamic().getMod(Stats.BUILD_IN_BONUS_XP_MOD).modifyFlat(id, BUILD_IN_XP_BONUS); 093 } 094 095 public void unapply(MutableCharacterStatsAPI stats, String id) { 096 stats.getDynamic().getMod(Stats.BUILD_IN_BONUS_XP_MOD).unmodifyFlat(id); 097 } 098 099 public String getEffectDescription(float level) { 100 return "+" + (int) Math.round(BUILD_IN_XP_BONUS * 100f) + "% bonus experience from building permanent hullmods* into ships"; 101 } 102 103 public String getEffectPerLevelDescription() { 104 return null; 105 } 106 107 public ScopeDescription getScopeDescription() { 108 return ScopeDescription.ALL_SHIPS; 109 } 110 } 111 112 public static class Level4 implements ShipSkillEffect { 113 114 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 115 stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).modifyFlat(id, EXTRA_MODS); 116 } 117 118 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 119 stats.getDynamic().getMod(Stats.MAX_PERMANENT_HULLMODS_MOD).unmodifyFlat(id); 120 } 121 122 public String getEffectDescription(float level) { 123 return "Able to build " + EXTRA_MODS + " more permanent hullmod* into ships"; 124 } 125 126 public String getEffectPerLevelDescription() { 127 return null; 128 } 129 130 public ScopeDescription getScopeDescription() { 131 return ScopeDescription.FLEET; 132 } 133 } 134 135} 136 137 138 139 140