It is currently 29 Oct 2025, 00:50
   
Text Size

stPreventDamage

Post MTG Forge Related Programming Questions Here

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

stPreventDamage

Postby 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:
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
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: stPreventDamage

Postby 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

Postby 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.
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: stPreventDamage

Postby friarsol » 20 May 2011, 13:25

Rob Cashwalker wrote:Why is it being done as a keyword? Isn't it a trigger?
Nope. It's a replacement effect.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: stPreventDamage

Postby 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.
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: stPreventDamage

Postby friarsol » 20 May 2011, 13:40

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: stPreventDamage

Postby 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}..."
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: stPreventDamage

Postby Sloth » 20 May 2011, 13:52

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: stPreventDamage

Postby Sloth » 20 May 2011, 13:57

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: stPreventDamage

Postby friarsol » 20 May 2011, 14:03

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: stPreventDamage

Postby Sloth » 20 May 2011, 14:16

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: stPreventDamage

Postby friarsol » 20 May 2011, 14:26

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: stPreventDamage

Postby Sloth » 20 May 2011, 15:09

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: stPreventDamage

Postby friarsol » 20 May 2011, 15:25

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.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: stPreventDamage

Postby Sloth » 20 May 2011, 15:34

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 25 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 25 users online :: 0 registered, 0 hidden and 25 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 25 guests

Login Form