Ajout commande /ddr

This commit is contained in:
Vincent Vandemeulebrouck
2020-12-31 11:53:41 +01:00
parent d5c4b69e1d
commit bfffd09f0f
5 changed files with 80 additions and 39 deletions

27
module/de-draconique.js Normal file
View File

@ -0,0 +1,27 @@
import { RdDDice } from "./rdd-dice.js";
export class DeDraconique extends Roll{
static async ddr(rollMode=undefined) {
let ddr = new DeDraconique().evaluate();
await RdDDice.show(ddr, rollMode);
return ddr;
}
constructor(){
super("1d8x8 - 0")
}
evaluate() {
super.evaluate();
const rerolls = Math.ceil(this.total / 8);
this.terms[this.terms.length - 1] = rerolls;
this.results[this.results.length - 1] = rerolls;
this._total -= rerolls;
return this;
}
async render(chatOptions) {
return super.render(chatOptions)
}
}