roll dice

This commit is contained in:
François-Xavier Guillois
2023-05-18 23:19:05 +02:00
parent 03d71ecd3c
commit 2dacf17369
21 changed files with 544 additions and 864 deletions
+7 -3
View File
@@ -1,9 +1,13 @@
export class TotemRoll {
static roll(actorId, label, NoD, Mod, params = {}){
static roll(actorId, label, NoD, Reroll = 0, params = {}){
const actor = game.actors.get(actorId);
let roll = new Roll(NoD + "d10+"+ Mod, actor.getRollData());
let formula = '{' + NoD + "d10";
if (Reroll > 0){
formula += 'r' + Reroll;
}
formula += (params.difficulty != undefined) ? "}cs>" + params.difficulty : "}cs>7";
let roll = new Roll(formula, actor.getRollData());
roll.toMessage({
speaker: ChatMessage.getSpeaker({ actor: actor }),
flavor: label,