Package mage.target.targetpointer

Examples of mage.target.targetpointer.FixedTarget


                Card card = game.getCard(cardId);
                card.moveToZone(Zone.BATTLEFIELD, source.getSourceId(), game, false);
                Permanent returnedCreature = game.getPermanent(cardId);
                if (returnedCreature != null) {
                    ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
                    effect.setTargetPointer(new FixedTarget(returnedCreature.getId()));
                    game.addEffect(effect, source);
                }
            }
            game.getExile().getExileZone(source.getSourceId()).clear();
            return true;
View Full Code Here


            Permanent sourcePermanent = game.getPermanent(this.getSourceId());
            if (sourcePermanent != null) {
                if (sourcePermanent.getCardType().contains(CardType.CREATURE)) {
                    if (event.getSourceId() == this.getSourceId()) {
                        UUID defender = game.getCombat().getDefendingPlayerId(this.getSourceId(), game);
                        this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
                        return true;
                    }
                } else {
                    if (sourcePermanent.getAttachedTo() != null && sourcePermanent.getAttachedTo().equals(event.getSourceId())) {
                        UUID defender = game.getCombat().getDefendingPlayerId(sourcePermanent.getAttachedTo(), game);
                        this.getEffects().get(0).setTargetPointer(new FixedTarget(defender));
                        return true;
                    }
                }
            }
View Full Code Here

        Permanent equipment = game.getPermanent(this.getSourceId());
        if (equipment != null) {
            Permanent permanent = game.getPermanent(equipment.getAttachedTo());
            if (event.getType() == GameEvent.EventType.UPKEEP_STEP_PRE
                    && permanent != null && event.getPlayerId().equals(permanent.getControllerId())) {
                this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
                return true;
            }
        }
        return false;
    }
View Full Code Here

        for (int i = 0; i < 3; i++) {
            RedHumanToken token = new RedHumanToken();
            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());

            SacrificeTargetEffect sacrificeEffect = new SacrificeTargetEffect("sacrifice this token");
            sacrificeEffect.setTargetPointer(new FixedTarget(token.getLastAddedToken()));
            DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(sacrificeEffect);
            delayedAbility.setSourceId(source.getSourceId());
            delayedAbility.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(delayedAbility);
        }
View Full Code Here

        if (creature != null) {
            Player controller = game.getPlayer(creature.getControllerId());
            if (controller != null) {
                int power = creature.getPower().getValue();
                Effect effect = new PutLibraryIntoGraveTargetEffect(power);
                effect.setTargetPointer(new FixedTarget(controller.getId()));
                return effect.apply(game, source);
            }
        }
        return false;
    }
View Full Code Here

        if (permanent != null) {
            PutTokenOntoBattlefieldCopyTargetEffect effect = new PutTokenOntoBattlefieldCopyTargetEffect(null, CardType.ENCHANTMENT, true);
            effect.setTargetPointer(getTargetPointer());
            if (effect.apply(game, source) && effect.getAddedPermanent() != null) {
                ExileTargetEffect exileEffect = new ExileTargetEffect();
                exileEffect.setTargetPointer(new FixedTarget(effect.getAddedPermanent().getId()));
                DelayedTriggeredAbility delayedAbility = new AtEndOfTurnDelayedTriggeredAbility(exileEffect);
                delayedAbility.setSourceId(source.getSourceId());
                delayedAbility.setControllerId(source.getControllerId());
                game.addDelayedTriggeredAbility(delayedAbility);
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.SPELL_CAST && event.getPlayerId().equals(playerId)) {
            this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
            return true;
        }
        return false;
    }
View Full Code Here

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.SPELL_CAST && game.getOpponents(controllerId).contains(event.getPlayerId())) {
            this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
            return true;
        }
        return false;
    }
View Full Code Here

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.BLOCKER_DECLARED) {
            Permanent blocker = game.getPermanent(event.getSourceId());
            if (blocker != null) {
                getEffects().get(0).setTargetPointer(new FixedTarget(blocker.getControllerId()));
                return true;
            }
        }
        return false;
    }
View Full Code Here

    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.SPELL_CAST && event.getZone() == Zone.HAND) {
            Spell spell = game.getStack().getSpell(event.getTargetId());
            if (spell != null) {
                for (Effect effect : this.getEffects()) {
                    effect.setTargetPointer(new FixedTarget(event.getTargetId()));
                }
                return true;
            }
        }
        return false;
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.