Page 1 of 1

Looking at adding an AF to do looping

PostPosted: 04 May 2012, 23:35
by ArsenalNut
Since two of the new Avacyn Restored set use looping, I am interested in writing code to support looping. My thought is to create a Repeat AF with a "RepeatSubAbility" that works similar to WinSubAbility and LoseSubAbilitiy in Clash and FlipACoin AFs. The first thing I want to do is make a list of the cards that need looping so I can get an overall sense of what is needed. I searched for "repeat" in the rules text and came up with the following list that use looping.

Ad Nauseam
Crooked Scales
Eureka
Forbidden Ritual
Forgotten Lore
Grindstone - (currently hardcoded)
Hoarder's Greed - already scripted without looping AF
Hypergenesis
Kindle the Carnage
Mana Clash
Plague of Vermin
Primal Surge
Rally the Horde
Scalpelexis - (currently hardcoded)
Shrouded Lore
Struggle for Sanity
Tainted Pact
Thieves' Auction
Timesifter
Trade Secrets
Tyrant of Discord

Are there any cards I am missing?

Edit: noted cards already in Forge

Re: Looking at adding an AF to do looping

PostPosted: 05 May 2012, 00:19
by slowe
First of all, sweet! Thanks for working on this.

Second, a couple more cards that use this:
- Countryside Crusher is currently scripted with DigUntil, but would more correctly in some corner cases with repetition/looping
- Game of Chaos, a real funky one which might just need its own code
.. and I assume you saw Development (of Research // Development) but didn't list it because split cards are currently out of reach.

Re: Looking at adding an AF to do looping

PostPosted: 05 May 2012, 04:22
by friarsol
Possibly Helm of Obedience

Target opponent, Pay X.

Mill the top card of target's library. If the card is a creature, and it's still in the graveyard (no replacement effects), put onto Battlefield under your control and stop. If the amount of cards put into the graveyard (no replacement effects) equals X, stop. If the library is empty, stop. Otherwise, loop to the beginning.

Re: Looking at adding an AF to do looping

PostPosted: 05 May 2012, 23:07
by Iran
.Alliance of Arms
Collective Voyage
Shared Trauma
Minds Aglow
Mana-Charged
Killing Wave

I think these cards enter in this category

Re: Looking at adding an AF to do looping

PostPosted: 09 May 2012, 03:27
by ArsenalNut
Iran wrote:.Alliance of Arms
Collective Voyage
Shared Trauma
Minds Aglow
Mana-Charged Dragon
Killing Wave

I think these cards enter in this category
Killing Wave might be possible. I don't think just paying mana is supported as an ability so I don't think the other are possible right now.

Re: Looking at adding an AF to do looping

PostPosted: 09 May 2012, 06:17
by ArsenalNut
I checked in the an initial version of the Repeat AF in revision 15487. I also checked in the following cards I used to test the AF:

Ad Nauseam
Primal Surge
Tyrant of Discord

I didn't really test what the AI would do with the cards. The only thing I did was make the AI always choose not to repeat the process for cards like Ad Nauseam. The AI side of things will definitely need work.

I didn't script a card that uses it but the AF also supports the use of
RepeatCheckSVar and RepeatSVarCompare to setup conditions for repeating.

Re: Looking at adding an AF to do looping

PostPosted: 09 May 2012, 18:19
by Sloth
ArsenalNut wrote:I checked in the an initial version of the Repeat AF in revision 15487. I also checked in the following cards I used to test the AF:

Ad Nauseam
Primal Surge
Tyrant of Discord

I didn't really test what the AI would do with the cards. The only thing I did was make the AI always choose not to repeat the process for cards like Ad Nauseam. The AI side of things will definitely need work.

I didn't script a card that uses it but the AF also supports the use of
RepeatCheckSVar and RepeatSVarCompare to setup conditions for repeating.
Good work ArsenalNut. I saw no problem with Primal Surge and Tyrant of Discord, so i removed SVar:RemAIDeck:True from them.