package data.scripts.hullmods;

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_luddic_church extends BaseHullMod {
        public static final float MISSILE_HEALTH_BONUS = 25f;
        public static final float MISSILE_DAMAGE_BONUS = 10f;
	@Override
	public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
            stats.getMissileHealthBonus().modifyPercent(id, MISSILE_HEALTH_BONUS);
            stats.getMissileWeaponDamageMult().modifyPercent(id, MISSILE_DAMAGE_BONUS);
	}

    @Override
    public void applyEffectsAfterShipCreation(ShipAPI ship, String id) {
                if (!Factions.LUDDIC_CHURCH.equals(Misc.getCommissionFactionId())) {
                    ship.getVariant().removeMod("CHM_luddic_church");
           }
                if (ship.getVariant().hasHullMod("CHM_commission")) {
                    ship.getVariant().removeMod("CHM_commission");
                }           
    }	
      @Override
	public String getDescriptionParam(int index, HullSize hullSize) {
		if (index == 0) return "+" + (int) MISSILE_HEALTH_BONUS  + "%";
		if (index == 1) return "+" + (int) MISSILE_DAMAGE_BONUS + "%";
		return null;
	}
}