phylll / mychs-macro-magic

A simple, sane, and friendly little scripting language for your Roll20 macros.
MIT License
0 stars 0 forks source link

Persistent attack/defense effects do not go away if no attacks/defenses are made #79

Open phylll opened 2 months ago

phylll commented 2 months ago

Attack/defense effects persist until the next attack and defense is attempted. Critical defense success/80 produces both effects, yet if the victim is not attacked, there is no reason to call defense, and if the player understands what happened, there is no reason to attack. Better convert into a round effect?! But what if there are several attacks b/c the character is faster?

phylll commented 2 months ago

Could the scripts treat action effects in such a way that if the action effect is not being cancelled for an entire round, it gets cancelled as if it were a round effect?

The blocker for doing this in the first place was that the script cannot know at what point in a given combat round an action effect originates. Consider the following examples:

Sequence Effect Problem Solution?
Alric (action rank 99) suffers a critical attack failure No defense or no attack for one opportunity If Alric is not being successfully attacked this round, the effect is supposed to disappear as if it were a round effect before their next turn "Remove any action effects at round's end" works for this special case, but not for anybody ranked #2 and lower in the combat turn order
Diarmid (action rank 67) suffers a critical attack failure late in the action round No defense or no attack for one opportunity This action effect must not disappear at the end of the round, but rather persist into the next round. But if Diarmid is not successfully attacked before their next turn (inside, but before the end of the following round), it needs to be gone since Diarmid is allowed to defend themselves again after their next turn, or attack during their next turn "Remove any action effect at beginning of turn": At the start of a specific character's turn, we have no script being called regardless of the character's choice or ability to attack/defend, but there are only two cases: either they do attack (which is only possible inside or after, in case of being sped up by magic, their turn) or they don't, which can be caught in the end-of-round script.
Spookie gets hit with a critical right before their own turn No defense or no attack for one opportunity "Remove any action effect at beginning of a character's own turn" would kill the effect too early "Remove any action effect at beginning of turn if a change of round has come in between"
Superfast Alric suffers not a critical attack failure during their turn but a critical defense failure or an opponent's critical attack success at the very end of the combat round, or a critical attack failure during an additional attack (as someone with two attacks per round) No defense or no attack for one opportunity If the effect gets canceled at the start of their next turn because (a) a round change has occurred and (b) no opportunity to attack/defend has come in between, it still gets canceled too early. In this case, two round changes would be needed, or some sort of counter by the number of turns in a round... a counter that would need to be different if the character is so fast (magically sped up?) that their recovery from the critical effect should also be faster than others (so only half a round of penalty) or not...

So, rather make an easily accessible "consume this effect" function that (if there is just one effect) just cancels it, or shows all effects with cancel buttons (showPersistentEffects.mmm does the latter already but isn't conveniently available). Extra token?