It is currently 31 Oct 2025, 13:36
   
Text Size

Question about Attach AF drawback implementation

Post MTG Forge Related Programming Questions Here

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

Question about Attach AF drawback implementation

Postby ArsenalNut » 13 Jan 2012, 07:47

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.
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: Question about Attach AF drawback implementation

Postby Hellfish » 13 Jan 2012, 08:32

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.
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: Question about Attach AF drawback implementation

Postby Sloth » 13 Jan 2012, 11:05

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

Re: Question about Attach AF drawback implementation

Postby ArsenalNut » 13 Jan 2012, 13:43

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?
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: Question about Attach AF drawback implementation

Postby Sloth » 13 Jan 2012, 13:56

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

Re: Question about Attach AF drawback implementation

Postby friarsol » 18 Jan 2012, 21:19

Arsenal,

Feel free to update http://cardforge.org/bugz/view.php?id=27 with your information regarding AF_Attach.
friarsol
Global Moderator
 
Posts: 7593
Joined: 15 May 2010, 04:20
Has thanked: 243 times
Been thanked: 965 times

Re: Question about Attach AF drawback implementation

Postby ArsenalNut » 23 Jan 2012, 03:34

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.
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: Question about Attach AF drawback implementation

Postby jeffwadsworth » 23 Jan 2012, 04:02

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.
jeffwadsworth
Super Tester Elite
 
Posts: 1172
Joined: 20 Oct 2010, 04:47
Location: USA
Has thanked: 287 times
Been thanked: 70 times

Re: Question about Attach AF drawback implementation

Postby ArsenalNut » 23 Jan 2012, 05:03

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


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 35 guests

cron

Main Menu

User Menu

Our Partners


Who is online

In total there are 35 users online :: 0 registered, 0 hidden and 35 guests (based on users active over the past 10 minutes)
Most users ever online was 9298 on 10 Oct 2025, 12:54

Users browsing this forum: No registered users and 35 guests

Login Form