forked from public/foundryvtt-wh4-lang-fr-fr
Ajout de la commande /voyage et grosse MAJK de la commande /auberge
This commit is contained in:
17
scripts/64aJznxPMUHAuf7F.js
Normal file
17
scripts/64aJznxPMUHAuf7F.js
Normal file
@@ -0,0 +1,17 @@
|
||||
if (this.item.flags.runeOfLuck || this.actor.type != "character") return
|
||||
|
||||
const currentFortune = this.actor.status.fortune.value
|
||||
const runesOfLuck = this.item.effects.contents.filter(e => e.name == this.effect.name)
|
||||
const runeFortune = parseInt(runesOfLuck.length)
|
||||
|
||||
if (args.equipped) {
|
||||
this.item.flags.runeOfLuck = true
|
||||
await this.actor.update({"system.status.fortune.value" : runeFortune + currentFortune})
|
||||
this.script.message(`Points de Chance augmentés de ${currentFortune} à ${runeFortune + currentFortune}.`)
|
||||
}
|
||||
else
|
||||
{
|
||||
this.item.flags.runeOfLuck = true
|
||||
await this.actor.update({"system.status.fortune.value" : Math.max(0, currentFortune - runeFortune)})
|
||||
this.script.message(`Points de Chance réduits à ${Math.max(0, currentFortune - runeFortune)}.`)
|
||||
}
|
||||
Reference in New Issue
Block a user