PNJ & Creatures
This commit is contained in:
parent
0a030460e4
commit
4762dc33ac
@ -529,13 +529,17 @@ export class MournbladeActor extends Actor {
|
||||
if (arme.system.nbressources && Number(arme.system.nbressources) > 0) {
|
||||
if (this.type == "creature") {
|
||||
let ressources = duplicate(this.system.ressources)
|
||||
ressources.value -= arme.system.nbressources
|
||||
this.update({ 'system.ressources': ressources })
|
||||
ChatMessage.create({
|
||||
content: "L'utilisation de la capacité/arme a dépensé " + arme.system.nbressources + " ressources.",
|
||||
whisper: game.user._id,
|
||||
user: game.user._id
|
||||
});
|
||||
if ( Number(ressources.value) >= Number(arme.system.nbressources)) {
|
||||
ressources.value -= arme.system.nbressources
|
||||
this.update({ 'system.ressources': ressources })
|
||||
ChatMessage.create({
|
||||
content: "L'utilisation de la capacité/arme a dépensé " + arme.system.nbressources + " ressources.",
|
||||
whisper: game.user._id,
|
||||
user: game.user._id
|
||||
});
|
||||
} else {
|
||||
ui.notifications.warn("Points de ressources insuffisants.")
|
||||
}
|
||||
} else {
|
||||
ui.notifications.warn("Les ressources ne sont pas disponibles pour les personnages.")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user