Fix async rolls

This commit is contained in:
2022-04-12 00:17:26 +02:00
parent 283712e15a
commit 41b09b956b
5 changed files with 10 additions and 10 deletions

View File

@ -557,7 +557,7 @@
"effectApplication": "actor",
"effectTrigger": "oneTime",
"preventDuplicateEffects": false,
"script": "fromUuid(\"Compendium.wfrp4e-core.injuries.fBcZhOBn8IpoVqQ1\").then(injury => {\n let teeth = new Roll(\"1d10\").roll().total\n ChatMessage.create({content : `<b>${this.actor.data.token.name}</b> a perdu ${teeth} dents`, speaker : {alias: this.effect.label}})\ninjury.location.value = `${teeth} ${injury.location.value}`\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury.data)\n})"
"script": "fromUuid(\"Compendium.wfrp4e-core.injuries.fBcZhOBn8IpoVqQ1\").then(injury => {\n let teeth = new Roll(\"1d10\").roll({async: false}).total\n ChatMessage.create({content : `<b>${this.actor.data.token.name}</b> a perdu ${teeth} dents`, speaker : {alias: this.effect.label}})\ninjury.location.value = `${teeth} ${injury.location.value}`\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury.data)\n})"
}
},
"icon": "modules/wfrp4e-core/icons/injuries/head.png",
@ -930,7 +930,7 @@
"wfrp4e": {
"effectApplication": "actor",
"effectTrigger": "oneTime",
"script": "args.actor.addCondition(\"stunned\", new Roll(\"1d10\").roll().total)"
"script": "args.actor.addCondition(\"stunned\", new Roll(\"1d10\").roll({async: false}).total)"
}
},
"icon": "modules/wfrp4e-core/icons/injuries/head.png",
@ -2640,7 +2640,7 @@
"effectApplication": "actor",
"effectTrigger": "oneTime",
"preventDuplicateEffects": false,
"script": "fromUuid(\"Compendium.wfrp4e-core.injuries.fBcZhOBn8IpoVqQ1\").then(injury => {\n let teeth = new Roll(\"1d10\").roll().total\n ChatMessage.create({content : `<b>${this.actor.data.token.name}</b> loses ${teeth} teeth`, speaker : {alias: this.effect.label}})\ninjury.location.value = `${teeth} ${injury.location.value}`\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury.data)\n})\n\nfromUuid(\"Compendium.wfrp4e-core.injuries.rkJA1DlK51QuRlJy\").then(injury => {\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury)\n})\n\nfromUuid(\"Compendium.wfrp4e-core.injuries.hCadFsTRvLN9faaY\").then(injury => {\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury)\n})\n\n\nif (args.actor.isOwner)\n args.actor.setupSkill(\"Résistance\").then(setupData => {\n args.actor.basicTest(setupData).then(test => \n {\n if (test.result.outcome == \"failure\")\n args.actor.addCondition(\"unconscious\")\n })\n })"
"script": "fromUuid(\"Compendium.wfrp4e-core.injuries.fBcZhOBn8IpoVqQ1\").then(injury => {\n let teeth = new Roll(\"1d10\").roll({async: false}).total\n ChatMessage.create({content : `<b>${this.actor.data.token.name}</b> loses ${teeth} teeth`, speaker : {alias: this.effect.label}})\ninjury.location.value = `${teeth} ${injury.location.value}`\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury.data)\n})\n\nfromUuid(\"Compendium.wfrp4e-core.injuries.rkJA1DlK51QuRlJy\").then(injury => {\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury)\n})\n\nfromUuid(\"Compendium.wfrp4e-core.injuries.hCadFsTRvLN9faaY\").then(injury => {\n args.actor.createEmbeddedEntity(\"OwnedItem\", injury)\n})\n\n\nif (args.actor.isOwner)\n args.actor.setupSkill(\"Résistance\").then(setupData => {\n args.actor.basicTest(setupData).then(test => \n {\n if (test.result.outcome == \"failure\")\n args.actor.addCondition(\"unconscious\")\n })\n })"
}
},
"icon": "modules/wfrp4e-core/icons/injuries/head.png",