jsObjectsPractice.js
// Determine if an attack hits and calculate raw damage

Determine if an attack hits and calculate raw damage
Determine if an attack hits and calculate raw damage
function mechHitModel (battleMech, attackRoll, damageRoll){
    if (attackRoll >= battleMech.armorClass){
        document.write("An attack was made on the " + battleMech.mechName + " with a roll of " + attackRoll+
        " which beats an armor class of " +battleMech.armorClass + "<br> " +damageRoll + " damage has occured!" + "<br>" );
        return damageRoll; 
    } else {
        document.write("The attack missed." + "<br>");
        return attackRoll;
    }
}
function mechHitModel ( battleMech , attackRoll , damageRoll ) { if ( attackRoll >= battleMech . armorClass ) { document . write ( "An attack was made on the " + battleMech . mechName + " with a roll of " + attackRoll + " which beats an armor class of " + battleMech . armorClass + "<br> " + damageRoll + " damage has occured!" + "<br>" ) ; return damageRoll ; } else { document . write ( "The attack missed." + "<br>" ) ; return attackRoll ; } }
Determine if an attack hits and calculate raw damage
Determine if an attack hits and calculate raw damage
// TODO add damage location
 // Update armor values
