function changeClass() {
    let chosenClass = document.getElementById("characterClass").value;
    switch (chosenClass) {
        case "Cleric":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT + 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR - 3);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS + 3);
            document.getElementById("characterDEX").innerHTML = "DEX: " + DEX;
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE - 2);
            //player1.vit = VIT + 2, player1.str = STR - 3, player1.wis = WIS + 3, player1.dex = DEX, player1.spe = SPE - 2;
            currentVIT = VIT + 2, currentSTR = STR - 3, currentWIS = WIS + 3, currentDEX = DEX, currentSPE = SPE - 2;
            break;
        case "Paladin":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT + 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR + 3);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS - 1);
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX - 3);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE - 1);
            currentVIT = VIT + 2, currentSTR = STR + 3, currentWIS = WIS - 1, currentDEX = DEX - 3, currentSPE = SPE - 1;
            break;
        case "Wizard":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT - 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR - 3);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS + 3);
            document.getElementById("characterDEX").innerHTML = "DEX: " + DEX;
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE + 2);
            currentVIT = VIT - 2, currentSTR = STR - 3, currentWIS = WIS + 3, currentDEX = DEX, currentSPE = SPE + 2;
            break;
        case "Rogue":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT - 3);
            document.getElementById("characterSTR").innerHTML = "STR: " + STR;
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS - 2);
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX + 2);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE + 3);
            currentVIT = VIT - 3, currentSTR = STR, currentWIS = WIS - 2, currentDEX = DEX + 2, currentSPE = SPE + 3;
            break;
        case "Ranger":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT - 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR - 2);
            document.getElementById("characterWIS").innerHTML = "WIS: " + WIS;
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX + 3);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE + 1);
            currentVIT = VIT - 2, currentSTR = STR - 2, currentWIS = WIS, currentDEX = DEX + 3, currentSPE = SPE + 1;
            break;
        /*else if (chosenClass == "Druid") {
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT-3);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR-2);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS+2);
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX+2);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE+1);
        } */
        default:
            document.getElementById("characterVIT").innerHTML = "VIT: " + VIT;
            document.getElementById("characterSTR").innerHTML = "STR: " + STR;
            document.getElementById("characterWIS").innerHTML = "WIS: " + WIS;
            document.getElementById("characterDEX").innerHTML = "DEX: " + DEX;
            document.getElementById("characterSPE").innerHTML = "SPE: " + SPE;
            currentVIT = VIT, currentSTR = STR, currentWIS = WIS, currentDEX = DEX, currentSPE = SPE;
            break;
    }
    correctStats();
}
/**
 * Changes the stat values shown on screen every time user changes class in pop-up window.
 */
