use of mage.abilities.effects.common.continuous.GainAbilityControlledSpellsEffect in project mage by magefree.
the class DomriChaosBringerTriggeredAbility method checkTrigger.
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (!event.getSourceId().equals(spellId)) {
return false;
}
if (game.getTurnNum() != turnNumber) {
return false;
}
MageObject mo = game.getObject(event.getTargetId());
if (mo == null || !mo.isCreature(game)) {
return false;
}
StackObject stackObject = game.getStack().getStackObject(event.getTargetId());
if (stackObject == null) {
return false;
}
this.getEffects().clear();
FilterCard filter = new FilterCard();
filter.add(new CardIdPredicate(stackObject.getSourceId()));
this.addEffect(new GainAbilityControlledSpellsEffect(new RiotAbility(), filter));
return true;
}
Aggregations