It is currently 27 Apr 2024, 04:24
   
Text Size

New keyword: stPump

Post MTG Forge Related Programming Questions Here

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

New keyword: stPump

Postby Sloth » 17 Sep 2010, 20:24

I've added the new keyword (proposed by Rob):

stPump<Range>:<Requirements>:<Bonus>:<Special Condition>:<Description>

<Range>: Self , All, Other, Enchanted

<Requirements>: isValidCard restrictions

<Bonus>: <Power>/<Toughness>/<Keyword> & <Keyword> & ...

<Special Condition>: [CardsInHandMore][Num] , [Threshold] , [Hellbent] , [Metalcraft] , [isEquipped] , [isUntapped] , [isEnchanted] , [LibraryLE][Num] , [isPresent] <ValidCard restriction> , [isNotPresent] <ValidCard restriction>


Examples:
Code: Select all
Name:Auriok Glaivemaster
ManaCost:W
Types:Creature Human Soldier
Text:no text
PT:1/1
K:stPumpSelf:Permanent.equipped:1/1/First Strike:No Condition:As long as Auriok Glaivemaster is equipped, it gets +1/+1 and has first strike.
Code: Select all
Name:Mindwrack Liege
ManaCost:3 UR UR UR
Types:Creature Horror
Text:UR UR UR UR: You may put a blue or red creature card from your hand onto the battlefield.
PT:4/4
K:stPumpOther:Creature.Blue+YouCtrl:1/1:No Condition:Other blue creatures you control get +1/+1.
K:stPumpOther:Creature.Red+YouCtrl:1/1:No Condition:Other red creatures you control get +1/+1.
Code: Select all
Name:Gravitational Shift
ManaCost:3 U U
Types:Enchantment
Text:no text
K:stPumpAll:Creature.withFlying:2/0:No Condition:Creatures with flying get +2/+0.
K:stPumpAll:Creature.withoutFlying:-2/0:No Condition:Creatures without flying get -2/-0.
Code: Select all
Name:Ember Weaver
ManaCost:2 G
Types:Creature Spider
Text:no text
PT:2/3
K:Reach
K:stPumpSelf:Creature:1/0/First Strike:isPresent Permanent.Red+YouCtrl:As long as you control a red permanent, Ember Weaver gets +1/+0 and has first strike.
Code: Select all
Name:True Conviction
ManaCost:3 W W W
Types:Enchantment
Text:no text
K:stPumpAll:Creature.YouCtrl:0/0/Lifelink & Double Strike:No Condition:Creatures you control have double strike and lifelink.
Last edited by Sloth on 01 Oct 2010, 10:10, edited 8 times in total.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Sloth » 19 Sep 2010, 15:27

I updated the syntax of stPumpAll:

Bonus is now expressed by P/T/Keyword/Keyword/.....

I updated the examples above.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Sloth » 19 Sep 2010, 16:02

I've added the special conditions: Threshold and Hellbent.

Examples:

Code: Select all
Name:Anurid Barkripper
ManaCost:1 G G
Types:Creature Frog Beast
Text:no text
PT:2/2
K:stPumpAll:Creature:Self:2/2:Threshold:Threshold - Anurid Barkripper gets +2/+2 as long as seven or more cards are in your graveyard.
Code: Select all
Name:Cutthroat il-Dal
ManaCost:3 B
Types:Creature Human Rogue
Text:no text
PT:4/1
K:stPumpAll:Creature:Self:0/0/Shadow:Hellbent:Hellbent - Cutthroat il-Dal has shadow as long as you have no cards in hand. (It can block or be blocked by only creatures with shadow.)
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Sloth » 19 Sep 2010, 17:17

I've added the special condition: isEquipped.

Examples:

Code: Select all
Name:Raksha Golden Cub
ManaCost:5 W W
Types:Legendary Creature Cat Soldier
Text:no text
PT:3/4
K:Vigilance
K:stPumpAll:Creature.Cat:Permanents you Control:2/2/Double Strike:isEquipped:As long as Raksha Golden Cub is equipped, Cat creatures you control get +2/+2 and have double strike.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Rob Cashwalker » 20 Sep 2010, 00:11

Sloth wrote:I updated the syntax of stPumpAll:

Bonus is now expressed by P/T/Keyword/Keyword/.....

I updated the examples above.
I'd like to request you keep the format the other pumps use - P/T/K1&K2&...&Kn
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: New keyword: stPumpAll

Postby Sloth » 20 Sep 2010, 05:42

Rob Cashwalker wrote:
Sloth wrote:I updated the syntax of stPumpAll:

Bonus is now expressed by P/T/Keyword/Keyword/.....

I updated the examples above.
I'd like to request you keep the format the other pumps use - P/T/K1&K2&...&Kn
No problem, I will change it. Any other suggestions?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Rob Cashwalker » 20 Sep 2010, 11:36

Well, I'm not terribly satisfied with the syntax "{ValidCards}:Permanents you control". I think we need to implement "YouCtrl" and "YouDontCtrl" as qualifiers for isValidCard. It applies to many other situations, so it's worth the effort.

And Anurid Barkripper... OK, I get that it works, but I'm not crazy about it using "stPumpAll". You can reduce that parameter to be part of the keyword itself. "stPumpSelf", "stPumpOther", "stPumpAll"... you trigger off "stPump", then check for the "range".
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: New keyword: stPumpAll

Postby Sloth » 20 Sep 2010, 13:59

