use of mage.game.events.DamagedBatchEvent in project mage by magefree.
the class OliviasAttendantsTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
int amount = ((DamagedBatchEvent) event).getEvents().stream().filter(e -> e.getSourceId().equals(getSourceId())).mapToInt(GameEvent::getAmount).sum();
if (amount < 1) {
return false;
}
this.getEffects().clear();
this.addEffect(new CreateTokenEffect(new BloodToken(), amount));
return true;
}
Aggregations