congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
Player.flipCoin
Code IndexAdd Tabnine to your IDE (free)

How to use
flipCoin
method
in
mage.players.Player

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

origin: magefree/mage

@Override
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
  Player controller = game.getPlayer(controllerId);
  if (controller != null) {
    controller.flipCoin(ability, game, true);
    this.paid = true;
    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;
    }
    while (true) {
      if (!player.flipCoin(source, game, true)) {
        return true;
      }
    }
  }
}
origin: magefree/mage

@Override
public void init(Ability source, Game game) {
  this.wonFlip = game.getPlayer(source.getControllerId()).flipCoin(source, game, true);
  super.init(source, game);
}
origin: magefree/mage

@Override
public void init(Ability source, Game game) {
  this.wonFlip = game.getPlayer(source.getControllerId()).flipCoin(source, game, true);
  super.init(source, game);
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  if (player != null) {
    if (!player.flipCoin(source, game, true)) {
      player.damage(3, source.getSourceId(), game, false, true);
    }
    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.flipCoin(source, game, true)) {
      player.getManaPool().addMana(getMana(game, source), game, source);
    }
    return true;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    if (controller.flipCoin(source, game, true)) {
      game.informPlayers(controller.getLogName() + " got " + controller.gainLife(6, game, source)+ " live");
    }
  }
  return false;
}
origin: magefree/mage

@Override
public void init(Ability source, Game game) {
  this.target.choose(Outcome.Benefit, source.getControllerId(), source.getSourceId(), game);
  Player you = game.getPlayer(source.getControllerId());
  if(you != null) {
    wonFlip = you.flipCoin(source, game, true);
    super.init(source, game);
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  if (player != null) {
    if (!player.flipCoin(source, game, true)) {
      Permanent permanent = game.getPermanent(source.getSourceId());
      if (permanent != null) {
        return permanent.sacrifice(source.getSourceId(), game);
      }
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(source.getSourceId());
  if (controller != null && permanent != null && !controller.flipCoin(source, game, true)) {
    return permanent.turnFaceDown(game, source.getControllerId());
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    if (controller.flipCoin(source, game, true)) {
      new DamageEverythingEffect(1).apply(game, source);
      return true;
    } else {
      new DrawCardAllEffect(1).apply(game, source);
      return true;
      }
    }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(source.getSourceId());
  if (controller != null && permanent != null) {
    if (controller.flipCoin(source, game, true)) {
      return true;
    } else {
      new ReturnToHandSourceEffect().apply(game, source);
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
  if (controller != null && permanent != null) {
    if (controller.flipCoin(source, game, true)) {
      game.addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn), source);
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
  if (controller != null && permanent != null) {
    if (controller.flipCoin(source, game, true)) {
      game.addEffect(new BoostTargetEffect(1, 1, Duration.EndOfTurn), 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) {
    if (player.flipCoin(source, game, true)) {
      UUID targetId = getTargetPointer().getFirst(game, source);
      Permanent permanent = game.getPermanent(targetId);
      if (permanent != null) {
        permanent.destroy(source.getSourceId(), game, false);
      }
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  if (player != null) {
    if (player.flipCoin(source, game, true)) {
      game.getState().getTurnMods().add(new TurnMod(player.getId(), false));
      return true;
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player player = game.getPlayer(source.getControllerId());
  Permanent perm = game.getPermanent(source.getSourceId());
  if (player == null || perm == null) {
    return false;
  }
  if (player.flipCoin(source, game, true)) {
    return new ExileReturnBattlefieldOwnerNextEndStepSourceEffect(true).apply(game, source);
  } else {
    return perm.sacrifice(source.getSourceId(), game);
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanent(source.getSourceId());
  if (controller != null && permanent != null) {
    if (controller.flipCoin(source, game, true)) {
      new ReturnToHandSourceEffect().apply(game, source);
      return true;
    } else {
      new SacrificeSourceEffect().apply(game, source);
      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.getSourceId());
  if (player != null && permanent != null) {
    if (!player.flipCoin(source, game, true)) {
      String message = permanent.getLogName() + " deals 2 damage to itself";
      game.informPlayers(message);
      permanent.damage(2, source.getSourceId(), game, false, true);
    }
    return true;
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      if (controller.flipCoin(source, game, false)) {
        game.informPlayers("Odds: Spell countered");
        return game.getStack().counter(getTargetPointer().getFirst(game, source), source.getSourceId(), game);

      } else {
        game.informPlayers("Odds: Spell will be copied");
        return new CopyTargetSpellEffect().apply(game, source);
      }
    }
    return false;
  }
}
mage.playersPlayerflipCoin

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

  • Start an intent from android
  • getApplicationContext (Context)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • HashMap (java.util)
    HashMap is an implementation of Map. All optional operations are supported.All elements are permitte
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top 12 Jupyter Notebook Extensions
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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