forked from public/foundryvtt-reve-de-dragon
Réduction de l'espace des TMR
This commit is contained in:
@ -1,12 +1,9 @@
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
import { tmrConstants, tmrColors, tmrTokenZIndex } from "../tmr-constants.js";
|
||||
import { tmrTokenZIndex } from "../tmr-constants.js";
|
||||
import { Draconique } from "./draconique.js";
|
||||
|
||||
export class TrouNoir extends Draconique {
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
type() { return 'souffle' }
|
||||
match(item) { return Draconique.isSouffleDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('trou noir'); }
|
||||
@ -15,21 +12,19 @@ export class TrouNoir extends Draconique {
|
||||
async onActorCreateOwned(actor, souffle) {
|
||||
const existants = actor.items.filter(it => this.isCase(it)).map(it => it.system.coord);
|
||||
const selectedTMR = await TMRUtility.getTMRAleatoire(tmr => !(TMRUtility.isCaseHumide(tmr) || existants.includes(tmr.coord)));
|
||||
await this.createCaseTmr(actor, 'Trou noir: ' + selectedTMR.label, selectedTMR, souffle.id);
|
||||
await this.createCaseTmr(actor, 'Trou noir', selectedTMR, souffle.id);
|
||||
}
|
||||
|
||||
code() { return 'trounoir' }
|
||||
tooltip(linkData) { return `Trou noir en ${this.tmrLabel(linkData)} !` }
|
||||
img() { return 'icons/svg/explosion.svg' }
|
||||
tooltip(linkData) { return `Trou noir` }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/trounoir.svg' }
|
||||
|
||||
createSprite(pixiTMR) {
|
||||
return pixiTMR.sprite(this.code(),
|
||||
{
|
||||
zIndex: tmrTokenZIndex.trounoir,
|
||||
color: tmrColors.trounoir,
|
||||
alpha: 1, taille:
|
||||
tmrConstants.full,
|
||||
decallage: { x: 2, y: 2 },
|
||||
decallage: pixiTMR.sizes.decallage(0, 0),
|
||||
taille: () => pixiTMR.sizes.full,
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user