Examples of canBlock()


Examples of mage.abilities.effects.RestrictionEffect.canBlock()

        //20101001 - 509.1b
        for (Map.Entry entry: game.getContinuousEffects().getApplicableRestrictionEffects(this, game).entrySet()) {
            RestrictionEffect effect = (RestrictionEffect)entry.getKey();
            for (Ability ability : (HashSet<Ability>) entry.getValue()) {
                if (!effect.canBlock(null, this, ability, game)) {
                    return false;
                }
            }
        }
View Full Code Here

Examples of mage.game.combat.CombatGroup.canBlock()

  @Override
  public void declareBlocker(UUID blockerId, UUID attackerId, Game game) {
    Permanent blocker = game.getPermanent(blockerId);
    CombatGroup group = game.getCombat().findGroup(attackerId);
    if (blocker != null && group != null && group.canBlock(blocker, game)) {
      group.addBlocker(blockerId, playerId, game);
    }
  }

  @Override
View Full Code Here

Examples of mage.game.combat.CombatGroup.canBlock()

      else {
        defender = game.getPlayer(group.getDefenderId());
      }
      if (defender != null) {
        for (Permanent creature: game.getBattlefield().getAllActivePermanents(FilterCreaturePermanent.getDefault(), defender.getId())) {
          if (group.canBlock(creature, game)) {
            group.addBlocker(creature.getId(), creature.getControllerId(), game);
          }
        }
        return true;
      }
View Full Code Here

Examples of mage.game.combat.CombatGroup.canBlock()

    @Override
    public void declareBlocker(UUID defenderId, UUID blockerId, UUID attackerId, Game game) {
        Permanent blocker = game.getPermanent(blockerId);
        CombatGroup group = game.getCombat().findGroup(attackerId);
        if (blocker != null && group != null && group.canBlock(blocker, game)) {
            group.addBlocker(blockerId, playerId, game);
            game.getCombat().addBlockingGroup(blockerId, attackerId, playerId, game);
        } else {
            if (this.isHuman()) {
                game.informPlayer(this, "You can't block this creature.");
View Full Code Here

Examples of mage.game.permanent.Permanent.canBlock()

    @Override
    public boolean applies(Permanent permanent, Ability source, Game game) {
        if (permanent.getId().equals(source.getFirstTarget())) {
            Permanent blocker = game.getPermanent(source.getFirstTarget());
            if (blocker != null && blocker.canBlock(source.getSourceId(), game)) {             
                Permanent attacker = game.getPermanent(source.getSourceId());
                if (attacker != null) {
                    BlockedAttackerWatcher blockedAttackerWatcher = (BlockedAttackerWatcher) game.getState().getWatchers().get("BlockedAttackerWatcher");
                    if (blockedAttackerWatcher != null && blockedAttackerWatcher.creatureHasBlockedAttacker(attacker, blocker)) {
                        // has already blocked this turn, so no need to do again
View Full Code Here

Examples of mage.game.permanent.Permanent.canBlock()

    public boolean applies(Permanent permanent, Ability source, Game game) {
        if (permanent.getId().equals(targetPointer.getFirst(game, source))) {
            Permanent blocker = game.getPermanent(source.getFirstTarget());
            if (blocker != null && blocker.isTapped()) {
                blocker.untap(game);
                if (blocker.canBlock(source.getSourceId(), game)) {
                    return true;
                }
            }
        }
        return false;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.