Package mage.game.permanent

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


    @Override
    public boolean apply(Game game, Ability source) {
        Permanent targetCreature = game.getPermanent(source.getFirstTarget());
        if (targetCreature != null) {
            Player targetController = game.getPlayer(targetCreature.getControllerId());
            targetCreature.destroy(source.getSourceId(), game, false);
            Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
            if (destroyedCreature.getColor().isGreen()
                    || destroyedCreature.getColor().isWhite()) {
                targetController.discard(1, source, game);
                return true;
View Full Code Here


            attachments.addAll(permanent.getAttachments());

            for (UUID attachmentId : attachments) {
                Permanent attachment = game.getPermanent(attachmentId);
                if (attachment.hasSubtype("Equipment")) {
                    attachment.destroy(source.getSourceId(), game, false);
                }
            }

            permanent.destroy(source.getSourceId(), game, false);
            return true;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
        if (permanent != null && permanent.getColor().isRed()) {
            permanent.destroy(source.getSourceId(), game, false);
        }
        return true;
    }

    @Override
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        for (UUID targetID : this.targetPointer.getTargets(game, source)) {
            Permanent permanent = game.getPermanent(targetID);
            if (permanent != null) {
                if (permanent.destroy(source.getSourceId(), game, false)) {
                    if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) {
                        Player controller = game.getPlayer(permanent.getControllerId());
                        ElephantToken elephantToken = new ElephantToken();
                        elephantToken.putOntoBattlefield(1, game, source.getSourceId(), controller.getId());
                    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent targetCreature = game.getPermanent(source.getFirstTarget());
        if (targetCreature != null) {
            targetCreature.destroy(source.getSourceId(), game, false);
            Permanent destroyedCreature = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
            if (destroyedCreature.getColor().isBlue()
                    || destroyedCreature.getColor().isBlack()) {
                SpiderToken token = new SpiderToken();
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
View Full Code Here

    public boolean apply(Game game, Ability source) {
        int randomNumber = (int)(Math.random() * 3);
        Permanent target = game.getPermanent(source.getTargets().get(randomNumber).getFirstTarget());
        if (target != null) {
            game.informPlayers("Wild Swing: The randomly chosen target to destroy is " + target.getName());
            return target.destroy(source.getSourceId(), game, false);
        }
        return false;
    }
}
View Full Code Here

            if (target.canChoose(source.getControllerId(), game) && target.choose(Outcome.DestroyPermanent, source.getControllerId(), source.getSourceId(), game)) {
                Permanent targetedArtifact = game.getPermanent(target.getFirstTarget());
                if (targetedArtifact != null) {
                    Card artifact = game.getCard(targetedArtifact.getId());
                    Player controller = game.getPlayer(targetedArtifact.getControllerId());
                    targetedArtifact.destroy(id, game, true);
                    if (controller.getGraveyard().contains(artifact.getId())) {
                        int alliesControlled = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
                        controller.damage(alliesControlled, id, game, false, true);
                        return true;
                    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent targetedLand = game.getPermanent(source.getFirstTarget());
        if (targetedLand != null) {
            Player controller = game.getPlayer(targetedLand.getControllerId());
            targetedLand.destroy(id, game, true);
            int landsInGraveyard = controller.getGraveyard().count(filter, game);
            controller.damage(landsInGraveyard, id, game, false, true);
            return true;
        }
        return false;
View Full Code Here

                    }
                }
            }
            if (permanentToDestroy != null) {
                game.informPlayers(new StringBuilder(sourcePermanent.getName()).append(" chosen creature: ").append(permanentToDestroy.getName()).toString());
                return permanentToDestroy.destroy(source.getSourceId(), game, true);
            }
            return true;
        }

        return false;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent helldozer = game.getPermanent(source.getSourceId());
        Permanent landTarget = game.getPermanent(source.getFirstTarget());
        if (landTarget != null) {
            landTarget.destroy(id, game, false);
        }
        Permanent landPermanent = (Permanent) game.getLastKnownInformation(landTarget.getId(), Zone.BATTLEFIELD);
        if (landPermanent != null
                && !landPermanent.getSupertype().contains("Basic")
                && helldozer != null) {
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.