Closed xyzzy42 closed 1 year ago
If a choice set is skipped, all other rule elements on the item are set to be ignored. You can override this by adding "allowNoSelection": true
to the choice set.
Ok, so then the bug is the opposite, but it's more complex. If there are multiple ChoiceSet REs and one of them is skipped, non-IWR REs are not ignored, but IWR are.
Example:
{"key":"ChoiceSet","choices":[{"label":"foo","value":"foo"},{"label":"bar","value":"bar"}],"flag":"test1"}
{"key":"ChoiceSet","choices":[{"label":"foo","value":"foo"},{"label":"bar","value":"bar"}],"predicate":["nope"],"flag":"test2"}
{"key": "GrantItem","uuid": "Compendium.pf2e.conditionitems.i3OJZU2nk64Df3xm"}
{"key":"Immunity","type":"bleed"}
This does grant Clumsy, but doesn't do the IWR RE.
Anything that runs during data preparation is forced to be ignored.
So what's going on is is the constructor of a ChoiceSet will set all REs to ignored if no selection is made. But then in preCreate
all ChoiceSets get processed again and it will set all REs to unignored if a selection is made. If there are multiple ChoiceSet REs, then all REs will go from ignored, to unignored, to ignored.
If an effect has a ChoiceSet RE that is skipped, e.g. because it has a false predicate, it will cause any IWR REs that follow it to failed to be applied. Other REs such as GrantItem and FlatModifier still work as expected when the follow non-activated ChoiceSet REs. The IWR RE still works if it precedes the ChoiceSet. Example:
Change the trait to one that does exist and the Weakness RE works again.