Package mage.abilities.effects

Examples of mage.abilities.effects.SearchEffect


  }

  protected void resolve(SimulationNode node, int depth, Game game) {
    StackObject ability = game.getStack().pop();
    if (ability instanceof StackAbility) {
      SearchEffect effect = getSearchEffect((StackAbility) ability);
      if (effect != null && ability.getControllerId().equals(playerId)) {
        Target target = effect.getTarget();
        if (!target.doneChosing()) {
          for (UUID targetId: target.possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) {
            Game sim = game.copy();
            StackAbility newAbility = (StackAbility) ability.copy();
            SearchEffect newEffect = getSearchEffect((StackAbility) newAbility);
            newEffect.getTarget().addTarget(targetId, newAbility, sim);
            sim.getStack().push(newAbility);
            SimulationNode newNode = new SimulationNode(sim, depth, ability.getControllerId());
            node.children.add(newNode);
            newNode.getTargets().add(targetId);
            logger.fine("simulating search -- node#: " + SimulationNode.getCount() + "for player: " + sim.getPlayer(ability.getControllerId()).getName());
View Full Code Here


    }

    protected void resolve(SimulationNode node, Game game) {
        StackObject ability = game.getStack().pop();
        if (ability instanceof StackAbility) {
            SearchEffect effect = getSearchEffect((StackAbility) ability);
            if (effect != null && ability.getControllerId().equals(playerId)) {
                Target target = effect.getTarget();
                if (!target.doneChosing()) {
                    for (UUID targetId: target.possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) {
                        Game sim = game.copy();
                        StackAbility newAbility = (StackAbility) ability.copy();
                        SearchEffect newEffect = getSearchEffect((StackAbility) newAbility);
                        newEffect.getTarget().addTarget(targetId, newAbility, sim);
                        sim.getStack().push(newAbility);
                        SimulationNode newNode = new SimulationNode(node, sim, ability.getControllerId());
                        node.children.add(newNode);
                        newNode.getTargets().add(targetId);
                        logger.debug(indent(node.depth) + "simulating search -- node#: " + SimulationNode.getCount() + "for player: " + sim.getPlayer(ability.getControllerId()).getName());
View Full Code Here

    }

    protected void resolve(SimulationNode2 node, int depth, Game game) {
        StackObject ability = game.getStack().pop();
        if (ability instanceof StackAbility) {
            SearchEffect effect = getSearchEffect((StackAbility) ability);
            if (effect != null && ability.getControllerId().equals(playerId)) {
                Target target = effect.getTarget();
                if (!target.doneChosing()) {
                    for (UUID targetId : target.possibleTargets(ability.getSourceId(), ability.getControllerId(), game)) {
                        Game sim = game.copy();
                        StackAbility newAbility = (StackAbility) ability.copy();
                        SearchEffect newEffect = getSearchEffect(newAbility);
                        newEffect.getTarget().addTarget(targetId, newAbility, sim);
                        sim.getStack().push(newAbility);
                        SimulationNode2 newNode = new SimulationNode2(node, sim, depth, ability.getControllerId());
                        node.children.add(newNode);
                        newNode.getTargets().add(targetId);
                        logger.trace("Sim search -- node#: " + SimulationNode2.getCount() + " for player: " + sim.getPlayer(ability.getControllerId()).getName());
View Full Code Here

        this.power = new MageInt(2);
        this.toughness = new MageInt(2);

        // When Trinket Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 1 or less, reveal that card, and put it into your hand. If you do, shuffle your library.
        TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
        SearchEffect effect = new SearchLibraryPutInHandEffect(target, true, true);
        this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true));
    }
View Full Code Here

        this.toughness = new MageInt(2);

        // When Treasure Mage enters the battlefield, you may search your library for an artifact card with converted mana cost 6 or greater,
        // reveal that card, and put it into your hand. If you do, shuffle your library.
        TargetCardInLibrary target = new TargetCardInLibrary(0, 1, filter);
        SearchEffect effect = new SearchLibraryPutInHandEffect(target, true, true);
        this.addAbility(new EntersBattlefieldTriggeredAbility(effect, true));
    }
View Full Code Here

TOP

Related Classes of mage.abilities.effects.SearchEffect

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.