Package mage.game.permanent

Examples of mage.game.permanent.Permanent.destroy()


            FilterCreaturePermanent filter = new FilterCreaturePermanent();
            filter.add(new PermanentIdPredicate(targetCreature.getId()));
            game.addEffect(new PreventAllDamageByAllEffect(filter, Duration.EndOfTurn, false), source);
            if (targetCreature.getColor().contains(ObjectColor.BLACK)
                    || targetCreature.getColor().contains(ObjectColor.RED)) {
                return targetCreature.destroy(source.getSourceId(), game, false);
            }
        }
        return false;
    }
}
View Full Code Here


            if (!lands.isEmpty()) {
                int destroyedLands = 0;
                for (UUID landId: lands) {
                    Permanent land = game.getPermanent(landId);
                    if (land != null) {
                        if (land.destroy(source.getSourceId(), game, false)) {
                            destroyedLands++;
                        }
                    }
                }
                game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(": ").append(destroyedLands).append(destroyedLands > 1 ? " lands were destroyed":"land was destroyed").toString());
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getFirstTarget());
        String name = permanent.getName();

        permanent.destroy(source.getSourceId(), game, false);
        for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
            if (perm.getName().equals(name) && perm.getCardType().contains(CardType.ENCHANTMENT))
                perm.destroy(source.getSourceId(), game, false);
        }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent p = game.getPermanent(source.getFirstTarget());       
        if (p != null) {
            p.destroy(source.getSourceId(), game, false);
        }
        Permanent s = game.getPermanent(source.getSourceId());
        if (s != null) {
            s.destroy(source.getSourceId(), game, false);
        }
View Full Code Here

        if (p != null) {
            p.destroy(source.getSourceId(), game, false);
        }
        Permanent s = game.getPermanent(source.getSourceId());
        if (s != null) {
            s.destroy(source.getSourceId(), game, false);
        }
        return true;
    }

    @Override
View Full Code Here

            Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
            if (permanent != null) {
                Watcher watcher = game.getState().getWatchers().get("AttackedThisTurn");
                if (watcher != null && watcher instanceof AttackedThisTurnWatcher) {
                    if (((AttackedThisTurnWatcher)watcher).getAttackedThisTurnCreatures().contains(permanent.getId())) {
                        return permanent.destroy(source.getSourceId(), game, false);
                    }
                }
            }
        }
        return false;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Permanent firstTarget = game.getPermanent(source.getFirstTarget());
            if (firstTarget != null) {
                firstTarget.destroy(source.getSourceId(), game, false);
               
            }
            Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget());
            if (secondTarget != null) {
                secondTarget.destroy(source.getSourceId(), game, false);               
View Full Code Here

                firstTarget.destroy(source.getSourceId(), game, false);
               
            }
            Permanent secondTarget = game.getPermanent(source.getTargets().get(1).getFirstTarget());
            if (secondTarget != null) {
                secondTarget.destroy(source.getSourceId(), game, false);               
            }
            return true;
        }
        return false;
    }
View Full Code Here

            for ( int idx = 0; idx < target.getTargets().size(); idx++) {
                Permanent permanent = game.getPermanent((UUID)target.getTargets().get(idx));

                if ( permanent != null ) {
                    abilityApplied |= permanent.destroy(source.getSourceId(), game, false);
                }
            }
        }
        return abilityApplied;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent targetDestroy = game.getPermanent(source.getFirstTarget());
        Card targetRetrieve = game.getCard(source.getTargets().get(1).getFirstTarget());
        if (targetDestroy != null) {
            targetDestroy.destroy(source.getSourceId(), game, true);
        }
        if (targetRetrieve != null) {
            targetRetrieve.moveToZone(Zone.HAND, source.getSourceId(), game, true);
        }
        return true;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.