Cheat Sheet ‐ Activation Conditions - MotoMoto1234/Midi-Wiki GitHub Wiki
To find stuff to use select an actors token and type _token.actor.getRollData()
in the console
You can also reference anything in midi's workflow too, but to get the workflow data you need to run a console.log(workflow) in an on use macro and study the output in console.
Key or legend:
&& //this means AND
|| //this means OR
?? //If the first is null, undefined, or false, then do the second instead
! //this means NOT or opposite
= //this is usually in macros not activation conditions cause it means something is assigned
== //this means EQUAL TO
=== //this means exactly equal to, really equal to
< //less than
<= //equal to or less than
> //greater than
>= //equal to or greater than
If you are using it in a reaction effect condition box, they must lead with reaction === ...
Examples:
raceOrType.includes("undead")
//true if target is undead(this one can't be source/target, its always target implied)
Any of the following can have "target." or "source."
!target.effects.some(eff=>eff.name.toLowerCase().includes('inspiration'))
//true if target does not have an effect with the word inspiration in it, NEVER USE THIS FOR CONDITIONS
!target.appliedEffects.some(eff=>eff.name.toLowerCase().includes('inspiration'))
//For use in dnd5e 3.0+ or midiqol 11.4.0+, NEVER USE THIS FOR CONDITIONS
!target.statuses.has('incapacitated')
//on dae version 11.3.46+ this should be the only proper way to check a condition due to a nuanced change to statuses in dnd5e
target.abilities.str.value >= 22
//true if strength value is higher than or equal to 22
target.attributes.hp.value < target.attributes.hp.max/2
//true if current hp is lower than 1/2 max
effects.some(eff=>eff.name==="Fighting Style: Defense")
//this returns true if the actor has an AE named Fighting Style: Defense.
flags["tidy5e-sheet"].eyes === "Green"
//this one checks if the actor has a flag under tidy-5e sheet scope for eyes entry being Green :D
target.attributes.hp.value !== target.attributes.hp.max
//true if current hp is not equal to max hp.
target.effects.some(e=>e.name == 'EffectNameHere' && !e.disabled)
//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
target.appliedEffects.some((e) => e.name == effectName)
//only works in dnd5e 3.0+ and midiqol 11.4.0+(also disabled doesn't need to be checked against in 3.0 dnd5e so its omitted)
target.details.type?.value === "undead" || target.details.race.toLocaleLowerCase().includes("undead")
//first for NPCs and second for PCs
["fiend", "undead"].includes(raceOrType)
//true if target is undead or fiend
["lg", "med", "sm", "tiny"].includes(target.traits.size)
//true if large, medium, small, or tiny
item.name == 'something'
//true if this item is present
//its better to try to use base weapon or type/subtype because of localization issues with name matching fyi
workflow.advantage
//true if the workflow's attack had advantage
Reaction conditions.
if present the reaction condition will trigger if the reaction fires or not.
If a reaction condition is NOT present on an item then the existing reaction action type will be used to determine triggering.
If a reaction condition is present the condition returning true will cause the item to be prompted as a reaction option. (this also works for magic-itms-2 items).
There are now many options for triggering reactions:
reactionTargeted - not yet
reaction pre attack (preAttack)
reactionAttacked (isAttacked)
reactionMissed - (isMissed)
reactionHit (isHit)
reactionDamaged (isDamaged)
reactionNotDamaged - not yet
reactionSave (isSave)
reactionSaveSuccess (isSaveSuccess)
reactionSaveFailure (isSaveFailure)
reactionMoved - not yet (will be after 3rd party reactions)
reactionItemRolled - not yet
When evaluating a reaction condition you can test reaction === "isHit" for example to present the reaction option during the isHit reaction phase.