Package mage.players

Examples of mage.players.Player.damage()


    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            int damage = game.getBattlefield().getAllActivePermanents(filter,targetPointer.getFirst(game, source) , game).size();
            player.damage(damage, source.getSourceId(), game, false, true);
            return true;
        }
        return false;
    }
View Full Code Here


    @Override
    public boolean apply(Game game, Ability source) {
        Player target = game.getPlayer(source.getFirstTarget());
        if (target != null) {
            target.damage(target.getHand().size(), source.getSourceId(), game, false, true);
        }
        return false;
    }

    @Override
View Full Code Here

        Integer damageAmount = (Integer) this.getValue("damageAmount");
        UUID targetId = this.targetPointer.getFirst(game, source);
        if (damageAmount != null && targetId != null) {
            Player player = game.getPlayer(targetId);
            if (player != null) {
                    player.damage(damageAmount, targetId, game, false, true);
                    return true;
            }
        }
        return false;
    }
View Full Code Here

                    targetCreature.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
                    return true;
                }
                Player targetPlayer = game.getPlayer(this.getTargetPointer().getFirst(game, source));
                if (targetPlayer != null) {
                    targetPlayer.damage(card.getManaCost().convertedManaCost(), source.getSourceId(), game, false, true);
                    return true;
                }               
             }
            return true;
        }
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(3, source.getSourceId(), game, false, true);
        }
        Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (creature != null) {
            creature.damage(3, source.getSourceId(), game, false, true);
        }
View Full Code Here

                permanent.damage(maxCost, source.getSourceId(), game, false, true);
                return true;
            }
            Player targetPlayer = game.getPlayer(targetPointer.getFirst(game, source));
            if (targetPlayer != null) {
                targetPlayer.damage(maxCost, source.getSourceId(), game, false, true);
                return true;
            }
        }
        return false;
    }
View Full Code Here

        UUID playerId = (UUID) game.getState().getValue(source.getSourceId().toString() + "_player");
        Player chosenPlayer = game.getPlayer(playerId);
        if (chosenPlayer != null) {
            int damage = chosenPlayer.getHand().size() - 4;
            if (damage > 0) {
                chosenPlayer.damage(damage, source.getSourceId(), game, false, true);
            }
            return true;
        }
        return false;
    }
View Full Code Here

                Card discardedCard = game.getCard(this.getTargetPointer().getFirst(game, source));
                if (discardedCard != null
                        && discardedCard.getCardType().contains(CardType.CREATURE)) {
                    int damage = discardedCard.getPower().getValue();
                    if (targetedPlayer != null) {
                        targetedPlayer.damage(damage, source.getSourceId(), game, false, true);
                        return true;
                    }
                }
            }
        }
View Full Code Here

        if (targetId != null) {
            Permanent permanent = game.getPermanentOrLKIBattlefield(targetId);
            if (permanent != null) {
                Player controller = game.getPlayer(permanent.getControllerId());
                if (controller != null) {
                    controller.damage(3, source.getSourceId(), game, false, false);
                    return true;
                }
            }
        }
        return false;
View Full Code Here

                    target.damage(prevented, source.getSourceId(), game, false, true);
                }
                Player player = game.getPlayer(damageTarget);
                if (player != null) {
                    game.informPlayers("Dealing " + prevented + " to " + player.getName());
                    player.damage(prevented, source.getSourceId(), game, true, false);
                }
            }
        }
        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.