WEll, I checked hte shadow order mod and I followed hte logical steps..still n oworky...
What I did:
Added this to the hullmods folder:
package data.hullmods;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import java.util.HashMap;
import java.util.Map;
public class InfusedHull extends BaseHullMod {
public static final float REPAIR_FRACTION = 1f;
public static final float REPAIR_BONUS = .99f;
private static Map mag = new HashMap();
static {
mag.put(HullSize.FIGHTER, 3f);
mag.put(HullSize.FRIGATE, 1f);
mag.put(HullSize.DESTROYER, .75f);
mag.put(HullSize.CRUISER, .5f);
mag.put(HullSize.CAPITAL_SHIP, .25f);
}
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getHullRepairRatePercentPerSecond().modifyFlat(id, (Float) mag.get(hullSize));
stats.getMaxHullRepairFraction().unmodify(id);
stats.getMaxHullRepairFraction().modifyFlat(id, REPAIR_FRACTION);
}
public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "1";// + ((Float) mag.get(HullSize.FRIGATE)).intValue();
if (index == 1) return ".75";// + ((Float) mag.get(HullSize.DESTROYER)).intValue();
if (index == 2) return ".5";// + ((Float) mag.get(HullSize.CRUISER)).intValue();
if (index == 3) return ".25";// + ((Float) mag.get(HullSize.CAPITAL_SHIP)).intValue();
return null;
}
}
Added this line to hullmods.csv
"Nano-Infused Hull","infusedhull",,0,0,0,0,"data.hullmods.InfusedHull","Repairs %s/%s/%s/%s percent of the ships hull per second."
And this is how my fighter variant looks:
{
"displayName":"Advanced Fighter",
"hullId":"PhnH",
"hullMods": [infusedhull]
"variantId":"PhnH_standard",
"fluxVents":0,
"fluxCapacitors":0,
"mods":[], # array of strings
# mode is either LINKED or ALTERNATING
# slot ids (WS ***) must match what's in the .ship file
"weaponGroups":[
{"mode":"LINKED",
"weapons":{
"WS01":"20mm_rc",
"WS02":"20mm_rc",
},
},
{"mode":"LINKED",
"weapons":{
"WS03":"stingerx2",
},
},
],
}