Package mage.game.permanent

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


        }
        else if (targetPointer.getTargets(game, source).size() > 0) {
            for (UUID permanentId : targetPointer.getTargets(game, source)) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
                    permanent.destroy(source.getSourceId(), game, noRegen);
                    affectedTargets++;
                }
            }
        }
        return affectedTargets > 0;
View Full Code Here


        if (enchantment != null && enchantment.getAttachedTo() != null) {
            Permanent equipment = game.getPermanent(enchantment.getAttachedTo());
            if (equipment != null && equipment.getAttachedTo() != null) {
                Permanent creature = game.getPermanent(equipment.getAttachedTo());
                if (creature != null && creature.getCardType().contains(CardType.CREATURE)) {
                    return creature.destroy(source.getSourceId(), game, false);
                }
            }
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent target = game.getPermanent(getTargetPointer().getFirst(game, source));
        Player controller = game.getPlayer(source.getControllerId());
        if (target != null && controller != null) {
            int toughness = target.getToughness().getValue();
            target.destroy(source.getSourceId(), game, false);
            if (toughness > 0) {
                controller.loseLife(toughness, game);
            }
            return true;
        }
View Full Code Here

                }
            }

            for (Permanent permanent : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getControllerId(), source.getSourceId(), game)) {
                if (!chosen.contains(permanent)) {
                    permanent.destroy(source.getSourceId(), game, false);
                }
            }
            return true;
        }
        return false;
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            for (UUID attachmentId: player.getAttachments()) {
                Permanent attachment = game.getPermanent(attachmentId);
                if (attachment != null && attachment.getSubtype().contains("Curse")) {
                    attachment.destroy(source.getSourceId(), game, false);
                }
            }
            return true;
        }
        return false;
View Full Code Here

        if (player != null) {
            if (player.flipCoin(game)) {
                UUID targetId = getTargetPointer().getFirst(game, source);
                Permanent permanent = game.getPermanent(targetId);
                if (permanent != null) {
                    permanent.destroy(source.getSourceId(), game, false);
                }
            }
        }
        return false;
    }
View Full Code Here

            if (target != null) {
                ArrayList<UUID> attachments = new ArrayList<>(target.getAttachments());
                for (UUID attachmentId : attachments) {
                    Permanent attachment = game.getPermanent(attachmentId);
                    if (attachment != null && attachment.getSubtype().contains("Equipment")) {
                        attachment.destroy(source.getSourceId(), game, false);
                    }
                }
            }
            return true;
        }
View Full Code Here

                            game.addEffect(effect, source);
                        }
                        break;
                    }
                }
                blockingCreature.destroy(source.getSourceId(), game, false);
            }
            return true;
        }
        return false;
    }
View Full Code Here

        if (player.choose(Outcome.DestroyPermanent, target, id, game)) {
            List<UUID> targets = target.getTargets();
            for (UUID landId : targets) {
                Permanent land = game.getPermanent(landId);
                if (land != null) {
                    land.destroy(landId, game, false);
                }
            }

        }
        return true;
View Full Code Here

        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        Permanent targetPermanent = game.getPermanent(source.getFirstTarget());

        if (sourcePermanent != null && targetPermanent != null) {
            if (sourcePermanent.sacrifice(source.getSourceId(), game)) {
                targetPermanent.destroy(source.getSourceId(), game, false);
            }
        }

        return false;
    }
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.