function increaseStats(character, numOfRolls) {
    let charClass = findClassStats(character);
    for (let i = 0; i < numOfRolls; i++) {
        let roll = Math.floor(Math.random() * 100) + 1;
        if (roll <= charClass[0]) {
            character.vit++;
        }
        else if (roll <= charClass[0] + charClass[1]) {
            character.str++;
        }
        else if (roll <= charClass[0] + charClass[1] + charClass[2]) {
            character.wis++;
        }
        else if (roll <= charClass[0] + charClass[1] + charClass[2] + charClass[3]) {
            character.dex++;
        }
        else if (roll <= charClass[0] + charClass[1] + charClass[2] + charClass[3] + charClass[4]) {
            character.spe++;
        }
    }
}
/**
 * Increase the stats of the chosen character.
 * @param {*} character the chosen character.
 * @param {*} numOfRolls number of random rolls to decide what stat gets increased.
 */
Increase the stats of the chosen character.
@param {*} character the chosen character.
@param {*} numOfRolls number of random rolls to decide what stat gets increased.
Increase the stats of the chosen character . @param { * } character the chosen character . @param { * } numOfRolls number of random rolls to decide what stat gets increased .
function increaseStats(character, numOfRolls) {
    let charClass = findClassStats(character);
    for (let i = 0; i < numOfRolls; i++) {
        let roll = Math.floor(Math.random() * 100) + 1;
        if (roll <= charClass[0]) {
            character.vit++;
        }
        else if (roll <= charClass[0] + charClass[1]) {
            character.str++;
        }
        else if (roll <= charClass[0] + charClass[1] + charClass[2]) {
            character.wis++;
        }
        else if (roll <= charClass[0] + charClass[1] + charClass[2] + charClass[3]) {
            character.dex++;
        }
        else if (roll <= charClass[0] + charClass[1] + charClass[2] + charClass[3] + charClass[4]) {
            character.spe++;
        }
    }
}
function increaseStats ( character , numOfRolls ) { let charClass = findClassStats ( character ) ; for ( let i = 0 ; i < numOfRolls ; i ++ ) { let roll = Math . floor ( Math . random ( ) * 100 ) + 1 ; if ( roll <= charClass [ 0 ] ) { character . vit ++ ; } else if ( roll <= charClass [ 0 ] + charClass [ 1 ] ) { character . str ++ ; } else if ( roll <= charClass [ 0 ] + charClass [ 1 ] + charClass [ 2 ] ) { character . wis ++ ; } else if ( roll <= charClass [ 0 ] + charClass [ 1 ] + charClass [ 2 ] + charClass [ 3 ] ) { character . dex ++ ; } else if ( roll <= charClass [ 0 ] + charClass [ 1 ] + charClass [ 2 ] + charClass [ 3 ] + charClass [ 4 ] ) { character . spe ++ ; } } }
Increase the stats of the chosen character.
Increase the stats of the chosen character .