* reformatting of skill checks table

* Including own Random "generator", more refactoring
This commit is contained in:
2021-04-22 17:36:10 +02:00
committed by GitHub
parent cc8387256a
commit 126dce828d
14 changed files with 127 additions and 208 deletions

View File

@ -12,15 +12,11 @@ module.exports = {
async exec(message, args) {
let params = args.join('').split(globals.DiceRegex);
if ( params.length >= 2 ) {
let bonus = 0;
const Bonus = params[2] || 0;
const numberOfDice = parseInt( params[0] );
const diceValues = parseInt( params[1] );
if ( params.length == 3 ) {
bonus = parseInt( params[2] );
}
const result = roll( numberOfDice, diceValues, message.author.tag );
message.reply(`${findMessage('ROLL')} ${result.dice.join(', ')} (Gesamt: ${result.sum} + ${bonus} = ${result.sum + bonus})` );
message.reply(`${findMessage('ROLL')} ${result.dice.join(', ')} (Gesamt: ${result.sum} + ${Bonus} = ${result.sum + Bonus})` );
}
},
};