25 public static boolean isNoOfficer(MutableShipStatsAPI stats) {
26 if (stats.getEntity() instanceof ShipAPI) {
27 ShipAPI ship = (ShipAPI) stats.getEntity();
32 return ship.getCaptain().isDefault();
34 FleetMemberAPI member = stats.getFleetMember();
35 if (member ==
null)
return true;
36 return member.getCaptain().isDefault();
41 if (stats.getEntity() instanceof ShipAPI) {
42 ShipAPI ship = (ShipAPI) stats.getEntity();
46 return ship.getOriginalCaptain() !=
null && ship.getOriginalCaptain().isDefault();
48 FleetMemberAPI member = stats.getFleetMember();
49 if (member ==
null)
return true;
50 return member.getCaptain().isDefault();
55 public static class Level1
implements ShipSkillEffect {
56 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
73 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
74 new Helmsmanship.Level1().unapply(stats, hullSize,
id);
75 new Helmsmanship.Level2().unapply(stats, hullSize,
id);
77 new DamageControl.Level2().unapply(stats, hullSize,
id);
78 new DamageControl.Level3().unapply(stats, hullSize,
id);
79 new DamageControl.Level4().unapply(stats, hullSize,
id);
81 new CombatEndurance.Level1().unapply(stats, hullSize,
id);
82 new CombatEndurance.Level2().unapply(stats, hullSize,
id);
83 new CombatEndurance.Level3().unapply(stats, hullSize,
id);
85 new OrdnanceExpertise.Level1().unapply(stats, hullSize,
id);
88 public String getEffectDescription(
float level) {
89 return "Gain non-elite Helmsmanship, Damage Control, Combat Endurance, and Ordnance Expertise";
92 public String getEffectPerLevelDescription() {
96 public ScopeDescription getScopeDescription() {
97 return ScopeDescription.PILOTED_SHIP;
101 public static class Level2
implements ShipSkillEffect {
102 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
104 float baseCost = stats.getSuppliesToRecover().getBaseValue();
107 if (stats.getFleetMember() ==
null || stats.getFleetMember().getVariant() ==
null ||
108 (!stats.getFleetMember().getVariant().hasHullMod(HullMods.NEURAL_INTERFACE) &&
109 !stats.getFleetMember().getVariant().hasHullMod(HullMods.NEURAL_INTEGRATOR))
116 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
120 public String getEffectDescription(
float level) {
122 String percent =
"" + (int)Math.round(
DP_REDUCTION * 100f) +
"%";
123 return "Deployment point cost reduced by " + percent +
" or " + max +
" points, whichever is less";
126 public String getEffectPerLevelDescription() {
130 public ScopeDescription getScopeDescription() {
131 return ScopeDescription.PILOTED_SHIP;
136 public static class Level3
extends BaseSkillEffectDescription implements ShipSkillEffect {
137 public void createCustomDescription(MutableCharacterStatsAPI stats, SkillSpecAPI skill,
138 TooltipMakerAPI info,
float width) {
141 Color c = Misc.getBasePlayerColor();
143 info.addPara(
"Affects: %s", opad + 5f, Misc.getGrayColor(), c,
"fleet");
144 info.addSpacer(opad);
145 info.addPara(
"%s faster command point recovery unless command was transferred to a ship originally without an officer", 0f,
hc,
hc,
149 public void apply(MutableShipStatsAPI stats, HullSize hullSize, String
id,
float level) {
155 public void unapply(MutableShipStatsAPI stats, HullSize hullSize, String
id) {
156 stats.getDynamic().getMod(Stats.COMMAND_POINT_RATE_FLAT).unmodify(
id);