Package mage

Examples of mage.ObjectColor


    public ObjectColor getColor() {
        if (choice == null) {
            return null;
        }
        ObjectColor color = new ObjectColor();
        switch (choice) {
            case "Black":
                color.setBlack(true);
                break;
            case "Blue":
                color.setBlue(true);
                break;
            case "Green":
                color.setGreen(true);
                break;
            case "Red":
                color.setRed(true);
                break;
            case "White":
                color.setWhite(true);
                break;
        }
        return color;
    }
View Full Code Here


        return new EmptyShrineKannushiProtectionAbility(this);
    }
   
    @Override
    public boolean canTarget(MageObject source, Game game) {
        ObjectColor color = new ObjectColor();
        for (Permanent permanent: game.getBattlefield().getAllActivePermanents(controllerId)) {
            ObjectColor permanentColor = permanent.getColor();
            if (permanentColor.isColorless()) {
                continue;
            }
            if (permanentColor.isBlack()) {
                color.setBlack(true);
            }
            if (permanentColor.isBlue()) {
                color.setBlue(true);
            }
            if (permanentColor.isGreen()) {
                color.setGreen(true);
            }
            if (permanentColor.isRed()) {
                color.setRed(true);
            }
            if (permanentColor.isWhite()) {
                color.setWhite(true);
            }
        }

        ArrayList<Predicate<MageObject>> colorPredicates = new ArrayList<Predicate<MageObject>>();
View Full Code Here

        return new HallOfTriumphBoostControlledEffect(this);
    }

    @Override
    public boolean apply(Game game, Ability source) {
        ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
        if (color != null) {
            for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
                if (perm.getColor().shares(color)) {
                    perm.addPower(1);
                    perm.addToughness(1);
View Full Code Here

        }

        ArrayList<String> list = new ArrayList<>();
        list.add("Spirit");
        list.add("Warrior");
        ObjectColor objectColor = new ObjectColor();
        objectColor.setBlack(true);
        objectColor.setGreen(true);
        Token token = new Token("Spirit Warrior", "X/X black and green Spirit Warrior creature token onto the battlefield, where X is the greatest toughness among creatures you control",
                objectColor, list, value, value, new AbilitiesImpl());
        token.getAbilities().newId(); // neccessary if token has ability like DevourAbility()
        token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
        return true;
View Full Code Here

        if (event.getType() == GameEvent.EventType.ZONE_CHANGE  || event.getType() == GameEvent.EventType.LOST_CONTROL
                || event.getType() == GameEvent.EventType.COLOR_CHANGED
                || event.getType() == GameEvent.EventType.SPELL_CAST) {
            Card card = game.getCard(this.getSourceId());
            if (card != null) {
                ObjectColor color = (ObjectColor) game.getState().getValue(card.getId() + "_color");
                if (color != null) {
                    for (Permanent perm: game.getBattlefield().getAllActivePermanents(controllerId)) {
                        if (perm.getColor().contains(color))
                            return false;
                    }
View Full Code Here

        this.toughness = "";
        this.loyalty = "";
        this.cardTypes = new ArrayList<>();
        this.subTypes = new ArrayList<>();
        this.superTypes = new ArrayList<>();
        this.color = new ObjectColor();
        this.manaCost = new ArrayList<>();
        this.convertedManaCost = 0;

        // the controller can see more information (e.g. enlarged image) than other players for face down cards (e.g. Morph played face down)
        if (!controlled) {
View Full Code Here

            if (imprinted.size() > 0) {
                Card imprintedCard = game.getCard(imprinted.get(0));
                if (imprintedCard != null) {
                    Choice choice = new ChoiceImpl(true);
                    choice.setMessage("Pick a mana color");
                    ObjectColor color = imprintedCard.getColor();
                    if (color.isBlack()) {
                        choice.getChoices().add("Black");
                    }
                    if (color.isRed()) {
                        choice.getChoices().add("Red");
                    }
                    if (color.isBlue()) {
                        choice.getChoices().add("Blue");
                    }
                    if (color.isGreen()) {
                        choice.getChoices().add("Green");
                    }
                    if (color.isWhite()) {
                        choice.getChoices().add("White");
                    }
                 
                    if (choice.getChoices().size() > 0) {
                        if (choice.getChoices().size() == 1) {
View Full Code Here

        this.toughness = "";
        this.loyalty = "";
        this.cardTypes = new ArrayList<>();
        this.subTypes = new ArrayList<>();
        this.superTypes = new ArrayList<>();
        this.color = new ObjectColor();
        this.manaCost = ability.getManaCosts().getSymbols();
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            ObjectColor color = (ObjectColor) game.getState().getValue(source.getSourceId() + "_color");
            if (color == null) {
                return false;
            }
            String colorString = color.toString();
            for (Permanent perm : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
                switch (colorString) {
                    case "W":
                        perm.getColor().setWhite(true);
                        break;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null) {
            ObjectColor color = (ObjectColor) game.getState().getValue(permanent.getId() + "_color");
            if (color != null) {
                for (Permanent perm: game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
                    if (perm.getColor().contains(color)) {
                        perm.addPower(1);
                        perm.addToughness(1);
View Full Code Here

TOP

Related Classes of mage.ObjectColor

Copyright © 2018 www.massapicom. 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.