It is currently 09 Sep 2025, 17:51
   
Text Size

Whenever CARDNAME becomes tapped

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Whenever CARDNAME becomes tapped

Postby Chris H. » 09 Apr 2010, 16:44

The new code based on the City of Brass caught my attention. =D> I added the following card:

Code: Select all
Fallowsage
3 U
Creature Merfolk Wizard
Whenever Fallowsage becomes tapped, you may draw a card.
2/2
`

Code: Select all
        if (c.getName().equals("Fallowsage")) {
            final String player = c.getController();
            Ability ability = new Ability(c, "0") {
                @Override
                public void resolve() {
                   AllZone.GameAction.drawCard(player);
                }
            };// Ability
            ability.setStackDescription("Fallowsage - draw a card");
            AllZone.Stack.add(ability);
        }//end Fallowsage
`
and it works. The code above places this ability on the stack along with the message and we have to click OK to continue. It is not automatic.

I reduced the code to this:

Code: Select all
        if (c.getName().equals("Fallowsage")) {
            final String player = c.getController();
            AllZone.GameAction.drawCard(player);
        }//end Fallowsage
`
and this version no longer includes the stack. Hmm, how does this card play in real life? Before I add this card I would like to know which of the two code versions above are rules compliant. :D
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Whenever CARDNAME becomes tapped

Postby apthaven » 09 Apr 2010, 17:45

This might help.

Rulings for Fallowsage: (from gatherer.wizards.com)

This is a triggered ability, not an activated ability. It doesn't allow you to tap the creature whenever you want; rather, you need some other way of tapping it, such as by attacking with the creature.

For the ability to trigger, the creature has to actually change from untapped to tapped. If an effect attempts to tap the creature, but it was already tapped at the time, this ability won't trigger.
"I am a man and real men do not consume pink beverages. Get thee gone woman, and bring me something brown." - Jace Wayland
apthaven
Tester
 
Posts: 242
Joined: 20 Jun 2009, 12:34
Has thanked: 0 time
Been thanked: 1 time

Re: Whenever CARDNAME becomes tapped

Postby jim » 09 Apr 2010, 21:13

In ref to Fallowsage, you wrote:

Chris H. wrote:
Hmm, how does this card play in real life? Before I add this card I would like to know which of the two code versions above are rules compliant. :D
The way I read the rules, the triggered ability should go on the stack -- is that what you're asking, or is it a more subtle question?
jim
 
Posts: 46
Joined: 19 Feb 2010, 01:46
Location: Sunny New England
Has thanked: 0 time
Been thanked: 0 time

Re: Whenever CARDNAME becomes tapped

Postby Chris H. » 09 Apr 2010, 21:49

jim wrote:In ref to Fallowsage, you wrote:

Chris H. wrote:
Hmm, how does this card play in real life? Before I add this card I would like to know which of the two code versions above are rules compliant. :D
The way I read the rules, the triggered ability should go on the stack -- is that what you're asking, or is it a more subtle question?
`
I guess that I am wrestling with several issues. :D

I played Magic "the real card thing" for a few years a long time ago. I sold my cards and got busy with other things over the years. I stumbled across the forge project by accident and got hooked. :) While my knowledge of the rules have become rusty we do have some knowledgeable people who chime in and serve as rules experts.

I can commit the first version of the code which use the Ability ability, although it makes declaring attackers in combat more complicated.

On a more subtle front, I noticed that there are a number of auras that might be able to take advantage of this system ... just thinking at this moment ... as I am not sure what I will work on after I finish the eqPumps and enPumps.
User avatar
Chris H.
Forge Moderator
 
Posts: 6320
Joined: 04 Nov 2008, 12:11
Location: Mac OS X Yosemite
Has thanked: 644 times
Been thanked: 643 times

Re: Whenever CARDNAME becomes tapped

Postby jim » 09 Apr 2010, 22:37

Chris H. wrote:I can commit the first version of the code which use the Ability ability, although it makes declaring attackers in combat more complicated.
Okay, I can see that. Exalted has the same issue: when it triggers, lots of abilities get put on the stack that basically just have to be clicked through. It's not clear how much of a benefit that there is to implement them this way, given that there are relatively few cards in Magic that can counter abilities, and I don't think any of them are in Forge yet.

On the other hand, having things implemented as stack abilities rather than just "happening" does give opponents the chance to react. And if those "counter target ability" cards do make it into Forge, we'll be all ready. :)
jim
 
Posts: 46
Joined: 19 Feb 2010, 01:46
Location: Sunny New England
Has thanked: 0 time
Been thanked: 0 time


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 50 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 50 users online :: 0 registered, 0 hidden and 50 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 50 guests

Login Form