Control Magic and cards like it
by ubeefx
Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins
Control Magic and cards like it
by madmarcel » 17 Jul 2011, 09:50
Trying to add some new cards to MagArena,
For my first attempt I'm trying to get Control Magic to work...
(and it's many variants will surely follow:
Mind Control
Binding Grasp
Enslave
Persuasion
Biting Tether
Corrupted Conscience
Yavimaya's Embrace )
Added the new card, set it up it so that it can only be played on opponents creatures (not entirely accurate, but it works, and in theory the AI will use the card correctly as well), and added a trigger that
changes control of the creature. Put together a test deck with 4 copies of both Mind Control and Control Magic, and the creature stealing works, so far so good.
But of course there is a piece missing. When Control Magic is destroyed or bounced, the creature remains under your control. Couldn't find a suitable 'leaves play' trigger to switch the creature back to it's previous controller, so I added a 'whenleavesplay' trigger in what I hope is the appropriate place.
Played a test game, and stole 4 or 5 of my opponents creatures before I drew an 'Into the Roil'. Time to test, cast Into the Roil on one of the Control Magic aura's...and much to my delight...ALL the stolen creatures were returned to my opponents control
Back to the drawing board
For my first attempt I'm trying to get Control Magic to work...
(and it's many variants will surely follow:
Mind Control
Binding Grasp
Enslave
Persuasion
Biting Tether
Corrupted Conscience
Yavimaya's Embrace )
Added the new card, set it up it so that it can only be played on opponents creatures (not entirely accurate, but it works, and in theory the AI will use the card correctly as well), and added a trigger that
changes control of the creature. Put together a test deck with 4 copies of both Mind Control and Control Magic, and the creature stealing works, so far so good.
But of course there is a piece missing. When Control Magic is destroyed or bounced, the creature remains under your control. Couldn't find a suitable 'leaves play' trigger to switch the creature back to it's previous controller, so I added a 'whenleavesplay' trigger in what I hope is the appropriate place.
Played a test game, and stole 4 or 5 of my opponents creatures before I drew an 'Into the Roil'. Time to test, cast Into the Roil on one of the Control Magic aura's...and much to my delight...ALL the stolen creatures were returned to my opponents control
Back to the drawing board
-
madmarcel - Posts: 18
- Joined: 17 Jul 2011, 03:18
- Location: New Zealand
- Has thanked: 0 time
- Been thanked: 0 time
Re: Control Magic and cards like it
by ubeefx » 17 Jul 2011, 11:34
Hi madmarcel,
cool avatar.
You start with a challenging type of cards to add.
There are several ways I think, one is to extend the local variables with getController support.
I will let you figure out how it could be done exactly. Then you can rely on the regular support for auras.
Or you can use a mix of come into play and leave play triggers.
cool avatar.
You start with a challenging type of cards to add.
There are several ways I think, one is to extend the local variables with getController support.
I will let you figure out how it could be done exactly. Then you can rely on the regular support for auras.
Or you can use a mix of come into play and leave play triggers.
Re: Control Magic and cards like it
by melvin » 17 Jul 2011, 14:10
Thanks for helping out with card implementations Nice to know that there are others hacking on the code as well.
I second ubeefx's suggestion of extending local variables to include changes to the controller. Local variables are used by the engine to represent changes to the properties of a permanent.
When you are ready to push to the main repo, drop me a PM with your google account email.
I second ubeefx's suggestion of extending local variables to include changes to the controller. Local variables are used by the engine to represent changes to the properties of a permanent.
When you are ready to push to the main repo, drop me a PM with your google account email.
-
melvin - AI Programmer
- Posts: 1062
- Joined: 21 Mar 2010, 12:26
- Location: Singapore
- Has thanked: 36 times
- Been thanked: 459 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 20 guests