Package mage.cards

Examples of mage.cards.SplitCard


        // If a player names a card, the player may name either half of a split card, but not both.
        // A split card has the chosen name if one of its two names matches the chosen name.
        if (input instanceof SplitCard) {
            return name.equals(((SplitCard)input).getLeftHalfCard().getLogName()) || name.equals(((SplitCard)input).getRightHalfCard().getLogName());
        } else if (input instanceof Spell && ((Spell)input).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)){
            SplitCard card = (SplitCard) ((Spell)input).getCard();
            return name.equals(card.getLeftHalfCard().getLogName()) || name.equals(card.getRightHalfCard().getLogName());
        } else {
            return name.equals(input.getLogName());
        }
    }
View Full Code Here


        if (object instanceof Spell) {
            cmcObject.add(((Spell)object).getConvertedManaCost());
        } else if (object instanceof Card) {
            Card card = (Card) object;
            if (card instanceof SplitCard) {
                SplitCard splitCard = (SplitCard) card;
                cmcObject.add(splitCard.getLeftHalfCard().getManaCost().convertedManaCost());
                cmcObject.add(splitCard.getRightHalfCard().getManaCost().convertedManaCost());
            } else {
                cmcObject.add(card.getManaCost().convertedManaCost());
            }
        }
        return cmcObject;
View Full Code Here

                    return false;
                }
            }
            if (costs.canPay(this, sourceId, controllerId, game)) {
                if (getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) {
                    SplitCard splitCard = (SplitCard) game.getCard(getSourceId());
                    if (splitCard != null) {
                        return (splitCard.getLeftHalfCard().getSpellAbility().canChooseTarget(game)
                                && splitCard.getRightHalfCard().getSpellAbility().canChooseTarget(game));
                    }
                    return false;

                } else {
                    return  canChooseTarget(game);
View Full Code Here

                this.hideInfo = true;
                return;
            }
        }

        SplitCard splitCard = null;
        if (card.isSplitCard()) {
            splitCard = (SplitCard) card;
            rotate = true;
        } else {
            if (card instanceof Spell) {
                switch(((Spell) card).getSpellAbility().getSpellAbilityType()) {
                    case SPLIT_FUSED:
                        splitCard = (SplitCard) ((Spell) card).getCard();
                        rotate = true;
                        break;
                    case SPLIT_LEFT:
                    case SPLIT_RIGHT:
                        rotate = true;
                        break;
                }
            }
        }
        if (splitCard != null) {
            this.isSplitCard = true;
            leftSplitName = splitCard.getLeftHalfCard().getName();
            leftSplitCosts = splitCard.getLeftHalfCard().getManaCost();
            leftSplitRules = splitCard.getLeftHalfCard().getRules();
            rightSplitName = splitCard.getRightHalfCard().getName();
            rightSplitCosts = splitCard.getRightHalfCard().getManaCost();
            rightSplitRules = splitCard.getRightHalfCard().getRules();
        }

        this.name = card.getImageName();
        this.displayName = card.getName();
        this.rules = card.getRules();
View Full Code Here

        // If a player names a card, the player may name either half of a split card, but not both.
        // A split card has the chosen name if one of its two names matches the chosen name.
        if (input instanceof SplitCard) {
            return cardNames.contains(((SplitCard)input).getLeftHalfCard().getName()) || cardNames.contains(((SplitCard)input).getRightHalfCard().getName());
        } else if (input instanceof Spell && ((Spell)input).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)){
            SplitCard card = (SplitCard) ((Spell)input).getCard();
            return cardNames.contains(card.getLeftHalfCard().getName()) || cardNames.contains(card.getRightHalfCard().getName());
        } else {
            return cardNames.contains(input.getName());
        }
    }
View Full Code Here

TOP

Related Classes of mage.cards.SplitCard

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.