Whenever CARDNAME becomes tapped
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
5 posts
• Page 1 of 1
Whenever CARDNAME becomes tapped
by Chris H. » 09 Apr 2010, 16:44
The new code based on the City of Brass caught my attention.
I added the following card:
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:
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.

- 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.

-
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
by 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.
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
Re: Whenever CARDNAME becomes tapped
by jim » 09 Apr 2010, 21:13
In ref to Fallowsage, you wrote:
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?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.
- 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
by Chris H. » 09 Apr 2010, 21:49
`jim wrote:In ref to Fallowsage, you wrote: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?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.
I guess that I am wrestling with several issues.

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.

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.
-
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
by jim » 09 Apr 2010, 22:37
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.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.
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
5 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 50 guests