#effect edit
1 messages · Page 1 of 1 (latest)
Banish you!
@scarlet musk @winged jasper
@scarlet musk duplicating nothing won't help you get something ^^
Got it
I was originally under the impression your array had something to begin with
const {tokenUuid, actorId} = args[0];
const tactor = tokenUuid ? await fromUuid(tokenUuid) : game.actors.get(actorId);
const itemName = "Reactive Resistance";
const options = ["Acid", "Cold", "Fire", "Lightning", "Poison"].reduce((acc, e) => {
const slug = e.slugify();
return acc + `<option value="${slug}">${e}</option>`;
}, ``);
new Dialog({
title: 'Choose a damage type',
content: `
<form>
<div class="form-group">
<label for="element">Pick type:</label>
<div class="form-fields">
<select id="element">${options}</select>
</div>
</div>
</form>`,
buttons: {
yes: {
icon: '<i class="fas fa-poo-storm"></i>',
label: 'Select',
callback: async (html) => {
const element = html[0].querySelector('#element').value;
const effect = tactor.effects.find(i => i.data.label === itemName);
const changes = [{
key: "data.traits.dr.value",
mode: CONST.ACTIVE_EFFECT_MODES.ADD,
value: element
}];
await effect.update({changes});
}
}
}
}).render(true);
Ah, you added the array at the top.
Is the effect called "Reactive Resistance Resistance"? 🤔
I thought that line referred to the resistance type?
Right
But itsm name itself is Reactive Resistance
So the result is
Reactive Resistance Resistance
On phone so please forgive the missing quotationmarks on my end
Sooooo is the effect's label that or should the second Resistance be cut?
Cutting it. You can't stop me.
My god, there's no div class="form-fields">
heresy
Okay, it's done
💩
Testing time!