use of mage.game.permanent.token.FaerieRogueToken in project mage by magefree.
the class NotoriousThrongEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player controller = game.getPlayer(source.getControllerId());
AmountOfDamageAPlayerReceivedThisTurnWatcher watcher = game.getState().getWatcher(AmountOfDamageAPlayerReceivedThisTurnWatcher.class);
if (controller != null && watcher != null) {
int numTokens = 0;
for (UUID opponentId : game.getOpponents(controller.getId())) {
numTokens += watcher.getAmountOfDamageReceivedThisTurn(opponentId);
}
if (numTokens > 0) {
new CreateTokenEffect(new FaerieRogueToken(), numTokens).apply(game, source);
}
return true;
}
return false;
}
Aggregations