Gestion des présents des cités

+ fix bug sur conquête cité (pour supprimer la casetmr)
+ svg couleur plus lisibles
This commit is contained in:
Vincent Vandemeulebrouck
2021-02-12 12:50:17 +01:00
parent 1c5d14a1fa
commit 99ed077da8
18 changed files with 527 additions and 356 deletions

View File

@@ -14,12 +14,12 @@ 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/svg/wave.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/wave.svg' }
_createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(),
{
color: tmrColors.casehumide, alpha: 0.5, taille: tmrConstants.twoThird, decallage: tmrConstants.bottom
color: tmrColors.casehumide, taille: tmrConstants.twoThird, decallage: tmrConstants.bottom
});
}

View File

@@ -13,7 +13,7 @@ export class DemiReve extends Draconique {
async onActorCreateOwned(actor, item) { }
code() { return 'demi-reve' }
tooltip(linkData) { return `Demi-rêve` }
tooltip(actor) { return `Demi-rêve ${actor.name}` }
img() { return 'icons/svg/sun.svg' }
_createSprite(pixiTMR) {

View File

@@ -33,7 +33,7 @@ export class FermetureCites extends Draconique {
async onConquete(actor, coord) {
const citeFermee = actor.data.items.find(it => this.isCase(it, coord));
await this.actor.deleteOwnedItem(citeFermee._id);
await actor.deleteOwnedItem(citeFermee._id);
}
}

View File

@@ -76,7 +76,9 @@ export class PixiTMR {
sprite.width = options.taille ?? tmrConstants.half;
sprite.height = options.taille ?? tmrConstants.half;
sprite.anchor.set(0.5);
sprite.tint = options.color ?? 0x000000;
if (options.color) {
sprite.tint = options.color;
}
sprite.alpha = options.alpha ?? 0.75;
sprite.decallage = options.decallage ?? tmrConstants.center;
this.pixiApp.stage.addChild(sprite);

View File

@@ -15,7 +15,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/svg/wave.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/wave.svg' }
_createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(),

View File

@@ -15,12 +15,12 @@ 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/svg/gift.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/gift.svg' }
_createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(),
{
color: tmrColors.tetes, alpha: 0.7, taille: tmrConstants.third, decallage: tmrConstants.topRight
color: 0xFEFEFE, alpha: 0.8, taille: tmrConstants.third, decallage: tmrConstants.topRight
});
}
@@ -39,19 +39,22 @@ export class PresentCites extends Draconique {
}
}
}
async choisirUnPresent(casetmr) {
async choisirUnPresent(casetmr, onChoixPresent) {
let d = new Dialog({
title: "Présent des cités",
content: `La ${casetmr.data.coord} vous offre un présent`,
content: `La ${this.tmrLabel(casetmr)} vous offre un présent, faite votre choix`,
buttons: {
fleur: {
icon: '<i class="fas fa-check"></i>',
label: "Fleur des rêves 2d6",
callback: () => this.creerObjet()
}
}
messager: { icon: '<i class="fas fa-check"></i>', label: "Un Messager des rêves", callback: () => onChoixPresent('messager2d6') },
passeur: { icon: '<i class="fas fa-check"></i>', label: "Un Passeur des rêves", callback: () => onChoixPresent('passeur2d6') },
fleur: { icon: '<i class="fas fa-check"></i>', label: "Une Fleur des rêves", callback: () => onChoixPresent('fleur2d6') },
},
default: "fleur"
});
d.render(true);
}
async ouvrirLePresent(actor, casetmr) {
await actor.deleteOwnedItem(casetmr._id);
}
}

View File

@@ -13,10 +13,10 @@ export class ReserveExtensible extends Draconique {
code() { return 'reserve_extensible' }
tooltip(linkData) { return `Réserve extensible en ${this.tmrLabel(linkData)} !` }
img() { return 'icons/svg/chest.svg' }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/treasure-chest.svg' }
_createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { color: tmrColors.tetes, decallage: tmrConstants.left});
return pixiTMR.sprite(this.code(), { alpha: 0.9, decallage: tmrConstants.left});
}
async _creerCaseTmr(actor) {

View File

@@ -13,10 +13,10 @@ export class SortReserve extends Draconique {
async onActorCreateOwned(actor, item) { }
code() { return 'sort' }
tooltip(linkData) { return `${linkData.name}, r${linkData.data.ptreve_reel}` }
img() { return 'icons/svg/book.svg' }
tooltip(sort) { return `${sort.name}, r${sort.data.ptreve_reel}` }
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/scroll.svg' }
_createSprite(pixiTMR) {
return pixiTMR.sprite(this.code(), { color: tmrColors.sort, decallage: tmrConstants.right });
return pixiTMR.sprite(this.code(), { alpha: 0.5, decallage: tmrConstants.right });
}
}