added Raid support

thisturn(creature[attacking]|mybattlefield)~morethan~0 only triggers
once... use raid keyword... if raid then blah...
This commit is contained in:
Anthony Calosa
2015-10-20 11:09:57 +08:00
parent 9f8d2b2d46
commit 7810c65862
6 changed files with 21 additions and 9 deletions
+2
View File
@@ -204,6 +204,8 @@ void GameObserver::nextGamePhase()
cleanupPhase();
currentPlayer->damageCount = 0;
currentPlayer->drawCounter = 0;
currentPlayer->raidcount = 0;
currentPlayer->opponent()->raidcount = 0;
currentPlayer->prowledTypes.clear();
currentPlayer->opponent()->damageCount = 0; //added to clear odcount
currentPlayer->preventable = 0;
+7
View File
@@ -418,6 +418,13 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
return 0;
}
check = restriction[i].find("raid");
if(check != string::npos)
{
if(card->controller()->raidcount < 1)
return 0;
}
check = restriction[i].find("ownerscontrol");
if(check != string::npos)
{
+1
View File
@@ -1398,6 +1398,7 @@ int MTGCombatTriggersRule::receiveEvent(WEvent *e)
if (card && card->isAttacker())
{
card->eventattacked();
card->controller()->raidcount += 1;
}
}
}
+1
View File
@@ -34,6 +34,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck *
extraTurn = 0;
drawCounter = 0;
epic = 0;
raidcount = 0;
prowledTypes.clear();
doesntEmpty = NEW ManaCost();
poolDoesntEmpty = NEW ManaCost();