Hellfish wrote:Ok, got it to work, but A) it's messy and B) I'm not sure it's 100% correct.
what I do is basically propagate a single boolean through the whole chain of functions that handle cost payment, which denotes that the associated SpellAbility should skip the stack. Then I created a counterpart to ComputerUtil.playNoStack() for the humanplayer (GameAction.playSpellAbility_NoStack()), which is used by the wrapperAbility.resolve() in Triggerhandler. The wrapper ability in itself is free and always put on the stack when the trigger goes off, in it's resolve it asks the player if they want to make use of it and has them play any costs (via the messy playSpellAbility_NoStack()). Otherwise the actual ability created by the trigger is put on the stack as an additional entry after the wrapper resolves.
Alright I'm not sure if what you said lines up or not (particularly the additional entry bit)
1) Trigger occurs. Any targets occur now.
2) Trigger starts resolving. If it's Optional the player says yes or no. If there is any Cost, this occurs now.
3) Trigger continues resolving.
a) If player chooses no or did not pay the cost properly, the ability ends, not resolving the inner ability.
b) Everything has been paid/chosen properly. Resolve the inner ability (don't place it on the stack).
4) Trigger finishes resolving.
This definitely sounds like a mess. We'll have to build some type of structure within the Trigger that handles this better.