StaticEffectFactory
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
66 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
StaticEffectFactory
by Sloth » 03 Jul 2011, 08:09
To be close to AbilityFactory and Triggers, I imagine it to look like this:
Example: Crusade
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?
Example: Crusade
- Code: Select all
S:Affected$ Creature.White | AddPower$ 1 | AddToughness$ 1 | EffectDescription$ White creatures get +1/+1.
- 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?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticEffectFactory
by friarsol » 03 Jul 2011, 13:33
I love it already.Sloth wrote:I hope this should cover everything. I won't commit anything active until the next beta is released. Any comments?
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
- jeffwadsworth
- Super Tester Elite
- Posts: 1172
- Joined: 20 Oct 2010, 04:47
- Location: USA
- Has thanked: 287 times
- Been thanked: 70 times
Re: StaticEffectFactory
by Hellfish » 03 Jul 2011, 14:10
Sweet, sweet uniformity 

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
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
-
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
by Sloth » 03 Jul 2011, 15:21
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.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
Prevention and Replacement effects likely need their own factory.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticEffectFactory
by 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
by Sloth » 03 Jul 2011, 19:48
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.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.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticEffectFactory
by 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
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
by 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
by 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.
-
Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: StaticEffectFactory
by 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?
Wouldn't this be fairly easy?
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticEffectFactory
by 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 

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
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
-
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
by Sloth » 08 Jul 2011, 13:41
Maybe targeting and paying costs will require some work. But implementing it otherwise will also have to fight with that.Hellfish wrote:It's worth a try.I can't immideately think of any complications, but that doesn't mean there won't be
Will you do this Hellfish? Or should I once I finished converteing the continuous static effects.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: StaticEffectFactory
by 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
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
-
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
by Sloth » 08 Jul 2011, 15:39
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.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.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
66 posts
• Page 1 of 5 • 1, 2, 3, 4, 5
Who is online
Users browsing this forum: No registered users and 37 guests