@Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana) { return pay(ability, game, sourceId, controllerId, noMana, this); }
/** * bookmarks the current state and restores it if player doesn't pay the * mana cost * * @param ability * @param game * @param sourceId * @param payingPlayerId * @return true if the cost was paid */ @Override public boolean payOrRollback(Ability ability, Game game, UUID sourceId, UUID payingPlayerId) { int bookmark = game.bookmarkState(); handlePhyrexianManaCosts(payingPlayerId, ability, game); if (pay(ability, game, sourceId, payingPlayerId, false, null)) { game.removeBookmark(bookmark); return true; } game.restoreState(bookmark, ability.getRule()); return false; }
@Override public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) { Player player = game.getPlayer(controllerId); if (player == null) { return false; } paid = false; manaCost.clearPaid(); if (manaCost.pay(ability, game, player.getId(), player.getId(), false) && player.canPayLifeCost() && player.getLife() >= 1 && lifeCost.pay(ability, game, player.getId(), player.getId(), false)) { paid = true; } return paid; }
@Override public boolean apply(Game game, Ability source) { Player player = game.getPlayer(source.getControllerId()); ManaCostsImpl cost = new ManaCostsImpl("{2}"); if (player != null) { if (cost.canPay(source, source.getSourceId(), player.getId(), game) && player.chooseUse(Outcome.Benefit, "Pay " + cost.getText() + "? If you do, copy that ability. You may choose new targets for the copy.", source, game)) { if (cost.pay(source, game, source.getSourceId(), source.getControllerId(), false, null)) { StackAbility ability = (StackAbility) getValue("stackAbility"); Player controller = game.getPlayer(source.getControllerId()); Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId()); if (ability != null && controller != null && sourcePermanent != null) { ability.createCopyOnStack(game, source, source.getControllerId(), true); game.informPlayers(sourcePermanent.getIdName() + ": " + controller.getLogName() + " copied activated ability"); return true; } return false; } } return true; } return false; } }