simplifications sur EffetsDraconiques
ajout de methode tmrLabel pour les tooltips ajout de l'item en paramètre aux ajouts/suppressions ajout d'un 'sourceId' pour les casetmr liées à un souffle/queue/tête
This commit is contained in:
@ -14,25 +14,25 @@ export class PresentCites extends Draconique {
|
||||
async onActorCreateOwned(actor, item) { await this._ajouterPresents(actor); }
|
||||
|
||||
code() { return 'present-cites' }
|
||||
tooltip(linkData) { return `La ${TMRUtility.getTMR(linkData.data.coord).label} a un présent` }
|
||||
tooltip(linkData) { return `La ${this.tmrLabel(linkData)} a un présent` }
|
||||
img() { return 'systems/foundryvtt-reve-de-dragon/icons/svg/gift.svg' }
|
||||
|
||||
_createSprite(pixiTMR) {
|
||||
return pixiTMR.sprite(this.code(),
|
||||
{
|
||||
color: tmrColors.tetes, alpha: 0.7, taille: tmrConstants.third, decallage:tmrConstants.topRight
|
||||
color: tmrColors.tetes, alpha: 0.7, taille: tmrConstants.third, decallage: tmrConstants.topRight
|
||||
});
|
||||
}
|
||||
|
||||
async _ajouterPresents(actor) {
|
||||
let existants = actor.data.items.filter(it => this.isCase(it)).map(it => it.data.coord);
|
||||
if (existants.length >0 ) {
|
||||
if (existants.length > 0) {
|
||||
ChatMessage.create({
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user),
|
||||
whisper: ChatUtility.getWhisperRecipientsAndGMs(game.user.name),
|
||||
content: "Vous avez encore des présents dans des cités, vous devrez tirer une autre tête pour remplacer celle ci!"
|
||||
})
|
||||
}
|
||||
else{
|
||||
else {
|
||||
let cites = TMRUtility.filterTMR(it => it.type == 'cite');
|
||||
for (let tmr of cites) {
|
||||
await this.createCaseTmr(actor, 'Présent: ' + tmr.label, tmr);
|
||||
|
Reference in New Issue
Block a user