001package com.fs.starfarer.api.impl.hullmods; 002 003import com.fs.starfarer.api.combat.MutableShipStatsAPI; 004import com.fs.starfarer.api.combat.ShipAPI; 005import com.fs.starfarer.api.combat.ShipAPI.HullSize; 006 007public class EfficiencyOverhaul extends BaseLogisticsHullMod { 008 public static float MAINTENANCE_MULT = 0.8f; 009 010 public static float REPAIR_RATE_BONUS = 50f; 011 public static float CR_RECOVERY_BONUS = 50f; 012 public static float REPAIR_BONUS = 50f; 013 014 public static float SMOD_MODIFIER = 0.1f; 015 016 public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) { 017 018 boolean sMod = isSMod(stats); 019 020 stats.getMinCrewMod().modifyMult(id, MAINTENANCE_MULT - (sMod ? SMOD_MODIFIER : 0)); 021 stats.getSuppliesPerMonth().modifyMult(id, MAINTENANCE_MULT - (sMod ? SMOD_MODIFIER : 0)); 022 stats.getFuelUseMod().modifyMult(id, MAINTENANCE_MULT - (sMod ? SMOD_MODIFIER : 0)); 023 024 stats.getBaseCRRecoveryRatePercentPerDay().modifyPercent(id, CR_RECOVERY_BONUS); 025 stats.getRepairRatePercentPerDay().modifyPercent(id, REPAIR_RATE_BONUS); 026 } 027 028 public String getSModDescriptionParam(int index, HullSize hullSize, ShipAPI ship) { 029 if (index == 0) return "" + (int) Math.round(SMOD_MODIFIER * 100f) + "%"; 030 return null; 031 } 032 033 public String getDescriptionParam(int index, HullSize hullSize, ShipAPI ship) { 034 if (index == 0) return "" + (int) Math.round((1f - MAINTENANCE_MULT) * 100f) + "%"; 035 if (index == 1) return "" + (int) Math.round(CR_RECOVERY_BONUS) + "%"; 036 return null; 037 } 038 039 040} 041 042 043 044 045 046 047