|
楼主 |
发表于 2022-11-23 12:24:33
|
显示全部楼层
星舰传奇有非常多的状态修改可以参考,真的太棒了:
if(isFighter) {
switch (trait.getTypeId()) {
case "fighter_damage":
stats.getBallisticWeaponDamageMult().modifyPercent(id, e);
stats.getEnergyWeaponDamageMult().modifyPercent(id, e);
stats.getMissileWeaponDamageMult().modifyPercent(id, e);
break;
case "fighter_speed":
stats.getAcceleration().modifyPercent(id, e);
stats.getMaxSpeed().modifyPercent(id, e);
stats.getTurnAcceleration().modifyPercent(id, e);
break;
case "fighter_durability":
stats.getHullDamageTakenMult().modifyPercent(id, -e);
stats.getShieldDamageTakenMult().modifyPercent(id, -e);
stats.getArmorDamageTakenMult().modifyPercent(id, -e);
break;
}
} else {
switch (trait.getTypeId()) {
case "ammo_regen":
stats.getBallisticAmmoRegenMult().modifyPercent(id, e);
stats.getEnergyAmmoRegenMult().modifyPercent(id, e);
stats.getMissileAmmoRegenMult().modifyPercent(id, e);
break;
case "ammo_capacity":
stats.getBallisticAmmoBonus().modifyPercent(id, e);
stats.getEnergyAmmoBonus().modifyPercent(id, e);
stats.getMissileAmmoBonus().modifyPercent(id, e);
break;
case "system_cooldown":
stats.getSystemCooldownBonus().modifyPercent(id, e);
break;
case "system_regen_rate":
stats.getSystemRegenBonus().modifyPercent(id, e);
break;
case "ballistics_rof":
stats.getBallisticRoFMult().modifyPercent(id, e);
break;
case "energy_cost":
stats.getEnergyWeaponFluxCostMod().modifyPercent(id, e);
break;
case "pd_range":
stats.getNonBeamPDWeaponRangeBonus().modifyPercent(id, e);
stats.getBeamPDWeaponRangeBonus().modifyPercent(id, e);
break;
case "pd_damage":
stats.getDamageToMissiles().modifyPercent(id, e);
stats.getDamageToFighters().modifyPercent(id, e);
break;
case "dmod_integrity":
int dmods = 0;
for(String modId : ship.getVariant().getPermaMods()) {
if(Global.getSettings().getHullModSpec(modId).hasTag("dmod")) dmods++;
}
stats.getHullBonus().modifyPercent(id, e * dmods);
break;
case "missile_guidance":
stats.getMissileGuidance().modifyPercent(id, e);
stats.getMissileAccelerationBonus().modifyPercent(id, e);
stats.getMissileMaxSpeedBonus().modifyPercent(id, e);
stats.getMissileTurnAccelerationBonus().modifyPercent(id, e);
stats.getMissileMaxTurnRateBonus().modifyPercent(id, e);
break;
case "missile_reload":
stats.getMissileRoFMult().modifyPercent(id, e);
break;
case "cursed":
CombatPlugin.CURSED.put(ship.getId(), e);
break;
case "phase_mad":
CombatPlugin.PHASEMAD.put(ship.getId(), e);
break;
case "dmod_effect":
stats.getDynamic().getStat(Stats.DMOD_EFFECT_MULT).modifyPercent(id, e);
break;
case "survey":
stats.getDynamic().getMod(Stats.getSurveyCostReductionId(Commodities.SUPPLIES)).modifyFlat(id, -e);
break;
case "blockade_runner":
stats.getZeroFluxSpeedBoost().modifyPercent(id, e);
break;
case "drive_stabilizer":
stats.getSensorProfile().modifyFlat(id, e);
break;
case "command_support":
stats.getDynamic().getMod(Stats.COMMAND_POINT_RATE_FLAT).modifyFlat(id, e * 0.01f);
break;
case "nav_support":
stats.getDynamic().getMod(Stats.COORDINATED_MANEUVERS_FLAT).modifyFlat(id, e);
break;
case "ecm_support":
stats.getDynamic().getMod(Stats.ELECTRONIC_WARFARE_FLAT).modifyFlat(id, e);
break;
case "cr_cap":
stats.getMaxCombatReadiness().modifyFlat(id, e * 0.01f, trait.getName(true));
break;
case "cr_recovery":
stats.getBaseCRRecoveryRatePercentPerDay().modifyPercent(id, e);
break;
case "damage":
stats.getBallisticWeaponDamageMult().modifyPercent(id, e);
stats.getEnergyWeaponDamageMult().modifyPercent(id, e);
stats.getMissileWeaponDamageMult().modifyPercent(id, e);
break;
case "malfunction":
stats.getCriticalMalfunctionChance().modifyPercent(id, e);
stats.getEngineMalfunctionChance().modifyPercent(id, e);
stats.getShieldMalfunctionChance().modifyPercent(id, e);
stats.getWeaponMalfunctionChance().modifyPercent(id, e);
break;
case "mount_durability":
stats.getWeaponHealthBonus().modifyPercent(id, e);
break;
case "engine_durability":
stats.getEngineHealthBonus().modifyPercent(id, e);
break;
case "crew_casualties":
stats.getCrewLossMult().modifyPercent(id, e);
stats.getDynamic().getStat(Stats.FIGHTER_CREW_LOSS_MULT).modifyPercent(id, e);
break;
case "recovery_chance":
stats.getDynamic().getMod(Stats.INDIVIDUAL_SHIP_RECOVERY_MOD).modifyPercent(id, e);
stats.getBreakProb().modifyPercent(id, -e);
break;
case "maneuverability":
stats.getAcceleration().modifyPercent(id, e);
stats.getDeceleration().modifyPercent(id, e);
stats.getTurnAcceleration().modifyPercent(id, e);
stats.getMaxTurnRate().modifyPercent(id, e);
break;
case "hull_integrity":
stats.getHullBonus().modifyPercent(id, e);
break;
case "shield_strength":
stats.getShieldDamageTakenMult().modifyPercent(id, e);
break;
case "armor_strength":
stats.getArmorBonus().modifyPercent(id, e);
break;
case "engine_power":
stats.getMaxSpeed().modifyPercent(id, e);
break;
case "emp_resistance":
stats.getEmpDamageTakenMult().modifyPercent(id, -e);
break;
case "shield_stability":
stats.getShieldUpkeepMult().modifyPercent(id, e);
break;
case "peak_cr_time":
stats.getPeakCRDuration().modifyPercent(id, e);
break;
case "overload_time":
stats.getOverloadTimeMod().modifyPercent(id, e);
break;
case "flux_capacity":
stats.getFluxCapacity().modifyPercent(id, e);
break;
case "flux_dissipation":
stats.getFluxDissipation().modifyPercent(id, e);
break;
case "sensor_strength":
stats.getSensorStrength().modifyPercent(id, e);
break;
case "sensor_profile":
stats.getSensorProfile().modifyPercent(id, e);
break;
case "refit_time":
stats.getFighterRefitTimeMult().modifyPercent(id, e);
break;
case "salvage":
stats.getDynamic().getMod(Stats.SALVAGE_VALUE_MULT_MOD).modifyPercent(id, e);
break;
case "cargo_capacity":
stats.getCargoMod().modifyFlat(id, e);
break;
case "fuel_efficiency":
stats.getFuelUseMod().modifyPercent(id, e);
break;
case "fuel_capacity":
stats.getFuelMod().modifyFlat(id, e);
break;
case "supply_upkeep":
stats.getSuppliesPerMonth().modifyPercent(id, e);
break;
case "phase_cost":
stats.getPhaseCloakActivationCostBonus().modifyPercent(id, e);
stats.getPhaseCloakUpkeepCostBonus().modifyPercent(id, e);
break;
case "phase_cooldown":
stats.getPhaseCloakCooldownBonus().modifyPercent(id, e);
break;
case "range":
stats.getBallisticWeaponRangeBonus().modifyPercent(id, e);
stats.getEnergyWeaponRangeBonus().modifyPercent(id, e);
stats.getMissileWeaponRangeBonus().modifyPercent(id, e);
break;
case "repair":
stats.getCombatEngineRepairTimeMult().modifyPercent(id, -e);
stats.getCombatWeaponRepairTimeMult().modifyPercent(id, -e);
stats.getRepairRatePercentPerDay().modifyPercent(id, e);
break;
case "weapon_stability":
stats.getRecoilPerShotMult().modifyPercent(id, e);
break;
case "turret_rotation":
stats.getWeaponTurnRateBonus().modifyPercent(id, e);
break;
case "vent_rate":
stats.getVentRateMult().modifyPercent(id, e);
break;
case "shield_raise_rate":
stats.getShieldUnfoldRateMult().modifyPercent(id, e);
break;
}
}
|
|