Fix regression /table

This commit is contained in:
Vincent Vandemeulebrouck 2020-11-12 18:42:41 +01:00
parent bc32cd1ad4
commit 1cb7d1f251

View File

@ -1,45 +1,43 @@
export class RdDRollTables { export class RdDRollTables {
/* -------------------------------------------- */ /* -------------------------------------------- */
static async genericGetTableResult( tableName, toChat) static async genericGetTableResult(tableName, toChat) {
{ const pack = game.packs.get("foundryvtt-reve-de-dragon.tables-diverses");
let pack = game.packs.get("foundryvtt-reve-de-dragon.tables-diverses"); const index = await pack.getIndex();
await pack.getIndex(); const entry = index.find(e => e.name === tableName);
let entry = pack.index.find(e => e.name === tableName); const table = await pack.getEntity(entry._id);
let rollQueues = await pack.getEntity(entry._id); const result = await table.draw({ displayChat: toChat });
let result = await rollQueues.draw( { displayChat: toChat } ); console.log("RdDRollTables", tableName, toChat, ":", result);
console.log("CAT", result);
return result; return result;
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async getSouffle( toChat ) { static async getSouffle(toChat) {
return genericGetTableResult( "Souffles de Dragon", toChat); return RdDRollTables.genericGetTableResult("Souffles de Dragon", toChat);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async getQueue( toChat = true) { static async getQueue(toChat = true) {
return genericGetTableResult( "Queues de dragon", toChat); return RdDRollTables.genericGetTableResult("Queues de dragon", toChat);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async getTete( toChat = true ) { static async getTete(toChat = true) {
return genericGetTableResult( "Têtes de Dragon pour haut-rêvants", toChat); return RdDRollTables.genericGetTableResult("Têtes de Dragon pour haut-rêvants", toChat);
}
/* -------------------------------------------- */
static async getTeteHR( toChat = true ) {
return genericGetTableResult( "Têtes de Dragon pour tous personnages", toChat);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async getOmbre( toChat = true ) { static async getTeteHR(toChat = true) {
return genericGetTableResult( "Ombre de Thanatos", toChat); return RdDRollTables.genericGetTableResult("Têtes de Dragon pour tous personnages", toChat);
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
static async getTarot( toChat = true ) { static async getOmbre(toChat = true) {
return genericGetTableResult( "Tarot Draconique", toChat); return RdDRollTables.genericGetTableResult("Ombre de Thanatos", toChat);
} }
} /* -------------------------------------------- */
static async getTarot(toChat = true) {
return RdDRollTables.genericGetTableResult("Tarot Draconique", toChat);
}
}