- Fixed a bug where the AI would block its own attacking creatures (I reintroduced that bug recently when I removed a safeguard Zethfox had added a while ago)

- Added a way to specify "no interrupt" in modrules.xml (I need to write a doc about this file) for a given game. This does not mean the stack does not show up (the stack is interesting to see what the opponent does), but that it only offers to continue.
This commit is contained in:
wagic.the.homebrew
2011-05-07 11:58:37 +00:00
parent fe276ca330
commit ab33d29682
4 changed files with 95 additions and 40 deletions

View File

@@ -882,8 +882,7 @@ int AIPlayer::interruptIfICan()
if (!clickstream.empty())
g->mLayers->stackLayer()->cancelInterruptOffer();
else
g->mLayers->stackLayer()->setIsInterrupting(this);
return 1;
return g->mLayers->stackLayer()->setIsInterrupting(this);
}
return 0;
}
@@ -1131,8 +1130,14 @@ int AIPlayer::canFirstStrikeKill(MTGCardInstance * card, MTGCardInstance *ennemy
int AIPlayer::chooseBlockers()
{
GameObserver * g = GameObserver::GetInstance();
//Should not block during my own turn...
if (g->currentPlayer == this)
return 0;
//Should not run this if I'm not the player with priority
if (g->currentActionPlayer != this)
return 0;
//I am interrupting, why would I be choosing blockers now?
if(g->isInterrupting == this)
return 0;
//ai should not be allowed to run this if it is not legally allowed to do so