Changes the stat values shown on screen every time user changes class in pop-up window.
Changes the stat values shown on screen every time user changes class in pop - up window .
function changeClass() {
    let chosenClass = document.getElementById("characterClass").value;
    switch (chosenClass) {
        case "Cleric":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT + 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR - 3);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS + 3);
            document.getElementById("characterDEX").innerHTML = "DEX: " + DEX;
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE - 2);
            currentVIT = VIT + 2, currentSTR = STR - 3, currentWIS = WIS + 3, currentDEX = DEX, currentSPE = SPE - 2;
            break;
        case "Paladin":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT + 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR + 3);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS - 1);
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX - 3);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE - 1);
            currentVIT = VIT + 2, currentSTR = STR + 3, currentWIS = WIS - 1, currentDEX = DEX - 3, currentSPE = SPE - 1;
            break;
        case "Wizard":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT - 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR - 3);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS + 3);
            document.getElementById("characterDEX").innerHTML = "DEX: " + DEX;
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE + 2);
            currentVIT = VIT - 2, currentSTR = STR - 3, currentWIS = WIS + 3, currentDEX = DEX, currentSPE = SPE + 2;
            break;
        case "Rogue":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT - 3);
            document.getElementById("characterSTR").innerHTML = "STR: " + STR;
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS - 2);
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX + 2);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE + 3);
            currentVIT = VIT - 3, currentSTR = STR, currentWIS = WIS - 2, currentDEX = DEX + 2, currentSPE = SPE + 3;
            break;
        case "Ranger":
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT - 2);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR - 2);
            document.getElementById("characterWIS").innerHTML = "WIS: " + WIS;
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX + 3);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE + 1);
            currentVIT = VIT - 2, currentSTR = STR - 2, currentWIS = WIS, currentDEX = DEX + 3, currentSPE = SPE + 1;
            break;
        default:
            document.getElementById("characterVIT").innerHTML = "VIT: " + VIT;
            document.getElementById("characterSTR").innerHTML = "STR: " + STR;
            document.getElementById("characterWIS").innerHTML = "WIS: " + WIS;
            document.getElementById("characterDEX").innerHTML = "DEX: " + DEX;
            document.getElementById("characterSPE").innerHTML = "SPE: " + SPE;
            currentVIT = VIT, currentSTR = STR, currentWIS = WIS, currentDEX = DEX, currentSPE = SPE;
            break;
    }
    correctStats();
}
function changeClass ( ) { let chosenClass = document . getElementById ( "characterClass" ) . value ; switch ( chosenClass ) { case "Cleric" : document . getElementById ( "characterVIT" ) . innerHTML = "VIT: " + ( VIT + 2 ) ; document . getElementById ( "characterSTR" ) . innerHTML = "STR: " + ( STR - 3 ) ; document . getElementById ( "characterWIS" ) . innerHTML = "WIS: " + ( WIS + 3 ) ; document . getElementById ( "characterDEX" ) . innerHTML = "DEX: " + DEX ; document . getElementById ( "characterSPE" ) . innerHTML = "SPE: " + ( SPE - 2 ) ; currentVIT = VIT + 2 , currentSTR = STR - 3 , currentWIS = WIS + 3 , currentDEX = DEX , currentSPE = SPE - 2 ; break ; case "Paladin" : document . getElementById ( "characterVIT" ) . innerHTML = "VIT: " + ( VIT + 2 ) ; document . getElementById ( "characterSTR" ) . innerHTML = "STR: " + ( STR + 3 ) ; document . getElementById ( "characterWIS" ) . innerHTML = "WIS: " + ( WIS - 1 ) ; document . getElementById ( "characterDEX" ) . innerHTML = "DEX: " + ( DEX - 3 ) ; document . getElementById ( "characterSPE" ) . innerHTML = "SPE: " + ( SPE - 1 ) ; currentVIT = VIT + 2 , currentSTR = STR + 3 , currentWIS = WIS - 1 , currentDEX = DEX - 3 , currentSPE = SPE - 1 ; break ; case "Wizard" : document . getElementById ( "characterVIT" ) . innerHTML = "VIT: " + ( VIT - 2 ) ; document . getElementById ( "characterSTR" ) . innerHTML = "STR: " + ( STR - 3 ) ; document . getElementById ( "characterWIS" ) . innerHTML = "WIS: " + ( WIS + 3 ) ; document . getElementById ( "characterDEX" ) . innerHTML = "DEX: " + DEX ; document . getElementById ( "characterSPE" ) . innerHTML = "SPE: " + ( SPE + 2 ) ; currentVIT = VIT - 2 , currentSTR = STR - 3 , currentWIS = WIS + 3 , currentDEX = DEX , currentSPE = SPE + 2 ; break ; case "Rogue" : document . getElementById ( "characterVIT" ) . innerHTML = "VIT: " + ( VIT - 3 ) ; document . getElementById ( "characterSTR" ) . innerHTML = "STR: " + STR ; document . getElementById ( "characterWIS" ) . innerHTML = "WIS: " + ( WIS - 2 ) ; document . getElementById ( "characterDEX" ) . innerHTML = "DEX: " + ( DEX + 2 ) ; document . getElementById ( "characterSPE" ) . innerHTML = "SPE: " + ( SPE + 3 ) ; currentVIT = VIT - 3 , currentSTR = STR , currentWIS = WIS - 2 , currentDEX = DEX + 2 , currentSPE = SPE + 3 ; break ; case "Ranger" : document . getElementById ( "characterVIT" ) . innerHTML = "VIT: " + ( VIT - 2 ) ; document . getElementById ( "characterSTR" ) . innerHTML = "STR: " + ( STR - 2 ) ; document . getElementById ( "characterWIS" ) . innerHTML = "WIS: " + WIS ; document . getElementById ( "characterDEX" ) . innerHTML = "DEX: " + ( DEX + 3 ) ; document . getElementById ( "characterSPE" ) . innerHTML = "SPE: " + ( SPE + 1 ) ; currentVIT = VIT - 2 , currentSTR = STR - 2 , currentWIS = WIS , currentDEX = DEX + 3 , currentSPE = SPE + 1 ; break ; default : document . getElementById ( "characterVIT" ) . innerHTML = "VIT: " + VIT ; document . getElementById ( "characterSTR" ) . innerHTML = "STR: " + STR ; document . getElementById ( "characterWIS" ) . innerHTML = "WIS: " + WIS ; document . getElementById ( "characterDEX" ) . innerHTML = "DEX: " + DEX ; document . getElementById ( "characterSPE" ) . innerHTML = "SPE: " + SPE ; currentVIT = VIT , currentSTR = STR , currentWIS = WIS , currentDEX = DEX , currentSPE = SPE ; break ; } correctStats ( ) ; }
Changes the stat values shown on screen every time user changes class in pop-up window.
Changes the stat values shown on screen every time user changes class in pop - up window .
//player1.vit = VIT + 2, player1.str = STR - 3, player1.wis = WIS + 3, player1.dex = DEX, player1.spe = SPE - 2; /*else if (chosenClass == "Druid") {
            document.getElementById("characterVIT").innerHTML = "VIT: " + (VIT-3);
            document.getElementById("characterSTR").innerHTML = "STR: " + (STR-2);
            document.getElementById("characterWIS").innerHTML = "WIS: " + (WIS+2);
            document.getElementById("characterDEX").innerHTML = "DEX: " + (DEX+2);
            document.getElementById("characterSPE").innerHTML = "SPE: " + (SPE+1);
        } */