Added ability to apply the strife to the actor

This commit is contained in:
Vlyan
2022-02-13 13:34:24 +01:00
parent 64b436627f
commit 8c4072d8af
11 changed files with 83 additions and 22 deletions

View File

@@ -9,22 +9,23 @@ export class RollL5r5e extends Roll {
super(formula, data, options);
this.l5r5e = {
stance: "",
skillId: "",
skillCatId: "",
actor: null,
targetTokenId: null,
difficulty: 2,
difficultyHidden: false,
voidPointUsed: false,
keepLimit: null,
isInitiativeRoll: false,
skillAssistance: 0,
initialFormula: null,
dicesTypes: {
std: false,
l5r: false,
},
difficulty: 2,
difficultyHidden: false,
history: null,
initialFormula: null,
isInitiativeRoll: false,
keepLimit: null,
rnkEnded: false,
skillAssistance: 0,
skillCatId: "",
skillId: "",
stance: "",
strifeApplied: 0,
summary: {
totalSuccess: 0,
totalBonus: 0,
@@ -33,12 +34,12 @@ export class RollL5r5e extends Roll {
opportunity: 0,
strife: 0,
},
history: null,
rnkEnded: false,
targetTokenId: null,
voidPointUsed: false,
};
// Parse flavor for stance and skillId
const flavors = Array.from(formula.matchAll(/\d+d(s|r)\[([^\]]+)\]/gmu));
const flavors = Array.from(formula.matchAll(/\d+d([sr])\[([^\]]+)\]/gmu));
flavors.forEach((res) => {
if (res[1] === "r" && !!res[2] && this.l5r5e.stance === "") {
this.l5r5e.stance = res[2];