better handling of cards with restrictions for ai. if we can't play it, then don't make it nextcardtoplay.

This commit is contained in:
omegablast2002@yahoo.com
2011-09-23 19:48:17 +00:00
parent 7ba6c8e85d
commit f04a0dd338

View File

@@ -1663,6 +1663,13 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
SAFE_DELETE(withKickerCost);
shouldPlayPercentage = 10*canKick;
}
if(card->getRestrictions().size())
{
AbilityFactory af;
int canPlay = af.parseCastRestrictions(card,card->controller(),card->getRestrictions());
if(!canPlay)
continue;
}
if (WRand() % 100 > shouldPlayPercentage)
continue;
nextCardToPlay = card;