From cd291c4ae019e57a8954df3de2aee0b2dc3ee545 Mon Sep 17 00:00:00 2001 From: sladecraven Date: Sun, 13 Sep 2020 23:08:52 +0200 Subject: [PATCH] Ajout commande /tmra --- module/rdd-utility.js | 5 ++++- module/tmr-utility.js | 22 ++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/module/rdd-utility.js b/module/rdd-utility.js index cf8798a4..5494602c 100644 --- a/module/rdd-utility.js +++ b/module/rdd-utility.js @@ -628,7 +628,10 @@ export class RdDUtility { } else if (command === "/tmrr") { TMRUtility.getRencontre(commands[1], commands[2] ) return false - } + } else if (command === "/tmra") { + TMRUtility.getTMRAleatoire( ) + return false + } return true; } diff --git a/module/tmr-utility.js b/module/tmr-utility.js index f0157270..430759e0 100644 --- a/module/tmr-utility.js +++ b/module/tmr-utility.js @@ -159,7 +159,7 @@ const TMRMapping = { C12: { type: "lac", label: "Lac de Fricassa"}, D12: { type: "collines", label: "Collines d’Huaï"}, E12: { type: "monts", label: "Monts Ajourés"}, - F12: { type: "necropole", label: "Nécropole de 'roat"}, + F12: { type: "necropole", label: "Nécropole de Troat"}, G12: { type: "plaines", label: "Plaines de Lufmil"}, H12: { type: "collines", label: "Collines de Tooth"}, I12: { type: "gouffre", label: "Gouffre Abimeux"}, @@ -428,6 +428,24 @@ export class TMRUtility { } } - + + /* -------------------------------------------- */ + /** + * + */ + static getTMRAleatoire() + { + let num = new Roll("1d15").roll().total; + let letter, letterValue; + if ( num == 15) { + letterValue = new Roll( "1d7").roll().total; + letter = String.fromCharCode( 65 + ((parseInt(letterValue)-1)*2) ); + } else { + letterValue = new Roll( "1d13 + 64" ).roll().total; + letter = String.fromCharCode( letterValue ); + } + let caseIndex = letter+num; + console.log("Case ", letterValue, letter, num, TMRMapping[caseIndex].label ); + } }