It is currently 05 Aug 2025, 06:35
   
Text Size

Counters

Moderator: CCGHQ Admins

Counters

Postby --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?
--Dream--
 
Posts: 65
Joined: 28 Jul 2012, 12:01
Has thanked: 4 times
Been thanked: 0 time

Re: Counters

Postby 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.
RiiakShiNal
Programmer
 
Posts: 2188
Joined: 16 May 2011, 21:37
Has thanked: 75 times
Been thanked: 497 times


Return to Programming Talk

Who is online

Users browsing this forum: No registered users and 6 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 6 users online :: 0 registered, 0 hidden and 6 guests (based on users active over the past 10 minutes)
Most users ever online was 7303 on 15 Jul 2025, 20:46

Users browsing this forum: No registered users and 6 guests

Login Form