2021-02-12 18:31:49 +01:00
|
|
|
import { Grammar } from "../grammar.js";
|
2021-12-12 17:36:22 +01:00
|
|
|
import { TMRUtility } from "../tmr-utility.js";
|
2023-11-15 22:14:00 +01:00
|
|
|
import { tmrTokenZIndex } from "../tmr-constants.js";
|
2021-02-12 18:31:49 +01:00
|
|
|
import { Draconique } from "./draconique.js";
|
2023-11-15 22:14:00 +01:00
|
|
|
import { TMRAnimations } from "./animation.js";
|
2021-02-12 18:31:49 +01:00
|
|
|
|
|
|
|
export class Pelerinage extends Draconique {
|
|
|
|
|
|
|
|
type() { return 'queue' }
|
|
|
|
match(item) { return Draconique.isQueueDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('pelerinage'); }
|
|
|
|
manualMessage() { return false }
|
|
|
|
|
2023-11-15 22:14:00 +01:00
|
|
|
async onActorCreateOwned(actor, queue) {
|
2021-05-11 21:45:43 +02:00
|
|
|
let tmr = await TMRUtility.getTMRAleatoire();
|
2023-11-15 22:14:00 +01:00
|
|
|
await this.createCaseTmr(actor, 'Pèlerinage', tmr, queue.id);
|
2021-02-12 18:31:49 +01:00
|
|
|
}
|
2023-11-15 22:14:00 +01:00
|
|
|
|
2021-02-12 18:31:49 +01:00
|
|
|
code() { return 'pelerinage' }
|
2023-11-15 22:14:00 +01:00
|
|
|
tooltip(linkData) { return `Lieu de pèlerinage` }
|
|
|
|
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/pelerinage.svg' }
|
|
|
|
|
2021-02-12 18:31:49 +01:00
|
|
|
createSprite(pixiTMR) {
|
2023-11-15 22:14:00 +01:00
|
|
|
return TMRAnimations.withAnimation(
|
|
|
|
pixiTMR.sprite(this.code(), {
|
|
|
|
zIndex: tmrTokenZIndex.conquete,
|
|
|
|
decallage: pixiTMR.sizes.decallage(0, 0),
|
|
|
|
taille: () => pixiTMR.sizes.half,
|
|
|
|
}),
|
|
|
|
pixiTMR,
|
|
|
|
TMRAnimations.changeZoom()
|
|
|
|
)
|
2021-02-12 18:31:49 +01:00
|
|
|
}
|
2023-11-15 22:14:00 +01:00
|
|
|
|
2021-02-28 01:52:58 +01:00
|
|
|
async onActorDeleteCaseTmr(actor, casetmr) {
|
2022-06-12 12:14:55 +02:00
|
|
|
await actor.deleteEmbeddedDocuments('Item', [casetmr.system.sourceid]);
|
2021-02-28 01:52:58 +01:00
|
|
|
}
|
|
|
|
|
2021-02-12 18:31:49 +01:00
|
|
|
}
|