It is currently 19 Apr 2024, 22:25
   
Text Size

Control Magic and cards like it

Moderators: ubeefx, beholder, melvin, ShawnieBoy, Lodici, CCGHQ Admins

Control Magic and cards like it

Postby 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 :lol:

Back to the drawing board :roll:
User avatar
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

Postby 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.
User avatar
ubeefx
DEVELOPER
 
Posts: 748
Joined: 23 Nov 2010, 19:16
Has thanked: 34 times
Been thanked: 249 times

Re: Control Magic and cards like it

Postby melvin » 17 Jul 2011, 14:10

Thanks for helping out with card implementations :D 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.
User avatar
melvin
AI Programmer
 
Posts: 1062
Joined: 21 Mar 2010, 12:26
Location: Singapore
Has thanked: 36 times
Been thanked: 459 times


Return to Magarena

Who is online

Users browsing this forum: No registered users and 44 guests


Who is online

In total there are 44 users online :: 0 registered, 0 hidden and 44 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 44 guests

Login Form