001package com.fs.starfarer.api.impl.campaign.skills; 002 003import com.fs.starfarer.api.characters.ShipSkillEffect; 004import com.fs.starfarer.api.combat.MutableShipStatsAPI; 005import com.fs.starfarer.api.combat.ShipAPI.HullSize; 006 007public class BallisticMastery { 008 009 public static float PROJ_SPEED_BONUS = 33; 010 011 public static float DAMAGE_BONUS = 10f; 012 public static float DAMAGE_ELITE = 5f; 013 public static float RANGE_BONUS = 10f; 014 015 016 public static class Level1 implements ShipSkillEffect { 017 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 018 stats.getBallisticWeaponDamageMult().modifyPercent(id, DAMAGE_BONUS); 019 } 020 021 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 022 stats.getBallisticWeaponDamageMult().unmodify(id); 023 } 024 025 public String getEffectDescription(float level) { 026 return "+" + (int)(DAMAGE_BONUS) + "% damage dealt by ballistic weapons"; 027 } 028 029 public String getEffectPerLevelDescription() { 030 return null; 031 } 032 033 public ScopeDescription getScopeDescription() { 034 return ScopeDescription.PILOTED_SHIP; 035 } 036 } 037 038 public static class Level2 implements ShipSkillEffect { 039 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 040 stats.getBallisticWeaponRangeBonus().modifyPercent(id, RANGE_BONUS); 041 } 042 043 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 044 stats.getBallisticWeaponRangeBonus().unmodify(id); 045 } 046 047 public String getEffectDescription(float level) { 048 return "+" + (int)(RANGE_BONUS) + "% ballistic weapon range"; 049 } 050 051 public String getEffectPerLevelDescription() { 052 return null; 053 } 054 055 public ScopeDescription getScopeDescription() { 056 return ScopeDescription.PILOTED_SHIP; 057 } 058 } 059 060 public static class Level3 implements ShipSkillEffect { 061 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 062 stats.getBallisticProjectileSpeedMult().modifyPercent(id, PROJ_SPEED_BONUS); 063 } 064 065 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 066 stats.getBallisticProjectileSpeedMult().unmodify(id); 067 } 068 069 public String getEffectDescription(float level) { 070 return "+" + (int)(PROJ_SPEED_BONUS) + "% ballistic projectile speed"; 071 } 072 073 public String getEffectPerLevelDescription() { 074 return null; 075 } 076 077 public ScopeDescription getScopeDescription() { 078 return ScopeDescription.PILOTED_SHIP; 079 } 080 } 081 082 083 public static class Level4 implements ShipSkillEffect { 084 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 085 stats.getBallisticWeaponDamageMult().modifyPercent(id, DAMAGE_ELITE); 086 } 087 088 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 089 stats.getBallisticWeaponDamageMult().unmodify(id); 090 } 091 092 public String getEffectDescription(float level) { 093 return "+" + (int)(DAMAGE_ELITE) + "% damage dealt by ballistic weapons"; 094 } 095 096 public String getEffectPerLevelDescription() { 097 return null; 098 } 099 100 public ScopeDescription getScopeDescription() { 101 return ScopeDescription.PILOTED_SHIP; 102 } 103 } 104 105 106 107 108 109 110 111 112}