Package mage.game.permanent

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


        Permanent permanent = game.getPermanent(source.getFirstTarget());
        if(permanent != null)
        {
            int couvertedManaCost = permanent.getManaCost().convertedManaCost();
            Player player = game.getPlayer(permanent.getControllerId());
            permanent.destroy(source.getSourceId(), game, false);
            if(player != null){
                player.damage(couvertedManaCost, source.getSourceId(), game, false, true);
            }
            return true;
        }
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (controller != null && creature != null) {
            creature.destroy(source.getSourceId(), game, false);
            if (ClashEffect.getInstance().apply(game, source)) {
                controller.gainLife(creature.getToughness().getValue(), game);
            }
            return true;
        }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(this.getTargetPointer().getFirst(game, source));
        if (permanent != null) {
            permanent.destroy(source.getSourceId(), game, false);
            Player permController = game.getPlayer(permanent.getControllerId());
            if (permController != null) {
                permController.damage(2, source.getSourceId(), game, false, true);
                return true;
            }
View Full Code Here

        filter.add(new ColorPredicate(ObjectColor.BLACK));

        if (game.getBattlefield().countAll(filter, source.getControllerId(), game) == 0) {
            permanent.damage(2, source.getSourceId(), game, false, true);
        } else {
            permanent.destroy(source.getSourceId(), game, false);
        }
        return true;
    }
}
View Full Code Here

            for(UUID uuid : attachments)
            {
                Permanent aura = game.getPermanent(uuid);
                if(aura != null && aura.getSubtype().contains("Aura"))
                {
                    aura.destroy(source.getSourceId(), game, false);
                }
            }
        }
        return false;
    }
View Full Code Here

        int destroyedCreatures = 0;
        for (Target target: source.getTargets()) {
            if (target instanceof TargetPermanent) {
                Permanent targetPermanent = game.getPermanent(target.getFirstTarget());
                if (targetPermanent != null) {
                    if (targetPermanent.destroy(source.getSourceId(), game, false)) {
                        destroyedCreatures++;
                    }
                }
            }
        }
View Full Code Here

            enchantment = (Permanent) game.getLastKnownInformation(source.getSourceId(), Zone.BATTLEFIELD);
        }
        if (enchantment != null) {
            Permanent enchanted = game.getPermanent(enchantment.getAttachedTo());
            if (enchanted != null) {
                return enchanted.destroy(source.getSourceId(), game, false);
            }
        }
        return false;
    }
}
View Full Code Here

            if (permanent != null) {
                permanent.setTapped(true);
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(filterHuman, source.getControllerId(), game)) {
            permanent.destroy(source.getSourceId(), game, false);
        }
        return true;
    }
}
View Full Code Here

        }

        if (!targetPermanents.isEmpty()) {
            Random random = new Random();
            permanent = targetPermanents.get(random.nextInt(targetPermanents.size()));
            permanent.destroy(source.getSourceId(), game, false);
            return true;
        }
        return false;
    }
}
View Full Code Here

        if (source.getTargets().size() > 1 && targetPointer instanceof FirstTargetPointer) { // for Rain of Thorns
            for (Target target : source.getTargets()) {
                for (UUID permanentId : target.getTargets()) {
                    Permanent permanent = game.getPermanent(permanentId);
                    if (permanent != null && permanent.getToughness().getValue() <= game.getPlayer(source.getControllerId()).getGraveyard().size()) {
                        permanent.destroy(source.getSourceId(), game, noRegen);
                        affectedTargets++;
                    }
                }
            }
        } else if (targetPointer.getTargets(game, source).size() > 0) {
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.