Page 1 of 1

Ripple. Someone already coded?

PostPosted: 11 Aug 2012, 03:15
by alexandreonly
I'm asking mainly because i want to code Thrumming Stone to use in my deck of rats.

Re: Ripple. Someone already coded?

PostPosted: 11 Aug 2012, 09:45
by thefiremind
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.zip
Thrumming stone code, illustration, and LOL file with ripple functions
(109.98 KiB) Downloaded 238 times
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 :P) 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.

Re: Ripple. Someone already coded?

PostPosted: 11 Aug 2012, 16:53
by alexandreonly
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.zip
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 :P) 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.
Thanks.