Page 1 of 5

StaticEffectFactory

PostPosted: 03 Jul 2011, 08:09
by Sloth
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?

Re: StaticEffectFactory

PostPosted: 03 Jul 2011, 13:33
by friarsol
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

Re: StaticEffectFactory

PostPosted: 03 Jul 2011, 13:49
by jeffwadsworth
My only comment is "Wow!!". =D>

Re: StaticEffectFactory

PostPosted: 03 Jul 2011, 14:10
by Hellfish
Sweet, sweet uniformity :D

Re: StaticEffectFactory

PostPosted: 03 Jul 2011, 15:21
by Sloth
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.

Re: StaticEffectFactory

PostPosted: 03 Jul 2011, 15:38
by friarsol
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.

Re: StaticEffectFactory

PostPosted: 03 Jul 2011, 19:48
by Sloth
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.

Re: StaticEffectFactory

PostPosted: 06 Jul 2011, 22:54
by slapshot5
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

Re: StaticEffectFactory

PostPosted: 07 Jul 2011, 00:00
by friarsol
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.

Re: StaticEffectFactory

PostPosted: 07 Jul 2011, 11:22
by Rob Cashwalker
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.*

Re: StaticEffectFactory

PostPosted: 08 Jul 2011, 12:30
by Sloth
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?

Re: StaticEffectFactory

PostPosted: 08 Jul 2011, 13:23
by Hellfish
It's worth a try.I can't immideately think of any complications, but that doesn't mean there won't be :mrgreen:

Re: StaticEffectFactory

PostPosted: 08 Jul 2011, 13:41
by Sloth
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.

Re: StaticEffectFactory

PostPosted: 08 Jul 2011, 14:11
by Hellfish
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.

Re: StaticEffectFactory

PostPosted: 08 Jul 2011, 15:39
by Sloth
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.