cards with the whenever keyword
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
cards with the whenever keyword
by Sloth » 12 Jul 2010, 13:14
I found some more cards with the whenever keyword (used as on Curiosity):
cards.txt:
cards.txt:
- Code: Select all
Sleeper's Robe
U B
Enchantment Aura
no text
Enchant creature
enPump:+0/+0/Fear
WheneverKeyword:DealsDamage/Opponent:Enchanted_Creature:Play:DrawCards/1:ControllingPlayer_Self:ASAP:Yes_No:No Special Condition:Whenever enchanted creature deals damage to an opponent, you may draw a card.
Ophidian Eye
2 U
Enchantment Aura
no text
Enchant creature
Flash
enPump:+0/+0
WheneverKeyword:DealsDamage/Opponent:Enchanted_Creature:Play:DrawCards/1:ControllingPlayer_Self:ASAP:Yes_No:No Special Condition:Whenever enchanted creature deals damage to an opponent, you may draw a card.
Keen Sense
G
Enchantment Aura
no text
Enchant creature
enPump:+0/+0
WheneverKeyword:DealsDamage/Opponent:Enchanted_Creature:Play:DrawCards/1:ControllingPlayer_Self:ASAP:Yes_No:No Special Condition:Whenever enchanted creature deals damage to an opponent, you may draw a card.
- Code: Select all
sleepers_robe.jpg http://www.wizards.com/global/images/magic/general/sleepers_robe.jpg
ophidian_eye.jpg http://www.wizards.com/global/images/magic/general/ophidian_eye.jpg
keen_sense.jpg http://www.wizards.com/global/images/magic/general/keen_sense.jpg
Last edited by Huggybaby on 12 Jul 2010, 21:48, edited 1 time in total.
Reason: fixed typo in title
Reason: fixed typo in title
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: cards with the wehnever keyword
by Chris H. » 12 Jul 2010, 16:27
The WheneverKeyword is a work in progress. I had a little fun with it this morning.
I had two Metathran Soldier in play. Each of these two creatures had a single Ophidian Eye aura attached to it. They both attacked and 4 not two resolves appeared on the stack and I drew 4 not 2 cards.
Sleeper's Robe needs a spell description rather than a no text. It should look like this:
Sleeper's Robe
U B
Enchantment Aura
Enchanted creature has fear.
Enchant creature
enPump:+0/+0/Fear
WheneverKeyword:DealsDamage/Opponent:Enchanted_Creature:Play:DrawCards/1:ControllingPlayer_Self:ASAP:Yes_No:No Special Condition:Whenever enchanted creature deals damage to an opponent, you may draw a card.
I had two Metathran Soldier in play. Each of these two creatures had a single Ophidian Eye aura attached to it. They both attacked and 4 not two resolves appeared on the stack and I drew 4 not 2 cards.
Sleeper's Robe needs a spell description rather than a no text. It should look like this:
Sleeper's Robe
U B
Enchantment Aura
Enchanted creature has fear.
Enchant creature
enPump:+0/+0/Fear
WheneverKeyword:DealsDamage/Opponent:Enchanted_Creature:Play:DrawCards/1:ControllingPlayer_Self:ASAP:Yes_No:No Special Condition:Whenever enchanted creature deals damage to an opponent, you may draw a card.
-
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: cards with the wehnever keyword
by Sloth » 12 Jul 2010, 17:15
I have reproduced this bug with Sleeper's Robe. And good catch with the discription.Chris H. wrote:The WheneverKeyword is a work in progress. I had a little fun with it this morning.
I had two Metathran Soldier in play. Each of these two creatures had a single Ophidian Eye aura attached to it. They both attacked and 4 not two resolves appeared on the stack and I drew 4 not 2 cards.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: cards with the wehnever keyword
by Beached As » 12 Jul 2010, 19:19
Bug has been pwned. I've also added those three cards similar to Curiosity, good job pointing them out.
- Beached As
- Programmer
- Posts: 110
- Joined: 23 Feb 2010, 07:48
- Has thanked: 0 time
- Been thanked: 0 time
Re: cards with the whenever keyword
by Sloth » 21 Jul 2010, 11:36
While testing your new keyword Beached As, I found a little inconsistency:
The trigger WheneverKeyword:DealsDamage triggers whenever a permanent deals damage, which is alright for Curiosity and the other auras, but not for Worldslayer and Dune-Brood Nephilim which should both only trigger on combat damage (I tested with Prodigal Sorcerer and Worldslayer triggered).
It would be great if you can fix this by adding a condition or just something like WheneverKeyword:DealsCombatDamage (implemented cards, that trigger like that, are Sword of Light and Shadow and Sedraxis Specter).
Edit:
I also found out that the AI always chooses its targets if the damage effect is applied even if a specific target is given. Example:
The trigger WheneverKeyword:DealsDamage triggers whenever a permanent deals damage, which is alright for Curiosity and the other auras, but not for Worldslayer and Dune-Brood Nephilim which should both only trigger on combat damage (I tested with Prodigal Sorcerer and Worldslayer triggered).
It would be great if you can fix this by adding a condition or just something like WheneverKeyword:DealsCombatDamage (implemented cards, that trigger like that, are Sword of Light and Shadow and Sedraxis Specter).
Edit:
I also found out that the AI always chooses its targets if the damage effect is applied even if a specific target is given. Example:
- Code: Select all
Poisonbelly Ogre
4 B
Creature Ogre Warrior
no text
3/3
WheneverKeyword:EntersBattleField:Type/Creature:Play:Damage/1:ControllingPlayer_Initiator:ASAP:No_Condition:Initiator - Other than Self:Whenever another creature enters the battlefield, its controller loses 1 life.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: cards with the whenever keyword
by Beached As » 23 Jul 2010, 02:28
I've been looking into the Worldslayer bug and i haven't found anything yet, i'll keep looking. I've been busy with a StaticEffect keyword (almost there too). It will allow slivers and cards like Goblin King to be keyworded.
WheneverKeyword:EntersBattleField:Type/Creature:Play:ModifyLife/-1:ControllingPlayer_Initiator:ASAP:No_Condition:Initiator - Other than Self:Whenever another creature enters the battlefield, its controller loses 1 life.
Use ModifyLife instead, it should be:Sloth wrote:I also found out that the AI always chooses its targets if the damage effect is applied even if a specific target is given. Example:This card works fine for the human, but the AI always deals damage to the player even if a creature enters the battlefield under the AIs control.
- Code: Select all
Poisonbelly Ogre
4 B
Creature Ogre Warrior
no text
3/3
WheneverKeyword:EntersBattleField:Type/Creature:Play:Damage/1:ControllingPlayer_Initiator:ASAP:No_Condition:Initiator - Other than Self:Whenever another creature enters the battlefield, its controller loses 1 life.
WheneverKeyword:EntersBattleField:Type/Creature:Play:ModifyLife/-1:ControllingPlayer_Initiator:ASAP:No_Condition:Initiator - Other than Self:Whenever another creature enters the battlefield, its controller loses 1 life.
- Beached As
- Programmer
- Posts: 110
- Joined: 23 Feb 2010, 07:48
- Has thanked: 0 time
- Been thanked: 0 time
Re: cards with the whenever keyword
by Sloth » 23 Jul 2010, 10:19
Beached As wrote:I've been looking into the Worldslayer bug and i haven't found anything yet, i'll keep looking.
Well it's not a bug of the whenever keyword, but a feature that is missing to make Worldslayer and Dune-Brood Nephilim work as they should. It works alright on Curiosity and more cards that I addded (example: Vedalken Heretic).
Well, Rob Cashwalker always reminds me to only add cards that not only work as they should work now, but which also work right with cards which might get added in the future (in this case damage prevention). And this hack also doesn't work for cards that deal damage to a specific creature (like Caltrops).Beached As wrote:Use ModifyLife instead, it should be:
WheneverKeyword:EntersBattleField:Type/Creature:Play:ModifyLife/-1:ControllingPlayer_Initiator:ASAP:No_Condition:Initiator - Other than Self:Whenever another creature enters the battlefield, its controller loses 1 life.
This will also make a lot of players (me included) happy!Beached As wrote:I've been busy with a StaticEffect keyword (almost there too). It will allow slivers and cards like Goblin King to be keyworded.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: cards with the whenever keyword
by Rob Cashwalker » 23 Jul 2010, 14:33
I'm also all for simplicity... and the WheneverKeyword keyword is quite cyptic.Well, Rob Cashwalker always reminds me to only add cards that not only work as they should work now, but which also work right with cards which might get added in the future (in this case damage prevention). And this hack also doesn't work for cards that deal damage to a specific creature (like Caltrops).
From what I can tell, Poisonbelly Ogre should use modify life as Beached As suggests. But it's not overtly obvious whose life is to be modified....
The Force will be with you, Always.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: cards with the whenever keyword
by Sloth » 23 Jul 2010, 19:07
Oh, sorry. I misread Poisonbelly Ogre. Your version is alright then Beached As. But it was just a bad example. The problem still applies to cards like Caltrops:
- Code: Select all
Caltrops
3
Artifact
no text
WheneverKeyword:Attacks:No_Initiator:Play:Damage/1:Initiating_Card:ASAP:No_Condition:No Special Condition:Whenever a creature attacks, Caltrops deals 1 damage to it.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: cards with the whenever keyword
by Sloth » 26 Jul 2010, 16:35
Another issue has come up:
And if you have some time Beached As, I can write down some other cards, that I tested and work fine but have strange issues when played by the AI.
Edit: For example when the AI controls Battle Strain (which you added) it will always deal the damage to you and not to the initiating creatures controler.
I tested this and found out that:Hamletchickencrisis wrote:In a quest mode game, Ajani's Pridemate was gaining counters off of opponent ai's Wall of Reverence life gain.
- Code: Select all
WheneverKeyword:GainLife:Controller:
And if you have some time Beached As, I can write down some other cards, that I tested and work fine but have strange issues when played by the AI.
Edit: For example when the AI controls Battle Strain (which you added) it will always deal the damage to you and not to the initiating creatures controler.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: cards with the whenever keyword
by slapshot5 » 15 Sep 2010, 23:13
Whatever came of this? I'm trying to add Ankh of Mishra via WheneverKeyword. Basically Poisonbelly Ogre, but for Lands.Sloth wrote:Oh, sorry. I misread Poisonbelly Ogre. Your version is alright then Beached As. But it was just a bad example. The problem still applies to cards like Caltrops
When the AI controls Caltrops and one of his creatures attacks, the AI is able to point the damage at you.
Here is what I have:
- Code: Select all
Name:Ankh of Mishra
ManaCost:2
Types:Artifact
Text:no text
K:WheneverKeyword:EntersBattleField:Type/Land:Play:Damage/2:ControllingPlayer_Initiator:ASAP:No_Condition:Initiator - Other than Self:Whenever a land enters the battlefield, Ankh of Mishra deals 2 damage to that land's controller.
K:Svar:Rarity:Rare
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/ankh_of_mishra.jpg
End
-slapshot5
- slapshot5
- Programmer
- Posts: 1391
- Joined: 03 Jan 2010, 17:47
- Location: Mac OS X
- Has thanked: 25 times
- Been thanked: 68 times
Re: cards with the whenever keyword
by Chris H. » 16 Sep 2010, 00:49
Death of a Thousand Stings is only partially implemented. The spLoseLifeTgt ability and spell text description works.
The WheneverKeyword spell text description is missing. The WheneverKeyword ability will trigger and ask if you want to move the card from graveyard to your hand. You can then choose yes or no, but either way the Death of a Thousand Stings card remains in the graveyard.
This version will display both spell text descriptions:
The WheneverKeyword spell text description is missing. The WheneverKeyword ability will trigger and ask if you want to move the card from graveyard to your hand. You can then choose yes or no, but either way the Death of a Thousand Stings card remains in the graveyard.
This version will display both spell text descriptions:
- Code: Select all
Name:Death of a Thousand Stings
ManaCost:4 B
Types:Instant Arcane
Text:At the beginning of your upkeep, if you have more cards in hand than each opponent, you may return Death of a Thousand Stings from your graveyard to your hand.\r\n
K:spLoseLifeTgt:1:Drawback$YouGainLife/1:Target player loses 1 life and you gain 1 life.
K:WheneverKeyword:BeginningOfUpkeep:No_Initiator:Graveyard:MoveFrom-Graveyard-Hand:Self:ASAP:Yes_No:ControllerUpkeep!MoreCardsInHand
K:SVar:Rarity:Common
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/death_of_a_thousand_stings.jpg
End
-
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: cards with the whenever keyword
by Sloth » 16 Sep 2010, 05:29
Beached As, the developer who made the whenever keyword, stopped contributing shortly after releasing this very large portion of code. There are some more unfixed bugs with it.slapshot5 wrote:Whatever came of this? I'm trying to add Ankh of Mishra via WheneverKeyword. Basically Poisonbelly Ogre, but for Lands.
Here is what I have:But, when the compy has Ankh of Mishra in play and plays a land, human is dealt the 2 damage.
- Code: Select all
Name:Ankh of Mishra
ManaCost:2
Types:Artifact
Text:no text
K:WheneverKeyword:EntersBattleField:Type/Land:Play:Damage/2:ControllingPlayer_Initiator:ASAP:No_Condition:Initiator - Other than Self:Whenever a land enters the battlefield, Ankh of Mishra deals 2 damage to that land's controller.
K:Svar:Rarity:Rare
K:SVar:Picture:http://www.wizards.com/global/images/magic/general/ankh_of_mishra.jpg
End
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: cards with the whenever keyword
by Chris H. » 17 Sep 2010, 18:15
`Sloth wrote:Beached As, the developer who made the whenever keyword, stopped contributing shortly after releasing this very large portion of code. There are some more unfixed bugs with it.
I found another bug today. Breeding pit is creating a token named "Thrull Token" rather than "Thrull" and it does not match the token jpg name. This may not be too hard to find and fix.
I may take a shot at it myself in a few days once Rob's new cards are merged into the SVN.
-
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: cards with the whenever keyword
by Chris H. » 19 Sep 2010, 01:08
`Chris H. wrote:I found another bug today. Breeding pit is creating a token named "Thrull Token" rather than "Thrull" and it does not match the token jpg name. This may not be too hard to find and fix.
I may take a shot at it myself in a few days once Rob's new cards are merged into the SVN.
I have spent a little time examining the "WheneverKeyword" keyword. In GameAction we have a section of code that makes tokens. It starts with:
- Code: Select all
// Make Token-Type-color-Power-Toughness-Keywords---Amount
if(Effect[y].contains("MakeToken")) {
and starting on line 1721 we have
- Code: Select all
CardFactoryUtil.makeToken( F_TokenConditions[1] + " Token", F_TokenConditions[2]+ " " + Integer.valueOf(F_TokenConditions[3])+ " " + Integer.valueOf(F_TokenConditions[4]) + " " + F_TokenConditions[1], F_card, Color, creatTypes, Integer.valueOf(F_TokenConditions[3]), Integer.valueOf(F_TokenConditions[4]), F_KeyWordConditions);
It looks like
- Code: Select all
F_TokenConditions[1] + " Token",
is causing the token to be named "Thrull Token". So, we have two different Thrull tokens, a 0/1 and a 1/1. If we delete the
- Code: Select all
+ " Token"
we end up with a token that is named like the other Thrull token. Does anyone have any thoughts on this matter?
-
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
18 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 34 guests