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

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;