diff --git a/Axolotl-with-a-Gun/the-horrors.mjs b/Axolotl-with-a-Gun/the-horrors.mjs new file mode 100644 index 0000000..4b80f49 --- /dev/null +++ b/Axolotl-with-a-Gun/the-horrors.mjs @@ -0,0 +1,46 @@ +const diceCount = await DialogManager.ask({ + id: `horrors-dice-pool`, + inputs: [ + { + key: `diceCount`, + inputType: `number`, + label: `Dice Count`, + autofocus: true, + }, + ], +}); +let rollMode = game.settings.get(`core`, `rollMode`); + +let r = new Roll(`${diceCount}d6cs<4`); +await r.evaluate(); +const successes = r.total; + +const privacy = stats.utils.determinePrivacyFromRollMode(rollMode); +await CONFIG.stats.db.createRows( + `Dice/d6`, + game.user.id, + r.dice[0].results.map(d => ({ value: d.result, privacy })), + { rerender: false }, +); +await CONFIG.stats.db.createRow( + `AwaG/Count of Successes`, + game.user.id, + { value: successes, privacy }, + { rerender: false }, +); +await CONFIG.stats.db.createRow( + `AwaG/Amount of Dice Rolled`, + game.user.id, + { value: diceCount, privacy }, + { rerender: false }, +); +CONFIG.stats.db.render(); + +const chatData = ChatMessage.applyRollMode( + { rolls: [r], }, + rollMode, +); +await ChatMessage.implementation.create(chatData); + +const clock = window.clockDatabase.getName(`Attacking Dice`); +window.clockDatabase.update({ id: clock.id, value: successes });