forked from public/foundryvtt-reve-de-dragon
Debug sorts, WIP
This commit is contained in:
@ -262,9 +262,9 @@ export class RdDActor extends Actor {
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
getBestDraconic() {
|
||||
const list = this.getDraconicList().sort((a, b) => b.data.niveau - a.data.niveau);
|
||||
const list = this.getDraconicList().sort((a, b) => b.data.data.niveau - a.data.data.niveau);
|
||||
if (list.length == 0) {
|
||||
return { name: "Aucun", data: { niveau: -11 } };
|
||||
return { name: "Aucun", data: { name: "Aucun", data: { niveau: -11 } } };
|
||||
}
|
||||
return duplicate(list[0]);
|
||||
}
|
||||
@ -1742,13 +1742,14 @@ export class RdDActor extends Actor {
|
||||
let bestDraconic = this.getBestDraconic();
|
||||
for (let sort of sortList) {
|
||||
let voie = sort.data.draconic.toLowerCase();
|
||||
let draconic = draconicList.find(it => it.data.categorie == 'draconic' && it.name.toLowerCase().includes(voie));
|
||||
let draconic = draconicList.find(it => it.data.data.categorie == 'draconic' && it.data.name.toLowerCase().includes(voie));
|
||||
//console.log(draconicList, bestDraconic, draconic, voie);
|
||||
if (sort.name.toLowerCase().includes('aura')) {
|
||||
draconic = bestDraconic;
|
||||
}
|
||||
draconic = duplicate(draconic);
|
||||
if (draconicDone[draconic.name] == undefined) {
|
||||
draconic.data.defaut_carac = 'reve';
|
||||
draconic.data.data.defaut_carac = 'reve';
|
||||
newDraconicList.push(draconic);
|
||||
draconicDone[draconic.name] = newDraconicList.length - 1; // Patch local pour relier facilement voie/compétence
|
||||
}
|
||||
@ -2029,8 +2030,8 @@ export class RdDActor extends Actor {
|
||||
/* -------------------------------------------- */
|
||||
async rollTache(id) {
|
||||
let tache = duplicate(this.getTache(id));
|
||||
let competence = duplicate(this.getCompetence(tache.data.competence));
|
||||
competence.data.defaut_carac = tache.data.carac; // Patch !
|
||||
let competence = this.getCompetence(tache.data.competence);
|
||||
competence.data.data.defaut_carac = tache.data.carac; // Patch !
|
||||
let rollData = {
|
||||
competence: competence,
|
||||
tache: tache,
|
||||
@ -2436,12 +2437,12 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getSortList() {
|
||||
return this.data.items.filter(it => it.type == "sort");
|
||||
return this.data.items.filter(it => it.data.type == "sort");
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
getDraconicList() {
|
||||
return this.data.items.filter(it => it.data.categorie == 'draconic')
|
||||
return this.data.items.filter(it => it.data.data.categorie == 'draconic')
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
@ -3108,7 +3109,7 @@ export class RdDActor extends Actor {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
_deleteStatusEffectsByIds(effectIds, options) {
|
||||
this.deleteEmbeddedEntity('ActiveEffect', effectIds, options);
|
||||
this.deleteEmbeddedDocument('ActiveEffect', effectIds, options);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
Reference in New Issue
Block a user