function didEvade(modifier, defender) {
    console.log(modifier);
    var diceRoll = Math.random();
    let chanceToHit = 1 - modifier;
    console.log(`Chance to hit: ${chanceToHit}, roll: ${diceRoll}`);

    if (diceRoll > chanceToHit) {
      dispatch({
        type: CHANGE_MESSAGE,
        payload: `${defender} evaded their attack`,
      })
      return true
    }
    else {
      return false
    }
  }
/* Returns whether the defender was able to evade the attack */
Returns whether the defender was able to evade the attack
Returns whether the defender was able to evade the attack
function didEvade(modifier, defender) {
    console.log(modifier);
    var diceRoll = Math.random();
    let chanceToHit = 1 - modifier;
    console.log(`Chance to hit: ${chanceToHit}, roll: ${diceRoll}`);
    if (diceRoll > chanceToHit) {
      dispatch({
        type: CHANGE_MESSAGE,
        payload: `${defender} evaded their attack`,
      })
      return true
    }
    else {
      return false
    }
  }
function didEvade ( modifier , defender ) { console . log ( modifier ) ; var diceRoll = Math . random ( ) ; let chanceToHit = 1 - modifier ; console . log ( ` ${ chanceToHit } ${ diceRoll } ` ) ; if ( diceRoll > chanceToHit ) { dispatch ( { type : CHANGE_MESSAGE , payload : ` ${ defender } ` , } ) return true } else { return false } }
Returns whether the defender was able to evade the attack
Returns whether the defender was able to evade the attack