It is currently 11 Sep 2025, 23:15
   
Text Size

StaticEffectFactory

Post MTG Forge Related Programming Questions Here

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

StaticEffectFactory

Postby Sloth » 03 Jul 2011, 08:09

To be close to AbilityFactory and Triggers, I imagine it to look like this:

Example: Crusade
Code: Select all
S:Affected$ Creature.White | AddPower$ 1 | AddToughness$ 1 | EffectDescription$ White creatures get +1/+1.
Example: Life and Limb
Code: Select all
S:Affected$ Forest,Saproling | AddCardType$ Creature,Land | AddSubType$ Forest,Saproling | SetPower$ 1 | SetToughness$ 1 | EffectDescription$ All Forests and all Saprolings are 1/1 green Saproling creatures and Forest lands in addition to their other types.
'

Parameters:

A. General
EffectZone (defaults to Battlefield)
Affected (can be expanded to players in the future)
Description

B. Effects
AddPower, AddToughness, SetPower, SetToughness, SwitchPT
AddKeyword, AddAbility, AddTrigger
RemoveKeyword, RemoveAbility, RemoveTrigger (allowed is "All")
AddSuperType, AddCardType, AddSubType
RemoveSuperType, RemoveCardType, RemoveSubType (allowed is "All")
AddColor
RemoveColor (allowed is "All")

C. Conditions
isPresent, Threshold, etc.

I hope this should cover everything. I won't commit anything active until the next beta is released. Any comments?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticEffectFactory

Postby friarsol » 03 Jul 2011, 13:33

Sloth wrote:I hope this should cover everything. I won't commit anything active until the next beta is released. Any comments?
I love it already.

Do we need some type of "API" like we have for future looking like maybe if stPreventDamage gets converted over? All the ones you mentioned above are kinda "Pump" (or whatever nomenclature)

We would see something like:

Crusade
S:Mode$ Pump | Affected$ Creatures.White | AddPower$ 1 | AddToughnes$ 1 | EffectDescription$ White creatures gain +1/+1.
Urza's Armor
S:Mode$ PreventDamage | Affected$ You | DamageSource$ Card | DamageReduced$ 1
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby jeffwadsworth » 03 Jul 2011, 13:49

My only comment is "Wow!!". =D>
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: StaticEffectFactory

Postby Hellfish » 03 Jul 2011, 14:10

Sweet, sweet uniformity :D
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: StaticEffectFactory

Postby Sloth » 03 Jul 2011, 15:21

friarsol wrote:Do we need some type of "API" like we have for future looking like maybe if stPreventDamage gets converted over? All the ones you mentioned above are kinda "Pump" (or whatever nomenclature)

We would see something like:

Crusade
S:Mode$ Pump | Affected$ Creatures.White | AddPower$ 1 | AddToughnes$ 1 | EffectDescription$ White creatures gain +1/+1.
Urza's Armor
S:Mode$ PreventDamage | Affected$ You | DamageSource$ Card | DamageReduced$ 1
This kind of static ability only has to be called when damage is involved. The "Pump" abilities have to be called during each gamestate check. I can't see how to lump these together in the code.

Prevention and Replacement effects likely need their own factory.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticEffectFactory

Postby friarsol » 03 Jul 2011, 15:38

Wouldn't that be what the Mode is for? Like how they work for Triggers. Maybe the mode would be "Continuous" that are checked at each gamestate. And when Damage is dealt it would check any Damage prevention, etc.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby Sloth » 03 Jul 2011, 19:48

friarsol wrote:Wouldn't that be what the Mode is for? Like how they work for Triggers. Maybe the mode would be "Continuous" that are checked at each gamestate. And when Damage is dealt it would check any Damage prevention, etc.
Ok, that makes sense. I will start off with the "Continuous" mode then. I hope the whole factory won't make the performance worse when lots of static effects have to be checked.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticEffectFactory

Postby slapshot5 » 06 Jul 2011, 22:54

Will this be able to handle things like "As CARDNAME enters the battlefield, choose a creature type"?

Will we be able to leverage AbilityFactory to help with that? Perhaps with a AbilityFactory_Choose.createStaticAbilityChooseType(...) that can leverage the same resolve?

-slapshot5
slapshot5
Programmer
 
Posts: 1391
Joined: 03 Jan 2010, 17:47
Location: Mac OS X
Has thanked: 25 times
Been thanked: 68 times

Re: StaticEffectFactory

Postby friarsol » 07 Jul 2011, 00:00

I don't see any reason why we couldn't have an ETB Static Mode, even though it doesn't really exist right now. Linking to an AF might be the best way to go for Choose a type and Choose a Color type cards.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: StaticEffectFactory

Postby Rob Cashwalker » 07 Jul 2011, 11:22

I recently added the entire Mistform Ultimus creature type list along with all the other type data previously hardcoded. You can now actually present a list of creature type choices. look at Constant.CardTypes.*
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: StaticEffectFactory

Postby Sloth » 08 Jul 2011, 12:30

Working on continuous static effects, I wonder if it's not easier to implement "as CARDNAME enters the battlefield" static abilities with the trigger system and giving them the parameter "Static$ True". The ability should be build normally using the AbilityFactory but it will skip the stack (going straight to resolve).

Wouldn't this be fairly easy?
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticEffectFactory

Postby Hellfish » 08 Jul 2011, 13:23

It's worth a try.I can't immideately think of any complications, but that doesn't mean there won't be :mrgreen:
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: StaticEffectFactory

Postby Sloth » 08 Jul 2011, 13:41

Hellfish wrote:It's worth a try.I can't immideately think of any complications, but that doesn't mean there won't be :mrgreen:
Maybe targeting and paying costs will require some work. But implementing it otherwise will also have to fight with that.

Will you do this Hellfish? Or should I once I finished converteing the continuous static effects.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: StaticEffectFactory

Postby Hellfish » 08 Jul 2011, 14:11

I just added it. I already had infrastructure for it, so it was just a matter of catching the parameter. I could use some help finding cards that need to use it but currently don't though.
So now you're
Screaming for the blood of the cookie monster
Evil puppet demon of obesity
Time to change the tune of his fearful ballad
C is for "Lettuce," that's good enough for me
User avatar
Hellfish
Programmer
 
Posts: 1297
Joined: 07 Jun 2009, 10:41
Location: South of the Pumphouse
Has thanked: 110 times
Been thanked: 169 times

Re: StaticEffectFactory

Postby Sloth » 08 Jul 2011, 15:39

Hellfish wrote:I just added it. I already had infrastructure for it, so it was just a matter of catching the parameter. I could use some help finding cards that need to use it but currently don't though.
I couldn't find any at a quick glance. We do have some hardcoded ones that can be converted now: An-Zerrin Ruins, Cover of Darkness, Curse of Wizardry, etc.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Next

Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 35 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 10 minutes)
Most users ever online was 7967 on 09 Sep 2025, 23:08

Users browsing this forum: No registered users and 35 guests

Login Form