/* iRoll.js put roll results onscreen */ function RollOnInterface(muteSound = false, animation = true, times = 1) { let roll = {}; if (animation) { if (muteSound == false) {soundEffects.hit.play();}; app_dice_appearanceToggle(false); }; function rollTheDice() { for (rolls = 0; rolls < times; rolls++) { roll = rollDiceWithResults(); } } function playSound() { if (roll.result) { soundEffects.ding.play() }; }; rollTheDice(); function replaceDice() { let diceNumber = 0; let value_dices = roll.dice; let value_dices_current = 0; for (diceNumber = 0; diceNumber < value_dices.length; diceNumber++) { value_dices_current = value_dices[diceNumber]; let dice_identifier = ('#dice-' + (diceNumber + 1)); $(dice_identifier).removeClass(); $(dice_identifier).addClass('dice scale-transition center mdi'); let dice_className = ('mdi-dice-' + value_dices_current); $(dice_identifier).addClass(dice_className); if ((value_dices_current == 4) || (value_dices_current == 1)) { $(dice_identifier).addClass('red-text text-accent-1'); } else { $(dice_identifier).addClass('white-text'); } }; }; function showReward() { let results = roll.result; switch (results) { case 1: M.toast({text: '', html: '