Skip to content

Commit

Permalink
Moved infantry heat+damage to unofficial option.
Browse files Browse the repository at this point in the history
  • Loading branch information
neoancient committed Nov 5, 2023
1 parent f261dce commit ca22a27
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 7 deletions.
2 changes: 2 additions & 0 deletions megamek/i18n/megamek/common/options/messages.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions megamek/src/megamek/common/EquipmentMode.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 2 additions & 1 deletion megamek/src/megamek/common/options/GameOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions megamek/src/megamek/common/options/OptionsConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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 {
Expand Down

0 comments on commit ca22a27

Please sign in to comment.