Added/Fixed primitives, improved PAYZERO rule for commandzone.
This commit is contained in:
@@ -3429,7 +3429,7 @@ int AIPlayerBaka::computeActions()
|
||||
CardDescriptor cd;
|
||||
if (game->hand->hasAbility(Constants::PAYZERO))
|
||||
{
|
||||
//Attempt to put free cards into play
|
||||
//Attempt to put free cards into play from hand
|
||||
cd.init();
|
||||
cd.SetExclusionColor(Constants::MTG_COLOR_LAND);
|
||||
MTGCardInstance *freecard = cd.match(game->hand);
|
||||
@@ -3444,7 +3444,7 @@ int AIPlayerBaka::computeActions()
|
||||
}
|
||||
if (game->graveyard->hasAbility(Constants::PAYZERO) && game->graveyard->hasAbility(Constants::CANPLAYFROMGRAVEYARD))
|
||||
{
|
||||
//Attempt to put free cards into play
|
||||
//Attempt to put free cards into play from graveyard
|
||||
cd.init();
|
||||
cd.SetExclusionColor(Constants::MTG_COLOR_LAND);
|
||||
MTGCardInstance *freecard = cd.match(game->graveyard);
|
||||
@@ -3459,7 +3459,7 @@ int AIPlayerBaka::computeActions()
|
||||
}
|
||||
if (game->exile->hasAbility(Constants::PAYZERO) && game->exile->hasAbility(Constants::CANPLAYFROMEXILE))
|
||||
{
|
||||
//Attempt to put free cards into play
|
||||
//Attempt to put free cards into play from exile
|
||||
cd.init();
|
||||
cd.SetExclusionColor(Constants::MTG_COLOR_LAND);
|
||||
MTGCardInstance *freecard = cd.match(game->exile);
|
||||
@@ -3472,6 +3472,21 @@ int AIPlayerBaka::computeActions()
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (game->commandzone->hasAbility(Constants::PAYZERO))
|
||||
{
|
||||
//Attempt to put free cards into play from commandzone
|
||||
cd.init();
|
||||
cd.SetExclusionColor(Constants::MTG_COLOR_LAND);
|
||||
MTGCardInstance *freecard = cd.match(game->commandzone);
|
||||
int canCastCard = game->playRestrictions->canPutIntoZone(freecard, game->inPlay);
|
||||
if (freecard && (canCastCard == PlayRestriction::CAN_PLAY) && freecard->has(Constants::PAYZERO) && (freecard->getIncreasedManaCost()->getConvertedCost() < 1) && (!freecard->isCDA))
|
||||
{
|
||||
MTGAbility * castFreeCard = observer->mLayers->actionLayer()->getAbility(MTGAbility::PAYZERO_COST);
|
||||
AIAction * aa = NEW AIAction(this, castFreeCard, freecard); //TODO putinplay action
|
||||
clickstream.push(aa);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}//end
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user