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

How to use
isCanLoseLife
method
in
mage.players.Player

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

origin: magefree/mage

if (lifePlayer1 < lifePlayer2 && (!sourcePlayer.isCanGainLife() || !targetPlayer.isCanLoseLife())) {
  return false;
if (lifePlayer1 > lifePlayer2 && (!sourcePlayer.isCanLoseLife() || !targetPlayer.isCanGainLife())) {
  return false;
origin: magefree/mage

if (lifePlayer1 < lifePlayer2 && (!player1.isCanGainLife() || !player2.isCanLoseLife())) {
  return false;
if (lifePlayer1 > lifePlayer2 && (!player1.isCanLoseLife() || !player2.isCanGainLife())) {
  return false;
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Player player = game.getPlayer(source.getFirstTarget());
  if (controller != null && player != null) {
    int lifeController = controller.getLife();
    int lifePlayer = player.getLife();
    if (lifeController == lifePlayer) {
      return false;
    }
    if (!controller.isLifeTotalCanChange() || !player.isLifeTotalCanChange()) {
      return false;
    }
    if (lifeController < lifePlayer && (!controller.isCanGainLife() || !player.isCanLoseLife())) {
      return false;
    }
    if (lifeController > lifePlayer && (!controller.isCanLoseLife() || !player.isCanGainLife())) {
      return false;
    }
    controller.setLife(lifePlayer, game, source);
    player.setLife(lifeController, game, source);
    return true;
  }
  return false;
}
origin: magefree/mage

if (lifePlayer1 < lifePlayer2 && (!player1.isCanGainLife() || !player2.isCanLoseLife())) {
  return false;
if (lifePlayer1 > lifePlayer2 && (!player1.isCanLoseLife() || !player2.isCanGainLife())) {
  return false;
origin: magefree/mage

this.canLoseLife = player.isCanLoseLife();
this.attachments.clear();
this.attachments.addAll(player.getAttachments());
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  if (player != null && player.isLifeTotalCanChange()) {
    Permanent perm = game.getPermanent(source.getSourceId());
    if (perm != null) {
      int amount = perm.getPower().getValue();
      int life = player.getLife();
      if (life == amount) {
        return false;
      }
      if (life < amount && !player.isCanGainLife()) {
        return false;
      }
      if (life > amount && !player.isCanLoseLife()) {
        return false;
      }
      player.setLife(amount, game, source);
      game.addEffect(new SetPowerToughnessSourceEffect(life, Integer.MIN_VALUE, Duration.Custom, SubLayer.SetPT_7b), source);
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  if (player != null && player.isLifeTotalCanChange()) {
    Permanent perm = game.getPermanent(source.getSourceId());
    if (perm != null) {
      int amount = perm.getToughness().getValue();
      int life = player.getLife();
      if (life == amount) {
        return false;
      }
      if (life < amount && !player.isCanGainLife()) {
        return false;
      }
      if (life > amount && !player.isCanLoseLife()) {
        return false;
      }
      player.setLife(amount, game, source);
      game.addEffect(new SetPowerToughnessSourceEffect(Integer.MIN_VALUE, life, Duration.Custom, SubLayer.SetPT_7b), source);
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player opponent = game.getPlayer(source.getFirstTarget());
  if (opponent != null && opponent.isLifeTotalCanChange()) {
    Permanent perm = game.getPermanent(source.getSourceId());
    if (perm != null) {
      int amount = perm.getToughness().getValue();
      int life = opponent.getLife();
      if (life == amount) {
        return false;
      }
      if (life < amount && !opponent.isCanGainLife()) {
        return false;
      }
      if (life > amount && !opponent.isCanLoseLife()) {
        return false;
      }
      opponent.setLife(amount, game, source);
      perm.getToughness().modifyBaseValue(life);
      // game.addEffect(new SetPowerToughnessSourceEffect(Integer.MIN_VALUE, life, Duration.Custom, SubLayer.SetPT_7b), source);
      return true;
    }
  }
  return false;
}
mage.playersPlayerisCanLoseLife

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

  • Reading from database using SQL prepared statement
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSupportFragmentManager (FragmentActivity)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Enumeration (java.util)
    A legacy iteration interface.New code should use Iterator instead. Iterator replaces the enumeration
  • JPanel (javax.swing)
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • From CI to AI: The AI layer in your organization
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