Package mage.game.permanent

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


    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        DamageCreatureEvent damageEvent = (DamageCreatureEvent) event;
        if (permanent != null) {
            permanent.damage(damageEvent.getAmount(), damageEvent.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable());
            return true;
        }
        return false;
    }
View Full Code Here


        List<UUID> wolves = new ArrayList<UUID>();
        Permanent target = game.getPermanent(source.getFirstTarget());
        if (target != null && game.getBattlefield().countAll(filter, source.getControllerId(), game) > 0) {
            for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
                permanent.tap(game);
                target.damage(permanent.getToughness().getValue(), permanent.getId(), game, false, true);
                wolves.add(permanent.getId());
            }
            Player player = game.getPlayer(target.getControllerId());
            player.assignDamage(target.getPower().getValue(), wolves, "Wolf", target.getId(), game);
            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.damage(3, source.getSourceId(), game, false, true);
            if (ClashEffect.getInstance().apply(game, source)) {
                Player creaturesController = game.getPlayer(creature.getControllerId());
                if (creaturesController != null) {
                    creaturesController.damage(3, source.getSourceId(), game, false, true);
                }
View Full Code Here

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

        FilterPermanent filter = new FilterPermanent("black permanent");
        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

        Permanent creature2 = game.getPermanent((UUID) target.getTargets().get(1));
        // 20110930 - 701.10
        if (creature1 != null && creature2 != null) {
            if (creature1.getCardType().contains(CardType.CREATURE) && creature2.getCardType().contains(CardType.CREATURE)) {
                creature1.damage(creature2.getPower().getValue(), creature2.getId(), game, false, true);
                creature2.damage(creature1.getPower().getValue(), creature1.getId(), game, false, true);
                return true;
            }
        }
        return false;
    }
View Full Code Here

            int damageAmount = cost.getRemovedCounters();
            if (damageAmount > 0) {

                    Permanent permanent = game.getPermanent(source.getFirstTarget());
                    if (permanent != null) {
                        permanent.damage(damageAmount, source.getSourceId(), game, false, true);
                    }
                    Player player = game.getPlayer(source.getFirstTarget());
                    if (player != null) {
                        player.damage(damageAmount, source.getSourceId(), game, false, true);
                    }
View Full Code Here

        UUID targetId = source.getTargets().get(1).getFirstTarget();
        int damage = sourcePermanent.getPower().getValue();

        Permanent permanent = game.getPermanent(targetId);
        if (permanent != null) {
            permanent.damage(damage, sourcePermanent.getId(), game, false, true);
            return true;
        }

        Player player = game.getPlayer(targetId);
        if (player != null) {
View Full Code Here

            // Last Stand deals damage equal to the number of Mountains you control to target creature.
            Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
            if (creature != null) {
                int mountains = game.getBattlefield().count(filterMountain, source.getSourceId(), source.getControllerId(), game);
                if (mountains > 0) {
                    creature.damage(mountains, source.getSourceId(), game, false, true);
                }
            }
            // Put a 1/1 green Saproling creature token onto the battlefield for each Forest you control.
            int forests = game.getBattlefield().count(filterForest, source.getSourceId(), source.getControllerId(), game);
            if (forests > 0) {
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        DamagePlayerEvent damageEvent = (DamagePlayerEvent) event;
        Permanent p = game.getPermanent(source.getSourceId());
        if (p != null) {
            p.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable());
            return true;
        }
        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.