trying to figure out why ai is cast cards that belong to a combo outside of a combo even though it is told to skip these cards.
This commit is contained in:
@@ -1691,6 +1691,7 @@ MTGCardInstance * AIPlayerBaka::FindCardToPlay(ManaCost * pMana, const char * ty
|
|||||||
if(comboCards.size())
|
if(comboCards.size())
|
||||||
{
|
{
|
||||||
nextCardToPlay = comboCards.back();
|
nextCardToPlay = comboCards.back();
|
||||||
|
DebugTrace("ai is doing a combo:" << nextCardToPlay->getName());
|
||||||
comboCards.pop_back();
|
comboCards.pop_back();
|
||||||
if(!comboHint->cardTargets.size() && !comboCards.size())
|
if(!comboHint->cardTargets.size() && !comboCards.size())
|
||||||
comboHint = NULL;//becuase it's no longer needed.
|
comboHint = NULL;//becuase it's no longer needed.
|
||||||
@@ -1861,7 +1862,8 @@ MTGCardInstance * AIPlayerBaka::activateCombo()
|
|||||||
for(unsigned int k = 0;k < comboHint->hold.size(); k++)
|
for(unsigned int k = 0;k < comboHint->hold.size(); k++)
|
||||||
{
|
{
|
||||||
hintTc = tfc.createTargetChooser(comboHint->hold[k],nextCardToPlay);
|
hintTc = tfc.createTargetChooser(comboHint->hold[k],nextCardToPlay);
|
||||||
for(unsigned int j = 0; j < game->hand->cards.size();j++)
|
int combohand = game->hand->cards.size();
|
||||||
|
for(int j = 0; j < combohand;j++)
|
||||||
{
|
{
|
||||||
if(!hintTc)
|
if(!hintTc)
|
||||||
break;
|
break;
|
||||||
@@ -1878,6 +1880,7 @@ MTGCardInstance * AIPlayerBaka::activateCombo()
|
|||||||
if(comboCards.size())
|
if(comboCards.size())
|
||||||
{
|
{
|
||||||
nextCardToPlay = comboCards.back();
|
nextCardToPlay = comboCards.back();
|
||||||
|
DebugTrace("ai is doing a combo:" << nextCardToPlay->getName());
|
||||||
if (game->playRestrictions->canPutIntoZone(nextCardToPlay, game->stack) == PlayRestriction::CANT_PLAY)
|
if (game->playRestrictions->canPutIntoZone(nextCardToPlay, game->stack) == PlayRestriction::CANT_PLAY)
|
||||||
return NULL;
|
return NULL;
|
||||||
comboCards.pop_back();
|
comboCards.pop_back();
|
||||||
|
|||||||
@@ -1033,7 +1033,10 @@ bool TypeTargetChooser::canTarget(Targetable * target,bool withoutProtections)
|
|||||||
if (card->hasSubtype(types[i])) return true;
|
if (card->hasSubtype(types[i])) return true;
|
||||||
if(card->getLCName().size())
|
if(card->getLCName().size())
|
||||||
{
|
{
|
||||||
if (MTGAllCards::findType(card->getLCName()) == types[i]) return true;
|
if (MTGAllCards::findType(card->getLCName()) == types[i])
|
||||||
|
return true;
|
||||||
|
if (MTGAllCards::findType(card->getName()) == types[i])
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user