Package mage.game.permanent

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


    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Permanent land = game.getPermanentOrLKIBattlefield(this.targetPointer.getFirst(game, source));
            if (land != null &&  !land.getControllerId().equals(game.getActivePlayerId())) { // intervening if clause has to be checked again
                land.destroy(source.getSourceId(), game, false);
            }
            return true;
        }
        return false;
    }
View Full Code Here


        int affectedTargets = 0;
        if (targetPointer.getTargets(game, source).size() > 0) {
            for (UUID permanentId : targetPointer.getTargets(game, source)) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
                    if (permanent.destroy(source.getSourceId(), game, false)) {
                        affectedTargets++;
                        if (game.getState().getZone(permanent.getId()) == Zone.GRAVEYARD) {
                            Player player = game.getPlayer(permanent.getControllerId());
                            if (player != null)
                                player.damage(3, source.getSourceId(), game, false, true);
View Full Code Here

        Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (creature != null) {
            Player controller = game.getPlayer(creature.getControllerId());
            if (controller != null) {
                int lifeLoss = creature.getPower().getValue() + creature.getToughness().getValue();
                creature.destroy(source.getSourceId(), game, false);
                // the life loss happens also if the creature is indestructible or regenerated (legal targets)
                controller.loseLife(lifeLoss, game);
                return true;
            }
        }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent target = game.getPermanent(source.getFirstTarget());
        if (target != null) {
            return target.destroy(source.getSourceId(), game, false);
        }
        return false;
    }

    @Override
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 true;
        }
        return false;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
        if (creature != null) {
            creature.removeCounters(CounterType.FUSE.getName(), creature.getCounters().getCount(CounterType.FUSE), game);
            creature.destroy(source.getSourceId(), game, false);
        }
        if (creature == null) {
            creature = (Permanent) game.getLastKnownInformation(this.getTargetPointer().getFirst(game, source), Zone.BATTLEFIELD);
        }
        if (creature != 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.