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 MissileSpecialization { 008 009 public static final float MISSILE_AMMO_BONUS = 100f; 010 public static final float MISSILE_SPEC_PERK_HEALTH_BONUS = 25f; 011 public static final float MISSILE_SPEC_ROF_BONUS = 25f; 012 public static final float MISSILE_SPEC_AMMO_REGEN_BONUS = 25f; 013 public static final float MISSILE_SPEC_DAMAGE_BONUS = 10f; 014 015 public static class Level1 implements ShipSkillEffect { 016 017 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 018 stats.getMissileAmmoBonus().modifyPercent(id, MISSILE_AMMO_BONUS); 019 } 020 021 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 022 stats.getMissileAmmoBonus().unmodify(id); 023 } 024 025 public String getEffectDescription(float level) { 026 return "+" + (int)(MISSILE_AMMO_BONUS) + "% missile weapon ammo capacity"; 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 040 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 041 stats.getMissileHealthBonus().modifyPercent(id, MISSILE_SPEC_PERK_HEALTH_BONUS); 042 } 043 044 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 045 stats.getMissileHealthBonus().unmodify(id); 046 } 047 048 public String getEffectDescription(float level) { 049 //return "+" + (int)(MISSILE_SPEC_PERK_HEALTH_BONUS) + "% missile, rocket, bomb, and torpedo hitpoints"; 050 return "+" + (int)(MISSILE_SPEC_PERK_HEALTH_BONUS) + "% missile hitpoints"; 051 } 052 053 public String getEffectPerLevelDescription() { 054 return null; 055 } 056 057 public ScopeDescription getScopeDescription() { 058 return ScopeDescription.PILOTED_SHIP; 059 } 060 061 } 062 063 public static class Level3 implements ShipSkillEffect { 064 065 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 066 //stats.getMissileWeaponDamageMult().modifyPercent(id, MISSILE_SPEC_PERK_DAMAGE_BONUS); 067 stats.getMissileRoFMult().modifyPercent(id, MISSILE_SPEC_ROF_BONUS); 068 } 069 070 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 071 //stats.getMissileWeaponDamageMult().unmodify(id); 072 stats.getMissileRoFMult().unmodify(id); 073 } 074 075 public String getEffectDescription(float level) { 076 return "+" + (int)(MISSILE_SPEC_ROF_BONUS) + "% rate of fire for missile weapons"; 077 } 078 079 public String getEffectPerLevelDescription() { 080 return null; 081 } 082 083 public ScopeDescription getScopeDescription() { 084 return ScopeDescription.PILOTED_SHIP; 085 } 086 } 087 088 public static class Level3A implements ShipSkillEffect { 089 090 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 091 //stats.getMissileWeaponDamageMult().modifyPercent(id, MISSILE_SPEC_PERK_DAMAGE_BONUS); 092 stats.getMissileAmmoRegenMult().modifyPercent(id, MISSILE_SPEC_AMMO_REGEN_BONUS); 093 } 094 095 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 096 //stats.getMissileWeaponDamageMult().unmodify(id); 097 stats.getMissileAmmoRegenMult().unmodify(id); 098 } 099 100 public String getEffectDescription(float level) { 101 return "+" + (int)(MISSILE_SPEC_AMMO_REGEN_BONUS) + "% missile weapon ammo regeneration rate (only for missile weapons that regenerate ammo)"; 102 } 103 104 public String getEffectPerLevelDescription() { 105 return null; 106 } 107 108 public ScopeDescription getScopeDescription() { 109 return ScopeDescription.PILOTED_SHIP; 110 } 111 } 112 113 public static class Level4 implements ShipSkillEffect { 114 115 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String id, float level) { 116 stats.getMissileWeaponDamageMult().modifyPercent(id, MISSILE_SPEC_DAMAGE_BONUS); 117 } 118 119 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String id) { 120 stats.getMissileWeaponDamageMult().unmodify(id); 121 } 122 123 public String getEffectDescription(float level) { 124 return "+" + (int)(MISSILE_SPEC_DAMAGE_BONUS) + "% damage dealt by missile weapons"; 125 } 126 127 public String getEffectPerLevelDescription() { 128 return null; 129 } 130 131 public ScopeDescription getScopeDescription() { 132 return ScopeDescription.PILOTED_SHIP; 133 } 134 } 135}