/** * Check to shuffle library if allowed * * @param player * @param source * @param game */ protected void mayShuffle(Player player, Ability source, Game game) { if (this.mayShuffleAfter && player.chooseUse(Outcome.Benefit, "Shuffle your library?", source, game)) { player.shuffleLibrary(source, game); } }
@Override public boolean canBeUntapped(Permanent permanent, Ability source, Game game) { Player player = game.getPlayer(permanent.getControllerId()); return player != null && player.chooseUse(Outcome.Benefit, "Untap " + permanent.getLogName() + '?', source, game); }
private void chooseAndSearchLibrary(List<Player> usingPlayers, Player player, Ability source, Game game) { if (player.chooseUse(Outcome.PutCardInPlay, "Search your library for up to two basic land cards and put them onto the battlefield?", source, game)) { usingPlayers.add(player); TargetCardInLibrary target = new TargetCardInLibrary(0, 2, StaticFilters.FILTER_CARD_BASIC_LAND); if (player.searchLibrary(target, game)) { if (!target.getTargets().isEmpty()) { player.moveCards(new CardsImpl(target.getTargets()), Zone.BATTLEFIELD, source, game); } } } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); if (event.getPlayerId().equals(source.getControllerId()) && controller != null && controller.chooseUse(outcome, "Would you like to skip your draw step to gain 2 life?", source, game)) { controller.gainLife(2, game, source); return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); if (player != null && player.chooseUse(Outcome.DrawCard, "Do you wish to draw a card? If you do, discard a card.", source, game)) { if (player.drawCards(1, game) > 0) { player.discard(1, source, game); } return true; } return false; } }
@Override public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) { Permanent blockedCreature = game.getPermanent(sourceId); if (blockedCreature != null) { Player controller = game.getPlayer(blockedCreature.getControllerId()); if (controller != null) { return controller.chooseUse(Outcome.Damage, "Do you wish to assign combat damage for " + blockedCreature.getLogName() + " as though it weren't blocked?", source, game); } } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent archmage = game.getPermanent(source.getSourceId()); Player you = game.getPlayer(source.getControllerId()); if (event.getPlayerId().equals(source.getControllerId()) && archmage != null && you != null && you.chooseUse(Outcome.Benefit, "Would you like to skip drawing a card?", source, game)) { return true; } return false; }
@Override public boolean applies(GameEvent event, Ability source, Game game) { if (event.getPlayerId().equals(source.getControllerId())) { Player player = game.getPlayer(source.getControllerId()); if (player != null) { return player.chooseUse(Outcome.Detriment, "Choose:", source.getSourceObject(game).getLogName(), "land or nonland and reveal cards from the top", "normal card draw", source, game); } } return false; } }
@Override public boolean apply(Game game, Ability source) { UUID defenderId = game.getCombat().getDefenderId(source.getSourceId()); Player defender = game.getPlayer(defenderId); if (defender != null) { if (defender.chooseUse(outcome, "Draw a card?", source, game)) { defender.drawCards(1, game); } } return false; } }
@Override public boolean apply(Game game, Ability source) { UUID defenderId = game.getCombat().getDefenderId(source.getSourceId()); Player defender = game.getPlayer(defenderId); if (defender != null) { if (defender.chooseUse(outcome, "Draw a card?", source, game)) { defender.drawCards(1, game); } } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObjectIfItStillExists(game); if (controller != null && (sourceObject instanceof Card)) { return controller.moveCards((Card) sourceObject, Zone.BATTLEFIELD, source, game, false, controller.chooseUse(Outcome.Detriment, "Return " + sourceObject.getLogName() + " face down to battlefield (otherwise face up)?", source, game), false, null); } return false; } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Permanent archmage = game.getPermanent(source.getSourceId()); Player you = game.getPlayer(source.getControllerId()); return event.getPlayerId().equals(source.getControllerId()) && archmage != null && archmage.getCounters(game).getCount(CounterType.QUEST) >= 6 && you != null && you.chooseUse(Outcome.Benefit, "Would you like to search your library instead of drawing a card?", source, game); } }
@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) { return false; } int boost = (player.chooseUse(outcome, "Give +1/-1 or -1/+1?", null, "+1/-1", "-1/+1", source, game) ? 1 : -1); game.addEffect(new BoostSourceEffect(boost, -1 * boost, Duration.EndOfTurn), source); return true; } }
@Override public boolean applies(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(source.getControllerId()); DamageEvent damageEvent = (DamageEvent) event; return controller != null && controller.chooseUse(outcome, "Would you like to have " + damageEvent.getAmount() + " damage dealt to you instead of " + game.getPermanentOrLKIBattlefield(damageEvent.getTargetId()).getLogName() + "?", source, game); } }
@Override public boolean replaceEvent(GameEvent event, Ability source, Game game) { Player controller = game.getPlayer(event.getPlayerId()); if (controller != null && controller.chooseUse(outcome, "Skip draw card? (If you do, until your next turn, you can't be attacked except by creatures with flying and/or islandwalk)", source, game)) { game.informPlayers(controller.getLogName() + " skips their draw card action. Until their next turn, he or she can't be attacked except by creatures with flying and/or islandwalk"); game.addEffect(new CantAttackYouAllEffect(Duration.UntilYourNextTurn, notFlyingorIslandwalkCreatures), source); return true; } return false; }
public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getTargets().get(0).getTargetController()); if (player != null) { if (player.chooseUse(outcome, "Give targeted creature -3/-3 ?", source, game)) { game.addEffect(new BoostTargetEffect(-3, -3, Duration.EndOfTurn), source); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player permanentController = game.getPlayer(getTargetPointer().getFirst(game, source)); if (permanentController != null) { if (permanentController.chooseUse(outcome, "create a 1/1 colorless Sliver creature token", source, game)) { return new SliverToken().putOntoBattlefield(1, game, source.getSourceId(), permanentController.getId()); } return true; } return false; } }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (controller != null && card != null) { if (controller.chooseUse(Outcome.PlayForFree, "Play " + card.getIdName() + " without paying its mana cost?", source, game)) { controller.playCard(card, game, true, true, new MageObjectReference(source.getSourceObject(game), game)); } return true; } return false; }
@Override public boolean apply(Game game, Ability source) { Player attacker = game.getPlayer(this.getTargetPointer().getFirst(game, source)); if (attacker != null && attacker.chooseUse(outcome, "create a tapped 2/2 black Zombie creature token?", source, game)) { Effect effect = new CreateTokenTargetEffect(new ZombieToken(), new StaticValue(1), true, false); effect.setTargetPointer(targetPointer); return effect.apply(game, source); } return false; } }
@Override public boolean apply(Game game, Ability source) { Card card = game.getCard(getTargetPointer().getFirst(game, source)); if (card != null) { Player player = game.getPlayer(source.getControllerId()); if (player != null && player.chooseUse(Outcome.Benefit, "Cast " + card.getName() + " without paying cost?", source, game)) { player.cast(card.getSpellAbility(), game, true, new MageObjectReference(source.getSourceObject(game), game)); } } return false; } }