Fix effets TMR A0
This commit is contained in:
@@ -13,7 +13,7 @@ export class Conquete extends Draconique {
|
||||
async onActorCreateOwned(actor, item) { await this._creerConquete(actor, item); }
|
||||
|
||||
code() { return 'conquete' }
|
||||
tooltip(linkData) { return `Doit être conquis` }
|
||||
tooltip(linkData) { return 'Doit être conquis' }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/conquete.svg' }
|
||||
|
||||
createSprite(pixiTMR) {
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { ITEM_TYPES } from "../constants.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
import { COORD_TMR_INCONNU, TMRUtility } from "../tmr-utility.js";
|
||||
import { PixiTMR } from "./pixi-tmr.js";
|
||||
|
||||
const registeredEffects = [
|
||||
@@ -12,7 +12,7 @@ export class Draconique {
|
||||
static init() {
|
||||
}
|
||||
|
||||
static isCaseTMR(item) { return item.type == ITEM_TYPES.casetmr; }
|
||||
static isCaseTMR(item) { return item.type == ITEM_TYPES.casetmr }
|
||||
static isQueueDragon(item) { return item.isQueueDragon(); }
|
||||
static isSouffleDragon(item) { return item.type == ITEM_TYPES.souffle; }
|
||||
static isTeteDragon(item) { return item.type == ITEM_TYPES.tete; }
|
||||
@@ -92,7 +92,7 @@ export class Draconique {
|
||||
const tooltip = this.tooltip(linkData);
|
||||
return this._createToken(pixiTMR, linkData, coordTMR, type, tooltip);
|
||||
}
|
||||
|
||||
|
||||
tokens(pixiTMR, linkData, coordTMR, type = undefined) {
|
||||
const tooltip = this.tooltip(linkData);
|
||||
return [this._createToken(pixiTMR, linkData, coordTMR, type, tooltip)];
|
||||
@@ -127,7 +127,7 @@ export class Draconique {
|
||||
* @param {*} coord les coordonnées d'une case. Si undefined toute case du type correspondra,
|
||||
*/
|
||||
isCase(item, coord = undefined) {
|
||||
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && (coord ? item.system.coord == coord : true);
|
||||
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && (coord ? (coord != COORD_TMR_INCONNU && item.system.coord == coord) : true);
|
||||
}
|
||||
|
||||
find(list, coord = undefined) {
|
||||
@@ -150,7 +150,7 @@ export class Draconique {
|
||||
}
|
||||
|
||||
isCaseForSource(item, draconique) {
|
||||
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && item.system.sourceid == draconique.id;
|
||||
return Draconique.isCaseTMR(item) && item.system.specific == this.code() && item.system.sourceid == draconique.id
|
||||
}
|
||||
|
||||
async onVisiteSupprimer(actor, tmr, onRemoveToken) {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { tmrTokenZIndex } from "../tmr-constants.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
import { COORD_TMR_INCONNU, TMRUtility } from "../tmr-utility.js";
|
||||
import { Draconique } from "./draconique.js";
|
||||
|
||||
export class QueteEaux extends Draconique {
|
||||
@@ -9,11 +9,13 @@ export class QueteEaux extends Draconique {
|
||||
match(item) { return Draconique.isTeteDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes("quete des eaux"); }
|
||||
manualMessage() { return "Vous devrez re-configurer votre Nouvelle Quête des Eaux une fois un lac ou marais vaincu" }
|
||||
async onActorCreateOwned(actor, tete) {
|
||||
await this.createCaseTmr(actor, "Nouvelle Quête des Eaux", { coord: 'A0' }, tete.id);
|
||||
await this.createCaseTmr(actor, "Nouvelle Quête des Eaux", { coord: COORD_TMR_INCONNU }, tete.id);
|
||||
}
|
||||
|
||||
code() { return 'maitrisee' }
|
||||
tooltip(linkData) { return `Quête des eaux, ${TMRUtility.getTMRType(linkData.system.coord)} maîtrisé` }
|
||||
tooltip(linkData) {
|
||||
return linkData.system.coord == COORD_TMR_INCONNU ? 'Nouvelle Quête des eaux en cours' : `Quête des eaux, ${TMRUtility.getTMRType(linkData.system.coord)} maîtrisé`
|
||||
}
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/maitrisee.svg' }
|
||||
|
||||
createSprite(pixiTMR) {
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { tmrTokenZIndex } from "../tmr-constants.js";
|
||||
import { COORD_TMR_INCONNU } from "../tmr-utility.js";
|
||||
import { Draconique } from "./draconique.js";
|
||||
|
||||
export class TerreAttache extends Draconique {
|
||||
@@ -9,7 +10,7 @@ export class TerreAttache extends Draconique {
|
||||
manualMessage() { return "Vous pouvez re-configurer votre Nouvelle Terre d'attache" }
|
||||
|
||||
async onActorCreateOwned(actor, tete) {
|
||||
await this.createCaseTmr(actor, "Nouvelle Terre d'attache", { coord: 'A0' }, tete.id);
|
||||
await this.createCaseTmr(actor, "Nouvelle Terre d'attache", { coord: COORD_TMR_INCONNU }, tete.id);
|
||||
}
|
||||
|
||||
code() { return 'attache' }
|
||||
|
Reference in New Issue
Block a user