@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; } }
@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; } }
@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; } }
@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; }
@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; } }
@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; } }
@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; } }
@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; } }
@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; } }
@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; } }
@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; }
@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; }
@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; }
@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; } }
@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; }
@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; }
@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; }
@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; }
@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; } }
@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; } }