forked from public/foundryvtt-reve-de-dragon
Réduction de l'espace des TMR
This commit is contained in:
@ -1,15 +1,12 @@
|
||||
import { Grammar } from "../grammar.js";
|
||||
import { RdDDice } from "../rdd-dice.js";
|
||||
import { TMRUtility } from "../tmr-utility.js";
|
||||
import { tmrConstants, tmrTokenZIndex } from "../tmr-constants.js";
|
||||
import { tmrTokenZIndex } from "../tmr-constants.js";
|
||||
import { Draconique } from "./draconique.js";
|
||||
import { TMRAnimations } from "./animation.js";
|
||||
|
||||
export class Periple extends Draconique {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
type() { return 'souffle' }
|
||||
match(item) { return Draconique.isSouffleDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('periple'); }
|
||||
manualMessage() { return false }
|
||||
@ -18,22 +15,25 @@ export class Periple extends Draconique {
|
||||
let terrain = (await RdDDice.rollTotal("1d2")) == 1 ? 'sanctuaire' : 'necropole';
|
||||
let tmrs = TMRUtility.getListTMR(terrain);
|
||||
for (let tmr of tmrs) {
|
||||
await this.createCaseTmr(actor, 'Périple: ' + tmr.label, tmr, souffle.id);
|
||||
await this.createCaseTmr(actor, 'Périple', tmr, souffle.id);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
code() { return 'periple' }
|
||||
tooltip(linkData) { return `Votre Périple passe par ${this.tmrLabel(linkData)}` }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/pelerin.webp' }
|
||||
tooltip(linkData) { return `Etape de périple` }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/periple.svg' }
|
||||
|
||||
createSprite(pixiTMR) {
|
||||
return pixiTMR.sprite(this.code(), {
|
||||
zIndex: tmrTokenZIndex.conquete,
|
||||
alpha: 1,
|
||||
taille: tmrConstants.full,
|
||||
decallage: tmrConstants.center
|
||||
});
|
||||
return TMRAnimations.withAnimation(
|
||||
pixiTMR.sprite(this.code(), {
|
||||
zIndex: tmrTokenZIndex.conquete,
|
||||
decallage: pixiTMR.sizes.decallage(0, 0),
|
||||
taille: () => pixiTMR.sizes.half
|
||||
}),
|
||||
pixiTMR,
|
||||
TMRAnimations.changeZoom()
|
||||
)
|
||||
}
|
||||
getDifficulte(tmr) {
|
||||
switch (tmr.type) {
|
||||
|
Reference in New Issue
Block a user