Big WIP...

This commit is contained in:
2022-06-12 12:14:55 +02:00
parent 0228d5bc56
commit 1f3fd0bb46
38 changed files with 237 additions and 239 deletions

View File

@ -10,21 +10,22 @@ export class RdDRollTables {
table = await pack.getDocument(entry._id);
}
const draw = await table.draw({ displayChat: toChat, rollMode: "gmroll"});
console.log("RdDRollTables", tableName, toChat, ":", draw);
//console.log("RdDRollTables", tableName, toChat, ":", draw);
return draw.results.length > 0 ? draw.results[0] : undefined;
}
/* -------------------------------------------- */
static async drawItemFromRollTable(tableName, toChat = false) {
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
const pack = game.packs.get(drawResult.data.collection);
return await pack.getDocument(drawResult.data.resultId);
const pack = game.packs.get(drawResult.documentCollection)
let doc = await pack.getDocument(drawResult.documentId)
return doc
}
/* -------------------------------------------- */
static async drawTextFromRollTable(tableName, toChat) {
const drawResult = await RdDRollTables.genericGetTableResult(tableName, toChat);
return drawResult.data.text;
return drawResult.system.text;
}
/* -------------------------------------------- */