Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk
Newb wants to make Doubling Season work, Here's my idea
Moderator: CCGHQ Admins
Newb wants to make Doubling Season work, Here's my idea
by zanemerrick » 12 Apr 2011, 08:52
The past couple of days now I've been reading up on a lot of the goings on at this board and decided that this is definitely something I'd like to be involved with. Keep up all the great work! Also, sorry for the length on this.
That being said, I'm an extreme newb when it comes to coding for this stuff, but after fooling around with it a bit, as well as going through a few tutorials I found here, I think I may have found a way to get Doubling Season to work properly...sort of. While I'm not sure if anyone has tried (or even cares to), I figured I could get lucky and find someone to help me out and get this card into my game
Focusing on just the first triggered ability for now (the token doubling):
I couldn't find anything in all the files for something like: <TRIGGER value="COMES_INTO_PLAY">return TokenYouControl() </TRIGGER> and correct me if I'm wrong please (again, I'm new to this), but I figured that it should be easy enough to code "TokenYouControl" into the functions. The biggest issue I was having was to come up with something that would actually double the tokens created. Then it hit me to try setting it up somewhat like so:
Say you have 2 Doubling Season's on the battlefield. You create a token. Doubling Season 1 triggers. First thing it should do is to check to see if any other Doubling Season's under your control have triggered. If yes, then do nothing (bear with me). If no, then move on to the next check. The next check should be to see how many Doubling Season's are under your control. If 1, create 1 token of same type(for a total of 2). If 2, create 3 tokens (for a total of 4). If 3, Create 7 tokens. And finally, if 4, create 15. When Doubling Season 2 triggers, it sees that the first one triggered already and therefore does nothing. All this checking is a shortcut around the "doubling" effect (or the long way, again new to this and it's the simplest way I could think of).
So I definitely could use some pointers on how to even start all of that craziness, even if it's just a suggestion to look at some other cards with similar "checks" to base it off of. The part I really can't wrap my head around is how to get the card to produce a token of the same type as the triggering token. As a crappy shortcut around that, I've just been thinking of making it produce specific tokens for the deck I want to put them in, but I would much rather have it work for any deck.
There you have it! Still need to get the second doubling effect (the counters) as well, but that should be a piece of cake after this, right? Please let me know what I can do, what I've done wrong (or can't be done in a way I suggested), or help me brainstorm. Much Appreciation for reading this entire thing
That being said, I'm an extreme newb when it comes to coding for this stuff, but after fooling around with it a bit, as well as going through a few tutorials I found here, I think I may have found a way to get Doubling Season to work properly...sort of. While I'm not sure if anyone has tried (or even cares to), I figured I could get lucky and find someone to help me out and get this card into my game

Focusing on just the first triggered ability for now (the token doubling):
I couldn't find anything in all the files for something like: <TRIGGER value="COMES_INTO_PLAY">return TokenYouControl() </TRIGGER> and correct me if I'm wrong please (again, I'm new to this), but I figured that it should be easy enough to code "TokenYouControl" into the functions. The biggest issue I was having was to come up with something that would actually double the tokens created. Then it hit me to try setting it up somewhat like so:
Say you have 2 Doubling Season's on the battlefield. You create a token. Doubling Season 1 triggers. First thing it should do is to check to see if any other Doubling Season's under your control have triggered. If yes, then do nothing (bear with me). If no, then move on to the next check. The next check should be to see how many Doubling Season's are under your control. If 1, create 1 token of same type(for a total of 2). If 2, create 3 tokens (for a total of 4). If 3, Create 7 tokens. And finally, if 4, create 15. When Doubling Season 2 triggers, it sees that the first one triggered already and therefore does nothing. All this checking is a shortcut around the "doubling" effect (or the long way, again new to this and it's the simplest way I could think of).
So I definitely could use some pointers on how to even start all of that craziness, even if it's just a suggestion to look at some other cards with similar "checks" to base it off of. The part I really can't wrap my head around is how to get the card to produce a token of the same type as the triggering token. As a crappy shortcut around that, I've just been thinking of making it produce specific tokens for the deck I want to put them in, but I would much rather have it work for any deck.
There you have it! Still need to get the second doubling effect (the counters) as well, but that should be a piece of cake after this, right? Please let me know what I can do, what I've done wrong (or can't be done in a way I suggested), or help me brainstorm. Much Appreciation for reading this entire thing

- zanemerrick
- Posts: 6
- Joined: 12 Apr 2011, 08:10
- Has thanked: 0 time
- Been thanked: 0 time
Re: Newb wants to make Doubling Season work, Here's my idea
by Eglin » 17 Mar 2012, 07:46
You're on the right track, but the logic for spawning the tokens doesn't need to be so convoluted. It's easy enough to simply count the number of doubling seasons in play and spawn the appropriate number of tokens. Storing a pointer to each of the tokens you've created ensures you don't trigger recursively on them coming into play.
The harder part is handling counters. As far as I can tell, nobody knows how to gracefully determine what kind of counters have changed. It /may/ be possible to manually track the state of every counter on every card, such that you can determine what exactly has changed when the counterschanged trigger fires, but it sure seems like a lot of work.
The harder part is handling counters. As far as I can tell, nobody knows how to gracefully determine what kind of counters have changed. It /may/ be possible to manually track the state of every counter on every card, such that you can determine what exactly has changed when the counterschanged trigger fires, but it sure seems like a lot of work.
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: Bing [Bot] and 0 guests


