Package mage.players

Examples of mage.players.Player.damage()


            permanent.damage(damage, source.getSourceId(), game, false, true);
        }
        for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null) {
                player.damage(damage, source.getSourceId(), game, false, true);
            }
        }
        return true;
    }
}
View Full Code Here


        switch (controller) {
            case ANY:
                for (UUID playerId: game.getPlayer(source.getControllerId()).getInRange()) {
                    Player player = game.getPlayer(playerId);
                    if (player != null) {
                        player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true);
                    }
                }
                break;
            case OPPONENT:
                for (UUID playerId: game.getOpponents(source.getControllerId())) {
View Full Code Here

                break;
            case OPPONENT:
                for (UUID playerId: game.getOpponents(source.getControllerId())) {
                    Player player = game.getPlayer(playerId);
                    if (player != null) {
                        player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, true);
                    }
                }
                break;
            default:
                throw new UnsupportedOperationException("TargetController type not supported.");
View Full Code Here

            for (UUID playerId : controller.getInRange()) {
                int amount = game.getBattlefield().countAll(filter , playerId, game);
                if (amount > 0) {
                    Player player = game.getPlayer(playerId);
                    if (player != null) {
                        player.damage(amount * 2, source.getSourceId(), game, false, true);
                    }
                }
            }
            return true;
        }
View Full Code Here

                defender.markDamage(amount, attacker.getId(), game, true, true);
            }
        }
        else {
            Player defender = game.getPlayer(defenderId);
            defender.damage(amount, attacker.getId(), game, true, true);
        }
    }

    public boolean canBlock(Permanent blocker, Game game) {
        // player can't block if another player is attacked
View Full Code Here

            permanent.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
            return true;
        }
        Player player = game.getPlayer(redirectTarget.getFirstTarget());
        if (player != null) {
            player.damage(damageEvent.getAmount(), event.getSourceId(), game, damageEvent.isCombatDamage(), damageEvent.isPreventable(), event.getAppliedEffects());
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getTargets().get(0).getFirstTarget());
        if (player != null) {
            player.damage(1, source.getSourceId(), game, false, true);
        }
        Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (creature != null) {
            creature.damage(1, source.getSourceId(), game, false, true);
            ContinuousEffect effect = new CantBlockTargetEffect(Duration.EndOfTurn);
View Full Code Here

                    if (permanent != null) {
                        permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
                    }
                    Player player = game.getPlayer(targetId);
                    if (player != null) {
                        player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
                    }
                }
            }
            return true;
        }
View Full Code Here

            if (permanent != null) {
                permanent.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
            } else {
                Player player = game.getPlayer(targetId);
                if (player != null) {
                    player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
                }
            }
        }
        return true;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        if (player != null) {
            player.damage(amount.calculate(game, source, this), source.getSourceId(), game, false, preventable);
            return 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.