From ca22a279b7fd3200c70be54d1be0f1a2267e6834 Mon Sep 17 00:00:00 2001 From: cwspain Date: Sat, 4 Nov 2023 21:49:50 -0500 Subject: [PATCH] Moved infantry heat+damage to unofficial option. --- megamek/i18n/megamek/common/options/messages.properties | 2 ++ megamek/src/megamek/common/EquipmentMode.java | 4 ++++ megamek/src/megamek/common/options/GameOptions.java | 3 ++- megamek/src/megamek/common/options/OptionsConstants.java | 1 + .../common/weapons/infantry/InfantryHeatWeaponHandler.java | 2 +- .../weapons/infantry/InfantrySupportLRMInfernoWeapon.java | 2 +- .../infantry/InfantrySupportMortarHeavyInfernoWeapon.java | 2 +- .../src/megamek/common/weapons/infantry/InfantryWeapon.java | 6 +++--- 8 files changed, 15 insertions(+), 7 deletions(-) diff --git a/megamek/i18n/megamek/common/options/messages.properties b/megamek/i18n/megamek/common/options/messages.properties index ced77889abd..03bc0c34138 100644 --- a/megamek/i18n/megamek/common/options/messages.properties +++ b/megamek/i18n/megamek/common/options/messages.properties @@ -47,6 +47,8 @@ GameOptionsInfo.option.rng_log.displayableName=RNG Log GameOptionsInfo.option.rng_log.description=Whether or not to log the Random Number Generator. GameOptionsInfo.option.flamer_heat.displayableName=Flamers per Battlemech Manual GameOptionsInfo.option.flamer_heat.description=If checked, flamers deal both heat and damage. (BMM pg. 99) Otherwise, you have the option to choose heat or damage. +GameOptionsInfo.option.infantry_damage_heat.displayableName=(Unofficial) Infantry weapons like BMM flamers +GameOptionsInfo.option.infantry_damage_heat.description=If checked, flame-based infantry weapons will deal damage and heat like flamers. GameOptionsInfo.option.indirect_fire.displayableName=Indirect fire GameOptionsInfo.option.indirect_fire.description=If checked, LRMs may be fire indirectly, and players may choose to spot for indirect fire instead of attacking.\nChecked by default. GameOptionsInfo.option.breeze.displayableName=Smoke Drift diff --git a/megamek/src/megamek/common/EquipmentMode.java b/megamek/src/megamek/common/EquipmentMode.java index 9bec2924012..94d9c1ad5be 100644 --- a/megamek/src/megamek/common/EquipmentMode.java +++ b/megamek/src/megamek/common/EquipmentMode.java @@ -118,6 +118,10 @@ public String toString() { return getName(); } + public boolean isHeat() { + return name.equals(Weapon.MODE_FLAMER_HEAT) || name.equals(Weapon.MODE_INDIRECT_HEAT); + } + public boolean isIndirect() { return name.equals(Weapon.MODE_MISSILE_INDIRECT) || name.equals(Weapon.MODE_INDIRECT_HEAT); } diff --git a/megamek/src/megamek/common/options/GameOptions.java b/megamek/src/megamek/common/options/GameOptions.java index de4a71012fb..7c9d5e9d97b 100755 --- a/megamek/src/megamek/common/options/GameOptions.java +++ b/megamek/src/megamek/common/options/GameOptions.java @@ -68,7 +68,8 @@ public synchronized void initialize() { addOption(base, OptionsConstants.BASE_SHOW_BAY_DETAIL, false); addOption(base, OptionsConstants.BASE_RNG_TYPE, 1); addOption(base, OptionsConstants.BASE_RNG_LOG, false); - addOption(base, OptionsConstants.BASE_FLAMER_HEAT, false); + addOption(base, OptionsConstants.BASE_FLAMER_HEAT, false); + addOption(base, OptionsConstants.BASE_INFANTRY_DAMAGE_HEAT, false); addOption(base, OptionsConstants.BASE_INDIRECT_FIRE, true); addOption(base, OptionsConstants.BASE_BREEZE, false); addOption(base, OptionsConstants.BASE_RANDOM_BASEMENTS, true); diff --git a/megamek/src/megamek/common/options/OptionsConstants.java b/megamek/src/megamek/common/options/OptionsConstants.java index d5dbeea8f63..02d11bd3fce 100644 --- a/megamek/src/megamek/common/options/OptionsConstants.java +++ b/megamek/src/megamek/common/options/OptionsConstants.java @@ -288,6 +288,7 @@ public class OptionsConstants { public static final String BASE_RNG_TYPE = "rng_type"; public static final String BASE_RNG_LOG = "rng_log"; public static final String BASE_FLAMER_HEAT = "flamer_heat"; + public static final String BASE_INFANTRY_DAMAGE_HEAT = "infantry_damage_heat"; public static final String BASE_INDIRECT_FIRE = "indirect_fire"; public static final String BASE_BREEZE = "breeze"; public static final String BASE_RANDOM_BASEMENTS = "random_basements"; diff --git a/megamek/src/megamek/common/weapons/infantry/InfantryHeatWeaponHandler.java b/megamek/src/megamek/common/weapons/infantry/InfantryHeatWeaponHandler.java index 1012dae5b40..fa7f5b28886 100644 --- a/megamek/src/megamek/common/weapons/infantry/InfantryHeatWeaponHandler.java +++ b/megamek/src/megamek/common/weapons/infantry/InfantryHeatWeaponHandler.java @@ -88,7 +88,7 @@ protected void handleEntityDamage(Entity entityTarget, } // If using BMM heat option, do damage as well as heat - if (game.getOptions().booleanOption(OptionsConstants.BASE_FLAMER_HEAT)) { + if (game.getOptions().booleanOption(OptionsConstants.BASE_INFANTRY_DAMAGE_HEAT)) { vPhaseReport.addAll(gameManager.damageEntity(entityTarget, hit, nDamage, false, ae.getSwarmTargetId() == entityTarget.getId() ? DamageType.IGNORE_PASSENGER : damageType, false, false, throughFront, underWater, nukeS2S)); diff --git a/megamek/src/megamek/common/weapons/infantry/InfantrySupportLRMInfernoWeapon.java b/megamek/src/megamek/common/weapons/infantry/InfantrySupportLRMInfernoWeapon.java index a6dec97b0c5..288a39c1ad5 100644 --- a/megamek/src/megamek/common/weapons/infantry/InfantrySupportLRMInfernoWeapon.java +++ b/megamek/src/megamek/common/weapons/infantry/InfantrySupportLRMInfernoWeapon.java @@ -69,7 +69,7 @@ public void adaptToGameOptions(GameOptions gOp) { // Indirect Fire if (gOp.booleanOption(OptionsConstants.BASE_INDIRECT_FIRE)) { - if (gOp.booleanOption(OptionsConstants.BASE_FLAMER_HEAT)) { + if (gOp.booleanOption(OptionsConstants.BASE_INFANTRY_DAMAGE_HEAT)) { addMode(""); addMode(MODE_MISSILE_INDIRECT); } else { diff --git a/megamek/src/megamek/common/weapons/infantry/InfantrySupportMortarHeavyInfernoWeapon.java b/megamek/src/megamek/common/weapons/infantry/InfantrySupportMortarHeavyInfernoWeapon.java index d2a5effd88b..b3c1bd72ec2 100644 --- a/megamek/src/megamek/common/weapons/infantry/InfantrySupportMortarHeavyInfernoWeapon.java +++ b/megamek/src/megamek/common/weapons/infantry/InfantrySupportMortarHeavyInfernoWeapon.java @@ -70,7 +70,7 @@ public void adaptToGameOptions(GameOptions gOp) { // Indirect Fire if (gOp.booleanOption(OptionsConstants.BASE_INDIRECT_FIRE)) { - if (gOp.booleanOption(OptionsConstants.BASE_FLAMER_HEAT)) { + if (gOp.booleanOption(OptionsConstants.BASE_INFANTRY_DAMAGE_HEAT)) { addMode(""); addMode(MODE_MISSILE_INDIRECT); } else { diff --git a/megamek/src/megamek/common/weapons/infantry/InfantryWeapon.java b/megamek/src/megamek/common/weapons/infantry/InfantryWeapon.java index 2a7cd50e067..0fa6fa76826 100644 --- a/megamek/src/megamek/common/weapons/infantry/InfantryWeapon.java +++ b/megamek/src/megamek/common/weapons/infantry/InfantryWeapon.java @@ -247,13 +247,13 @@ public int getSupportVeeSlots(Entity entity) { @Override protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction waa, Game game, GameManager manager) { Mounted m = game.getEntity(waa.getEntityId()).getEquipment(waa.getWeaponId()); - if (((null != m) && ((m.hasModes() && m.curMode().isIndirect()) + if (((null != m) && ((m.hasModes() && m.curMode().isHeat()) || (waa.getEntity(game).isSupportVehicle() && m.getLinked() != null && m.getLinked().getType() != null && (((AmmoType) m.getLinked().getType()).getMunitionType().contains(AmmoType.Munitions.M_INFERNO)))))) { return new InfantryHeatWeaponHandler(toHit, waa, game, manager); - } else if (game.getOptions().booleanOption(OptionsConstants.BASE_FLAMER_HEAT) + } else if (game.getOptions().booleanOption(OptionsConstants.BASE_INFANTRY_DAMAGE_HEAT) && (isFlameBased() || (m instanceof InfantryWeaponMounted) && ((InfantryWeaponMounted) m).getOtherWeapon().isFlameBased())) { return new InfantryHeatWeaponHandler(toHit, waa, game, manager); @@ -264,7 +264,7 @@ protected AttackHandler getCorrectHandler(ToHitData toHit, WeaponAttackAction wa @Override public void adaptToGameOptions(GameOptions gOp) { if (isFlameBased()) { - if (!gOp.booleanOption(OptionsConstants.BASE_FLAMER_HEAT)) { + if (!gOp.booleanOption(OptionsConstants.BASE_INFANTRY_DAMAGE_HEAT)) { addMode(MODE_FLAMER_DAMAGE); addMode(MODE_FLAMER_HEAT); } else {