Package mage.players

Examples of mage.players.Player.loseLife()


                permanent = (Permanent) game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
            }
            if (permanent != null) {
                Player player = game.getPlayer(permanent.getControllerId());
                if (player != null) {
                    player.loseLife(damageAmount, game);
                    return true;
                }
            }
        }
        return false;
View Full Code Here


                player.gainLife(3, game);
            } else {
                for (UUID opponentId : player.getInRange()) {
                    Player opponent = game.getPlayer(opponentId);
                    if (opponent != null) {
                        opponent.loseLife(3, game);
                    }
                }
            }
            return true;
        }
View Full Code Here

        if (targetPlayer != null && targetPlayer.getHand().size() > 0) {
            Cards revealed = new CardsImpl();
            Card card = targetPlayer.getHand().getRandom(game);
            revealed.add(card);
            targetPlayer.revealCards("Singe-Mind Ogre", revealed, game);
            targetPlayer.loseLife(card.getManaCost().convertedManaCost(), game);
            return true;
        }
        return false;
    }
}
View Full Code Here

        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player == null) {
            return false;
        }
        if (player.getLife() > 2 && player.chooseUse(Outcome.Neutral, "Pay 2 life? If you don't, return a permanent you control to its owner's hand.", game)) {
            player.loseLife(2, game);
            game.informPlayers(player.getName() + " pays 2 life. He will not return a permanent he or she controls.");
            return true;
        } else {
            Target target = new TargetControlledPermanent();
            if (target.canChoose(source.getSourceId(), player.getId(), game) && player.chooseTarget(outcome, target, source, game)) {
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(source.getControllerId());
        Permanent target = game.getPermanentOrLKIBattlefield(this.getTargetPointer().getFirst(game, source));
        if (player != null && target != null) {
            player.loseLife(target.getToughness().getValue(), game);
            return true;
        }
        return false;
    }
View Full Code Here

        }

        UUID attackerId = (UUID) this.getValue("attackerId");
        Player attacker = game.getPlayer(attackerId);
        if (attacker != null) {
            attacker.loseLife(amount, game);
        }
        return true;
    }
}
View Full Code Here

            for (UUID playerId : controller.getInRange()) {
                final int amount = game.getBattlefield().getAllActivePermanents(new FilterAttackingCreature(), playerId, game).size();
                if (amount > 0) {
                    Player player = game.getPlayer(playerId);
                    if (player != null) {
                        player.loseLife(amount, game);
                    }
                }
            }
            return true;
        }
View Full Code Here

    @Override
    public boolean replaceEvent(GameEvent event, Ability source, Game game) {
        Player player = game.getPlayer(event.getPlayerId());
        if (player != null) {
            player.loseLife(event.getAmount(), game);
        }
        return true;
    }

    @Override
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            Integer amount = (int) Math.ceil(player.getLife() / 2f);
            if (amount > 0) {
                player.loseLife(amount, game);
                return true;
            }
        }
        return false;
    }
View Full Code Here

            Card card = you.getLibrary().removeFromTop(game);
            cards.add(card);
            you.revealCards("Sapling of Colfenor", cards, game);
            if (card.getCardType().contains(CardType.CREATURE)) {
                you.gainLife(card.getToughness().getValue(), game);
                you.loseLife(card.getPower().getValue(), game);
                return card.moveToZone(Zone.HAND, source.getSourceId(), game, 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.