76
Modding / Re: Misc modding questions that are too minor to warrant their own thread
« on: February 02, 2023, 04:52:20 PM »
Can a projectile have more than one onHitEffect?
Starsector 0.97a is out! (02/02/24); New blog post: Save/Load UI, Autosave, Intel Map Markers, and More (04/10/24)
The character skill "Hull restoration" gives +5 CR for each S-mod a ship has. Is there any way to make these S-mods count? Currently they don't because the skill looks at the variant, not the specific ship.Really? I haven't had an issue with that with my install and I'm running several other "ship upgrade" mods alongside this. This functionality is, in fact offsetting, some CR loss I should have from some hullmods I use from the More Hullmods mod.
private static Map mag = new HashMap();
static {
mag.put(HullSize.FRIGATE, 1);
mag.put(HullSize.DESTROYER, 2);
mag.put(HullSize.CRUISER, 3);
mag.put(HullSize.CAPITAL_SHIP, 4);
}
public int hs = 1;
@Override
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
this.hs = (int) mag.get(hullSize); // It doesn't like this line for some reason
}
private static Map mag = new HashMap();
static {
mag.put(HullSize.FRIGATE, 80f);
mag.put(HullSize.DESTROYER, 160f);
mag.put(HullSize.CRUISER, 160f);
mag.put(HullSize.CAPITAL_SHIP, 160f);
}
@Override
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getCargoMod().modifyFlat(id, (Float) mag.get(hullSize)); // No problem here
stats.getFluxCapacity().modifyFlat(id, (Float) mag.get(hullSize) * -0.5f);
stats.getFluxDissipation().modifyFlat(id, -60f);
}