use of mage.abilities.effects.common.CopyTokenEffect in project mage by magefree.
the class HomurasEssence2 method apply.
@Override
public boolean apply(Game game, Ability source) {
Card sourceCard = game.getCard(source.getSourceId());
Player controller = game.getPlayer(source.getControllerId());
if (sourceCard != null && controller != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
ContinuousEffect effect = new ConditionalContinuousEffect(new CopyTokenEffect(flipToken), FlippedCondition.instance, "");
game.addEffect(effect, source);
controller.moveCards(sourceCard, Zone.BATTLEFIELD, source, game);
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
// not complete correct because it should enter the battlefield flipped
permanent.flip(game);
}
return true;
}
return false;
}
Aggregations