Board index
Programs with AI or Rules Enforcement
Magic: The Gathering - Duels of the Planeswalkers
Programming Talk



Counters
Moderator: CCGHQ Admins
2 posts
• Page 1 of 1
Counters
by --Dream-- » 05 Sep 2012, 15:58
I'm trying to code Wall of Roots and I can't find a function that adds a -0/-1 counter. I see here viewtopic.php?f=65&t=7330 that the game engine only has functions for +1/+1, +1/+0, +0/+1 and -1/-1 counters. So, is it possible to have custom counters?
Re: Counters
by RiiakShiNal » 05 Sep 2012, 16:18
You can have custom counters, but you'll have to manage their effect on your own. Since you want -0/-1 counters you'll need to code an ability to look for those counters and alter the toughness of the creature they are on from that ability (which will mean the ability will need to work from ALL zones). You will also need to make sure if you have multiple cards that add those counters that the effect is only applied once for each counter otherwise if you have two of the same card then a creature with one counter would get -0/-2 instead of -0/-1 as would be correct.
So in this case while it can be done it is a pain to do.
An easier way (though less correct) would be to code Wall of Roots such that it manages the -0/-1 internally using the ObjectDC() for itself, though that would prevent interacting with the counters other than through the card itself. For example if you add one by using the ability then you would not be able to move it or remove it using another card. It would also prevent abilities such as Proliferate from being able to interact with those counters.
So in this case while it can be done it is a pain to do.
An easier way (though less correct) would be to code Wall of Roots such that it manages the -0/-1 internally using the ObjectDC() for itself, though that would prevent interacting with the counters other than through the card itself. For example if you add one by using the ability then you would not be able to move it or remove it using another card. It would also prevent abilities such as Proliferate from being able to interact with those counters.
Just getting started: Xander9009's DotP 2014 Community Wad
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
Need a deck builder: DotP 2014 Deck Builder
Problems Modding: DotP 2014 Frequent Modding Mistakes
- RiiakShiNal
- Programmer
- Posts: 2188
- Joined: 16 May 2011, 21:37
- Has thanked: 75 times
- Been thanked: 497 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 2 guests