Implemented new keyword for creatures which have to be blocked from 3 or more other creatures, added/fixed primitives.

This commit is contained in:
valfieri
2020-12-11 16:41:20 +01:00
parent d2ea81bdbc
commit a753bb0c1b
5 changed files with 344 additions and 324 deletions
+2 -1
View File
@@ -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;
+18
View File
@@ -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;