Board index Programs with AI or Rules Enforcement Magic: The Gathering - Duels of the Planeswalkers Programming Talk
Magic Trick : Working out mana producing abilities
Moderator: CCGHQ Admins
Magic Trick : Working out mana producing abilities
by Yanna » 20 Jul 2010, 23:01
EDIT : 07-21-2010
- Updated the DLC with new mana-producing cards. Now the 'Crash-Test Deck' is playable by the AI.
- Mana count is no longer incorrect when casting spells.
Hi all !
I kept this until it would be significant to realease a test-DLC, and i hope you'll find it interesting.
If you want to skip the talking, here's the link to DLC_7778 : Updated ! http://www.mediafire.com/?a4d41d7qv9q1hu6
A little warning thought, it's still under dev and needs some fixing, so every idea is welcome to improve it.
I've tried for a long time to use tokens as 'mana lands', but the game can't understand that a token is not a creature
But then, loosing hope there was one last crazy test to be done, via a misleading named function.
PutTokensIntoPlay
Yeah right, you can put tokens into play good thing... But how about you try to create a non-token card instead ? As shocking as it is, you can 'spawn' any card you want, not just tokens
From this on, it was a matter of code-fixing and after many crashes here's the result :
How does it works :
- 5 new 'basic lands' are created as cards. They represents mana tokens.
- These lands have very special abilities :
=> can't be the target of spells or effects
=> removed from the game if they ever get tapped
=> removed from the game at the end of every step
=> cool pictures
- You can spawn those lands via the allmighty PutTokensIntoPlay function, as a spell ability (thinking dark ritual ? or an activated ability, surely via triggers but i didn't test it).
- They act as lands, thought don't count towards your one land limit. You can also 'produce mana' at instant speed (see coded cards).
So if you find it interesting and want to give me a hand on fixing this, you're welcome ! Mana producing cards would completely change the options available and certainly add a nice bunch of good cards to the sets.
Until then, have fun and see ya later,
YannA a.k.a NOVA
- Updated the DLC with new mana-producing cards. Now the 'Crash-Test Deck' is playable by the AI.
- Mana count is no longer incorrect when casting spells.
Hi all !
I kept this until it would be significant to realease a test-DLC, and i hope you'll find it interesting.
If you want to skip the talking, here's the link to DLC_7778 : Updated ! http://www.mediafire.com/?a4d41d7qv9q1hu6
A little warning thought, it's still under dev and needs some fixing, so every idea is welcome to improve it.
I've tried for a long time to use tokens as 'mana lands', but the game can't understand that a token is not a creature
But then, loosing hope there was one last crazy test to be done, via a misleading named function.
PutTokensIntoPlay
Yeah right, you can put tokens into play good thing... But how about you try to create a non-token card instead ? As shocking as it is, you can 'spawn' any card you want, not just tokens
From this on, it was a matter of code-fixing and after many crashes here's the result :
How does it works :
- 5 new 'basic lands' are created as cards. They represents mana tokens.
- These lands have very special abilities :
=> can't be the target of spells or effects
=> removed from the game if they ever get tapped
=> removed from the game at the end of every step
=> cool pictures
- You can spawn those lands via the allmighty PutTokensIntoPlay function, as a spell ability (thinking dark ritual ? or an activated ability, surely via triggers but i didn't test it).
- They act as lands, thought don't count towards your one land limit. You can also 'produce mana' at instant speed (see coded cards).
So if you find it interesting and want to give me a hand on fixing this, you're welcome ! Mana producing cards would completely change the options available and certainly add a nice bunch of good cards to the sets.
Until then, have fun and see ya later,
YannA a.k.a NOVA
Last edited by Yanna on 21 Jul 2010, 20:05, edited 5 times in total.
Re: Magic Trick : Working out mana producing abilities
by Epiphany » 20 Jul 2010, 23:29
Wow. Amazing stuff.
I'm just heading off to bed, but will gladly test this tomorrow. Excellent thinking outside the box here! I love it.
I had an idea of using those sorts of effects to search your library for a land card, put it into play untapped, then return it to your library, but this beats that idea hands down! Well done!
I'm just heading off to bed, but will gladly test this tomorrow. Excellent thinking outside the box here! I love it.
I had an idea of using those sorts of effects to search your library for a land card, put it into play untapped, then return it to your library, but this beats that idea hands down! Well done!
-------
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
- Epiphany
- Posts: 95
- Joined: 30 Jun 2010, 13:27
- Has thanked: 0 time
- Been thanked: 0 time
Re: Magic Trick : Working out mana producing abilities
by Yanna » 20 Jul 2010, 23:58
Thanks and glad you liked it ^^Epiphany wrote:Wow. Amazing stuff.
I'm just heading off to bed, but will gladly test this tomorrow. Excellent thinking outside the box here! I love it.
I had an idea of using those sorts of effects to search your library for a land card, put it into play untapped, then return it to your library, but this beats that idea hands down! Well done!
The function could be used for other purpose than mana generating, since you can 'spwan' anything.
Cunning wish ? well if you could name a card yeah
Btw, i found out what seems to be the cause of the wrong mana spent :
It's related to the trigger that removes the 'mana' when it is tapped. Maybe a bad layer number or something else... but definetely it pays the cost correctly when this ability is removed.
Re: Magic Trick : Working out mana producing abilities
by Uresti » 21 Jul 2010, 02:23
excellent work! mana tokens was the first idea that came from SA forums but your surely its the best implemented! jow what if we could use MC_COLOUR to choose what color of mana we need..or if theres a way to use MC_MANA that its on the EXE... anyways Good work!
PS Sorry if i wasnt too optimist
PS Sorry if i wasnt too optimist
- Uresti
- Posts: 151
- Joined: 25 Jun 2010, 15:26
- Has thanked: 0 time
- Been thanked: 0 time
Re: Magic Trick : Working out mana producing abilities
by Epiphany » 21 Jul 2010, 07:09
One thing that immediately springs to mind:
Perhaps it's also possible to have the land tokens deal one damage to you if it leaves play untapped? To represent mana burn.
Perhaps it's also possible to have the land tokens deal one damage to you if it leaves play untapped? To represent mana burn.
-------
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
- Epiphany
- Posts: 95
- Joined: 30 Jun 2010, 13:27
- Has thanked: 0 time
- Been thanked: 0 time
Re: Magic Trick : Working out mana producing abilities
by Huggybaby » 21 Jul 2010, 18:31
Mana burn is no longer in the rules.
-
Huggybaby - Administrator
- Posts: 3207
- Joined: 15 Jan 2006, 19:44
- Location: Finally out of Atlanta
- Has thanked: 702 times
- Been thanked: 595 times
Re: Magic Trick : Working out mana producing abilities
by Yanna » 21 Jul 2010, 19:41
Bump for the Updated DLC
Cards now included for test purposes :
- Llanowar Elves
- Ebon Stronghold
- Havenwood Battlegrounds
- Golgari Rot Farm
- Mox Jet
- Mox Emerald
- Sacrifice
- Dark Ritual
- Black Lotus
Plus the deck should be a little more fun to play, and the AI, while taking a bit more time to play, sucessfully understands that it can speed up the game with mana-producing abilities ^^
As for the Mana Burn, the one concern i had in mind (thus not including the damage for unspent mana) is that you can't control what mana is going to be tapped. If it's one of your lands instead of the produced mana, you're pretty screwed...
Cards now included for test purposes :
- Llanowar Elves
- Ebon Stronghold
- Havenwood Battlegrounds
- Golgari Rot Farm
- Mox Jet
- Mox Emerald
- Sacrifice
- Dark Ritual
- Black Lotus
Plus the deck should be a little more fun to play, and the AI, while taking a bit more time to play, sucessfully understands that it can speed up the game with mana-producing abilities ^^
As for the Mana Burn, the one concern i had in mind (thus not including the damage for unspent mana) is that you can't control what mana is going to be tapped. If it's one of your lands instead of the produced mana, you're pretty screwed...
Re: Magic Trick : Working out mana producing abilities
by Yanna » 21 Jul 2010, 20:12
Nice idea indeed, i'll take a look at it. Especially when it comes to dual lands.Uresti wrote:now what if we could use MC_COLOUR to choose what color of mana we need..or if theres a way to use MC_MANA that its on the EXE...
Btw, have you got any idea on how the AI can pick up a colour ? it doesn't make any choice for example when a blacklotus is in play (and it could burn it to play a spell).
No problem mate ^^Uresti wrote:PS Sorry if i wasnt too optimist
Re: Magic Trick : Working out mana producing abilities
by Epiphany » 22 Jul 2010, 07:15
Wow, shows how out of touch I am!Huggybaby wrote:Mana burn is no longer in the rules.
-------
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
http://www.slightlymagic.net/forum/viewtopic.php?f=62&t=2876
^ My release thread
http://www.slightlymagic.net/wiki/Duels_of_the_Planeswalkers
^ Check out the DotP wiki for help and guides
- Epiphany
- Posts: 95
- Joined: 30 Jun 2010, 13:27
- Has thanked: 0 time
- Been thanked: 0 time
Re: Magic Trick : Working out mana producing abilities
by kevlahnota » 23 Jul 2010, 02:52
add mana burn effect. please check the code if it works for you(example of black mana token below):
<?xml version="1.0"?>
<MULTICARDS>
<CARD>
<!--
///////////////////////////////////////////////////////////////////////////////////
CARD INFORMATIONS
///////////////////////////////////////////////////////////////////////////////////
-->
<FILENAME text = "_BLACK_MANA_Token" />
<ARTID value = "77789999" />
<TITLE text = "_COMMON_BLANKLINE" />
<TYPE metaname = "Land" />
<SUB_TYPE metaname = "Swamp" />
<SUPERTYPE metaname = "Basic"/>
<COLOR value = "C" />
<FRAMECOLOUR name = "_MANATOKEN_B" />
<EXPANSION metaname = "NOVATEST" />
<ARTIST name = "NOVA 2010" />
<!--
///////////////////////////////////////////////////////////////////////////////////
START OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<TRIGGERED_ABILITY layer="8" internal="1" pre_trigger="1">
<TRIGGER value="CARD_CONSIDERED_FOR_TARGETTING">
return SelfTriggered()
</TRIGGER>
</TRIGGERED_ABILITY>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<TRIGGERED_ABILITY internal="1" auto_skip="1" layer="8">
<TRIGGER value="END_OF_STEP">
return true
</TRIGGER>
<EFFECT>
if Object():Tapped() == 0 then
Object():RemoveFromGame()
YouGainLife( -1 )
else
Object():RemoveFromGame()
end
</EFFECT>
</TRIGGERED_ABILITY>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!--
///////////////////////////////////////////////////////////////////////////////////
END OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
</CARD>
</MULTICARDS>
<?xml version="1.0"?>
<MULTICARDS>
<CARD>
<!--
///////////////////////////////////////////////////////////////////////////////////
CARD INFORMATIONS
///////////////////////////////////////////////////////////////////////////////////
-->
<FILENAME text = "_BLACK_MANA_Token" />
<ARTID value = "77789999" />
<TITLE text = "_COMMON_BLANKLINE" />
<TYPE metaname = "Land" />
<SUB_TYPE metaname = "Swamp" />
<SUPERTYPE metaname = "Basic"/>
<COLOR value = "C" />
<FRAMECOLOUR name = "_MANATOKEN_B" />
<EXPANSION metaname = "NOVATEST" />
<ARTIST name = "NOVA 2010" />
<!--
///////////////////////////////////////////////////////////////////////////////////
START OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<TRIGGERED_ABILITY layer="8" internal="1" pre_trigger="1">
<TRIGGER value="CARD_CONSIDERED_FOR_TARGETTING">
return SelfTriggered()
</TRIGGER>
</TRIGGERED_ABILITY>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<TRIGGERED_ABILITY internal="1" auto_skip="1" layer="8">
<TRIGGER value="END_OF_STEP">
return true
</TRIGGER>
<EFFECT>
if Object():Tapped() == 0 then
Object():RemoveFromGame()
YouGainLife( -1 )
else
Object():RemoveFromGame()
end
</EFFECT>
</TRIGGERED_ABILITY>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!--
///////////////////////////////////////////////////////////////////////////////////
END OF CARD ABILITIES
///////////////////////////////////////////////////////////////////////////////////
-->
</CARD>
</MULTICARDS>
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Magic Trick : Working out mana producing abilities
by Marek14 » 23 Jul 2010, 08:34
But there IS no mana burn!
Re: Magic Trick : Working out mana producing abilities
by kevlahnota » 23 Jul 2010, 08:45
i see, i'm an old mtg player and i checked that they removed the mana burn rule. oh well...Marek14 wrote:But there IS no mana burn!
-
kevlahnota - Programmer
- Posts: 825
- Joined: 19 Jul 2010, 17:45
- Location: Philippines
- Has thanked: 14 times
- Been thanked: 264 times
Re: Magic Trick : Working out mana producing abilities
by whismer » 27 Jul 2010, 19:50
I try to code Pyretic Ritual the way you do Dark Ritual but in game, it doesn'T do anything except going to graveyard...
DOes I need to do a file manipulation like put RED_MANA token in my rep/CARDS?
Whismer
EDIT : It'S work if you add to the functions.LUA in 7778 expansion the other MANA TOKEN (only black and green for now)
DOes I need to do a file manipulation like put RED_MANA token in my rep/CARDS?
Whismer
EDIT : It'S work if you add to the functions.LUA in 7778 expansion the other MANA TOKEN (only black and green for now)
- whismer
- Posts: 64
- Joined: 23 Jul 2010, 02:36
- Has thanked: 0 time
- Been thanked: 0 time
Re: Magic Trick : Working out mana producing abilities
by Yanna » 27 Jul 2010, 22:36
Yes indeed, it was more of a test version than a real one.whismer wrote: EDIT : It'S work if you add to the functions.LUA in 7778 expansion the other MANA TOKEN (only black and green for now)
In my next release every ProduceXMana is included ^^
Glad you found it
Re: Magic Trick : Working out mana producing abilities
by logoliv » 28 Jul 2010, 13:05
nice idea Yanna
perhaps we need to make these mana tokens invisible to be more correct : lands are permanents and generate mana, so it's visually strange that mana appears nearby lands, and get tapped like permanents... I will try to set an empty framecolor and no artid to see.
perhaps we need to make these mana tokens invisible to be more correct : lands are permanents and generate mana, so it's visually strange that mana appears nearby lands, and get tapped like permanents... I will try to set an empty framecolor and no artid to see.
20 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 5 guests