@Override protected int calcHits(Vector<Report> vPhaseReport) { // conventional infantry gets hit in one lump // BAs can't mount Plasma Cannons if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { return 1; } if ((target instanceof Mech) || (target instanceof Aero)) { return 1; } if ((target instanceof BattleArmor) && ((BattleArmor) target).isFireResistant()) { return 0; } return Compute.d6(3); }
@Override protected int calcHits(Vector<Report> vPhaseReport) { int toReturn; // against mechs, 1 hit with 10 damage, plus heat if ((target instanceof Mech) || (target instanceof Aero)) { toReturn = 1; // otherwise, 10+2d6 damage // but fireresistant BA armor gets no damage from heat, and half the // normal one, so only 5 damage } else { if ((target instanceof BattleArmor) && ((BattleArmor) target).isFireResistant()) { toReturn = 5; } else { toReturn = 10 + Compute.d6(2); } if (bGlancing) { toReturn = (int) Math.floor(toReturn / 2.0); } } return toReturn; }
@Override protected int calcDamagePerHit() { int toReturn = super.calcDamagePerHit(); if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { // pain shunted infantry get half damage if (((Entity) target).hasAbility(OptionsConstants.MD_PAIN_SHUNT)) { toReturn = (int) Math.floor(toReturn / 2.0); } } else if ((target instanceof BattleArmor) && ((BattleArmor) target).isFireResistant()) { toReturn = 0; } return toReturn; }
@Override protected int calcDamagePerHit() { int toReturn = super.calcDamagePerHit(); if ((target instanceof Infantry) && !(target instanceof BattleArmor)) { // pain shunted infantry get half damage if (((Entity) target).hasAbility(OptionsConstants.MD_PAIN_SHUNT)) { toReturn = (int) Math.floor(toReturn / 2.0); } } else if ((target instanceof BattleArmor) && ((BattleArmor) target).isFireResistant()) { toReturn = 0; } return toReturn; }
((BattleArmor) movingUnit).isFireResistant()) { logMsg.append("Ignored by fire resistant armor (0)."); return 0;
/** * Returns how much damage a weapon will do against against a BattleArmor * target if the BattleArmor vs BattleArmor rules on TO pg 109 are in * effect. * * @param damage Original weapon damage * @param damageType The damage type for BA vs BA damage * @param target The target, used for ensuring the target BA isn't * fire resistant * @return */ public static int directBlowBADamage(double damage, int damageType, BattleArmor target) { switch (damageType) { case WeaponType.WEAPON_BURST_1D6: damage = Compute.d6(); break; case WeaponType.WEAPON_BURST_3D6: damage = Compute.d6(3); break; case WeaponType.WEAPON_PLASMA: // If the target is fire-resistant BA, damage is normal if (!target.isFireResistant()) { damage = 1 + Compute.d6(1); } break; } damage = Math.ceil(damage); return (int) damage; }
Mockito.when(mockBA.getCrew()).thenReturn(mockCrew); Mockito.when(mockBA.getHeatCapacity()).thenReturn(999); Mockito.when(mockBA.isFireResistant()).thenReturn(true); Mockito.when(mockHexThree.getTerrainTypes()).thenReturn(new int[]{Terrains.BUILDING, Terrains.FIRE}); Assert.assertEquals(0, testRanker.checkPathForHazards(mockPath, mockBA, mockGame), TOLERANCE);
if (isFireResistant() || isReflective() || isReactive()) { armorBV = 3.5;