Package mage.game.permanent

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


    @Override
    public boolean apply(Game game, Ability source) {
        for (UUID target : targetPointer.getTargets(game, source)) {
            Permanent creature = game.getPermanent(target);
            if (creature != null) {
                creature.damage(1, attachmentid, game, false, true);
            }
            Player player = game.getPlayer(target);
            if (player != null) {
                player.damage(1, attachmentid, game, false, true);
            }
View Full Code Here


               targetPlayer.damage(damageAmount.intValue(), source.getSourceId(), game, false, true);
               return true;
            }
            Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
            if (permanent != null) {
                permanent.damage(damageAmount.intValue(), source.getSourceId(), game, false, true);
                return true;
            }
        }
        return false;
    }
View Full Code Here

            if ( twoDamageDone ) {
                damage = 1;
            }

            if (permanent != null) {
                applied |= (permanent.damage( damage, source.getSourceId(), game, false, true ) > 0);
            }
            Player player = game.getPlayer(target);
            if (player != null) {
                applied |= (player.damage( damage, source.getSourceId(), game, false, true ) > 0);
            }
View Full Code Here

                player.damage(amount, source.getSourceId(), game, false, true);
                return true;
            }
            Permanent creature = game.getPermanent(targetPointer.getFirst(game, source));
            if (creature != null) {
                creature.damage(amount, source.getSourceId(), game, false, true);
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
        if (permanent != null) {
            Player controller = game.getPlayer(permanent.getControllerId());
            if (controller != null) {
                permanent.damage(1, source.getSourceId(), game, false, true);
                controller.damage(1, source.getSourceId(), game, false, true);
                return true;
            }
        }
        return false;
View Full Code Here

        if (targetPlayer != null) {
            targetPlayer.damage(damage, source.getSourceId(), game, false, preventable);
            return true;
        }
        if (targetCreature != null) {
            targetCreature.damage(damage, source.getSourceId(), game, false, preventable);
            return true;
        }
        return false;
    }
}
View Full Code Here

                }
            }
            if (controllerStopped) {
                Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
                if (creature != null) {
                    creature.damage(3, source.getSourceId(), game, false, true);
                }
                if (flipsWon > 1) {
                    new DamagePlayersEffect(6, TargetController.OPPONENT).apply(game, source);
                }
                if (flipsWon > 2) {
View Full Code Here

        if (preventionResult.getPreventedDamage() > 0) {
            Permanent redirectTo = game.getPermanent(getTargetPointer().getFirst(game, source));
            if (redirectTo != null) {
                game.informPlayers("Dealing " + preventionResult.getPreventedDamage() + " to " + redirectTo.getName() + " instead.");
                DamageEvent damageEvent = (DamageEvent) event;
                redirectTo.damage(preventionResult.getPreventedDamage(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
            }
        }
        return false;
    }
   
View Full Code Here

   
    @Override
    public boolean apply(Game game, Ability source) {
        Permanent creature = game.getPermanent(source.getFirstTarget());
        if (creature != null) {
            creature.damage(creature.getDamage(), source.getSourceId(), game, false, true);
            return true;
        }
        return false;
    }
   
View Full Code Here

                UUID redirectTo = source.getTargets().get(1).getFirstTarget();
                Permanent permanent = game.getPermanent(redirectTo);
                if (permanent != null) {
                    game.informPlayers("Dealing " + prevented + " to " + permanent.getName() + " instead");
                    // keep the original source id as it is redirecting
                    permanent.damage(prevented, event.getSourceId(), game, false, true);
                }
            }
        }
        return false;
    }
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.