Examples of canBeTargetedBy()


Examples of mage.players.Player.canBeTargetedBy()

            MageObject targetSource = game.getObject(source.getSourceId());
            if (permanent != null) {
                return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
            }
            if (player != null) {
                return player.canBeTargetedBy(targetSource, game) && filter.match(player, game);
            }
        }

        if (permanent != null) {
            return filter.match(permanent, game);
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                possibleTargets.add(playerId);
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), sourceControllerId, game)) {
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) {
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && !player.hasLeft() && filter.match(player, sourceId, sourceControllerId, game)) {
                if (player.canBeTargetedBy(targetSource, game)) {
                    count++;
                    if (count >= this.minNumberOfTargets)
                        return true;
                }
            }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

        Set<UUID> possibleTargets = new HashSet<>();
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && !player.hasLeft() && filter.match(player, sourceId, sourceControllerId, game)) {
                if (isNotTarget() || player.canBeTargetedBy(targetSource, game)) {
                    possibleTargets.add(playerId);
                }
            }
        }
        return possibleTargets;
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    @Override
    public boolean canTarget(UUID id, Ability source, Game game) {
        Player player = game.getPlayer(id);
        if (player != null) {
            if (source != null) {
                return (isNotTarget() || player.canBeTargetedBy(game.getObject(source.getSourceId()), game))
                        && filter.match(player, source.getSourceId(), source.getControllerId(), game);
            } else {
                return filter.match(player, game);
            }
        }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

            MageObject targetSource = game.getObject(source.getSourceId());
            if (permanent != null) {
                return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
            }
            if (player != null) {
                return player.canBeTargetedBy(targetSource, game) && filter.match(player, game);
            }
        }

        if (permanent != null) {
            return filter.match(permanent, game);
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
            }
View Full Code Here

Examples of mage.players.Player.canBeTargetedBy()

    public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
        Set<UUID> possibleTargets = new HashSet<>();
        MageObject targetSource = game.getObject(sourceId);
        for (UUID playerId: game.getPlayer(sourceControllerId).getInRange()) {
            Player player = game.getPlayer(playerId);
            if (player != null && player.canBeTargetedBy(targetSource, game) && filter.match(player, game)) {
                possibleTargets.add(playerId);
            }
        }
        for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterPermanent(), sourceControllerId, game)) {
            if (permanent.canBeTargetedBy(targetSource, sourceControllerId, game) && filter.match(permanent, sourceId, sourceControllerId, game)) {
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.