2021-02-28 01:56:17 +01:00
|
|
|
import { Grammar } from "../grammar.js";
|
2021-05-11 21:45:43 +02:00
|
|
|
import { RdDDice } from "../rdd-dice.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-28 01:56:17 +01:00
|
|
|
import { Draconique } from "./draconique.js";
|
2023-11-15 22:14:00 +01:00
|
|
|
import { TMRAnimations } from "./animation.js";
|
2021-02-28 01:56:17 +01:00
|
|
|
|
|
|
|
export class Periple extends Draconique {
|
|
|
|
|
|
|
|
type() { return 'souffle' }
|
|
|
|
match(item) { return Draconique.isSouffleDragon(item) && Grammar.toLowerCaseNoAccent(item.name).includes('periple'); }
|
|
|
|
manualMessage() { return false }
|
|
|
|
|
|
|
|
async onActorCreateOwned(actor, souffle) {
|
2021-05-11 21:45:43 +02:00
|
|
|
let terrain = (await RdDDice.rollTotal("1d2")) == 1 ? 'sanctuaire' : 'necropole';
|
2021-02-28 01:56:17 +01:00
|
|
|
let tmrs = TMRUtility.getListTMR(terrain);
|
|
|
|
for (let tmr of tmrs) {
|
2023-11-15 22:14:00 +01:00
|
|
|
await this.createCaseTmr(actor, 'Périple', tmr, souffle.id);
|
2021-02-28 01:56:17 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
code() { return 'periple' }
|
2023-11-15 22:14:00 +01:00
|
|
|
tooltip(linkData) { return `Etape de périple` }
|
|
|
|
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/periple.svg' }
|
2021-02-28 01:56:17 +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-28 01:56:17 +01:00
|
|
|
}
|
|
|
|
getDifficulte(tmr) {
|
|
|
|
switch (tmr.type) {
|
|
|
|
case 'sanctuaire': return -3;
|
|
|
|
case 'necropole': return -5;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|