It is currently 12 Sep 2025, 22:38
   
Text Size

Converting Keywords to Factories

Post MTG Forge Related Programming Questions Here

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

Converting Keywords to Factories

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

Re: Converting Keywords to Factories

Postby 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 8-[
friarsol wrote: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)
A CounterRemoved trigger with IsPresent$ Card+Self+counters_TIME_EQ0 might well work.

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.
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.
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: Converting Keywords to Factories

Postby friarsol » 22 Apr 2012, 19:53

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.
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.

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


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 65 guests

Main Menu

User Menu

Our Partners


Who is online

In total there are 65 users online :: 0 registered, 0 hidden and 65 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 65 guests

Login Form