Page 1 of 1

stPreventDamage

PostPosted: 20 May 2011, 10:12
by Sloth
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:
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

Re: stPreventDamage

PostPosted: 20 May 2011, 12:41
by friarsol
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?

Re: stPreventDamage

PostPosted: 20 May 2011, 13:24
by Rob Cashwalker
Why is it being done as a keyword? Isn't it a trigger?

Re: stPreventDamage

PostPosted: 20 May 2011, 13:25
by friarsol
Rob Cashwalker wrote:Why is it being done as a keyword? Isn't it a trigger?
Nope. It's a replacement effect.

Re: stPreventDamage

PostPosted: 20 May 2011, 13:29
by Rob Cashwalker
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."

Re: stPreventDamage

PostPosted: 20 May 2011, 13:40
by friarsol
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."
The something else that is occurring is the 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.

Re: stPreventDamage

PostPosted: 20 May 2011, 13:51
by Rob Cashwalker
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}..."

Re: stPreventDamage

PostPosted: 20 May 2011, 13:52
by Sloth
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?
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.

Re: stPreventDamage

PostPosted: 20 May 2011, 13:57
by Sloth
Rob Cashwalker wrote:Does Forge deal damage in single 1 point units? Or in any integer quantity passed to the Damage method?
Of course it's integer quantity, triggers won't work correctly otherwise.

Re: stPreventDamage

PostPosted: 20 May 2011, 14:03
by friarsol
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}..."
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.

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.

Re: stPreventDamage

PostPosted: 20 May 2011, 14:16
by Sloth
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?
I will try to make an AF_PreventDamage, shouldn't be too hard starting with creatures only.

Re: stPreventDamage

PostPosted: 20 May 2011, 14:26
by friarsol
Sloth wrote:I will try to make an AF_PreventDamage, shouldn't be too hard starting with creatures only.
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.

Re: stPreventDamage

PostPosted: 20 May 2011, 15:09
by Sloth
friarsol wrote:
Sloth wrote:I will try to make an AF_PreventDamage, shouldn't be too hard starting with creatures only.
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.
Uh, Why? We have the player class.

Re: stPreventDamage

PostPosted: 20 May 2011, 15:25
by friarsol
Sloth wrote:Uh, Why? We have the player class.
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.

Re: stPreventDamage

PostPosted: 20 May 2011, 15:34
by Sloth
friarsol wrote:
Sloth wrote:Uh, Why? We have the player class.
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.
A keyword list would be nice for stuff like Ivory Mask.