Implemented new keyword for creatures which have to be blocked from 3 or more other creatures, added/fixed primitives.
This commit is contained in:
@@ -197,7 +197,8 @@ const char* Constants::MTGBasicAbilities[] = {
|
||||
"hasotherkicker", //Kicker cost is expressed with "other" keyword (eg. not mana kicker such as life and/or tap a creature),
|
||||
"partner", //Has partner ability
|
||||
"canbecommander", //Can be a commander (eg. some planeswalkers can)
|
||||
"iscommander" //It's the current commander
|
||||
"iscommander", //It's the current commander
|
||||
"threeblockers" //It can be blocked just by 3 creatures or more.
|
||||
};
|
||||
|
||||
map<string,int> Constants::MTGBasicAbilitiesMap;
|
||||
|
||||
@@ -2365,6 +2365,24 @@ int MTGBlockRule::receiveEvent(WEvent *e)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (dynamic_cast<WEventBlockersChosen*>(e))
|
||||
{
|
||||
//if a card with threeblockers is not blocked by 3 or more, remove any known blockers and attacking as normal.
|
||||
MTGGameZone * z = p->game->inPlay;
|
||||
for (int i = 0; i < z->nb_cards; i++)
|
||||
{
|
||||
MTGCardInstance * card = z->cards[i];
|
||||
if (card->isAttacker() && card->has(Constants::THREEBLOCKERS) && card->blockers.size() < 3)
|
||||
{
|
||||
while (card->blockers.size())
|
||||
{
|
||||
MTGCardInstance * blockingCard = card->blockers.front();
|
||||
if(blockingCard->getNextOpponent() == card)
|
||||
blockingCard->toggleDefenser(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user