Tabnine Logo
Player.scry
Code IndexAdd Tabnine to your IDE (free)

How to use
scry
method
in
mage.players.Player

Best Java code snippets using mage.players.Player.scry (Showing top 14 results out of 315)

origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  if (player != null) {
    return player.scry(scryNumber, source, game);
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      int x = RemovedCountersForCostValue.instance.calculate(game, source, this);
      if (x > 0) {
        return controller.scry(x, source, game);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      int x = source.getManaCostsToPay().getX();
      if (x > 0) {
        return controller.scry(x, source, game);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller == null) {
      return false;
    }
    if (AddendumCondition.instance.apply(game, source)) {
      controller.scry(3, source, game);
    }
    controller.drawCards(3, game);
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      int planeswalker = game.getBattlefield().countAll(StaticFilters.FILTER_PERMANENT_PLANESWALKER, source.getControllerId(), game);
      if (planeswalker > 0) {
        controller.scry(planeswalker, source, game);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      int highCMC = new HighestConvertedManaCostValue().calculate(game, source, this);
      if (highCMC > 0) {
        controller.scry(highCMC, source, game);
      }
      controller.drawCards(3, game);
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      boolean isLittle = permanent.getConvertedManaCost() < 3;
      permanent.moveToZone(Zone.HAND, source.getSourceId(), game, true);
      if (isLittle && player != null) {
        player.scry(2, source, game);
      }
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
        Player player = game.getPlayer(playerId);
        if (player != null) {
          if (player.chooseUse(outcome, "Scry 1? <i>(Look at the top card of your library. You may put that card on the bottom of your library.)</i>", source, game)) {
            player.scry(1, source, game);
          }
        }
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      int numZombies = game.getBattlefield().countAll(filter, source.getControllerId(), game);

      if (numZombies > 0) {
        for (UUID playerId : game.getOpponents(source.getControllerId())) {
          Player opponent = game.getPlayer(playerId);
          if (opponent != null) {
            opponent.loseLife(numZombies, game, false);
          }
        }
        controller.scry(numZombies, source, game);
      }

      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player player = game.getPlayer(source.getControllerId());
    if (player == null) {
      return false;
    }
    player.scry(1, source, game);
    if (!player.chooseUse(
        outcome, "Reveal the top card of your library?", source, game
    )) {
      return true;
    }
    Card card = player.getLibrary().getFromTop(game);
    player.revealCards(source, new CardsImpl(card), game);
    if (card.isBasic() && card.isLand()) {
      player.moveCards(
          card, Zone.BATTLEFIELD, source,
          game, true, false, true, null
      );
    }
    return true;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    MageObject sourceObject = source.getSourceObject(game);
    if (controller != null && sourceObject != null) {
      controller.scry(3, source, game);

      Cards cards = new CardsImpl();
      Card card = controller.getLibrary().getFromTop(game);

      if (card != null) {
        cards.add(card);
        controller.revealCards(sourceObject.getIdName(), cards, game);
        controller.gainLife(card.getConvertedManaCost(), game, source);
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    MageObject sourceObject = game.getObject(source.getSourceId());
    if (sourceObject != null) {
      for (UUID targetId : getTargetPointer().getTargets(game, source) ) {
        Spell spell = game.getStack().getSpell(targetId);
        if (spell != null) {
          game.getStack().counter(targetId, source.getSourceId(), game);
          Player controller = game.getPlayer(source.getControllerId());
          // If it was a Jace planeswalker, you may discard a card. If you do, draw a card
          if (filter.match(spell, game) && controller != null) {
            controller.scry(2, source, game);
          }
        }
      }
      return true;
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getSourceId());
    Player player = game.getPlayer(source.getControllerId());
    if (player != null) {
      player.scry(1, source, game);
      if (permanent != null) {
        permanent.addCounters(CounterType.LANDMARK.createInstance(), source, game);
        int counters = permanent.getCounters(game).getCount(CounterType.LANDMARK);
        if (counters > 2) {
          permanent.removeCounters("landmark", counters, game);
          new TransformSourceEffect(true).apply(game, source);
          new CreateTokenEffect(new TreasureToken("XLN"), 3).apply(game, source);
        }
        return true;
      }
    }
    return false;
  }
}
origin: magefree/mage

Player player = getPlayer(playerId);
if (player != null && player.getHand().size() < startingHandSize) {
  player.scry(1, null, this);
mage.playersPlayerscry

Popular methods of Player

  • getId
  • getHand
  • getName
  • getLife
  • getLibrary
  • hasLeft
  • hasWon
  • getCounters
  • hasLost
  • copy
  • damage
  • declareAttacker
  • damage,
  • declareAttacker,
  • getGraveyard,
  • getPlayersUnderYourControl,
  • activateAbility,
  • canLose,
  • choose,
  • declareBlocker,
  • gainLife,
  • getAttachments

Popular in Java

  • Updating database using SQL prepared statement
  • setRequestProperty (URLConnection)
  • getSharedPreferences (Context)
  • findViewById (Activity)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • MalformedURLException (java.net)
    This exception is thrown when a program attempts to create an URL from an incorrect specification.
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • TimerTask (java.util)
    The TimerTask class represents a task to run at a specified time. The task may be run once or repeat
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now