Page 1 of 1
Slowtrips

Posted:
07 Nov 2010, 17:12
by Sloth
I've added the keyword "Draw a card at the beginning of the next turn's upkeep." (Known as Slowtrips back in the days).
It uses the player class to store the number of cards to draw next turn. (I hope this is the right place).
They are delayed abilities and thus don't use the stack (I hope someone can confirm that this is correct).
Re: Slowtrips

Posted:
07 Nov 2010, 17:58
by Chris H.
Thank you for the new keyword, Sloth.
Re: Slowtrips

Posted:
07 Nov 2010, 20:35
by lord of 13
The abilities do use the stack... In judge vernacular, it's called a "delayed trigger", much like the delayed trigger on Ball Lightning. The effects trigger (for slowtrips) at the beginning of the next upkeep, or for Ball Lightning, at the beginning of the next end step.
Re: Slowtrips

Posted:
07 Nov 2010, 20:58
by Sloth
lord of 13 wrote:The abilities do use the stack... In judge vernacular, it's called a "delayed trigger", much like the delayed trigger on Ball Lightning. The effects trigger (for slowtrips) at the beginning of the next upkeep, or for Ball Lightning, at the beginning of the next end step.
Uh, I see. Thank you lord of 13. This is bad though, since the effect has to remember from which card it came from. It will get very complicated. I don't know if I'm able to get this right. Has anyone a good idea how to handle this?
Re: Slowtrips

Posted:
07 Nov 2010, 21:07
by Hellfish
The method I used to code Mana Drain could prolly be used, though that's probably not great programming practice. I just kept a static CardList for each player in whatever class was handy for the source cards. An upkeep_X method in GameActionUtil with accompanying CardLists could work?
EDIT: CardLists,not ArrayLists. Though ArrayList<Card> would work too

Re: Slowtrips

Posted:
07 Nov 2010, 21:31
by Sloth
Hellfish wrote:The method I used to code Mana Drain could prolly be used, though that's probably not great programming practice. I just kept a static CardList for each player in whatever class was handy for the source cards. An upkeep_X method in GameActionUtil with accompanying CardLists could work?
EDIT: CardLists,not ArrayLists. Though ArrayList<Card> would work too

Sounds not too bad. I will look at your Mana Drain code tomorrow. Thanks Hellfish.
Re: Slowtrips

Posted:
07 Nov 2010, 21:33
by lord of 13
What about using events to register delayed triggers for each phase/step change?
Re: Slowtrips

Posted:
08 Nov 2010, 00:15
by friarsol
I don't think we need to have one for each phase/step change. We can just create a delay trigger queue, and attach when the trigger happens.
When those triggers could go on the stack, just check the queue for anything appropriate, and add each one on the stack.
Re: Slowtrips

Posted:
08 Nov 2010, 01:49
by lord of 13
I meant like (in C#-pseudocode)
EventHandler<StepChangeEventArgs> stepChange;
And StepChangeEventArgs has three fields: object sender, TurnStep prev, TurnStep current
Where the sender can be a Card (the source of the trigger) or a Plane card or anything else, for that matter.