mysurvive / pf2e-thaum-vuln

Improvement for Thaumaturge Exploit Vulnerability
MIT License
10 stars 11 forks source link

Fix EV effect predicates and Breached Defenses + Esoteric Warden #136

Closed xyzzy42 closed 4 months ago

xyzzy42 commented 4 months ago

The predicates on the PA and MW effects, for adding magical trait, work as is. The code to change them wasn't needed and it doesn't get the EV target effect slug the same as the actual effect will use, so it didn't work anyway. The BD effect is missing the token mark, but the predicate code in createBreachedDefenses() has the same slug name issues and wasn't working. It also created a predicate that wasn't an array, which produces validation warnings.

Since createBreachedDefenses() makes the changes to the BD effect rule itself, the rule editing code in createEffectOnActor() was just duplicating that, and the code in createEffectOnActor can be removed. Now createBreachedDefenses() doesn't need to return the predicate or rule anymore.

There was a bug in the BD case: the EWPredicate value wasn't set and the EW code wouldn't trigger.

Note, I didn't fix the BD effect to set a TokenMark, like PA and MW do.