Package mage.players

Examples of mage.players.Player.cast()


            player.moveCardToExileWithInfo(card, exile.getId(), exile.getName(), source.getSourceId(), game, Zone.LIBRARY);
        } while (player.isInGame() && card.getCardType().contains(CardType.LAND) || card.getManaCost().convertedManaCost() >= sourceCost);

        if (card != null) {
            if (player.chooseUse(outcome, "Use cascade effect on " + card.getName() + "?", game)) {
                if(player.cast(card.getSpellAbility(), game, true)){
                    exile.remove(card.getId());
                }
            }
        }
View Full Code Here


        }
        Card reboundCard = zone.get(this.cardId, game);
        Player player = game.getPlayer(source.getControllerId());
        if (player != null && reboundCard != null) {
            SpellAbility ability = reboundCard.getSpellAbility();
            player.cast(ability, game, true);
            zone.remove(reboundCard.getId());
            return true;
        }
        return false;
    }
View Full Code Here

        if (owner != null && card != null) {
            ManaCosts<ManaCost> costRef = card.getSpellAbility().getManaCostsToPay();
            // replace with the new cost
            costRef.clear();
            costRef.add(madnessCost);
            boolean result = owner.cast(card.getSpellAbility(), game, false);
            // Reset the casting costs (in case the player cancels cast and plays the card later)
            // TODO: CHeck if this is neccessary
            costRef.clear();
            for (ManaCost manaCost : card.getSpellAbility().getManaCosts()) {
                costRef.add(manaCost);
View Full Code Here

                    cipherEffect = effect;
                }
            }
            ability.getEffects().remove(cipherEffect);
            if (ability != null && ability instanceof SpellAbility) {
                controller.cast(ability, game, true);
            }
        }

        return false;
    }
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        Card target = (Card) game.getObject(source.getFirstTarget());
        if (controller != null && target != null) {
            return controller.cast(target.getSpellAbility(), game, true);
        }
        return false;
    }

    @Override
View Full Code Here

                if (card != null) {
                    Card copy1 = card.copy();
                    Card copy2 = card.copy();
                    Card copy3 = card.copy();
                    if (copy1 != null && you.chooseUse(outcome, "Do you wish to cast copy 1 of " + card.getName(), game)) {
                        you.cast(copy1.getSpellAbility(), game, true);
                    }
                    if (copy2 != null && you.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), game)) {
                        you.cast(copy2.getSpellAbility(), game, true);
                    }
                    if (copy3 != null && you.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), game)) {
View Full Code Here

                    Card copy3 = card.copy();
                    if (copy1 != null && you.chooseUse(outcome, "Do you wish to cast copy 1 of " + card.getName(), game)) {
                        you.cast(copy1.getSpellAbility(), game, true);
                    }
                    if (copy2 != null && you.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), game)) {
                        you.cast(copy2.getSpellAbility(), game, true);
                    }
                    if (copy3 != null && you.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), game)) {
                        you.cast(copy3.getSpellAbility(), game, true);
                    }
                    return true;
View Full Code Here

                    }
                    if (copy2 != null && you.chooseUse(outcome, "Do you wish to cast copy 2 of " + card.getName(), game)) {
                        you.cast(copy2.getSpellAbility(), game, true);
                    }
                    if (copy3 != null && you.chooseUse(outcome, "Do you wish to cast copy 3 of " + card.getName(), game)) {
                        you.cast(copy3.getSpellAbility(), game, true);
                    }
                    return true;
                }
            }
        }
View Full Code Here

                    // If the revealed card is a land, you can play it only if it's your turn and you haven't yet played a land this turn.
                    if (game.getActivePlayerId().equals(player.getId()) && player.canPlayLand()) {
                        player.playLand(card, game);
                    }
                } else {
                    player.cast(card.getSpellAbility(), game, true);
                }
            }
            return true;
        }
        return false;
View Full Code Here

    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            Card card = game.getCard(getTargetPointer().getFirst(game, source));
            if (card != null) {
                controller.cast(card.getSpellAbility(), game, false);
                game.addEffect(new ToshiroUmezawaReplacementEffect(card.getId()), source);
            }
        }
        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.