forked from public/foundryvtt-reve-de-dragon
Utilisation du token.name au lieu d'actor.name
Pour permettre de masquer les informations sur les PNJs secondaires, et ne pas dévoiler le nom de l'acteur
This commit is contained in:
@ -78,6 +78,13 @@ export class RdDBaseActor extends Actor {
|
||||
return game.actors.get(actorId)
|
||||
}
|
||||
|
||||
getAlias() {
|
||||
if (this.token?.name != null && this.token != this.prototypeToken) {
|
||||
return this.token.name
|
||||
}
|
||||
return this.name
|
||||
}
|
||||
|
||||
isPersonnageJoueur() { return false }
|
||||
|
||||
static extractActorMin = (actor) => { return { id: actor?.id, type: actor?.type, name: actor?.name, img: actor?.img }; };
|
||||
@ -367,7 +374,7 @@ export class RdDBaseActor extends Actor {
|
||||
chatAchatItem.quantiteTotal = quantite;
|
||||
ChatMessage.create({
|
||||
user: achat.userId,
|
||||
speaker: { alias: (acheteur ?? vendeur).name },
|
||||
speaker: { alias: (acheteur ?? vendeur).getAlias() },
|
||||
whisper: ChatUtility.getOwners(this),
|
||||
content: await renderTemplate('systems/foundryvtt-reve-de-dragon/templates/chat-achat-item.html', chatAchatItem)
|
||||
});
|
||||
@ -683,7 +690,7 @@ export class RdDBaseActor extends Actor {
|
||||
type: this.type,
|
||||
img: this.img,
|
||||
pack: this.pack,
|
||||
name: this.name,
|
||||
name: this.getAlias(),
|
||||
system: { description: this.system.description }
|
||||
}
|
||||
renderTemplate('systems/foundryvtt-reve-de-dragon/templates/post-actor.html', chatData)
|
||||
@ -691,10 +698,10 @@ export class RdDBaseActor extends Actor {
|
||||
}
|
||||
|
||||
actionImpossible(action) {
|
||||
ui.notifications.info(`${this.name} ne peut pas faire cette action: ${action}`)
|
||||
ui.notifications.info(`${this.getAlias()} ne peut pas faire cette action: ${action}`)
|
||||
|
||||
}
|
||||
async roll() { this.actionImpossible("jet de caractéristiques") }
|
||||
|
||||
async jetEthylisme() { this.actionImpossible("jet d'éthylisme") }
|
||||
async rollAppelChance() { this.actionImpossible("appel à la chance") }
|
||||
async jetDeMoral() { this.actionImpossible("jet de moral") }
|
||||
|
Reference in New Issue
Block a user