export class RdDRollTables { /* -------------------------------------------- */ static async genericGetTableResult( tableName, toChat) { let pack = game.packs.get("foundryvtt-reve-de-dragon.tables-diverses"); await pack.getIndex(); let entry = pack.index.find(e => e.name === tableName); let rollQueues = await pack.getEntity(entry._id); let result = await rollQueues.draw( { displayChat: toChat } ); console.log("CAT", result); return result; } /* -------------------------------------------- */ static async getSouffle( toChat ) { return genericGetTableResult( "Souffles de Dragon", toChat); } /* -------------------------------------------- */ static async getQueue( toChat = true) { return genericGetTableResult( "Queues de dragon", toChat); } /* -------------------------------------------- */ static async getTete( toChat = true ) { return 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 ) { return genericGetTableResult( "Ombre de Thanatos", toChat); } /* -------------------------------------------- */ static async getTarot( toChat = true ) { return genericGetTableResult( "Tarot Draconique", toChat); } }