also add aicode for Amplify cards
This commit is contained in:
Anthony Calosa
2017-03-09 18:37:55 +08:00
parent 650d794eec
commit b01c1455f5
11 changed files with 395 additions and 175 deletions
+37
View File
@@ -1015,6 +1015,43 @@ MTGCardInstance * MTGInPlay::getNextLurer(MTGCardInstance * previous)
return NULL;
}
MTGCardInstance * MTGInPlay::getNextProvoker(MTGCardInstance * previous, MTGCardInstance * thiscard)
{
int foundprevious = 0;
if (previous == NULL)
{
foundprevious = 1;
}
for (int i = 0; i < nb_cards; i++)
{
MTGCardInstance * current = cards[i];
if (current == previous)
{
foundprevious = 1;
}
else if (foundprevious && current->isAttacker() && thiscard->isProvoked && current->ProvokeTarget)
{
if(thiscard == current->ProvokeTarget)
return current;
}
}
return NULL;
}
MTGCardInstance * MTGInPlay::findAProvoker(MTGCardInstance * thiscard)
{
for (int i = 0; i < nb_cards; i++)
{
MTGCardInstance * current = cards[i];
if (current->isAttacker() && current->ProvokeTarget)
{
if(current->ProvokeTarget == thiscard)
return current;
}
}
return NULL;
}
MTGCardInstance * MTGInPlay::findALurer()
{
for (int i = 0; i < nb_cards; i++)