use of mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility in project mage by magefree.
the class MythosOfIllunaEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent == null) {
return false;
}
CreateTokenCopyTargetEffect effect = new CreateTokenCopyTargetEffect(source.getControllerId());
if (condition.apply(game, source)) {
Ability ability = new ConditionalInterveningIfTriggeredAbility(new EntersBattlefieldTriggeredAbility(new FightTargetSourceEffect()), MythosOfIllunaCondition.instance, "When this permanent enters the battlefield, " + "if it's a creature, it fights up to one target creature you don't control.");
ability.addTarget(new TargetPermanent(0, 1, StaticFilters.FILTER_CREATURE_YOU_DONT_CONTROL, false));
effect.addAdditionalAbilities(ability);
}
return effect.apply(game, source);
}
Aggregations