2023-11-15 22:14:00 +01:00
|
|
|
import { tmrTokenZIndex } from "../tmr-constants.js";
|
2023-12-09 01:04:33 +01:00
|
|
|
import { TMRUtility } from "../tmr-utility.js";
|
2021-02-11 02:48:27 +01:00
|
|
|
import { Draconique } from "./draconique.js";
|
2023-12-09 01:04:33 +01:00
|
|
|
import { EffetsDraconiques } from "./effets-draconiques.js";
|
2021-02-11 02:48:27 +01:00
|
|
|
|
|
|
|
export class SortReserve extends Draconique {
|
|
|
|
|
|
|
|
type() { return '' }
|
|
|
|
match(item) { return false; }
|
|
|
|
manualMessage() { return false }
|
|
|
|
async onActorCreateOwned(actor, item) { }
|
|
|
|
|
2022-09-17 16:07:38 +02:00
|
|
|
code() { return 'sortreserve' }
|
|
|
|
tooltip(sort) { return `${sort.name}, r${sort.system.ptreve}` }
|
2023-11-15 22:14:00 +01:00
|
|
|
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/sort-reserve.svg' }
|
2021-02-11 02:48:27 +01:00
|
|
|
|
2021-02-12 18:31:49 +01:00
|
|
|
createSprite(pixiTMR) {
|
2021-02-12 15:01:10 +01:00
|
|
|
return pixiTMR.sprite(this.code(), {
|
|
|
|
zIndex: tmrTokenZIndex.sort,
|
2024-12-08 18:50:52 +01:00
|
|
|
decallage: pixiTMR.sizes.decallage(-0.6, 0),
|
|
|
|
taille: () => pixiTMR.sizes.half,
|
2021-02-12 15:01:10 +01:00
|
|
|
});
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|
2024-12-08 18:50:52 +01:00
|
|
|
|
2023-12-09 01:04:33 +01:00
|
|
|
tokens(pixiTMR, linkData, coordTMR, type = undefined) {
|
|
|
|
if (TMRUtility.getTMR(coordTMR()).type == 'fleuve') {
|
|
|
|
const tooltip = this.tooltip(linkData)
|
|
|
|
const fleuves = TMRUtility.getListTMR('fleuve')
|
|
|
|
return fleuves.map(f => EffetsDraconiques.sortReserveHumide._createToken(pixiTMR, linkData, () => f.coord, type?? this.code(), tooltip))
|
|
|
|
}
|
|
|
|
return super.tokens(pixiTMR, linkData, coordTMR, type)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export class SortReserveHumide extends SortReserve {
|
|
|
|
code() { return 'sortreservehumide' }
|
|
|
|
tooltip(sort) { return `${sort.name} en fleuve, r${sort.system.ptreve}` }
|
|
|
|
img() { return 'systems/foundryvtt-reve-de-dragon/icons/tmr/sort-reserve-humide.svg' }
|
2021-02-11 02:48:27 +01:00
|
|
|
}
|