function changeCurrentMP(character, mp) {
    drainMP(character, mp);
    let mpBarWidth = 200 * character.mpLeft / character.mp;
    if (character instanceof Character) {
        document.getElementById("player" + (currentPlayerIndex + 1) + "MPNumber").innerHTML = character.mpLeft + "/" + character.mp;
        document.getElementById("player" + (currentPlayerIndex + 1) + "curMP").style.width = mpBarWidth + "px";
    }
    else if (character instanceof Monster) {
        document.getElementById("enemy" + (currentMonsterIndex + 1) + "MPNumber").innerHTML = character.mpLeft + "/" + character.mp;
        document.getElementById("enemy" + (currentMonsterIndex + 1) + "curMP").style.width = mpBarWidth + "px";
    }
}
/**
 * Changes current MP of the chosen character
 * @param {Character} character the chosen character
 * @param {Number} mp number to be subtracted from previous remaining MP.
 */
Changes current MP of the chosen character
@param {Character} character the chosen character
@param {Number} mp number to be subtracted from previous remaining MP.
Changes current MP of the chosen character @param { Character } character the chosen character @param { Number } mp number to be subtracted from previous remaining MP .
function changeCurrentMP(character, mp) {
    drainMP(character, mp);
    let mpBarWidth = 200 * character.mpLeft / character.mp;
    if (character instanceof Character) {
        document.getElementById("player" + (currentPlayerIndex + 1) + "MPNumber").innerHTML = character.mpLeft + "/" + character.mp;
        document.getElementById("player" + (currentPlayerIndex + 1) + "curMP").style.width = mpBarWidth + "px";
    }
    else if (character instanceof Monster) {
        document.getElementById("enemy" + (currentMonsterIndex + 1) + "MPNumber").innerHTML = character.mpLeft + "/" + character.mp;
        document.getElementById("enemy" + (currentMonsterIndex + 1) + "curMP").style.width = mpBarWidth + "px";
    }
}
function changeCurrentMP ( character , mp ) { drainMP ( character , mp ) ; let mpBarWidth = 200 * character . mpLeft / character . mp ; if ( character instanceof Character ) { document . getElementById ( "player" + ( currentPlayerIndex + 1 ) + "MPNumber" ) . innerHTML = character . mpLeft + "/" + character . mp ; document . getElementById ( "player" + ( currentPlayerIndex + 1 ) + "curMP" ) . style . width = mpBarWidth + "px" ; } else if ( character instanceof Monster ) { document . getElementById ( "enemy" + ( currentMonsterIndex + 1 ) + "MPNumber" ) . innerHTML = character . mpLeft + "/" + character . mp ; document . getElementById ( "enemy" + ( currentMonsterIndex + 1 ) + "curMP" ) . style . width = mpBarWidth + "px" ; } }
Changes current MP of the chosen character
 @param {Character} character the chosen character
 @param {Number} mp number to be subtracted from previous remaining MP.
Changes current MP of the chosen character @param { Character } character the chosen character @param { Number } mp number to be subtracted from previous remaining MP .