stPreventDamage
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
15 posts
• Page 1 of 1
stPreventDamage
by Sloth » 20 May 2011, 10:12
I'm working on keywording static damage prevention.
the syntax will look like this:
stPreventDamage:[Who is protected(You/Player/ValidCards)]:[ValidSource]:[Amount/All]:[Description]
Example:
the syntax will look like this:
stPreventDamage:[Who is protected(You/Player/ValidCards)]:[ValidSource]:[Amount/All]:[Description]
Example:
- Code: Select all
Name:Sphere of Grace
ManaCost:3 W
Types:Enchantment
Text:no text
K:stPreventDamage:You:Card.Black:2:If a black source would deal damage to you, prevent 2 of that damage.
SVar:RemRandomDeck:True
SVar:Rarity:Uncommon
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphere_of_grace.jpg
SetInfo:ODY|Uncommon|http://magiccards.info/scans/en/od/49.jpg
End
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: stPreventDamage
by friarsol » 20 May 2011, 12:41
Excellent. I remember mentioning this when you were talking about prevention the last time it came up. Now we just need someone motivated enough to write up an AF for Samite Healer . I think you said last time that we can handle prevent next X damage, but couldn't really handle prevent "of your choice" effects. Is that right? What's the syntax for all that?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: stPreventDamage
by Rob Cashwalker » 20 May 2011, 13:24
Why is it being done as a keyword? Isn't it a trigger?
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: stPreventDamage
by friarsol » 20 May 2011, 13:25
Nope. It's a replacement effect.Rob Cashwalker wrote:Why is it being done as a keyword? Isn't it a trigger?
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: stPreventDamage
by Rob Cashwalker » 20 May 2011, 13:29
But replacement effects occur because something else occurred. It could be handled just like "Whenever a black source deals damage to you, prevent n of that damage."
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: stPreventDamage
by friarsol » 20 May 2011, 13:40
The something else that is occurring is the damage.Rob Cashwalker wrote:But replacement effects occur because something else occurred. It could be handled just like "Whenever a black source deals damage to you, prevent n of that damage."
http://wiki.mtgsalvation.com/article/Re ... on_effects
"419.7c Some prevention effects generated by static abilities refer to a specific amount of damage—for example, “If a source would deal damage to you, prevent 1 of that damage.” Such an effect prevents only the indicated amount of damage from any applicable source at any given time. It will apply separately to damage from other applicable sources, or to damage that would be dealt by the same source at a different time. "
Triggered abilities use the stack, but damage resolution does not. So there would be no time to trigger the ability (and have it resolve) before the damage would "resolve"; Magic used to work like this where there would be a "Damage Resolution" portion of all damage dealing cards, where you could tap your Samite Healer or your Urza's Armor would effect the damaging spells. Now what happens is Prevention "shields" are created and used up when the appropriate scenario happens.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: stPreventDamage
by Rob Cashwalker » 20 May 2011, 13:51
Does Forge deal damage in single 1 point units? Or in any integer quantity passed to the Damage method?
I know it's not technically correct, but that's not stopped us before....
My main point, is that I would rather see the "K:{keyword}" syntax stick to regular keywords. (plus simple params, like "{keyword}:n") If we have to make the leap from AbilityFactory to EffectFactory, then do it, and make the card text syntax "E:EF{effect_name}..."
I know it's not technically correct, but that's not stopped us before....
My main point, is that I would rather see the "K:{keyword}" syntax stick to regular keywords. (plus simple params, like "{keyword}:n") If we have to make the leap from AbilityFactory to EffectFactory, then do it, and make the card text syntax "E:EF{effect_name}..."
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: stPreventDamage
by Sloth » 20 May 2011, 13:52
The AF just has to add an amount to the variable "preventNextDamage" stored in the Player/Card class. Everything else is taken care of already.friarsol wrote:Excellent. I remember mentioning this when you were talking about prevention the last time it came up. Now we just need someone motivated enough to write up an AF for Samite Healer . I think you said last time that we can handle prevent next X damage, but couldn't really handle prevent "of your choice" effects. Is that right? What's the syntax for all that?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: stPreventDamage
by Sloth » 20 May 2011, 13:57
Of course it's integer quantity, triggers won't work correctly otherwise.Rob Cashwalker wrote:Does Forge deal damage in single 1 point units? Or in any integer quantity passed to the Damage method?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: stPreventDamage
by friarsol » 20 May 2011, 14:03
I agree that our next big effort should be in converting all the Static abilities over to an "EffectFactory". Not only will it create scripting that's more readable, but will also bring the last of our "complex keywords" in line with our modern scripting.Rob Cashwalker wrote:My main point, is that I would rather see the "K:{keyword}" syntax stick to regular keywords. (plus simple params, like "{keyword}:n") If we have to make the leap from AbilityFactory to EffectFactory, then do it, and make the card text syntax "E:EF{effect_name}..."
It should also help with samples and documentation. This might be a fairly straightforward conversion since I'm not sure if there are any of the same AI functionalities that exist for SAs and Triggers.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: stPreventDamage
by Sloth » 20 May 2011, 14:16
I will try to make an AF_PreventDamage, shouldn't be too hard starting with creatures only.friarsol wrote:Excellent. I remember mentioning this when you were talking about prevention the last time it came up. Now we just need someone motivated enough to write up an AF for Samite Healer . I think you said last time that we can handle prevent next X damage, but couldn't really handle prevent "of your choice" effects. Is that right? What's the syntax for all that?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: stPreventDamage
by friarsol » 20 May 2011, 14:26
Yea, we might have to make Dummy Cards for Players, so these Bubbles can be attached to something. This would probably help with giving Players protection or shroud or a host of other things down the line.Sloth wrote:I will try to make an AF_PreventDamage, shouldn't be too hard starting with creatures only.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: stPreventDamage
by Sloth » 20 May 2011, 15:09
Uh, Why? We have the player class.friarsol wrote:Yea, we might have to make Dummy Cards for Players, so these Bubbles can be attached to something. This would probably help with giving Players protection or shroud or a host of other things down the line.Sloth wrote:I will try to make an AF_PreventDamage, shouldn't be too hard starting with creatures only.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: stPreventDamage
by friarsol » 20 May 2011, 15:25
Do Players already have List<Keywords>? That's really all we need, not sure why I was thinking it had to be done with dummy cards, probably just thinking about how I would have done it originally.Sloth wrote:Uh, Why? We have the player class.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: stPreventDamage
by Sloth » 20 May 2011, 15:34
A keyword list would be nice for stuff like Ivory Mask.friarsol wrote:Do Players already have List<Keywords>? That's really all we need, not sure why I was thinking it had to be done with dummy cards, probably just thinking about how I would have done it originally.Sloth wrote:Uh, Why? We have the player class.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
15 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 19 guests