Rob Cashwalker wrote:Well, I'm not terribly satisfied with the syntax "{ValidCards}:Permanents you control". I think we need to implement "YouCtrl" and "YouDontCtrl" as qualifiers for isValidCard. It applies to many other situations, so it's worth the effort.
Maybe we can make a second method isValidCard(String Restrictions[], Card Source, String Controller)? Then we can allow for "YouCtrl", "YouDontCtrl" and also "NotSelf".

Rob Cashwalker wrote:And Anurid Barkripper... OK, I get that it works, but I'm not crazy about it using "stPumpAll". You can reduce that parameter to be part of the keyword itself. "stPumpSelf", "stPumpOther", "stPumpAll"... you trigger off "stPump", then check for the "range".
Since there are 13 possible "Zones" already, I'd like to keep them as a seperate entry of the array. But just naming the keyword "stPump", would be more logical I agree.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Rob Cashwalker » 20 Sep 2010, 14:43

That's what I was thinking. More of a two-step process. The new method would handle checking for the controller portion, then pass it on to the original method for the normal characteristics. I'll throw something together for this later.

It's not like all 13 zones need to be represented for this particular keyword.... I think these are just about the only types needed.
PumpSelf, is an interesting one, because it could single-handedly support Nightmare and all like it. However, it's not technically correct, it should be handled by a very similar type of keyword "stSetPT"....

BTW, this static pump effect was one of the first things I wanted to try to assemble in one block of code. But that was before I had figured out how to do all the other keyword stuff, so I gave up early on, and did the first Pump spell keyword.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: New keyword: stPumpAll

Postby Sloth » 20 Sep 2010, 15:43

Rob Cashwalker wrote:It's not like all 13 zones need to be represented for this particular keyword.... I think these are just about the only types needed.
These 9 "Zones" are currently used by cards that have the stPumpAll or staticEffect keyword:
All Cards, All Permanents, Permanents you Control, Other Permanents you Control, Permanents your Opponents Control, Self, Enchanted Permanent and Eqiupped Permanent.

And some cards like Teferi, Mage of Zhalfir and Sedris, the Traitor King need other "Zones".

I don't think there is a need to have the "Range", just after "stPump" without ":". Yes, it would keep it in line with ab and sp keywords, but those need different AI code, while stPump does not (I think).

Rob Cashwalker wrote:PumpSelf, is an interesting one, because it could single-handedly support Nightmare and all like it. However, it's not technically correct, it should be handled by a very similar type of keyword "stSetPT"....
Once we get the layer system working (cough), these cards will have to be handled differently.

Rob Cashwalker wrote:BTW, this static pump effect was one of the first things I wanted to try to assemble in one block of code. But that was before I had figured out how to do all the other keyword stuff, so I gave up early on, and did the first Pump spell keyword.
Actually Beached As did quite a good job here, I just ordered and cleaned the components.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Rob Cashwalker » 20 Sep 2010, 15:58

These 9 "Zones" are currently used by cards that have the stPumpAll or staticEffect keyword:
All Cards, All Permanents, Permanents you Control, Other Permanents you Control, Permanents your Opponents Control, Self, Enchanted Permanent and Eqiupped Permanent.

And some cards like Teferi, Mage of Zhalfir and Sedris, the Traitor King need other "Zones".
Cards which deal with "all, even not in play" or any zone other than the battlefield are the corner cases which can use explicit code. Leaving cleaner keyword text for hundreds of normal cards.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: New keyword: stPumpAll

Postby Sloth » 20 Sep 2010, 16:12

Rob Cashwalker wrote:Cards which deal with "all, even not in play" or any zone other than the battlefield are the corner cases which can use explicit code. Leaving cleaner keyword text for hundreds of normal cards.
Ok, you've convinced me. So we will have:

    stPumpSelf
    stPumpAll
    stPumpEnchanted
    stPumpEquipped

The rest can be done by isValidCard, if YouCtrl, YouDontCtrl and NotSelf are options.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Rob Cashwalker » 20 Sep 2010, 16:20

LOL...

Don't forget "Other".

The requirement of the permanent granting the effect only if enchanted or equipped could be done as an optional parameter - see "NoRegen" for destroy keywords. ie: "IfEquipped" or "IfEnchanted"

Another benefit to starting with simpler syntax is that more complex syntax can be added later when we move away from the simple ":" delimited parameters to named parameters.

Think of the whenever keyword... it is obviously powerful and could handle a number of effects. But unless you were intimately related to the keyword (the original programmer) would you really have any idea what all the parameters did? With named parameters, it would be much easier to interpret, and more cards may be supported by it because it's easier to add them.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Re: New keyword: stPumpAll

Postby Sloth » 20 Sep 2010, 17:06

Rob Cashwalker wrote:Don't forget "Other".
Ok, plus: stPumpOther

Rob Cashwalker wrote:The requirement of the permanent granting the effect only if enchanted or equipped could be done as an optional parameter - see "NoRegen" for destroy keywords. ie: "IfEquipped" or "IfEnchanted"
"IfEquipped" and "IfEnchanted" are used as conditions, but we also need Equipped and Enchanted as "Range" for cards like Tenza, Godo's Maul, Clutch of Undeath and Kirtar's Desire.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: New keyword: stPumpAll

Postby Rob Cashwalker » 20 Sep 2010, 17:31

I think those should be handled specifically by the enchantment itself. "enPump", if it doesn't exist already, because putting the enchantment or equipment on a particular permanent needs AI anyway, so while some of the code may be redundant, there is a logical difference between a Glorious Anthem and an Aura.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: Google [Bot] and 91 guests


Who is online

In total there are 92 users online :: 1 registered, 0 hidden and 91 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: Google [Bot] and 91 guests

Login Form