Gestion des signes draconiques #455

Closed
vincent.vandeme wants to merge 233 commits from v1.4-signes-draconiques into master
14 changed files with 21 additions and 23 deletions
Showing only changes of commit 93b4d2ce7e - Show all commits

View File

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

View File

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

View File

@ -68,7 +68,7 @@ export class RdDTMRDialog extends Dialog {
} }
// load the texture we need // load the texture we need
this.pixiTMR.load((loader, resources) => this.createPixiSprites()); this.pixiTMR.load( (loader, resources) => this.createPixiSprites() );
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
@ -211,9 +211,9 @@ export class RdDTMRDialog extends Dialog {
this.moveFromKey("bottom"); this.moveFromKey("bottom");
} ); } );
// Gestion du cout de montée en points de rêve // Gestion du cout de montée en points de rêve
let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) let reveCout = ((this.tmrdata.isRapide && !EffetsDraconiques.isDeplacementAccelere(this.actor)) ? -2 : -1) - this.actor.countMonteeLaborieuse();
- this.actor.countMonteeLaborieuse();
this.cumulFatigue += this.fatigueParCase; this.cumulFatigue += this.fatigueParCase;
await this.actor.reveActuelIncDec(reveCout); await this.actor.reveActuelIncDec(reveCout);
@ -519,7 +519,7 @@ export class RdDTMRDialog extends Dialog {
if (TMRUtility.isForceRencontre() || myRoll == 7) { if (TMRUtility.isForceRencontre() || myRoll == 7) {
return await this.rencontreTMRRoll(tmr, this.actor.isRencontreSpeciale()); 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); this._tellToUser(myRoll + ": Pas de rencontre en " + locTMR);
} }
@ -933,7 +933,6 @@ export class RdDTMRDialog extends Dialog {
} }
} }
/* -------------------------------------------- */ /* -------------------------------------------- */
async postRencontre(tmr) { async postRencontre(tmr) {
if (!(this.viewOnly || this.currentRencontre)) { if (!(this.viewOnly || this.currentRencontre)) {

View File

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

View File

@ -19,7 +19,7 @@ export class Debordement extends Draconique {
code() { return 'debordement' } code() { return 'debordement' }
tooltip(linkData) { return `Débordement en ${this.tmrLabel(linkData)}` } 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { return pixiTMR.sprite(this.code(), {

View File

@ -20,7 +20,7 @@ export class Pelerinage extends Draconique {
code() { return 'pelerinage' } code() { return 'pelerinage' }
tooltip(linkData) { return `Votre pèlerinage en ${this.tmrLabel(linkData)}` } 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { return pixiTMR.sprite(this.code(), {

View File

@ -23,7 +23,7 @@ export class Periple extends Draconique {
code() { return 'periple' } code() { return 'periple' }
tooltip(linkData) { return `Votre Périple passe par ${this.tmrLabel(linkData)}` } 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { return pixiTMR.sprite(this.code(), {

View File

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

View File

@ -20,7 +20,7 @@ export class PontImpraticable extends Draconique {
code() { return 'pont-impraticable' } code() { return 'pont-impraticable' }
tooltip(linkData) { return `${this.tmrLabel(linkData)} 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), return pixiTMR.sprite(this.code(),

View File

@ -16,7 +16,7 @@ export class PresentCites extends Draconique {
code() { return 'present-cites' } code() { return 'present-cites' }
tooltip(linkData) { return `La ${this.tmrLabel(linkData)} a un présent` } 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), return pixiTMR.sprite(this.code(),

View File

@ -14,7 +14,7 @@ export class Rencontre extends Draconique {
code() { return 'rencontre' } code() { return 'rencontre' }
tooltip(linkData) { return `${linkData.rencontre.name} de force ${linkData.rencontre.force}` } 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { return pixiTMR.sprite(this.code(), {

View File

@ -18,7 +18,7 @@ export class ReserveExtensible extends Draconique {
code() { return 'reserve_extensible' } code() { return 'reserve_extensible' }
tooltip(linkData) { return `Réserve extensible en ${this.tmrLabel(linkData)} !` } 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { return pixiTMR.sprite(this.code(), {

View File

@ -14,7 +14,7 @@ export class SortReserve extends Draconique {
code() { return 'sort' } code() { return 'sort' }
tooltip(sort) { return `${sort.name}, r${sort.data.ptreve_reel}` } 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) { createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { return pixiTMR.sprite(this.code(), {

View File

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