Package mage.target.targetpointer

Examples of mage.target.targetpointer.FixedTarget


    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getTargetId().equals(this.getSourceId())) {
            for (Effect effect : this.getEffects()) {
                effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
            }
            return true;
        }
        return false;
    }
View Full Code Here


            if (!((Spell) stackObject).isCopiedSpell()) {
                MageObject card = game.getObject(stackObject.getSourceId());
                if (card instanceof Card) {
                    ((Card) card).moveToZone(Zone.EXILED, sourceId, game, true);
                    ContinuousEffect effect = new KheruSpellsnatcherCastFromExileEffect();
                    effect.setTargetPointer(new FixedTarget(card.getId()));
                    game.addEffect(effect, source);
                }
            }
            game.fireEvent(GameEvent.getEvent(GameEvent.EventType.COUNTERED, objectId, sourceId, stackObject.getControllerId()));
            return true;
View Full Code Here

            if (equipment != null && equipment.getAttachedTo() != null) {
                if (event.getSourceId().equals(equipment.getAttachedTo())) {
                    Permanent blocks = game.getPermanent(event.getTargetId());
                    if (blocks != null && blocks.hasSubtype("Vampire")) {
                        for (Effect effect : this.getEffects()) {
                            effect.setTargetPointer(new FixedTarget(event.getTargetId()));
                        }
                        return true;
                    }
                    return false;
                }
                if (event.getTargetId().equals(equipment.getAttachedTo())) {
                    Permanent blockedBy = game.getPermanent(event.getSourceId());
                    if (blockedBy != null && blockedBy.hasSubtype("Vampire")) {
                        for (Effect effect : this.getEffects()) {
                            effect.setTargetPointer(new FixedTarget(event.getSourceId()));
                        }
                        return true;
                    }
                    return false;
                }
View Full Code Here

            Permanent permanent = game.getPermanent(event.getSourceId());
            if (damageEvent.isCombatDamage() && permanent != null
                    && permanent.hasSubtype("Vampire") && permanent.getControllerId().equals(controllerId)) {
                this.getEffects().clear();
                AddCountersTargetEffect effect = new AddCountersTargetEffect(CounterType.P1P1.createInstance());
                effect.setTargetPointer(new FixedTarget(permanent.getId()));
                this.addEffect(effect);
                return true;
            }
        }
        return false;
View Full Code Here

                    Card card = player.getLibrary().getFromTop(game);
                    if (card != null) {
                        player.moveCardToExileWithInfo(card, CardUtil.getCardExileZoneId(game, source), sourceObject.getLogName(), source.getSourceId(), game, Zone.LIBRARY);
                        if (!card.getCardType().contains(CardType.CREATURE)) {
                            ContinuousEffect effect = new NarsetEnlightenedMasterCastFromExileEffect();
                            effect.setTargetPointer(new FixedTarget(card.getId()));
                            game.addEffect(effect, source);
                        }
                    }
                }
            }
View Full Code Here

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event instanceof DamagedCreatureEvent) {
            if (((DamagedCreatureEvent) event).isCombatDamage() && event.getSourceId().equals(sourceId)) {
                getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
                return true;
            }
        }
        return false;
    }
View Full Code Here

        if (event.getType() == EventType.DRAW_STEP_PRE) {
            Permanent enchantment = game.getPermanent(this.sourceId);
            if (enchantment != null && enchantment.getAttachedTo() != null) {
                Player player = game.getPlayer(enchantment.getAttachedTo());
                if (player != null && game.getActivePlayerId().equals(player.getId())) {
                    this.getEffects().get(0).setTargetPointer(new FixedTarget(player.getId()));
                    return true;
                }
            }
        }
        return false;
View Full Code Here

            Permanent equipment = game.getPermanent(this.getSourceId());
            if (equipment != null
                && equipment.getAttachedTo() != null
                && event.getSourceId().equals(equipment.getAttachedTo())) {
                for (Effect effect : this.getEffects()) {
                    effect.setTargetPointer(new FixedTarget(event.getTargetId()));
                }
                return true;
            }

        }
View Full Code Here

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
            for(Effect effect : this.getEffects())
            {
                effect.setTargetPointer(new FixedTarget(event.getTargetId()));
            }
            return true;
        }
        return false;
    }
View Full Code Here

                    lastCreatureCard = card;
                }
            }
            if (lastCreatureCard != null) {
                if (controller.putOntoBattlefieldWithInfo(lastCreatureCard, game, Zone.GRAVEYARD, source.getSourceId())) {
                    FixedTarget fixedTarget = new FixedTarget(lastCreatureCard.getId());
                    // Gains Haste
                    ContinuousEffect hasteEffect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
                    hasteEffect.setTargetPointer(fixedTarget);
                    game.addEffect(hasteEffect, source);
                    // Exile it at end of turn
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.