Package mage.game.permanent

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


        for (CombatGroup combatGroup : game.getCombat().getGroups()) {
            if (combatGroup.getAttackers().contains(blockedCreature.getId())) {
                blockingCreatures.addAll(combatGroup.getBlockers());
            }
        }
        if (blockedCreature.sacrifice(source.getSourceId(), game)) {
            for (UUID blockerId : blockingCreatures) {
                Permanent blockingCreature = game.getPermanent(blockerId);
                if (blockingCreature != null) {
                    blockingCreature.damage(4, blockedCreature.getId(), game, false, true);
                }
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.sacrifice(source.getSourceId(), game);
                }
            }

            return abilityApplied;
        }
View Full Code Here

        TargetControlledPermanent sacrificeLand = new TargetControlledPermanent(0, Integer.MAX_VALUE, new FilterControlledLandPermanent(), true);
        if(player.chooseTarget(Outcome.Sacrifice, sacrificeLand, source, game)){
            for(Object uuid : sacrificeLand.getTargets()){
                Permanent land = game.getPermanent((UUID)uuid);
                if(land != null){
                    land.sacrifice(source.getSourceId(), game);
                    amount++;
                }
            }
        }
        player.getManaPool().addMana(Mana.ColorlessMana(amount), game, source);
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Target target = new TargetPermanent(filter);
        Player player = game.getPlayer(source.getControllerId());
        if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) {
            Permanent permanent = game.getPermanent(target.getFirstTarget());
            if (permanent != null && permanent.sacrifice(source.getSourceId(), game)) {
                int toughness = permanent.getToughness().getValue();
                WolfToken token = new WolfToken();
                token.putOntoBattlefield(toughness, game, source.getSourceId(), source.getControllerId());
                return true;
            }
View Full Code Here

            Target target = new TargetControlledPermanent();

            if (target.canChoose(player.getId(), game) && player.choose(Outcome.Sacrifice, target, source.getSourceId(), game)) {
                Permanent permanent = game.getPermanent(target.getFirstTarget());
                if (permanent != null) {
                    return permanent.sacrifice(source.getSourceId(), game);
                }
            }
        }
        return false;
    }
View Full Code Here

        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            if (player.flipCoin(game)) {
                Permanent perm = game.getPermanent(source.getSourceId());
                if (perm != null) {
                    perm.sacrifice(source.getSourceId(), game);
                }
                player.drawCards(3, game);
                return true;
            }
        }
View Full Code Here

                if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false))
                {
                    return true;
                }
            }
            permanent.sacrifice(source.getSourceId(), game);
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        if (sourcePermanent != null) {
            if (sourcePermanent.sacrifice(source.getSourceId(), game)) {
                return new DestroyAllEffect(new FilterNonlandPermanent()).apply(game, source);
            }
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent sacrificed = game.getPermanent(source.getFirstTarget());
        System.out.println("The target is " + sacrificed.getName());
        Player player = game.getPlayer(source.getControllerId());
        if (sacrificed != null && player != null) {
            sacrificed.sacrifice(source.getSourceId(), game);
            Permanent lastKnownState = (Permanent) game.getLastKnownInformation(sacrificed.getId(), Zone.BATTLEFIELD);
            int power = lastKnownState.getPower().getValue();
            player.gainLife(power, game);
            player.drawCards(power, game);
            return true;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Integer amount = (Integer) game.getState().getValue(source.getSourceId().toString() + "DragonWhelp");
        if (amount != null && amount >= 4) {
            Permanent permanent = game.getPermanent(source.getSourceId());
            if (permanent != null) {
                permanent.sacrifice(source.getSourceId(), game);
            }
        }
        game.getState().setValue(source.getSourceId().toString() + "DragonWhelp", null);

        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.