Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix beast-mounted infantry bonus damage. #6193

Merged
merged 2 commits into from
Nov 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*
* MegaMek - Copyright (C) 2004,2005 Ben Mazur ([email protected])
* Copyright (c) 2024 - The MegaMek Team. All Rights Reserved.
*
* This file is part of MegaMek.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
Expand Down Expand Up @@ -92,19 +95,23 @@ protected int calcHits(Vector<Report> vPhaseReport) {
}
double damage = calculateBaseDamage(ae, weapon, wtype);

if ((ae instanceof Infantry)
&& (nRange == 0)) {
if (ae.hasAbility(OptionsConstants.MD_TSM_IMPLANT)) {
damage += 0.14;
}
if ((ae instanceof Infantry) && (nRange == 0)
&& ae.hasAbility(OptionsConstants.MD_TSM_IMPLANT)) {
damage += 0.14;
}
int damageDealt = (int) Math.round(damage * troopersHit);

// beast-mounted infantry get range 0 bonus damage per platoon
if ((ae instanceof Infantry) && (nRange == 0)) {
InfantryMount mount = ((Infantry) ae).getMount();
if ((mount != null) && target.isConventionalInfantry() && (mount.getBurstDamageDice() > 0)) {
damage += Compute.d6(mount.getBurstDamageDice());
} else if ((mount != null) && !target.isConventionalInfantry()) {
damage += mount.getVehicleDamage();
if (mount != null) {
if (!target.isConventionalInfantry()) {
damageDealt += mount.getVehicleDamage();
} else if (mount.getBurstDamageDice() > 0){
damageDealt += Compute.d6(mount.getBurstDamageDice());
}
}
}
int damageDealt = (int) Math.round(damage * troopersHit);

// conventional infantry weapons with high damage get treated as if they have
// the infantry burst mod
Expand Down