Add new compendiums

This commit is contained in:
2022-07-30 23:29:55 +02:00
parent 3957a6aa9f
commit 39c0e8c30a
4 changed files with 53 additions and 3 deletions

View File

@@ -287,9 +287,24 @@ export class CrucibleUtility {
if (!myRoll) { // New rolls only of no rerolls
myRoll = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
rollData.roll = myRoll
}
rollData.roll = myRoll
rollData.nbSuccess = myRoll.total
if (rollData.rollAdvantage) {
let myRoll2 = new Roll(diceFormula).roll({ async: false })
await this.showDiceSoNice(myRoll, game.settings.get("core", "rollMode"))
if ( myRoll2.total > rollData.nbSuccess) {
rollData.roll = myRoll2
rollData.nbSuccess = myRoll2.total
}
}
// Manage exp
if (rollData.skill) {
let nbSkillSuccess = rollData.roll.terms[2].total
if ( nbSkillSuccess == 0 || nbSkillSuccess == rollData.skill.data.level) {
actor.incrementSkillExp(rollData.skill._id, 1)
}
}
this.createChatWithRollMode(rollData.alias, {
content: await renderTemplate(`systems/fvtt-crucible-rpg/templates/chat-generic-result.html`, rollData)