2024-05-16 17:57:51 +02:00
|
|
|
let symptoms = {
|
|
|
|
convulsions : "Convulsions",
|
|
|
|
coughsandsneezes : "Coughs and Sneezes",
|
|
|
|
fever : "Fever",
|
|
|
|
flux : "Flux",
|
2024-05-17 01:07:37 +02:00
|
|
|
nausea : "Nausée"
|
2024-05-16 17:57:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
let roll = await (new Roll(`max(0, 1d10 - ${this.actor.characteristics.wp.bonus})`).roll())
|
|
|
|
roll.toMessage(this.script.getChatData());
|
|
|
|
|
2024-05-17 01:07:37 +02:00
|
|
|
let choices = await ItemDialog.create(ItemDialog.objectToArray(symptoms), roll.total, "Choisissez les Symptomes");
|
2024-05-16 17:57:51 +02:00
|
|
|
|
|
|
|
if (choices.length)
|
|
|
|
{
|
|
|
|
let symptomEffects = duplicate(game.wfrp4e.config.symptomEffects)
|
|
|
|
let added = []
|
|
|
|
for(let choice of choices)
|
|
|
|
{
|
|
|
|
let symptom = symptomEffects[choice.id];
|
|
|
|
symptom.origin = this.effect.uuid;
|
|
|
|
added.push(symptom);
|
|
|
|
}
|
|
|
|
this.actor.createEmbeddedDocuments("ActiveEffect", added)
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
this.effect.delete();
|
|
|
|
}
|
|
|
|
|