@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (!game.getBattlefield().getActivePermanents(filterPlains, this.getControllerId(), this.getSourceId(), game).isEmpty() && !game.getBattlefield().getActivePermanents(filterForest, this.getControllerId(), this.getSourceId(), game).isEmpty()) { for (CombatGroup group : game.getCombat().getGroups()) { if (isControlledBy(group.getDefenderId())) { return super.canActivate(playerId, game); } } } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (playerId.equals(caster)) { Permanent permanent = game.getBattlefield().getPermanent(this.getSourceId()); if (permanent != null) { if (filter.match(permanent, permanent.getId(), permanent.getControllerId(), game)) { return super.canActivate(playerId, game); } } } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (!super.hasMoreActivationsThisTurn(game) || !(condition == null || condition.apply(game, this))) { return ActivationStatus.getFalse(); } Player player = game.getPlayer(playerId); if (player != null && playerId.equals(game.getActivePlayerId()) && game.getStep().getType().isBefore(PhaseStep.END_TURN)) { if (costs.canPay(this, sourceId, playerId, game)) { this.setControllerId(playerId); return ActivationStatus.getTrue(); } } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { ActivationStatus activationStatus = super.canActivate(playerId, game); if (activationStatus.canActivate()) { Card card = game.getCard(getSourceId()); if (card != null) { // Cards with no Mana Costs cant't be flashbacked (e.g. Ancestral Vision) if (card.getManaCost().isEmpty()) { return ActivationStatus.getFalse(); } // Flashback can never cast a split card by Fuse, because Fuse only works from hand if (card.isSplitCard()) { if (((SplitCard) card).getLeftHalfCard().getName().equals(abilityName)) { return ((SplitCard) card).getLeftHalfCard().getSpellAbility().canActivate(playerId, game); } else if (((SplitCard) card).getRightHalfCard().getName().equals(abilityName)) { return ((SplitCard) card).getRightHalfCard().getSpellAbility().canActivate(playerId, game); } } return card.getSpellAbility().canActivate(playerId, game); } } return activationStatus; }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { // check if controller or teammate has already cast a spell this turn CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class); if (watcher != null) { Player player = game.getPlayer(playerId); if (player != null) { for (UUID playerToCheckId : game.getState().getPlayersInRange(playerId, game)) { if (!player.hasOpponent(playerToCheckId, game)) { if (watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(playerToCheckId) > 0) { return super.canActivate(playerId, game); } } } } } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (!super.hasMoreActivationsThisTurn(game) || !(condition == null || condition.apply(game, this))) { return ActivationStatus.getFalse(); } if (!controlsAbility(playerId, game)) { return ActivationStatus.getFalse(); } if (timing == TimingRule.SORCERY && !game.canPlaySorcery(playerId) && null == game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.ACTIVATE_AS_INSTANT, this, controllerId, game)) { return ActivationStatus.getFalse(); } // check if player is in the process of playing spell costs and he is no longer allowed to use activated mana abilities (e.g. because he started to use improvise) //20091005 - 605.3a return new ActivationStatus(costs.canPay(this, sourceId, controllerId, game), null); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (super.canActivate(playerId, game).canActivate()) { Player controller = game.getPlayer(this.getControllerId()); if (controller != null) { for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterControlledCreaturePermanent(), this.getControllerId(), this.getSourceId(), game)) { ManaCost costToPay = CardUtil.reduceCost(emergeCost.copy(), creature.getConvertedManaCost()); if (costToPay.canPay(this, this.getSourceId(), this.getControllerId(), game)) { return ActivationStatus.getTrue(); } } } } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (condition.apply(game, this) && costs.canPay(this, sourceId, playerId, game) && game.isActivePlayer(playerId)) { this.activatorId = playerId; return ActivationStatus.getTrue(); } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { Zone currentZone = game.getState().getZone(this.getSourceId()); if (currentZone == null || currentZone != Zone.COMMAND) { return ActivationStatus.getFalse(); } return super.canActivate(playerId, game); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (game.getState().getZone(getSourceId()) != Zone.HAND) { // Supend can only be activated from hand return ActivationStatus.getFalse(); } MageObject object = game.getObject(sourceId); return new ActivationStatus(object.isInstant() || object.hasAbility(FlashAbility.getInstance().getId(), game) || null != game.getContinuousEffects().asThough(sourceId, AsThoughEffectType.CAST_AS_INSTANT, this, playerId, game) || game.canPlaySorcery(playerId), null); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { // May be activated only during the upkeep step of the card's owner // Because it can only be activated from a players hand it should be ok to check here with controllerId instead of card.getOwnerId(). if (!game.isActivePlayer(controllerId) || PhaseStep.UPKEEP != game.getStep().getType()) { return ActivationStatus.getFalse(); } return super.canActivate(playerId, game); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { Player player = game.getPlayer(playerId); if (player != null && !player.isInPayManaMode()) { return super.canActivate(playerId, game); } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { Player player = game.getPlayer(playerId); if (player != null && !player.isInPayManaMode()) { return super.canActivate(playerId, game); } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { PlayerLostLifeWatcher watcher = game.getState().getWatcher(PlayerLostLifeWatcher.class); if (watcher != null && watcher.getAllOppLifeLost(playerId, game) > 0) { return super.canActivate(playerId, game); } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { Player player = game.getPlayer(playerId); if (player != null && !player.isInPayManaMode()) { // while paying the costs of a spell you cant activate this return super.canActivate(playerId, game); } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { if (!condition.apply(game, this)) { return ActivationStatus.getFalse(); } return super.canActivate(playerId, game); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { Permanent sourcePermanent = game.getBattlefield().getPermanent(this.getSourceId()); if (sourcePermanent != null) { Permanent attachedTo = game.getPermanent(sourcePermanent.getAttachedTo()); if (attachedTo != null) { return super.canActivate(attachedTo.getControllerId(), game); } } return ActivationStatus.getFalse(); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { MageObjectReference permittingObject = game.getContinuousEffects().asThough(getSourceId(), AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, null, playerId, game); if (!controlsAbility(playerId, game) && null == permittingObject) { return ActivationStatus.getFalse(); } //20091005 - 114.2a return new ActivationStatus(game.isActivePlayer(playerId) && game.getPlayer(playerId).canPlayLand() && game.canPlaySorcery(playerId), permittingObject); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { Card card = game.getCard(this.getSourceId()); if (card == null || card.getCounters(game).getCount(CounterType.TIME) == 0) { return ActivationStatus.getFalse(); } return super.canActivate(playerId, game); }
@Override public ActivationStatus canActivate(UUID playerId, Game game) { Player player = game.getPlayer(playerId); if (player != null && !player.isInPayManaMode()) { return super.canActivate(playerId, game); } return ActivationStatus.getFalse(); }