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

How to use
rollDice
method
in
mage.players.Player

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

origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      int firstRoll = controller.rollDice(game, 6);
      int secondRoll = controller.rollDice(game, 6);
      game.addEffect(new SetPowerToughnessSourceEffect(firstRoll, secondRoll, Duration.WhileOnBattlefield, SubLayer.SetPT_7b), source);
      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 thisRoll = controller.rollDice(game, 6);
      int thatRoll = controller.rollDice(game, 6);

      Token token = new GoblinToken();
      return token.putOntoBattlefield(Math.abs(thatRoll - thisRoll), game, source.getSourceId(), source.getControllerId());
    }
    return false;
  }
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    if (controller != null) {
      int count = 1;
      int amount = controller.rollDice(game, 20);

      while (amount == 20) {
        count += 1;
        amount = controller.rollDice(game, 20);
      }
      return new CreateTokenEffect(new DragonTokenGold(), count).apply(game, source);
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  MageObject mageObject = game.getObject(source.getSourceId());
  if (controller != null && mageObject != null) {
    controller.rollDice(game, numSides);                
    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 new AddCountersSourceEffect(CounterType.FUNK.createInstance(controller.rollDice(game, 6))).apply(game, source);
    }
    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) {
      int amount = controller.rollDice(game, 6);
      game.addEffect(new BoostSourceEffect(amount, amount, 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(source.getSourceId());
    if (controller != null && permanent != null) {
      int amount = controller.rollDice(game, 6);
      permanent.addCounters(CounterType.P1P1.createInstance(amount), 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 amount = controller.rollDice(game, 6);
      CreateTokenEffect effect = new CreateTokenEffect(new GoblinToken(), amount);
      effect.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) {
      int amount = controller.rollDice(game, 6);
      permanent.removeCounters(CounterType.P1P1.createInstance(amount), game);
      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) {
      int amount = controller.rollDice(game, 6);
      game.addEffect(new BoostSourceEffect(amount, 0, Duration.EndOfTurn), source);
      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 result = controller.rollDice(game, 6);
    if (result == 1) {
      new SacrificeSourceEffect().apply(game, source);
      return new DamageEverythingEffect(3).apply(game, source);
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
  Player player = game.getPlayer(event.getPlayerId());
  if (player != null) {
    String data = event.getData();
    int numSides = Integer.parseInt(data);
    if (numSides == 6 && event.getAmount() == 3) {
      if (player.chooseUse(outcome, "Reroll the die?", source, game)) {
        game.informPlayers(player.getLogName() + " chose to reroll the die.");
        event.setAmount(player.rollDice(game, 6));
      }
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    int result = controller.rollDice(game, 6);
    if (result == 6) {
      new SacrificeSourceEffect().apply(game, source);
      return (new CreateTokenEffect(new GiantChickenToken(), 1)).apply(game, source);
    }
  }
  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) {
      int amount = controller.rollDice(game, 6);
      return new CreateTokenEffect(new BrainiacToken(), amount).apply(game, source);
    }
    return false;
  }
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanentEntering(source.getSourceId());
  if (controller != null && permanent != null) {
    int amount = controller.rollDice(game, 6);
    ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
    permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects);
    return super.apply(game, source);
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  Permanent permanent = game.getPermanentEntering(source.getSourceId());
  if (controller != null && permanent != null) {
    int amount = controller.rollDice(game, 6);
    ArrayList<UUID> appliedEffects = (ArrayList<UUID>) this.getValue("appliedEffects"); // the basic event is the EntersBattlefieldEvent, so use already applied replacement effects from that event
    permanent.addCounters(CounterType.P1P1.createInstance(amount), source, game, appliedEffects);
    return super.apply(game, source);
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    int result = controller.rollDice(game, 6);
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      ContinuousEffect effect = new BoostTargetEffect(result, result, Duration.EndOfTurn);
      effect.setTargetPointer(new FixedTarget(permanent, game));
      game.addEffect(effect, source);
    }
  }
  return false;
}
origin: magefree/mage

@Override
public boolean apply(Game game, Ability source) {
  Player controller = game.getPlayer(source.getControllerId());
  if (controller != null) {
    int result = controller.rollDice(game, 6);
    Permanent permanent = game.getPermanent(source.getSourceId());
    if (permanent != null) {
      if (result == 1) {
        return permanent.sacrifice(source.getSourceId(), game);
      } else {
        return new AddCountersSourceEffect(CounterType.P1P1.createInstance()).apply(game, source);
      }
    }
  }
  return false;
}
origin: magefree/mage

  @Override
  public boolean apply(Game game, Ability source) {
    Player controller = game.getPlayer(source.getControllerId());
    Permanent equipment = game.getPermanent(source.getSourceId());
    Player player = game.getPlayer(source.getFirstTarget());

    if (controller != null && equipment != null && player != null) {
      player.damage(1, source.getSourceId(), game, false, true);        
      int amount = controller.rollDice(game, 6);
      if (amount >= 5) {
        new UntapSourceEffect().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 targetCreature = game.getPermanent(source.getFirstTarget());
    if (controller != null && targetCreature != null) {
      source.getEffects().get(0).setTargetPointer(new FixedTarget(targetCreature.getId()));
      game.addEffect(new GainControlTargetEffect(Duration.EndOfTurn), source);
      targetCreature.untap(game);
      int amount = controller.rollDice(game, 6);
      game.addEffect(new BoostTargetEffect(amount, 0, Duration.EndOfTurn), source);
      game.addEffect(new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn), source);
      return true;
    }
    return false;
  }
}
mage.playersPlayerrollDice

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

  • Running tasks concurrently on multiple threads
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • onCreateOptionsMenu (Activity)
  • getResourceAsStream (ClassLoader)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • BoxLayout (javax.swing)
  • Top 12 Jupyter Notebook extensions
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