MotoMoto1234 / Midi-Wiki

13 stars 0 forks source link

[Edit Suggestion] Effect Active Syntax #2

Closed GhostwheelX closed 10 months ago

GhostwheelX commented 10 months ago
target.effects.some(eff=>eff.getFlag("core","statusId") === CONFIG.statusEffects.find(eff=>eff.label === CONFIG.DND5E.conditionTypes.blinded).id) 
//true if the target has the Blinded Status Effect, no matter which module you use to set it up. ~ I think it should work :D 

For this syntax, Bugbear said that the correct syntax going forward is effects.some(e=>e.name == 'EffectNameHere'). Perhaps we could change that?

Furthermore, in the same bit, checking if an effect is both on a character and active, the code is effects.some(e=>e.name == 'EffectNameHere' && !e.disabled). Could that be added to the wiki?

MotoMoto1234 commented 10 months ago

Fwiw, I was using the simpler example on the page mostly. Also the old one had label which is bad and would throw dep warnings. I've edited that entry to be just your suggested version. Thank you for your input!