Search in sources :

Example 1 with DragonToken2

use of mage.game.permanent.token.DragonToken2 in project mage by magefree.

the class SarkhanTheMadDragonDamageEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
    if (permanent != null) {
        permanent.sacrifice(source, game);
        Player player = game.getPlayer(permanent.getControllerId());
        if (player != null) {
            Token dragonToken = new DragonToken2();
            dragonToken.putOntoBattlefield(1, game, source, player.getId());
        }
    }
    return false;
}
Also used : Player(mage.players.Player) FilterControlledPermanent(mage.filter.common.FilterControlledPermanent) Permanent(mage.game.permanent.Permanent) TargetCreaturePermanent(mage.target.common.TargetCreaturePermanent) DragonToken2(mage.game.permanent.token.DragonToken2) Token(mage.game.permanent.token.Token)

Example 2 with DragonToken2

use of mage.game.permanent.token.DragonToken2 in project mage by magefree.

the class DeathByDragonsEffect method apply.

@Override
public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
        for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
            if (!playerId.equals(this.getTargetPointer().getFirst(game, source))) {
                Token token = new DragonToken2();
                token.putOntoBattlefield(1, game, source, playerId);
            }
        }
        return true;
    }
    return false;
}
Also used : TargetPlayer(mage.target.TargetPlayer) Player(mage.players.Player) DragonToken2(mage.game.permanent.token.DragonToken2) Token(mage.game.permanent.token.Token) UUID(java.util.UUID)

Aggregations

DragonToken2 (mage.game.permanent.token.DragonToken2)2 Token (mage.game.permanent.token.Token)2 Player (mage.players.Player)2 UUID (java.util.UUID)1 FilterControlledPermanent (mage.filter.common.FilterControlledPermanent)1 Permanent (mage.game.permanent.Permanent)1 TargetPlayer (mage.target.TargetPlayer)1 TargetCreaturePermanent (mage.target.common.TargetCreaturePermanent)1