pelerinage
+ suppression des cases quand le souffle/queue sont supprimés
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { tmrColors, tmrConstants, tmrTokenZIndex, TMRUtility } from "../tmr-utility.js";
|
||||
import { Draconique } from "./draconique.js";
|
||||
|
||||
@ -8,27 +9,25 @@ export class Debordement extends Draconique {
|
||||
}
|
||||
|
||||
type() { return 'souffle' }
|
||||
match(item) { return Draconique.isSouffleDragon(item) && item.name.toLowerCase().includes('trou noir'); }
|
||||
match(item) { return Draconique.isSouffleDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('debordement'); }
|
||||
manualMessage() { return false }
|
||||
async onActorCreateOwned(actor, item) { await this._creerCaseTmr(actor); }
|
||||
async onActorCreateOwned(actor, souffle) {
|
||||
const existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
||||
const tmr = TMRUtility.getTMRAleatoire(it => !(TMRUtility.isCaseHumide(it) || existants.includes(it.coord)));
|
||||
await this.createCaseTmr(actor, 'Debordement: ' + tmr.label, tmr, souffle._id);
|
||||
}
|
||||
|
||||
code() { return 'debordement' }
|
||||
tooltip(linkData) { return `Débordement en ${this.tmrLabel(linkData)}` }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/wave.svg' }
|
||||
|
||||
_createSprite(pixiTMR) {
|
||||
return pixiTMR.sprite(this.code(),
|
||||
{
|
||||
color: tmrColors.casehumide,
|
||||
zIndex: tmrTokenZIndex.casehumide,
|
||||
taille: tmrConstants.twoThird,
|
||||
decallage: tmrConstants.bottom,
|
||||
});
|
||||
createSprite(pixiTMR) {
|
||||
return pixiTMR.sprite(this.code(), {
|
||||
color: tmrColors.casehumide,
|
||||
zIndex: tmrTokenZIndex.casehumide,
|
||||
taille: tmrConstants.twoThird,
|
||||
decallage: tmrConstants.bottom
|
||||
});
|
||||
}
|
||||
|
||||
async _creerCaseTmr(actor) {
|
||||
const existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
||||
const tmr = TMRUtility.getTMRAleatoire(it => !(TMRUtility.isCaseHumide(it) || existants.includes(it.coord)));
|
||||
await this.createCaseTmr(actor, 'Debordement: ' + tmr.label, tmr);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user