My custom sheet for my playtest has stacking advantage. My issue is there are certain rolls that I'd like to have start with either 1 advantage or 1 disadvantage. Like D&D 5e, they cancel each other out, so I think I'd need to have a custom variable for these, but I'm not sure how to pull it off. Currently the button, looks like this with you select advantage/disadvantage and the number of them. You use 0 for neither advantage or disadvantage. <span>
<input type="radio" class="toggle-center" name="attr_advantagetoggle" checked="checked" value="adv"><span >ADVANTAGE</span>
<input type="text" class="num_values advDisAdvDice" value="0" name="attr_advDisAdvDice">
<input type="radio" class="toggle-right" name="attr_advantagetoggle" value="disadv"><span >DISADVANTAGE</span>
</span> My rolls all look a bit like this, using two variables, advantage dice ("adDice") to determine how many additional dice to roll and keep lowest/highest ("klkh") to determine advantage or disadvantage. {{roll=[[(@{wpnDice}@{adDice})d6@{klkh}@{wpnDice}+@{wpnBonus}]]}} The info that sets this looks like this: on("change:advantagetoggle change:advDisAdvDice", function() {
getAttrs(["advantagetoggle","advDisAdvDice"], function(values) {
console.log("xxx: "+values.advantagetoggle);
let toggle = values.advantagetoggle;
let dice=" ";
let klkh=" ";
if (toggle=="adv"){
dice="+"+values.advDisAdvDice;
klkh="kh";
}
else if (toggle=="disadv") {
dice="+"+values.advDisAdvDice;
klkh="kl";
}
console.log("dice: "+dice);
console.log("klkh: "+klkh);
setAttrs({adDice:dice,klkh:klkh});
});
}); My question is if anyone can help me establish a way to set rolls that start with either 1 advantage or disadvantage. For instance a roll with 1 disadvantage would have -1 advantage when advantage > 0, switch to disadvantage and add 1 when at 0, or +1 when already on disadvantage. Any assistance is greatly appreciated. I'm thinking there might be a simpler way to do this whole process. Maybe a pop up dialogue box instead of a toggle for the whole sheet? Maybe using negative numbers as disadvantage instead of the toggle?