Search in sources :

Example 1 with DamagedBatchEvent

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;
}
Also used : DamagedBatchEvent(mage.game.events.DamagedBatchEvent) BloodToken(mage.game.permanent.token.BloodToken) CreateTokenEffect(mage.abilities.effects.common.CreateTokenEffect)

Aggregations

CreateTokenEffect (mage.abilities.effects.common.CreateTokenEffect)1 DamagedBatchEvent (mage.game.events.DamagedBatchEvent)1 BloodToken (mage.game.permanent.token.BloodToken)1