Commandes pour jet de dés

This commit is contained in:
Vincent Vandemeulebrouck
2020-12-29 00:11:58 +01:00
parent 3e42ddd314
commit 77ed4f1482
5 changed files with 227 additions and 66 deletions

View File

@ -891,17 +891,6 @@ export class RdDUtility {
});
}
/* -------------------------------------------- */
/* Display help for /table */
static displayHelpTable( msg )
{
msg.content = "";
for (let [name, tableData] of Object.entries(table2func)) {
msg.content += "<br>" + tableData.descr;
}
ChatMessage.create( msg );
}
/* -------------------------------------------- */
static afficherDemandePayer(som1, som2) {
som1 = (som1) ? som1.toLowerCase() : "0d";
@ -922,38 +911,4 @@ export class RdDUtility {
msgPayer += "<a id='payer-button' data-somme-denier='"+sumtotald+"'>Payer</a>"
ChatMessage.create( { content: msgPayer } );
}
/* -------------------------------------------- */
/* Manage chat commands */
static processChatCommand( commands, content, msg ) {
// Setup new message's visibility
let rollMode = game.settings.get("core", "rollMode");
if (["gmroll", "blindroll"].includes(rollMode)) msg["whisper"] = ChatMessage.getWhisperRecipients("GM");
if (rollMode === "blindroll") msg["blind"] = true;
msg["type"] = 0;
let command = commands[0];
// Roll on a table
if (command === "/table") {
if ( commands[1] ) {
let tableName = commands[1].toLowerCase();
table2func[tableName].func();
} else {
this.displayHelpTable( msg );
}
return false
} else if (command === "/tmrr") {
TMRUtility.getRencontre(commands[1], commands[2] )
return false
} else if (command === "/tmra") {
TMRUtility.getTMRAleatoire( )
return false
} else if (command === "/payer") {
RdDUtility.afficherDemandePayer( commands[1], commands[2] )
return false
}
return true;
}
}