求助,测试了一个修改飞机结构装甲的船插,但是没有生效
本帖最后由 443613745 于 2020-2-22 17:52 编辑package data.hullmods;
import com.fs.starfarer.api.combat.BaseHullMod;
import com.fs.starfarer.api.combat.ShipAPI;
import com.fs.starfarer.api.combat.ShipAPI.HullSize;
import com.fs.starfarer.api.combat.MutableShipStatsAPI;
import com.fs.starfarer.api.impl.campaign.ids.Stats;
public class hardenedChassisManufactory extends BaseHullMod {
public static final float HULL_BOUNS = 1175f;
public static final float ARMOR_BOUNS = 1175f;
public static final float SPEED_BOUNS = 66f;
public static final float REFIT_TIME_PERCENT = 50f;
public static final float MANEUVER_BONUS = 1000f;
public void applyEffectsToFighterSpawnedByShip(ShipAPI fighter, ShipAPI ship, String id) {
MutableShipStatsAPI stats = fighter.getMutableStats();
stats.getHullBonus().modifyPercent(id, HULL_BOUNS);
stats.getArmorBonus().modifyFlat(id, ARMOR_BOUNS);
stats.getMaxSpeed().modifyMult(id, 1f - SPEED_BOUNS*0.01f);
stats.getAcceleration().modifyPercent(id, MANEUVER_BONUS * 2f);
stats.getDeceleration().modifyPercent(id, MANEUVER_BONUS);
stats.getTurnAcceleration().modifyPercent(id, MANEUVER_BONUS * 2f);
stats.getMaxTurnRate().modifyPercent(id, MANEUVER_BONUS);
fighter.setHeavyDHullOverlay();
}
public void applyEffectsBeforeShipCreation(HullSize hullSize, MutableShipStatsAPI stats, String id) {
stats.getFighterRefitTimeMult().modifyPercent(id, REFIT_TIME_PERCENT);
}
public String getDescriptionParam(int index, HullSize hullSize, ShipAPI ship) {
if (index == 0) return "" + (int) Math.round(HULL_BOUNS) + "%";
if (index == 1) return "" + (int) Math.round(ARMOR_BOUNS);
if (index == 2) return "" + (int) Math.round(SPEED_BOUNS) + "%";
if (index == 3) return "" + (int) Math.round(REFIT_TIME_PERCENT) + "%";
if (index == 4) return "" + (int) MANEUVER_BONUS + "%";
return null;
}
求助,测试了一个修改飞机结构装甲的船插,但是没有生效,请问是为啥,速度和机动倒是生效了{:5_124:}数字因为是测试所以设的大了点,不要在意
凑,去官网查了一下,发现战斗机不适用getArmorBonus或getHullBonus,只能改装甲所受伤害getArmorDamageTakenMult,本来想改下飞机备弹量,估计也不行了
stats.getHullBonus().modifyPercent(id, HULL_BOUNS);
stats.getArmorBonus().modifyFlat(id, ARMOR_BOUNS);
只有这两行没生效?不应该啊,你是拿什么测试的 FAX 发表于 2020-2-22 09:11
只有这两行没生效?不应该啊,你是拿什么测试的
是啊,只有这两个不行,我拿航电的船和飞机试的,可以操控飞机看具体结构值,其他飞机也试过也不行{:5_134:} 本帖最后由 awnc 于 2020-3-5 10:21 编辑
用getMaxHitpoints方法试试?
页:
[1]