forked from public/foundryvtt-reve-de-dragon
Réduction de l'espace des TMR
This commit is contained in:
@ -1,37 +1,36 @@
|
||||
import { Grammar } from "../grammar.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 Pelerinage extends Draconique {
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
type() { return 'queue' }
|
||||
match(item) { return Draconique.isQueueDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('pelerinage'); }
|
||||
manualMessage() { return false }
|
||||
|
||||
async onActorCreateOwned(actor, queue) {
|
||||
async onActorCreateOwned(actor, queue) {
|
||||
let tmr = await TMRUtility.getTMRAleatoire();
|
||||
await this.createCaseTmr(actor, 'Pèlerinage: ' + tmr.label, tmr, queue.id);
|
||||
await this.createCaseTmr(actor, 'Pèlerinage', tmr, queue.id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
code() { return 'pelerinage' }
|
||||
tooltip(linkData) { return `Votre pèlerinage en ${this.tmrLabel(linkData)}` }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/pelerin.webp' }
|
||||
|
||||
tooltip(linkData) { return `Lieu de pèlerinage` }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/pelerinage.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()
|
||||
)
|
||||
}
|
||||
|
||||
|
||||
async onActorDeleteCaseTmr(actor, casetmr) {
|
||||
await actor.deleteEmbeddedDocuments('Item', [casetmr.system.sourceid]);
|
||||
}
|
||||
|
Reference in New Issue
Block a user