Page 1 of 1

Question about Attach AF drawback implementation

PostPosted: 13 Jan 2012, 07:47
by ArsenalNut
What is the purpose of the chkAIDrawback() and doTrigger() methods? The Attach drawback is coded up but I wasn't entirely sure what to do with these methods. I tried looking at some of the other ability factories but I wasn't obvious to me.

Re: Question about Attach AF drawback implementation

PostPosted: 13 Jan 2012, 08:32
by Hellfish
doTrigger is for the AI to decide wether to use the ability if it's on an optional trigger.chkAIDrawback helps the AI decide if the pro's of the main ability outweigh any eventual con's in drawbacks, if I understand correctly.

Re: Question about Attach AF drawback implementation

PostPosted: 13 Jan 2012, 11:05
by Sloth
Hellfish wrote:chkAIDrawback helps the AI decide if the pro's of the main ability outweigh any eventual con's in drawbacks, if I understand correctly.
That would be nice, but chkAIDrawback is unaware of the parent ability so it only checks for really really bad results (like having to target your own creature with removal or being killed by Char).

That said both functions should redirect to or do targeting stuff themselves.

Re: Question about Attach AF drawback implementation

PostPosted: 13 Jan 2012, 13:43
by ArsenalNut
Is there a particular ability factory that is a good example to look at for these methods? It seems like a bunch of them just return true for chkAIDrawback.

Besides the licids and the Soul Seizure/Ghastly Hunting, what are some cards that need to use the Attach drawback? Are there cards that could use the Attach ability as well?

Re: Question about Attach AF drawback implementation

PostPosted: 13 Jan 2012, 13:56
by Sloth
ArsenalNut wrote:Is there a particular ability factory that is a good example to look at for these methods? It seems like a bunch of them just return true for chkAIDrawback.
AbilityFactoryPump should be similar.

ArsenalNut wrote:Besides the licids and the Soul Seizure/Ghastly Hunting, what are some cards that need to use the Attach drawback? Are there cards that could use the Attach ability as well?
Auriok Survivors, Cloak and Dagger, Cranial Plating, Deathrender, Detainment Spell, Diviner's Wand, Dragon Breath, Dragon Fangs, Dragon Scales, Dragon Shadow, Dragon Wings, Evershrike, Hakim, Loreweaver, Healer's Headdress, Horned Helm, Iridescent Drake, Kjeldoran Pride, Neurok Stealthsuit, Nim Deathmantle, Obsidian Battle-Axe, Ogre Geargrabber, Piston Sledge, Prison Term, Reins of the Vinesteed, Ronin Warclub, Scythe of the Wretched, Sovereigns of Lost Alara, Sparring Collar, Stasis Cell,...

You better start with just using Defined and leave the targeting for later. You have to consider that some cards target the aura/equipment and some cards target the object it will be attached to.

Re: Question about Attach AF drawback implementation

PostPosted: 18 Jan 2012, 21:19
by friarsol
Arsenal,

Feel free to update http://cardforge.org/bugz/view.php?id=27 with your information regarding AF_Attach.

Re: Question about Attach AF drawback implementation

PostPosted: 23 Jan 2012, 03:34
by ArsenalNut
I fleshed out the createAbilityAttach to allow attach as an ability. Sloth had already added some logic to handle equipment. I used Cranial Plating as a test card and it worked fine. I did not check to how the AI handled using the ability.

Re: Question about Attach AF drawback implementation

PostPosted: 23 Jan 2012, 04:02
by jeffwadsworth
ArsenalNut wrote:I fleshed out the createAbilityAttach to allow attach as an ability. Sloth had already added some logic to handle equipment. I used Cranial Plating as a test card and it worked fine. I did not check to how the AI handled using the ability.
Some cool cards in there. Shouldn't take long to get them done.

Re: Question about Attach AF drawback implementation

PostPosted: 23 Jan 2012, 05:03
by ArsenalNut
jeffwadsworth wrote:
ArsenalNut wrote:I fleshed out the createAbilityAttach to allow attach as an ability. Sloth had already added some logic to handle equipment. I used Cranial Plating as a test card and it worked fine. I did not check to how the AI handled using the ability.
Some cool cards in there. Shouldn't take long to get them done.
I did a test where I gave the AI an Affinity Deck. The AI certainly equipped the Cranial Plating and made reasonable choices on which creature to initially equip. Kicked my butt with an Etched Champion equipped with Cranial Plating.:twisted: The AI didn't switch the Cranial Plating to the Etched Champion until I lightning bolted the memnite it was intially attached to. Never saw the AI use the attached ability though.