Make TMR great again....

This commit is contained in:
sladecraven 2021-05-02 21:08:50 +02:00
parent 6d7d55e12b
commit 93b4d2ce7e
14 changed files with 21 additions and 23 deletions

View File

@ -63,7 +63,7 @@ export class RdDActorSheet extends ActorSheet {
// // Copy Active Effects
// data.effects = effects;
console.log("---- data");
//console.log("---- data");
// // Return template data
let formData = {

View File

@ -1300,12 +1300,14 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
async updateCoordTMR(coord) {
console.log("UPDATE TMR", coord);
await this.update({ "data.reve.tmrpos.coord": coord });
}
/* -------------------------------------------- */
async reveActuelIncDec(value) {
let reve = Math.max(Misc.templateData(this).reve.reve.value + value, 0);
let mydata = Misc.templateData(this);
let reve = Math.max(mydata.reve.reve.value + value, 0);
await this.update( { "data.reve.reve.value": reve });
}

View File

@ -211,9 +211,9 @@ export class RdDTMRDialog extends Dialog {
this.moveFromKey("bottom");
} );
// Gestion du cout de montée en points de rêve
let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1)
- this.actor.countMonteeLaborieuse();
let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse();
this.cumulFatigue += this.fatigueParCase;
await this.actor.reveActuelIncDec(reveCout);
@ -519,7 +519,7 @@ export class RdDTMRDialog extends Dialog {
if (TMRUtility.isForceRencontre() || myRoll == 7) {
return await this.rencontreTMRRoll(tmr, this.actor.isRencontreSpeciale());
}
let locTMR = (this.montreTMR) ? tmr.label + " (" + tmr.coord + ")" : "??";
let locTMR = (this.cacheTMR) ? "??": tmr.label + " (" + tmr.coord + ")";
this._tellToUser(myRoll + ": Pas de rencontre en " + locTMR);
}
@ -933,7 +933,6 @@ export class RdDTMRDialog extends Dialog {
}
}
/* -------------------------------------------- */
async postRencontre(tmr) {
if (!(this.viewOnly || this.currentRencontre)) {

View File

@ -488,7 +488,6 @@ export class RdDUtility {
/* -------------------------------------------- */
static async loadCompendium(compendium, filter = item => true) {
let compendiumData = await RdDUtility.loadCompendiumData(compendium);
console.log(compendiumData);
return compendiumData.filter(filter);
}

View File

@ -19,7 +19,7 @@ export class Debordement extends Draconique {
code() { return 'debordement' }
tooltip(linkData) { return `Débordement en ${this.tmrLabel(linkData)}` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/wave.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/wave.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), {

View File

@ -20,7 +20,7 @@ export class Pelerinage extends Draconique {
code() { return 'pelerinage' }
tooltip(linkData) { return `Votre pèlerinage en ${this.tmrLabel(linkData)}` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/pelerin.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/pelerin.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), {

View File

@ -23,7 +23,7 @@ export class Periple extends Draconique {
code() { return 'periple' }
tooltip(linkData) { return `Votre Périple passe par ${this.tmrLabel(linkData)}` }
img() { return 'icons/svg/acid.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/pelerin.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), {

View File

@ -22,18 +22,16 @@ export class PixiTMR {
load( onLoad = (loader, resources) => {} ) {
let loader = this.pixiApp.loader;
console.log("LOADING 1");
for (const [name, img] of Object.entries(PixiTMR.textures)) {
loader = loader.add(name, img);
}
console.log("LOADING 2");
loader.onLoad.add((error, resaon) => { console.log("ERROR", error, resaon) });
loader.load( (loader, resources) => {
onLoad(loader, resources);
for (let onAnimate of this.callbacksOnAnimate) {
onAnimate();
}
});
console.log("LOADING 3");
}
static register(name, img) {

View File

@ -20,7 +20,7 @@ export class PontImpraticable extends Draconique {
code() { return 'pont-impraticable' }
tooltip(linkData) { return `${this.tmrLabel(linkData)} impraticable` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/wave.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/wave.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(),

View File

@ -16,7 +16,7 @@ export class PresentCites extends Draconique {
code() { return 'present-cites' }
tooltip(linkData) { return `La ${this.tmrLabel(linkData)} a un présent` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/gift.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/gift.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(),

View File

@ -14,7 +14,7 @@ export class Rencontre extends Draconique {
code() { return 'rencontre' }
tooltip(linkData) { return `${linkData.rencontre.name} de force ${linkData.rencontre.force}` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/heures/hd06.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/heures/hd06.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), {

View File

@ -18,7 +18,7 @@ export class ReserveExtensible extends Draconique {
code() { return 'reserve_extensible' }
tooltip(linkData) { return `Réserve extensible en ${this.tmrLabel(linkData)} !` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/treasure-chest.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/treasure-chest.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), {

View File

@ -14,7 +14,7 @@ export class SortReserve extends Draconique {
code() { return 'sort' }
tooltip(sort) { return `${sort.name}, r${sort.data.ptreve_reel}` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/scroll.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/scroll.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), {

View File

@ -41,7 +41,7 @@ export class UrgenceDraconique extends Draconique {
code() { return 'urgence' }
tooltip(linkData) { return `Urgence draconique!` }
img() { return 'icons/svg/hazard.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/gift.webp' }
createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(),