Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Ripple. Someone already coded?
Moderator: CCGHQ Admins
Ripple. Someone already coded?
by alexandreonly » 11 Aug 2012, 03:15
I'm asking mainly because i want to code Thrumming Stone to use in my deck of rats.
- alexandreonly
- Posts: 145
- Joined: 04 Jul 2011, 17:27
- Has thanked: 0 time
- Been thanked: 8 times
Re: Ripple. Someone already coded?
by thefiremind » 11 Aug 2012, 09:45
I'm sure it's possible to make because it's very similar to cascade... and it should be easier because it doesn't require to exile the cards and then get them back. I'll have a try.
EDIT: There you go:
I made a quick test and it seems OK.
As I did for cascade, I made a LOL file with the functions, so it's faster to implement the other spells with ripple (not that they are a lot, though
) and we can make adjustments in a single place when needed.
First, you are asked if you want to ripple or not. I didn't include the TEXT_PERMANENT so you'll have to define the localised text for CARD_QUERY_MC_RIPPLE, it should be something like "Do you want to ripple %d?" (the %d will be substituted by 4, this way my code can be even used for custom cards that have a different ripple count).
Then, the cards to reveal are saved in a chest, you look at them and you can choose which ones you want to play.
Note that the played cards will change zone (from library to stack), so they will be automatically deleted from the chest.
Finally, all the cards that are still in the chest are revealed and put on the bottom of the library (no need to reveal the played ones, you see them on the stack). The code could be refined by letting the player choose the order for the bottom of the library, but I think it would be a complication not worth the effort.
Let me know if you find bugs.
EDIT: There you go:
THRUMMING_STONE_124451.zip
- Thrumming stone code, illustration, and LOL file with ripple functions
- (109.98 KiB) Downloaded 234 times
As I did for cascade, I made a LOL file with the functions, so it's faster to implement the other spells with ripple (not that they are a lot, though

First, you are asked if you want to ripple or not. I didn't include the TEXT_PERMANENT so you'll have to define the localised text for CARD_QUERY_MC_RIPPLE, it should be something like "Do you want to ripple %d?" (the %d will be substituted by 4, this way my code can be even used for custom cards that have a different ripple count).
Then, the cards to reveal are saved in a chest, you look at them and you can choose which ones you want to play.
Note that the played cards will change zone (from library to stack), so they will be automatically deleted from the chest.
Finally, all the cards that are still in the chest are revealed and put on the bottom of the library (no need to reveal the played ones, you see them on the stack). The code could be refined by letting the player choose the order for the bottom of the library, but I think it would be a complication not worth the effort.
Let me know if you find bugs.
< Former DotP 2012/2013/2014 modder >
Currently busy with life...
Currently busy with life...
-
thefiremind - Programmer
- Posts: 3515
- Joined: 07 Nov 2011, 10:55
- Has thanked: 118 times
- Been thanked: 722 times
Re: Ripple. Someone already coded?
by alexandreonly » 11 Aug 2012, 16:53
Thanks.thefiremind wrote:I'm sure it's possible to make because it's very similar to cascade... and it should be easier because it doesn't require to exile the cards and then get them back. I'll have a try.
EDIT: There you go:THRUMMING_STONE_124451.zipI made a quick test and it seems OK.
As I did for cascade, I made a LOL file with the functions, so it's faster to implement the other spells with ripple (not that they are a lot, though) and we can make adjustments in a single place when needed.
First, you are asked if you want to ripple or not. I didn't include the TEXT_PERMANENT so you'll have to define the localised text for CARD_QUERY_MC_RIPPLE, it should be something like "Do you want to ripple %d?" (the %d will be substituted by 4, this way my code can be even used for custom cards that have a different ripple count).
Then, the cards to reveal are saved in a chest, you look at them and you can choose which ones you want to play.
Note that the played cards will change zone (from library to stack), so they will be automatically deleted from the chest.
Finally, all the cards that are still in the chest are revealed and put on the bottom of the library (no need to reveal the played ones, you see them on the stack). The code could be refined by letting the player choose the order for the bottom of the library, but I think it would be a complication not worth the effort.
Let me know if you find bugs.
- alexandreonly
- Posts: 145
- Joined: 04 Jul 2011, 17:27
- Has thanked: 0 time
- Been thanked: 8 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest