/**
* Damage that the specified mech does with a club attack
*/
public static int getDamageFor(Entity entity, Mounted club,
boolean targetInfantry) {
MiscType mType = (MiscType) (club.getType());
int nDamage = (int) Math.floor(entity.getWeight() / 5.0);
if (mType.hasSubType(MiscType.S_SWORD)) {
nDamage = (int) (Math.ceil(entity.getWeight() / 10.0) + 1.0);
} else if (mType.hasSubType(MiscType.S_MACE_THB)) {
nDamage *= 2;
} else if (mType.hasSubType(MiscType.S_RETRACTABLE_BLADE)) {
nDamage = (int) Math.ceil(entity.getWeight() / 10.0);
} else if (mType.hasSubType(MiscType.S_MACE)) {
nDamage = (int) Math.floor(entity.getWeight() / 4.0);
} else if (mType.hasSubType(MiscType.S_PILE_DRIVER)) {
// Pile Drivers have constant damage, not variable like most.
nDamage = 10;
} else if (mType.hasSubType(MiscType.S_FLAIL)) {
// Flails have constant damage, not variable like most.
nDamage = 9;
} else if (mType.hasSubType(MiscType.S_DUAL_SAW)) {
// Saws have constant damage, not variable like most.
nDamage = 7;
} else if (mType.hasSubType(MiscType.S_CHAINSAW)) {
// Saws have constant damage, not variable like most.
nDamage = 5;
} else if (mType.hasSubType(MiscType.S_BACKHOE)) {
// Backhoes have constant damage, not variable like most.
nDamage = 6;
} else if (mType.isShield()) {
nDamage = club.getDamageAbsorption(entity, club.getLocation());
} else if (mType.hasSubType(MiscType.S_WRECKING_BALL)) {
// Wrecking Balls have constant damage, not variable like most.
nDamage = 8;
} else if (mType.hasSubType(MiscType.S_BUZZSAW)) {
// buzzsaw does 2d6 damage, not weight dependant
nDamage = Compute.d6(2);
} else if (mType.isVibroblade()) {
if (club.curMode().equals("Active")) {
if (mType.hasSubType(MiscType.S_VIBRO_LARGE)) {
nDamage = 14;
} else if (mType.hasSubType(MiscType.S_VIBRO_MEDIUM)) {
nDamage = 10;
} else {
nDamage = 7;
}
} else {
// when not active a vibro blade does normal sword damage
nDamage = (int) (Math.ceil(entity.getWeight() / 10.0) + 1.0);
}
}else if (mType.hasSubType(MiscType.S_CHAIN_WHIP)){
nDamage = 3;
} else if (mType.hasSubType(MiscType.S_ROCK_CUTTER)) {
nDamage = 5;
}
// TSM doesn't apply to some weapons, including Saws.
if (entity.heat >= 9
&& !(mType.hasSubType(MiscType.S_DUAL_SAW)
|| mType.hasSubType(MiscType.S_CHAINSAW)
|| mType.hasSubType(MiscType.S_PILE_DRIVER)
|| mType.isShield()
|| mType.hasSubType(MiscType.S_WRECKING_BALL)
|| mType.hasSubType(MiscType.S_FLAIL)
|| (mType.isVibroblade() && club.curMode().equals("Active"))
|| mType.hasSubType(MiscType.S_BUZZSAW)
|| mType.hasSubType(MiscType.S_CHAIN_WHIP))
&& ((Mech) entity).hasTSM()) {
nDamage *= 2;
}
int clubLocation = club.getLocation();
// tree clubs don't have a location--use right arm (is this okay?)