Question about Attach AF drawback implementation
Post MTG Forge Related Programming Questions Here
	Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
			9 posts
			 • Page 1 of 1
		
	
Question about Attach AF drawback implementation
 by ArsenalNut » 13 Jan 2012, 07:47
by 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
		- 
				 
 ArsenalNut
- Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Question about Attach AF drawback implementation
 by Hellfish » 13 Jan 2012, 08:32
by 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
		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
- 
				 
 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
 by Sloth » 13 Jan 2012, 11:05
by Sloth » 13 Jan 2012, 11:05 
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).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 said both functions should redirect to or do targeting stuff themselves.
- 
				 
 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
 by ArsenalNut » 13 Jan 2012, 13:43
by 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?
			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
		- 
				 
 ArsenalNut
- Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Question about Attach AF drawback implementation
 by Sloth » 13 Jan 2012, 13:56
by Sloth » 13 Jan 2012, 13:56 
AbilityFactoryPump should be similar.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.
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,...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?
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.
- 
				 
 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
 by friarsol » 18 Jan 2012, 21:19
by 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.
			
		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
 by ArsenalNut » 23 Jan 2012, 03:34
by 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
		- 
				 
 ArsenalNut
- Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
Re: Question about Attach AF drawback implementation
 by jeffwadsworth » 23 Jan 2012, 04:02
by jeffwadsworth » 23 Jan 2012, 04:02 
Some cool cards in there. Shouldn't take long to get them done.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.
- 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
 by ArsenalNut » 23 Jan 2012, 05:03
by ArsenalNut » 23 Jan 2012, 05:03 
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.jeffwadsworth wrote:Some cool cards in there. Shouldn't take long to get them done.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.
 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.
 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
		- 
				 
 ArsenalNut
- Posts: 512
- Joined: 08 Jul 2011, 03:49
- Has thanked: 27 times
- Been thanked: 121 times
			9 posts
			 • Page 1 of 1
		
	
Who is online
Users browsing this forum: No registered users and 17 guests
