use of mage.game.permanent.token.WasitoraCatDragonToken in project mage by magefree.
the class WasitoraNekoruQueenEffect method apply.
@Override
public boolean apply(Game game, Ability source) {
Player damagedPlayer = game.getPlayer(targetPointer.getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (damagedPlayer != null && controller != null) {
FilterControlledPermanent filter = new FilterControlledPermanent("creature");
filter.add(CardType.CREATURE.getPredicate());
TargetPermanent target = new TargetPermanent(1, 1, filter, true);
if (damagedPlayer.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
Permanent objectToBeSacrificed = game.getPermanent(target.getFirstTarget());
if (objectToBeSacrificed != null) {
if (objectToBeSacrificed.sacrifice(source, game)) {
return true;
}
}
}
new CreateTokenEffect(new WasitoraCatDragonToken()).apply(game, source);
return true;
}
return false;
}
Aggregations