This commit is contained in:
2022-09-07 09:01:23 +02:00
parent 5a32cf26dc
commit 336767c19e
25 changed files with 75 additions and 76 deletions

View File

@ -7,12 +7,12 @@ export class RdDItemSort extends Item {
/* -------------------------------------------- */
static isDifficulteVariable(sort) {
return sort && (sort.data.difficulte.toLowerCase() == "variable");
return sort && (sort.system.difficulte.toLowerCase() == "variable");
}
/* -------------------------------------------- */
static isCoutVariable(sort) {
return sort && (sort.data.ptreve.toLowerCase() == "variable" || sort.data.ptreve.indexOf("+") >= 0);
return sort && (sort.system.ptreve.toLowerCase() == "variable" || sort.system.ptreve.indexOf("+") >= 0);
}
/* -------------------------------------------- */
@ -25,7 +25,7 @@ export class RdDItemSort extends Item {
/* -------------------------------------------- */
static getDifficulte(sort, variable) {
if (sort && !RdDItemSort.isDifficulteVariable(sort)) {
return Misc.toInt(sort.data.difficulte);
return Misc.toInt(sort.system.difficulte);
}
return variable;
}
@ -54,7 +54,7 @@ export class RdDItemSort extends Item {
static getBonusCaseList( item, newCase = false ) {
// Gestion spéciale case bonus
if ( item.type == 'sort') {
return this.buildBonusCaseList(item.data.bonuscase, newCase );
return this.buildBonusCaseList(item.system.bonuscase, newCase );
}
return undefined;
}
@ -87,7 +87,7 @@ export class RdDItemSort extends Item {
/* -------------------------------------------- */
static incrementBonusCase( actor, sort, coord ) {
let bonusCaseList = this.buildBonusCaseList(sort.data.bonuscase, false);
let bonusCaseList = this.buildBonusCaseList(sort.system.bonuscase, false);
//console.log("ITEMSORT", sort, bonusCaseList);
let found = false;
@ -111,7 +111,7 @@ export class RdDItemSort extends Item {
/* -------------------------------------------- */
static getCaseBonus( sort, coord) {
let bonusCaseList = this.buildBonusCaseList(sort.data.bonuscase, false);
let bonusCaseList = this.buildBonusCaseList(sort.system.bonuscase, false);
for( let bc of bonusCaseList) {
if (bc.case == coord) { // Case existante
return Number(bc.bonus);