canPlayAI
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins
3 posts
• Page 1 of 1
canPlayAI
by Sloth » 12 Dec 2010, 17:00
I noticed that the AI cast Tivadar of Thorn even though it already had one in play. I looked into etbDestroyTgt and found that canPlayAI() sometimes returns true without checking super.canPlayAI(). So I replaced "return true" with "return super.canPlayAI()" and the AI won't cast a second Tivadar of Thorn any more.
I don't know so much about this part of the code. So if someone thinks this is a bad idea please help. If not, should I try to find other instances of canPlayAI() not checking super.canPlayAI() and do the same?
I don't know so much about this part of the code. So if someone thinks this is a bad idea please help. If not, should I try to find other instances of canPlayAI() not checking super.canPlayAI() and do the same?
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: canPlayAI
by Rob Cashwalker » 12 Dec 2010, 20:44
I'd say put a check near the beginning of canPlayAI, which just checks if super.canPlayAI is False, if it is, return False, but otherwise, let the ability AI do its thing.
The Force will be with you, Always.
-

Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: canPlayAI
by Sloth » 12 Dec 2010, 20:49
The result is the same, for more complicated canPlayAI() functions I did just that. I don't know if super.canPlayAI takes more into consideration, but at least fighting against Leyline of Singularity .deck is now possible.Rob Cashwalker wrote:I'd say put a check near the beginning of canPlayAI, which just checks if super.canPlayAI is False, if it is, return False, but otherwise, let the ability AI do its thing.
-

Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
3 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 30 guests