Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Volrath's Laboratory Token
Moderator: CCGHQ Admins
Volrath's Laboratory Token
by migookman » 01 Nov 2016, 15:26
Would it be possible to create a token for Volrath's Laboratory that creates a token based on color and creature type that is chosen? Maybe would look something like:
TOKEN_S_C_2_2_S_CW_1
TOKEN_S_C_2_2_S_CW_1
Re: Volrath's Laboratory Token
by Xander9009 » 01 Nov 2016, 19:41
Given that it needs to enter as the creature type and color, I'm not sure. However, there are three ways I can think of to make it work. Not sure if they would, but maybe worth a shot.
1: Simple way, store the token in a data chest, and then grant the chosen creature type and color to that token. I have my doubts this would work.
2: Complicated way, make a DuelDC or PlayerDC chest for Volrath's Laboratory. In that chest, make a new subchest containing nothing in 0, the creature type in 1, and the color in 2. The token would have a constant CA which finds the first unclaimed chest (empty register 0), claims it (sets register 0 to itself), and uses those values permanently. I'm not certain how to fix this regarding copying the token or effects such as Doubling Season.
3: The tedious way, there are 1247 creature types and 5 colors. Make 6235 tokens, and programmatically create the token name, having all 6235 tokens registered.
I'm pretty sure everyone can agree that 3 isn't really feasible. 2 might not work because of copying/doubling abilities. It might not matter if 1 works, though. For the name in the first and second method, TOKEN_S_C_2_2_S_CW_1 looks fine to me.
1: Simple way, store the token in a data chest, and then grant the chosen creature type and color to that token. I have my doubts this would work.
2: Complicated way, make a DuelDC or PlayerDC chest for Volrath's Laboratory. In that chest, make a new subchest containing nothing in 0, the creature type in 1, and the color in 2. The token would have a constant CA which finds the first unclaimed chest (empty register 0), claims it (sets register 0 to itself), and uses those values permanently. I'm not certain how to fix this regarding copying the token or effects such as Doubling Season.
3: The tedious way, there are 1247 creature types and 5 colors. Make 6235 tokens, and programmatically create the token name, having all 6235 tokens registered.
I'm pretty sure everyone can agree that 3 isn't really feasible. 2 might not work because of copying/doubling abilities. It might not matter if 1 works, though. For the name in the first and second method, TOKEN_S_C_2_2_S_CW_1 looks fine to me.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
Re: Volrath's Laboratory Token
by thefiremind » 01 Nov 2016, 20:26
It would work with just a little change: once you have given the chest as argument to the token creation function, grant the chosen creature type and color to all tokens in the chest (save the chest count preemptively and loop with a for, because you can't assume that tokens will cease to exist starting from the last index). Cards like Doubling Season will make more tokens, but they will all be inside that chest. I'm pretty sure there must be cards that already do something similar.Xander9009 wrote:Simple way, store the token in a data chest, and then grant the chosen creature type and color to that token. I have my doubts this would work.
< 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: 721 times
Re: Volrath's Laboratory Token
by Xander9009 » 01 Nov 2016, 20:39
Yeah, that's what I was intending. And there are cards that already do this, the most notable of which that come to mind are the restricted mana cards, but I know there are others.thefiremind wrote:It would work with just a little change: once you have given the chest as argument to the token creation function, grant the chosen creature type and color to all tokens in the chest (save the chest count preemptively and loop with a for, because you can't assume that tokens will cease to exist starting from the last index). Cards like Doubling Season will make more tokens, but they will all be inside that chest. I'm pretty sure there must be cards that already do something similar.Xander9009 wrote:Simple way, store the token in a data chest, and then grant the chosen creature type and color to that token. I have my doubts this would work.
_______________________________
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
Community Wad - Community Wad Website - How to Help and Report Bugs
Discord: discord.gg/4AXvHzW
-
Xander9009 - Programmer
- Posts: 2905
- Joined: 29 Jun 2013, 07:44
- Location: Indiana, United States
- Has thanked: 121 times
- Been thanked: 445 times
4 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 5 guests