|
package data.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.HullMods;
import com.fs.starfarer.api.impl.campaign.ids.Stats;
public class ExtStoreCargo extends BaseHullMod {
public static final float StorageMulti = 2f;
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getCargoMod().modifyMult(id, StorageMulti); //货仓量
}
public boolean isApplicableToShip(ShipAPI ship) {
return ship != null && ship.getVariant().hasHullMod(HullMods.EXPANDED_CARGO_HOLDS);
}
public String getUnapplicableReason(ShipAPI ship) {
if (!ship.getVariant().hasHullMod(HullMods.EXPANDED_CARGO_HOLDS)) return "需要货仓扩容才能安装";
}
public String getDescriptionParam(int index, HullSize hullSize) {
if (index == 0) return "货舱容量增加为" + StorageMulti + "倍。";
}
}
错误日志
49069 [Thread-4] ERROR com.fs.starfarer.combat.CombatMain - java.lang.RuntimeException: Error compiling [com.fs.starfarer.api.impl.hullmods.hullmods.ExtStoreCargo]
java.lang.RuntimeException: Error compiling [com.fs.starfarer.api.impl.hullmods.hullmods.ExtStoreCargo]
at com.fs.starfarer.loading.scripts.ScriptStore$3.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
|
|