Converting Keywords to Factories
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
3 posts
• Page 1 of 1
Converting Keywords to Factories
by friarsol » 22 Apr 2012, 18:56
Certain Keywords we have are hardcoded, where they could be integrated into the Ability/Trigger/Static system that exists. Now I'm less familiar with the Trigger and Static system, so maybe the guys who have coded them up can chime in to say which of these are feasible.
Here's an incomplete list and how I'd picture them working:
Cycling - AB$ Draw | Cost$ Cost + Discard<1/Card.Self> | ActivationZone$ Hand. Set isCycling flag.
Typecycling - AB$ ChangeZone | Cost$ Cost + Discard<1/Card.Self> | Origin$ Library | Destination$ Hand | ChangeType$ <Type>. Set isCycling flag.
Transmute - AB$ ChangeZone | Cost$ Cost + Discard<1/Card.Self> | Origin$ Library | Destination$ Hand | ChangeType$ <Card.cmcEQX>.
Suspend - Both Triggers should be able to be converted. The actual Suspend action will have to stay hardcoded
Fading - Fading is basically: etbCounter:Fade:X and a Trigger that removes a fade counter during the upkeep if it has one. Or Sacrificing the card if it doesn't have one.
Vanishing - etbCounter:Time:X. Trigger that remove a fade counter if it has one. Trigger that sacrifices the permanent when the last counter is removed (not sure if this trigger exists)
Split Second - Static Ability that grants CantBeCast on both players and CantBeActivated (except Mana) on both players. EffectZone is only on the Stack.
Here's an incomplete list and how I'd picture them working:
Cycling - AB$ Draw | Cost$ Cost + Discard<1/Card.Self> | ActivationZone$ Hand. Set isCycling flag.
Typecycling - AB$ ChangeZone | Cost$ Cost + Discard<1/Card.Self> | Origin$ Library | Destination$ Hand | ChangeType$ <Type>. Set isCycling flag.
Transmute - AB$ ChangeZone | Cost$ Cost + Discard<1/Card.Self> | Origin$ Library | Destination$ Hand | ChangeType$ <Card.cmcEQX>.
Suspend - Both Triggers should be able to be converted. The actual Suspend action will have to stay hardcoded
Fading - Fading is basically: etbCounter:Fade:X and a Trigger that removes a fade counter during the upkeep if it has one. Or Sacrificing the card if it doesn't have one.
Vanishing - etbCounter:Time:X. Trigger that remove a fade counter if it has one. Trigger that sacrifices the permanent when the last counter is removed (not sure if this trigger exists)
Split Second - Static Ability that grants CantBeCast on both players and CantBeActivated (except Mana) on both players. EffectZone is only on the Stack.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
Re: Converting Keywords to Factories
by Hellfish » 22 Apr 2012, 19:38
I'm all for it. Forgive me if I only cheer from the sidelines,though, my codebase is a *little* dirty

A CounterRemoved trigger with IsPresent$ Card+Self+counters_TIME_EQ0 might well work.
Maybe two triggers at worst. One for when the card has a counter that subtracts one and one that sacs the card when there's none.Fading - Fading is basically: etbCounter:Fade:X and a Trigger that removes a fade counter during the upkeep if it has one. Or Sacrificing the card if it doesn't have one.
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: Converting Keywords to Factories
by friarsol » 22 Apr 2012, 19:53
Should be able to do it with one trigger and conditionals, since it might be possible to remove counters after the trigger hits the stack.Hellfish wrote:Maybe two triggers at worst. One for when the card has a counter that subtracts one and one that sacs the card when there's none.
I know what you mean about dirty code. I have a few half started ideas, that didn't flesh out that I probably should just nuke, but can't quite do it.
- friarsol
- Global Moderator
- Posts: 7593
- Joined: 15 May 2010, 04:20
- Has thanked: 243 times
- Been thanked: 965 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 68 guests