见习Mod作者
|
本帖最后由 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;
- }
-
复制代码
求助,测试了一个修改飞机结构装甲的船插,但是没有生效,请问是为啥,速度和机动倒是生效了数字因为是测试所以设的大了点,不要在意
凑,去官网查了一下,发现战斗机不适用getArmorBonus或getHullBonus,只能改装甲所受伤害getArmorDamageTakenMult,本来想改下飞机备弹量,估计也不行了
|
|