forge icon indicating copy to clipboard operation
forge copied to clipboard

Differ Between Control Untap Haste Effects

Open Hanmac opened this issue 3 years ago • 2 comments

Most Effects does "Gain Control, do Untap, Gain Haste"

very few like "Blind with Anger" does Untap before Gain Control.

This would matter under which control the creature does untap for possible trigger.

Hanmac avatar Jul 20 '22 13:07 Hanmac

The bigger problem here is even if untap() gets done before controller change in ControlGainEffect because of frozen stack a WaitingTrigger is created.

That means when after resolving TriggerHandler adds trigger to stack it still uses new host controller for it.

We might have to store controller in TriggerWaiting somehow or force it with runWaitingTriggers() directly afterwards but I'm not sure that's a good idea?

tool4ever avatar Oct 14 '22 08:10 tool4ever

i would need to debug it

Hanmac avatar Oct 14 '22 09:10 Hanmac

This issue has not been updated in a while and has now been marked as stale. Stale messages will be auto closed.

github-actions[bot] avatar Jun 18 '23 09:06 github-actions[bot]

If we remove the param and script it with extra effect either before or after ControlGain it might be cleaner without engine workarounds?

tool4ever avatar Jun 18 '23 10:06 tool4ever

If we remove the param and script it with extra effect either before or after ControlGain it might be cleaner without engine workarounds?

technically yes, but it would make AI way more difficult

i would prefer if we have a parameter for UntapBefore and UntapAfter ?

wouldn't your idea also has the problem with waiting triggers?

Hanmac avatar Jun 18 '23 10:06 Hanmac

Currently AbilityUtils.resolveSubAbilities should try and fill the WaitingTrigger from the previous events with the currently available ones

Would have to test it handles this interaction correctly though

tool4ever avatar Jun 18 '23 10:06 tool4ever

Currently AbilityUtils.resolveSubAbilities should try and fill the WaitingTrigger from the previous events with the currently available ones

Would have to test it handles this interaction correctly though

your problem was that while the waiting trigger are filled, when the trigger finally going to resolve and are put on the stack, the untap trigger might happen for the wrong controller

i think this might also be the problem if the cards were using extra script lines, because it isn't the problem of the effect, but the bigger problem of the TriggerHandler

Hanmac avatar Jun 18 '23 10:06 Hanmac

@tool4ever @Northmoc while touching GainControl Effect, we might look into this issue again for Untap Trigger

Hanmac avatar Nov 14 '23 15:11 Hanmac

I don't have a better idea besides refactoring such scripts into UntapEffect -> ControlGainEffect and storing the current controller while running collectTriggerForWaiting

tool4ever avatar Nov 14 '23 23:11 tool4ever

@tool4ever what we could do is use LKI objects of the Trigger so it keeps the current Controller

Hanmac avatar Nov 15 '23 08:11 Hanmac