Package mage.players

Examples of mage.players.Player.damage()


            Set<UUID> opponents = game.getOpponents(source.getControllerId());
            for (UUID opponentUuid : opponents) {
                Player opponent = game.getPlayer(opponentUuid);
                if (opponent != null && opponent.chooseUse(Outcome.LoseLife, sb.toString(), game)) {
                    game.informPlayers(opponent.getName() + " has chosen to receive 4 damage from " + permanent.getName());
                    int dealt = opponent.damage(4, permanent.getId(), game, false, true);
                    if (dealt == 4) {
                        game.informPlayers(opponent.getName() + " was dealt 4 damage so " + permanent.getName() + " will be sacrificed.");
                        permanent.sacrifice(source.getSourceId(), game);
                        return true;
                    } else {
View Full Code Here


            if (you.flipCoin(game)) {
                DjinnToken token = new DjinnToken();
                token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
                return true;
            } else {
                you.damage(5, source.getSourceId(), game, true, false);
                return true;
            }

        }
        return false;
View Full Code Here

        if (sourcePermanent != null) {
            Permanent attached = game.getPermanent(sourcePermanent.getAttachedTo());
            if (attached != null) {
                Player owner = game.getPlayer(attached.getOwnerId());
                if (owner != null) {
                    owner.damage(1, source.getSourceId(), game, false, true);
                    return true;
                }
            }
        }
View Full Code Here

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

            filterEnchantments.add(new CardTypePredicate(CardType.ENCHANTMENT));

            for (Permanent permanent : game.getBattlefield().getActivePermanents(filterEnchantments, source.getControllerId(), source.getSourceId(), game)) {
                Player controller = game.getPlayer(permanent.getControllerId());
                if (controller != null) {
                    controller.damage(2, permanent.getId(), game, false, true);
                    game.informPlayers("2 damage assigned to " + controller.getName() + " from " + permanent.getName());
                }
            }

            filterEnchantments.add(new SubtypePredicate("Aura"));
View Full Code Here

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

                targetCreature.damage(amount, creature.getId(), game, false, true);
                return true;
            }
            Player player = game.getPlayer(target);
            if (player != null) {
                player.damage(amount, creature.getId(), game, false, true);
                return true;
            }
        }
        return false;
    }
View Full Code Here

            if (object != null && object instanceof Spell) {
                Spell spell = (Spell) object;
                Player spellController = game.getPlayer(spell.getControllerId());
                if (spellController != null) {
                    int damage = new ManacostVariableValue().calculate(game, source, this);
                    spellController.damage(damage, source.getSourceId(), game, false, true);
                }
                return true;
            }
        }
        return false;
View Full Code Here

                objectControllerId = ((Spell) damageDealingObject).getControllerId();
            }
            if (objectControllerId != null) {
                Player objectController = game.getPlayer(objectControllerId);
                if (objectController != null) {
                    objectController.damage(preventionData.getPreventedDamage(), source.getSourceId(), game, false, true);
                }
            }
        }       
        return true;
    }
View Full Code Here

            permanent.damage(damage, source.getSourceId(), game, false, true);
            return true;
        }
        Player player = game.getPlayer(targetPointer.getFirst(game, source));
        if (player != null) {
            player.damage(damage, source.getSourceId(), game, false, true);
            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.