use of mage.abilities.effects.common.discard.DiscardControllerEffect in project mage by magefree.
the class VarinaLichQueenTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
int attackingZombies = 0;
for (UUID attacker : game.getCombat().getAttackers()) {
Permanent creature = game.getPermanent(attacker);
if (creature != null && creature.getControllerId() != null && creature.isControlledBy(this.getControllerId()) && creature.hasSubtype(SubType.ZOMBIE, game)) {
attackingZombies++;
}
}
if (attackingZombies > 0) {
this.getEffects().clear();
addEffect(new DrawCardSourceControllerEffect(attackingZombies));
addEffect(new DiscardControllerEffect(attackingZombies, false));
addEffect(new GainLifeEffect(attackingZombies));
return true;
}
return false;
}
Aggregations