forked from public/foundryvtt-reve-de-dragon
Fréquences par milieu pour l'environnement
Les herbes et les ingrédients peuvent être cherchées/tirées
This commit is contained in:
@ -13,6 +13,7 @@ import { RdDResolutionTable } from "./rdd-resolution-table.js";
|
||||
import { RdDRollResolutionTable } from "./rdd-roll-resolution-table.js";
|
||||
import { RdDRollTables } from "./rdd-rolltables.js";
|
||||
import { RdDUtility } from "./rdd-utility.js";
|
||||
import { CompendiumTableHelpers } from "./settings/system-compendiums.js";
|
||||
import { TMRUtility } from "./tmr-utility.js";
|
||||
|
||||
const rddRollNumeric = /^(\d+)\s*([\+\-]?\d+)?\s*(s)?/;
|
||||
@ -49,7 +50,9 @@ export class RdDCommands {
|
||||
<br><strong>/table rencontre deso</strong> affiche la table des rencontres en Désolation
|
||||
<br><strong>/table rencontre mauvaise</strong> affiche la table des mauvaises rencontres`
|
||||
});
|
||||
|
||||
this.registerCommand({ path: ["/table", "milieu"], func: (content, msg, params) => this.tableMilieu(msg, params,'liste'), descr: "Affiche la table des trouvailles dans un milieu donné" });
|
||||
this.registerCommand({ path: ["/tirer", "milieu"], func: (content, msg, params) => this.tableMilieu(msg, params, 'chat'), descr: "Affiche la table des trouvailles dans un milieu donné" });
|
||||
|
||||
this.registerCommand({ path: ["/tirer", "comp"], func: (content, msg, params) => RdDRollTables.getCompetence('chat'), descr: "Tire une compétence au hasard" });
|
||||
this.registerCommand({ path: ["/tirer", "queue"], func: (content, msg, params) => RdDRollTables.getQueue('chat'), descr: "Tire une Queue de Dragon" });
|
||||
this.registerCommand({ path: ["/tirer", "ombre"], func: (content, msg, params) => RdDRollTables.getOmbre('chat'), descr: "Tire une Ombre de Thanatos" });
|
||||
@ -363,6 +366,7 @@ export class RdDCommands {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async tableRencontres(msg, params) {
|
||||
if (params && params.length > 0) {
|
||||
const search = Misc.join(params, ' ');
|
||||
@ -370,11 +374,29 @@ export class RdDCommands {
|
||||
if (solvedTerrain == undefined) {
|
||||
return RdDCommands._chatAnswer(msg, 'Aucune TMR correspondant à ' + search);
|
||||
}
|
||||
return game.system.rdd.rencontresTMR.chatTable(solvedTerrain);
|
||||
return await game.system.rdd.rencontresTMR.chatTable(solvedTerrain);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
async tableMilieu(msg, params, toChat) {
|
||||
if (params && params.length > 0) {
|
||||
const search = Misc.join(params, ' ');
|
||||
const searches = game.system.rdd.environnement.findEnvironnementsLike(search);
|
||||
if (searches.length == 0) {
|
||||
return RdDCommands._chatAnswer(msg, 'Aucun milieu correspondant à ' + search);
|
||||
}
|
||||
if (toChat == 'liste') {
|
||||
return await game.system.rdd.environnement.searchToChatMessage(search);
|
||||
}
|
||||
else {
|
||||
const row = await game.system.rdd.environnement.getRandom(search);
|
||||
await CompendiumTableHelpers.tableRowToChatMessage(row, 'Item');
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getCoutXpComp(msg, params) {
|
||||
if (params && (params.length == 1 || params.length == 2)) {
|
||||
|
Reference in New Issue
Block a user