package data.scripts.hullmods;

//import java.util.HashMap;
//import java.util.Map;
import com.fs.starfarer.api.combat.BaseHullMod;
//import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import com.fs.starfarer.api.impl.campaign.ids.Factions;
import com.fs.starfarer.api.impl.campaign.ids.Stats;
import com.fs.starfarer.api.util.Misc;

public class CHM_persean_league extends BaseHullMod {

        public static final float RATE_INCREASE_MODIFIER = 25f;
        public static final float RATE_INCREASE_MODIFIER2 = 5f;
        
    @Override
    public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
                if (!Factions.PERSEAN.equals(Misc.getCommissionFactionId())) {
                    ship.getVariant().removeMod("CHM_persean_league");
           }
                if (ship.getVariant().hasHullMod("CHM_commission")) {
                    ship.getVariant().removeMod("CHM_commission");
                }
                if (ship.getVariant().hasHullMod("expanded_deck_crew")) {
                    ship.getMutableStats().getDynamic().getStat(Stats.REPLACEMENT_RATE_INCREASE_MULT).modifyPercent(id, RATE_INCREASE_MODIFIER2);
                } else {
                    ship.getMutableStats().getDynamic().getStat(Stats.REPLACEMENT_RATE_INCREASE_MULT).modifyPercent(id, RATE_INCREASE_MODIFIER);
            }
    }
    
	//@Override
	//public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
	//	stats.getDynamic().getStat(Stats.REPLACEMENT_RATE_INCREASE_MULT).modifyPercent(id, RATE_INCREASE_MODIFIER);
	//}
      @Override
	public String getDescriptionParam(int index, HullSize hullSize) {
		if (index == 0) return "" + (int) RATE_INCREASE_MODIFIER + "%";
                if (index == 1) return "" + (int) RATE_INCREASE_MODIFIER2 + "%";
		return null;
	}
}




