Card Contributions
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Re: Card Contributions
by squee1968 » 06 Feb 2014, 12:13
Since Sol implemented Teferi's Imp last night, I figured I would give a shot and code the other phasing trigger cards. I can't test these until tomorrow's snapshot build of course, but they should be correct. Or at least pretty close.
EDIT: Changed trigger description as per Marek's suggestion. Thanks!
- Ertai's Familiar | Open
- Name:Ertai's Familiar
ManaCost:1 U
Types:Creature Illusion
PT:2/2
K:Phasing
T:Mode$ PhaseOut | ValidCard$ Card.Self | Execute$ TrigMill | TriggerDescription$ Whenever CARDNAME phases out, put the top three cards of your library into your graveyard.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | TriggerZones$ Battlefield | Execute$ TrigMill | TriggerDescription$ Whenever CARDNAME leaves the battlefield, put the top three cards of your library into your graveyard.
SVar:TrigMill:AB$ Mill | Cost$ 0 | NumCards$ 3 | ValidTgts$ You
A:AB$ Pump | Cost$ U | ValidTgts$ Permanent.Self | KW$ CARDNAME can't phase out. | UntilYourNextUpkeep$ True | SpellDescription$ Until your next upkeep, CARDNAME can't phase out.
SVar:Picture:http://www.wizards.com/global/images/magic/general/ertais_familiar.jpg
- Shimmering Efreet | Open
- Name:Shimmering Efreet
ManaCost:2 U
Types:Creature Efreet
PT:2/2
K:Flying
K:Phasing
T:Mode$ PhaseIn | ValidCard$ Card.Self | Execute$ TrigWarp | TriggerDescription$ Whenever CARDNAME phases in, target creature phases out.
SVar:TrigWarp:AB$ Phases | Cost$ 0 | ValidTgts$ Creature | SpellDescription$ Target creature phases out.
SVar:Picture:http://www.wizards.com/global/images/magic/general/shimmering_efreet.jpg
- Warping Wurm | Open
- Name:Warping Wurm
ManaCost:2 G U
Types:Creature Wurm
PT:1/1
K:Phasing
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ TrigWarp | TriggerDescription$ At the beginning of your upkeep, CARDNAME phases out unless you pay {G}{U}.
SVar:TrigWarp:DB$ Phases | UnlessCost$ 2 G U | UnlessPayer$ You | Defined$ Self
T:Mode$ PhaseIn | ValidCard$ Card.Self | Execute$ TrigBuff | TriggerDescription$ Whenever CARDNAME phases in, put a +1/+1 counter on it.
SVar:TrigBuff:AB$ PutCounter | Cost$ 0 | Defined$ Self | CounterType$ P1P1 | CounterNum$ 1
SVar:Picture:http://www.wizards.com/global/images/magic/general/warping_wurm.jpg
EDIT: Changed trigger description as per Marek's suggestion. Thanks!
Last edited by squee1968 on 06 Feb 2014, 15:41, edited 1 time in total.
Re: Card Contributions
by Marek14 » 06 Feb 2014, 15:14
I would suggest changing the second trigger description for Ertai's Familiar to "When CARDNAME leaves the battlefield, put the top three cards of your library into your graveyard." which is more in line with how these triggers are usually written (card can only leave battlefield once -- if it returns it's no longer the same object). "Whenever" at first trigger is correct, though, since phasing out is something that can happen multiple times.
Re: Card Contributions
by friarsol » 06 Feb 2014, 16:51
It's a good suggestion, but it really should just use the Secondary$ True parameter for the second trigger so it's not displayed in the card detail panel. We use this trick for cards like Cockatrice that have combined triggers. So that small tweak, and listing the oracle text for both trigger descriptions gives us:Marek14 wrote:I would suggest changing the second trigger description for Ertai's Familiar to "When CARDNAME leaves the battlefield, put the top three cards of your library into your graveyard." which is more in line with how these triggers are usually written (card can only leave battlefield once -- if it returns it's no longer the same object). "Whenever" at first trigger is correct, though, since phasing out is something that can happen multiple times.
- Ertai's Familiar | Open
- Name:Ertai's Familiar
ManaCost:1 U
Types:Creature Illusion
PT:2/2
K:Phasing
T:Mode$ PhaseOut | ValidCard$ Card.Self | Execute$ TrigMill | TriggerDescription$ When CARDNAME phases out or leaves the battlefield, put the top three cards of your library into your graveyard.
T:Mode$ ChangesZone | Origin$ Battlefield | Destination$ Any | ValidCard$ Card.Self | TriggerZones$ Battlefield | Secondary$ True | Execute$ TrigMill | TriggerDescription$ When CARDNAME phases out or leaves the battlefield, put the top three cards of your library into your graveyard.
SVar:TrigMill:AB$ Mill | Cost$ 0 | NumCards$ 3 | ValidTgts$ You
A:AB$ Pump | Cost$ U | ValidTgts$ Permanent.Self | KW$ CARDNAME can't phase out. | UntilYourNextUpkeep$ True | SpellDescription$ Until your next upkeep, CARDNAME can't phase out.
SVar:Picture:http://www.wizards.com/global/images/magic/general/ertais_familiar.jpg
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by friarsol » 07 Feb 2014, 17:39
I committed Ertai's Familiar and Shimmering Efreet. Warping Wurm works except if you stack the triggers, it still gains it's +1/+1 counter even though it's phased out. Probably won't have time today to do it, but i'll keep it on my radar, if no one beats me to it. (This is probably a general issue with Defined not filtering out Phased out creatures)
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by friarsol » 14 Feb 2014, 04:07
I'm taking a look at the two ControlSpell cards: Commandeer and Perplexing Chimera. I don't imagine Commandeer will be too terrible, assuming I can SubAbility into the ChangeTargets the way I expect. Hopefully Perplexing Chimera won't be too annoying. Not sure if Perplexing Chimera has larger AI considerations considering that once the player makes a swap, the AI would be able to swap back.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Sloth » 14 Feb 2014, 07:09
Na, i don't think that's a problem. Even if the AI will never use the option to swap back, it's still not a powerful card that can be abused.friarsol wrote:Not sure if Perplexing Chimera has larger AI considerations considering that once the player makes a swap, the AI would be able to swap back.
And considering how popular Perplexing Chimera is, it won't be noticed by a lot of users.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Card Contributions
by friarsol » 16 Feb 2014, 17:26
Just realized I used the wrong targeting for Commandeer. I'm heading out for the afternoon, but I'll come back to fix that up tonight or tomorrow night.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Max mtg » 16 Feb 2014, 22:04
Just a reminder: when you add a new API effect, please add a handler for AI as well. The map from ApiType to SpellAbilityAi class is now stored in forge.ai.SpellApiToAi.apiToClass member.
If you don't, AI will have to use CannotPlayAi.class
If you don't, AI will have to use CannotPlayAi.class
Single class for single responsibility.
- Max mtg
- Programmer
- Posts: 1997
- Joined: 02 Jul 2011, 14:26
- Has thanked: 173 times
- Been thanked: 334 times
Re: Card Contributions
by friarsol » 17 Feb 2014, 00:12
Yea I know, I had seen that it was defaulting to CannotPlayAi, and the AI I was working isn't really good enough to commit (and it may not be), so I was just letting the default be assigned in. I figured if I couldn't get an AI worked out in a day or two I would just assign the CannotPlay implicitly.Max mtg wrote:Just a reminder: when you add a new API effect, please add a handler for AI as well. The map from ApiType to SpellAbilityAi class is now stored in forge.ai.SpellApiToAi.apiToClass member.
If you don't, AI will have to use CannotPlayAi.class
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Marek14 » 23 Feb 2014, 12:54
Shaman's Trance guide:
I tried to enumerate everything that's affected by Shaman's Trance to show what's necessary to implement it.
One-shot effects like Toshiro Umezawa are not affected (except for being blocked for other players). Shaman's Trance basically affects either cards that allow playing themselves from a graveyard, or static/longterm effects that work on multiple cards. For example, Bosium Strip always affects only one specific card, and so it can't be used to cast other players' cards, even with Shaman's Trance in effect.
Flashback mechanic: ST player is able to use flashback on cards in other players' graveyards. As for cards that grant flashback, like Snapcaster Mage, ST player is not able to give flashback to cards in other players' graveyards, but he is able to cast cards with granted flashback.
Retrace mechanic: ST player is able to cast cards with retrace in other players' graveyards.
Crucible of Worlds: ST player can use his Crucible of Worlds to play lands from other players' graveyards.
Gravecrawler: If ST player controls a Zombie, he can cast Gravecrawler from another player's graveyard.
Haakon, Stromgald Scourge: Not entirely clear here. I think that Haakon's "not from anywhere else" means you can't cast it from another player's graveyard, even under ST. However, having Haakon on battlefield should definitely allow the ST player to play Knight cards from other players' graveyards.
Karador, Ghost Chieftain: Under ST, player can use its effect to cast a creature from another player's graveyard.
Skaab Ruinator: ST player can cast Skaab Ruinator from another player's graveyard.
Yawgmoth's Agenda: ST player with Yawgmoth's Agenda can play cards from other players' graveyards.
Yawgmoth's Will: ST player can play cards from other players' graveyards after resolving Yawgmoth's Will.
So, in other words, if I get it right, Shaman's Trance interacts with only two mechanics and seven unique cards.
I tried to enumerate everything that's affected by Shaman's Trance to show what's necessary to implement it.
One-shot effects like Toshiro Umezawa are not affected (except for being blocked for other players). Shaman's Trance basically affects either cards that allow playing themselves from a graveyard, or static/longterm effects that work on multiple cards. For example, Bosium Strip always affects only one specific card, and so it can't be used to cast other players' cards, even with Shaman's Trance in effect.
Flashback mechanic: ST player is able to use flashback on cards in other players' graveyards. As for cards that grant flashback, like Snapcaster Mage, ST player is not able to give flashback to cards in other players' graveyards, but he is able to cast cards with granted flashback.
Retrace mechanic: ST player is able to cast cards with retrace in other players' graveyards.
Crucible of Worlds: ST player can use his Crucible of Worlds to play lands from other players' graveyards.
Gravecrawler: If ST player controls a Zombie, he can cast Gravecrawler from another player's graveyard.
Haakon, Stromgald Scourge: Not entirely clear here. I think that Haakon's "not from anywhere else" means you can't cast it from another player's graveyard, even under ST. However, having Haakon on battlefield should definitely allow the ST player to play Knight cards from other players' graveyards.
Karador, Ghost Chieftain: Under ST, player can use its effect to cast a creature from another player's graveyard.
Skaab Ruinator: ST player can cast Skaab Ruinator from another player's graveyard.
Yawgmoth's Agenda: ST player with Yawgmoth's Agenda can play cards from other players' graveyards.
Yawgmoth's Will: ST player can play cards from other players' graveyards after resolving Yawgmoth's Will.
So, in other words, if I get it right, Shaman's Trance interacts with only two mechanics and seven unique cards.
Re: Card Contributions
by friarsol » 23 Feb 2014, 14:38
Looks like any time the game would look up "Your Graveyard" in relation to playing cards with an active Trance, it finds cards in all player's graveyard. So you should be able to play an Opposing player's Haakon if it's in the graveyard.Marek14 wrote:Haakon, Stromgald Scourge: Not entirely clear here. I think that Haakon's "not from anywhere else" means you can't cast it from another player's graveyard, even under ST. However, having Haakon on battlefield should definitely allow the ST player to play Knight cards from other players' graveyards.
Not sure we really have the capacity to handle this right now, since most cards use the Card.YouOwn shorthand for determining if a card is in your graveyard.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Marek14 » 23 Feb 2014, 14:50
That's why I said I'm not entirely clear here. I think it needs an official answer.friarsol wrote:Looks like any time the game would look up "Your Graveyard" in relation to playing cards with an active Trance, it finds cards in all player's graveyard. So you should be able to play an Opposing player's Haakon if it's in the graveyard.
The way I see it, Trance is a "can" effect while Haakon has a "can't" effect, and "can't" should win. Though "as though" effects are inherently problematic...
EDIT: Although... does Haakon's prohibition even apply to other players? If you hit the opponent with Mindleech Mass, can you cast Haakon from his hand?
Re: Card Contributions
by Traldar » 24 Feb 2014, 02:49
Hello Friends,
I was playing with the latest beta (1.5.13) and seems I found a bug on the card Night Dealings, that I am testing on a Commander deck.
Looks like the expression ChangeType$ Card.nonLand+YouCtrl+cmcEQChosenX is resolving to no cards, even when ChosenX is greater than 0. If I replace the expression "cmcEQChosenX" with "cmcLEChosenX+cmcGEChosenX" I get the desired effect.
Here´s the code I am using:
Cheers,
Traldar
I was playing with the latest beta (1.5.13) and seems I found a bug on the card Night Dealings, that I am testing on a Commander deck.
Looks like the expression ChangeType$ Card.nonLand+YouCtrl+cmcEQChosenX is resolving to no cards, even when ChosenX is greater than 0. If I replace the expression "cmcEQChosenX" with "cmcLEChosenX+cmcGEChosenX" I get the desired effect.
Here´s the code I am using:
- Night Dealings | Open
- Name:Night Dealings
ManaCost:2 B B
Types:Enchantment
T:Mode$ DamageDone | ValidSource$ Card.YouCtrl | ValidTarget$ Player.Other | TriggerZones$ Battlefield | Execute$ TrigPutCounter | TriggerDescription$ Whenever a source you control deals damage to another player, put that many theft counters on CARDNAME.
SVar:TrigPutCounter:AB$ PutCounter | Cost$ 0 | CounterType$ THEFT | CounterNum$ Y | References$ Y
A:AB$ ChangeZone | Cost$ 2 B B SubCounter<X/THEFT> | Origin$ Library | Destination$ Hand | ChangeType$ Card.nonLand+cmcLEChosenX+cmcGEChosenX | ChangeNum$ 1 | Reveal$ True | Shuffle$ True | References$ X | SpellDescription$ Search your library for a nonland card with converted mana cost X, reveal it, and put it into your hand. Then shuffle your library.
SVar:X:XChoice
SVar:Y:TriggerCount$DamageAmount
SVar:RemAIDeck:True
SVar:Picture: xxx-REMOVED-xxx
Oracle:Whenever a source you control deals damage to another player, put that many theft counters on Night Dealings.\n{2}{B}{B}, Remove X theft counters from Night Dealings: Search your library for a nonland card with converted mana cost X, reveal it, and put it into your hand. Then shuffle your library.
Cheers,
Traldar
Re: Card Contributions
by friarsol » 10 Mar 2014, 15:05
Damn Swordshine, you are completely tearing it up right now with all these cards you are committing. It's truly impressive.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Card Contributions
by Marek14 » 10 Mar 2014, 17:05
Does Diaochan, Artful Beauty make possible other cards in the "Target Opp Choice" column like Arena?
Who is online
Users browsing this forum: No registered users and 113 guests