Package mage.target.targetpointer

Examples of mage.target.targetpointer.FixedTarget


    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.DECLARED_ATTACKERS && game.getActivePlayerId().equals(this.controllerId) ) {
            if (game.getCombat().attacksAlone()) {
                this.getEffects().get(0).setTargetPointer(new FixedTarget(game.getCombat().getAttackers().get(0)));
                return true;
            }
        }
        return false;
    }
View Full Code Here


                    }
                }
               
                if(!hasFlankingAbility){
                    for (Effect effect : this.getEffects()) {
                        effect.setTargetPointer(new FixedTarget(event.getSourceId()));
                    }
                    return true;
                }
            }
        }
View Full Code Here

                Permanent targetCreature = game.getPermanent(target.getFirstTarget());
                if (targetCreature != null && sourceCard != null) {
                    String ruleText = new StringBuilder("you may cast a copy of ").append(sourceCard.getLogName()).append(" without paying its mana cost").toString();
                    Ability ability = new DealsCombatDamageToAPlayerTriggeredAbility(new CipherStoreEffect(source.getSourceId(), ruleText), true);
                    ContinuousEffect effect = new GainAbilityTargetEffect(ability, Duration.Custom);
                    effect.setTargetPointer(new FixedTarget(target.getFirstTarget()));
                    game.addEffect(effect, source);
                    game.informPlayers(new StringBuilder(sourceCard.getLogName()).append(": Spell ciphered to ").append(targetCreature.getLogName()).toString());
                    return sourceCard.moveToExile(null, "", source.getSourceId(), game);
                } else {
                    return false;
View Full Code Here

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (super.checkTrigger(event, game)) {
            Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
            if (!p.getCounters().containsKey(CounterType.P1P1) || p.getCounters().getCount(CounterType.P1P1) == 0) {
                game.getState().setValue(new StringBuilder("undying").append(getSourceId()).toString(), new FixedTarget(p.getId()));
                return true;
            }
        }
        return false;
    }
View Full Code Here

        }
        Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (creature != null) {
            creature.damage(1, source.getSourceId(), game, false, true);
            ContinuousEffect effect = new CantBlockTargetEffect(Duration.EndOfTurn);
            effect.setTargetPointer(new FixedTarget(creature.getId()));
            game.addEffect(effect, source);
        }
        return true;
    }
View Full Code Here

            Library library = controller.getLibrary();
            Card card = library.removeFromTop(game);
            if (card != null) {
                controller.moveCardToExileWithInfo(card, source.getSourceId(), "Chandra Pyromaster <this card may be played the turn it was exiled>", source.getSourceId(), game, Zone.LIBRARY);
                ContinuousEffect effect = new ChandraPyromasterCastFromExileEffect();
                effect.setTargetPointer(new FixedTarget(card.getId()));
                game.addEffect(effect, source);
            }
            return true;
        }
        return false;
View Full Code Here

                    controller.lookAtCards(sourcePermanent.getLogName(), cards, game);
                    if (CardUtil.shareSubtypes(sourcePermanent, card)) {
                        if (controller.chooseUse(outcome,new StringBuilder("Kinship - Reveal ").append(card.getLogName()).append("?").toString(), game)) {
                            controller.revealCards(sourcePermanent.getLogName(), cards, game);
                            for (Effect effect: kinshipEffects) {
                                effect.setTargetPointer(new FixedTarget(card.getId()));
                                if (effect.getEffectType().equals(EffectType.ONESHOT)) {
                                    effect.apply(game, source);
                                } else {
                                    if (effect instanceof ContinuousEffect) {
                                        game.addEffect((ContinuousEffect)effect, source);
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        CreateTokenEffect effect =  new CreateTokenEffect(new TatsumaDragonToken());
        effect.apply(game, source);
        FixedTarget fixedTarget = new FixedTarget(effect.getLastAddedTokenId());
        DelayedTriggeredAbility delayedAbility = new TatsumaTheDragonsFangTriggeredAbility(fixedTarget);
        delayedAbility.setSourceId(source.getSourceId());
        delayedAbility.setControllerId(source.getControllerId());
        game.addDelayedTriggeredAbility(delayedAbility);
View Full Code Here

                if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) {
                    Permanent permanent = game.getPermanent(card.getId());
                    if (permanent != null) {
                        // Haste
                        ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);
                        effect.setTargetPointer(new FixedTarget(permanent.getId()));
                        game.addEffect(effect, source);
                        // Exile it at end of turn
                        Effect exileEffect = new ExileTargetEffect(new StringBuilder("Exile ").append(permanent.getName()).append(" at the beginning of the next end step").toString());
                        exileEffect.setTargetPointer(new FixedTarget(card.getId()));
                        DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
                        delayedAbility.setSourceId(source.getSourceId());
                        delayedAbility.setControllerId(source.getControllerId());
                        game.addDelayedTriggeredAbility(delayedAbility);
                        return true;
View Full Code Here

        filter.add(new ControllerIdPredicate(player.getId()));

        List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId() , game);
        for (Permanent permanent : permanents) {
            ContinuousEffect effect = new HellkiteTyrantControlEffect(source.getControllerId());
            effect.setTargetPointer(new FixedTarget(permanent.getId()));
            game.addEffect(effect, source);
        }
        return true;
    }
View Full Code Here

TOP

Related Classes of mage.target.targetpointer.FixedTarget

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.