It is currently 11 Sep 2025, 11:38
   
Text Size

Looking at adding an AF to do looping

Post MTG Forge Related Programming Questions Here

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

Looking at adding an AF to do looping

Postby ArsenalNut » 04 May 2012, 23:35

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
Last edited by ArsenalNut on 09 May 2012, 05:47, edited 1 time in total.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Looking at adding an AF to do looping

Postby slowe » 05 May 2012, 00:19

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.
slowe
 
Posts: 127
Joined: 05 Jan 2010, 14:04
Has thanked: 6 times
Been thanked: 10 times

Re: Looking at adding an AF to do looping

Postby friarsol » 05 May 2012, 04:22

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

Re: Looking at adding an AF to do looping

Postby Iran » 05 May 2012, 23:07

.Alliance of Arms
Collective Voyage
Shared Trauma
Minds Aglow
Mana-Charged
Killing Wave

I think these cards enter in this category
Iran
 
Posts: 251
Joined: 11 Jul 2011, 04:36
Has thanked: 61 times
Been thanked: 4 times

Re: Looking at adding an AF to do looping

Postby ArsenalNut » 09 May 2012, 03:27

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.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Looking at adding an AF to do looping

Postby ArsenalNut » 09 May 2012, 06:17

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.
So many cards, so little time
User avatar
ArsenalNut
 
Posts: 512
Joined: 08 Jul 2011, 03:49
Has thanked: 27 times
Been thanked: 121 times

Re: Looking at adding an AF to do looping

Postby Sloth » 09 May 2012, 18:19

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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 49 guests

Main Menu

User Menu

Our Partners


Who is online

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

Login Form