First v10 migration
This commit is contained in:
@ -20,19 +20,6 @@ export class YggdrasillUtility {
|
||||
return loadTemplates(templatePaths);
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static templateData(it) {
|
||||
return YggdrasillUtility.data(it)?.data ?? {}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static data(it) {
|
||||
if (it instanceof Actor || it instanceof Item || it instanceof Combatant) {
|
||||
return it.data;
|
||||
}
|
||||
return it;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static createDirectSortedOptionList( min, max) {
|
||||
let options = [];
|
||||
@ -205,7 +192,7 @@ export class YggdrasillUtility {
|
||||
|
||||
// Select niveau de competence/arme/carac
|
||||
if ( rollData.mode != "carac" ) {
|
||||
niveauCompetence = rollData.competence.data.niveau;
|
||||
niveauCompetence = rollData.competence.system.niveau;
|
||||
} else {
|
||||
niveauCompetence = rollData.selectedCarac.value;
|
||||
}
|
||||
@ -215,8 +202,8 @@ export class YggdrasillUtility {
|
||||
if ( rollData.attackDef) {
|
||||
rollData.finalBM -= rollData.attackDef.malus;
|
||||
}
|
||||
if ( rollData.sort && rollData.sort.data.malus ) {
|
||||
rollData.finalBM += rollData.sort.data.malus;
|
||||
if ( rollData.sort && rollData.sort.system.malus ) {
|
||||
rollData.finalBM += rollData.sort.system.malus;
|
||||
}
|
||||
// Gestion cas blessé (malus de -3)
|
||||
if ( rollData.isBlesse) { // Cas blesse : malus de -3
|
||||
@ -276,8 +263,8 @@ export class YggdrasillUtility {
|
||||
|
||||
// Dégats
|
||||
if ( isSuccess && (rollData.mode == "armecc" || rollData.mode == "armedist") ) {
|
||||
rollData.degatsExplain = `Marge(${marge}) + Degats Arme(${rollData.arme.data.degat}) + Bonus Attaque(${rollData.attackDef.bonusdegats})`;
|
||||
rollData.degats = marge + rollData.arme.data.degat + rollData.attackDef.bonusdegats;
|
||||
rollData.degatsExplain = `Marge(${marge}) + Degats Arme(${rollData.arme.system.degat}) + Bonus Attaque(${rollData.attackDef.bonusdegats})`;
|
||||
rollData.degats = marge + rollData.arme.system.degat + rollData.attackDef.bonusdegats;
|
||||
}
|
||||
|
||||
// Stockage resultats
|
||||
@ -292,7 +279,7 @@ export class YggdrasillUtility {
|
||||
let galdrRoll = new Roll( rollData.dureeGaldr.substring(0, rollData.dureeGaldr.length - 1) ).roll( { async: false} );
|
||||
await this.showDiceSoNice(galdrRoll, game.settings.get("core", "rollMode") );
|
||||
rollData.dureeGaldrText = galdrRoll.total + " " + dureeGaldrText[rollData.dureeGaldr];
|
||||
if ( rollData.sort.data.voie == "illusion") {
|
||||
if ( rollData.sort.system.voie == "illusion") {
|
||||
let volume = rollData.zoneGaldr.substring(3, rollData.zoneGaldr.length);
|
||||
rollData.zoneGaldrText = rollData.instinctCarac.value + " x " + volume;
|
||||
} else {
|
||||
@ -310,7 +297,7 @@ export class YggdrasillUtility {
|
||||
|
||||
/* -------------------------------------------- */
|
||||
static getUsers(filter) {
|
||||
return game.users.filter(filter).map(user => user.data._id);
|
||||
return game.users.filter(filter).map(user => user.system._id);
|
||||
}
|
||||
/* -------------------------------------------- */
|
||||
static getWhisperRecipients(rollMode, name) {
|
||||
|
Reference in New Issue
Block a user