mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
Added as thought effect to let creatures block tapped.
This commit is contained in:
parent
024a1fac9a
commit
4a28881f71
10 changed files with 194 additions and 52 deletions
|
@ -1701,7 +1701,7 @@ public class ComputerPlayer<T extends ComputerPlayer<T>> extends PlayerImpl<T> i
|
||||||
}
|
}
|
||||||
|
|
||||||
protected List<Permanent> getOpponentBlockers(UUID opponentId, Game game) {
|
protected List<Permanent> getOpponentBlockers(UUID opponentId, Game game) {
|
||||||
FilterCreatureForCombat blockFilter = new FilterCreatureForCombat();
|
FilterCreatureForCombatBlock blockFilter = new FilterCreatureForCombatBlock();
|
||||||
List<Permanent> blockers = game.getBattlefield().getAllActivePermanents(blockFilter, opponentId, game);
|
List<Permanent> blockers = game.getBattlefield().getAllActivePermanents(blockFilter, opponentId, game);
|
||||||
return blockers;
|
return blockers;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,8 +28,22 @@
|
||||||
|
|
||||||
package mage.player.human;
|
package mage.player.human;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
import mage.MageObject;
|
import mage.MageObject;
|
||||||
import mage.abilities.*;
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.ActivatedAbility;
|
||||||
|
import mage.abilities.Mode;
|
||||||
|
import mage.abilities.Modes;
|
||||||
|
import mage.abilities.SpecialAction;
|
||||||
|
import mage.abilities.SpellAbility;
|
||||||
|
import mage.abilities.TriggeredAbility;
|
||||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||||
import mage.abilities.costs.mana.ManaCost;
|
import mage.abilities.costs.mana.ManaCost;
|
||||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||||
|
@ -41,12 +55,15 @@ import mage.cards.Cards;
|
||||||
import mage.cards.decks.Deck;
|
import mage.cards.decks.Deck;
|
||||||
import mage.choices.Choice;
|
import mage.choices.Choice;
|
||||||
import mage.choices.ChoiceImpl;
|
import mage.choices.ChoiceImpl;
|
||||||
|
import mage.constants.AsThoughEffectType;
|
||||||
import mage.constants.Outcome;
|
import mage.constants.Outcome;
|
||||||
import mage.constants.RangeOfInfluence;
|
import mage.constants.RangeOfInfluence;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.common.FilterAttackingCreature;
|
import mage.filter.common.FilterAttackingCreature;
|
||||||
import mage.filter.common.FilterBlockingCreature;
|
import mage.filter.common.FilterBlockingCreature;
|
||||||
import mage.filter.common.FilterCreatureForCombat;
|
import mage.filter.common.FilterCreatureForCombat;
|
||||||
|
import mage.filter.common.FilterCreatureForCombatBase;
|
||||||
|
import mage.filter.common.FilterCreatureForCombatBlock;
|
||||||
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.draft.Draft;
|
import mage.game.draft.Draft;
|
||||||
|
@ -65,9 +82,6 @@ import mage.target.common.TargetDefender;
|
||||||
import mage.util.ManaUtil;
|
import mage.util.ManaUtil;
|
||||||
import org.apache.log4j.Logger;
|
import org.apache.log4j.Logger;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -77,6 +91,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
||||||
|
|
||||||
private final transient PlayerResponse response = new PlayerResponse();
|
private final transient PlayerResponse response = new PlayerResponse();
|
||||||
|
|
||||||
|
protected static FilterCreatureForCombatBlock filterCreatureForCombatBlock = new FilterCreatureForCombatBlock();
|
||||||
protected static FilterCreatureForCombat filterCreatureForCombat = new FilterCreatureForCombat();
|
protected static FilterCreatureForCombat filterCreatureForCombat = new FilterCreatureForCombat();
|
||||||
protected static FilterAttackingCreature filterAttack = new FilterAttackingCreature();
|
protected static FilterAttackingCreature filterAttack = new FilterAttackingCreature();
|
||||||
protected static FilterBlockingCreature filterBlock = new FilterBlockingCreature();
|
protected static FilterBlockingCreature filterBlock = new FilterBlockingCreature();
|
||||||
|
@ -593,7 +608,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
||||||
@Override
|
@Override
|
||||||
public void selectBlockers(Game game, UUID defendingPlayerId) {
|
public void selectBlockers(Game game, UUID defendingPlayerId) {
|
||||||
updateGameStatePriority("selectBlockers", game);
|
updateGameStatePriority("selectBlockers", game);
|
||||||
FilterCreatureForCombat filter = filterCreatureForCombat.copy();
|
FilterCreatureForCombatBlock filter = filterCreatureForCombatBlock.copy();
|
||||||
filter.add(new ControllerIdPredicate(defendingPlayerId));
|
filter.add(new ControllerIdPredicate(defendingPlayerId));
|
||||||
while (!abort) {
|
while (!abort) {
|
||||||
game.fireSelectEvent(playerId, "Select blockers");
|
game.fireSelectEvent(playerId, "Select blockers");
|
||||||
|
@ -601,10 +616,6 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
||||||
if (response.getBoolean() != null) {
|
if (response.getBoolean() != null) {
|
||||||
return;
|
return;
|
||||||
} else if (response.getInteger() != null) {
|
} else if (response.getInteger() != null) {
|
||||||
//if (response.getInteger() == -9999) {
|
|
||||||
// passedAllTurns = true;
|
|
||||||
//}
|
|
||||||
//passedTurn = true;
|
|
||||||
return;
|
return;
|
||||||
} else if (response.getUUID() != null) {
|
} else if (response.getUUID() != null) {
|
||||||
Permanent blocker = game.getPermanent(response.getUUID());
|
Permanent blocker = game.getPermanent(response.getUUID());
|
||||||
|
@ -613,8 +624,7 @@ public class HumanPlayer extends PlayerImpl<HumanPlayer> {
|
||||||
selectCombatGroup(blocker.getId(), game);
|
selectCombatGroup(blocker.getId(), game);
|
||||||
}
|
}
|
||||||
else if (filterBlock.match(blocker, null, playerId, game) && game.getStack().isEmpty()) {
|
else if (filterBlock.match(blocker, null, playerId, game) && game.getStack().isEmpty()) {
|
||||||
// if (game.getState().getTriggered().isEmpty() && game.getState().getDelayed().isEmpty())
|
game.getCombat().removeBlocker(blocker.getId(), game);
|
||||||
game.getCombat().removeBlocker(blocker.getId(), game);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,6 +54,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.filter.common.FilterCreatureForCombatBlock;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
@ -154,7 +155,7 @@ public class TestPlayer extends ComputerPlayer<TestPlayer> {
|
||||||
String command = action.getAction();
|
String command = action.getAction();
|
||||||
command = command.substring(command.indexOf("block:") + 6);
|
command = command.substring(command.indexOf("block:") + 6);
|
||||||
String[] groups = command.split(";");
|
String[] groups = command.split(";");
|
||||||
FilterCreatureForCombat filterBlocker = new FilterCreatureForCombat();
|
FilterCreatureForCombatBlock filterBlocker = new FilterCreatureForCombatBlock();
|
||||||
filterBlocker.add(new NamePredicate(groups[0]));
|
filterBlocker.add(new NamePredicate(groups[0]));
|
||||||
Permanent blocker = findPermanent(filterBlocker, playerId, game);
|
Permanent blocker = findPermanent(filterBlocker, playerId, game);
|
||||||
if (blocker != null) {
|
if (blocker != null) {
|
||||||
|
|
|
@ -5,7 +5,7 @@ package mage.constants;
|
||||||
* @author North
|
* @author North
|
||||||
*/
|
*/
|
||||||
public enum AsThoughEffectType {
|
public enum AsThoughEffectType {
|
||||||
BLOCK,
|
BLOCK_TAPPED,
|
||||||
BE_BLOCKED,
|
BE_BLOCKED,
|
||||||
ATTACK,
|
ATTACK,
|
||||||
CAST,
|
CAST,
|
||||||
|
|
|
@ -28,19 +28,15 @@
|
||||||
|
|
||||||
package mage.filter.common;
|
package mage.filter.common;
|
||||||
|
|
||||||
import mage.filter.predicate.Predicate;
|
|
||||||
import mage.filter.predicate.Predicates;
|
import mage.filter.predicate.Predicates;
|
||||||
import mage.filter.predicate.permanent.AttackingPredicate;
|
|
||||||
import mage.filter.predicate.permanent.TappedPredicate;
|
import mage.filter.predicate.permanent.TappedPredicate;
|
||||||
import mage.game.Game;
|
|
||||||
import mage.game.permanent.Permanent;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author BetaSteward_at_googlemail.com
|
* @author BetaSteward_at_googlemail.com
|
||||||
* @author North
|
* @author North
|
||||||
*/
|
*/
|
||||||
public class FilterCreatureForCombat extends FilterCreaturePermanent {
|
public class FilterCreatureForCombat extends FilterCreatureForCombatBase {
|
||||||
|
|
||||||
public FilterCreatureForCombat() {
|
public FilterCreatureForCombat() {
|
||||||
this("");
|
this("");
|
||||||
|
@ -48,10 +44,7 @@ public class FilterCreatureForCombat extends FilterCreaturePermanent {
|
||||||
|
|
||||||
public FilterCreatureForCombat(String name) {
|
public FilterCreatureForCombat(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
this.add(Predicates.not(new AttackingPredicate()));
|
|
||||||
this.add(Predicates.not(new TappedPredicate()));
|
this.add(Predicates.not(new TappedPredicate()));
|
||||||
this.add(new PhasedInPredicate());
|
|
||||||
this.add(new CanBlockPredicate());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public FilterCreatureForCombat(final FilterCreatureForCombat filter) {
|
public FilterCreatureForCombat(final FilterCreatureForCombat filter) {
|
||||||
|
@ -63,29 +56,3 @@ public class FilterCreatureForCombat extends FilterCreaturePermanent {
|
||||||
return new FilterCreatureForCombat(this);
|
return new FilterCreatureForCombat(this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class PhasedInPredicate implements Predicate<Permanent> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Permanent input, Game game) {
|
|
||||||
return input.isPhasedIn();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "PhasedIn";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CanBlockPredicate implements Predicate<Permanent> {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean apply(Permanent input, Game game) {
|
|
||||||
return input.getMaxBlocks() == 0 || input.getBlocking() < input.getMaxBlocks();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
return "CanBlock";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
91
Mage/src/mage/filter/common/FilterCreatureForCombatBase.java
Normal file
91
Mage/src/mage/filter/common/FilterCreatureForCombatBase.java
Normal file
|
@ -0,0 +1,91 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
|
* permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* The views and conclusions contained in the software and documentation are those of the
|
||||||
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package mage.filter.common;
|
||||||
|
|
||||||
|
import mage.filter.predicate.Predicate;
|
||||||
|
import mage.filter.predicate.Predicates;
|
||||||
|
import mage.filter.predicate.permanent.AttackingPredicate;
|
||||||
|
import mage.filter.predicate.permanent.TappedPredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author BetaSteward_at_googlemail.com
|
||||||
|
* @author North
|
||||||
|
*/
|
||||||
|
public class FilterCreatureForCombatBase extends FilterCreaturePermanent {
|
||||||
|
|
||||||
|
public FilterCreatureForCombatBase() {
|
||||||
|
this("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCreatureForCombatBase(String name) {
|
||||||
|
super(name);
|
||||||
|
this.add(Predicates.not(new AttackingPredicate()));
|
||||||
|
this.add(new PhasedInPredicate());
|
||||||
|
this.add(new CanBlockPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCreatureForCombatBase(final FilterCreatureForCombatBase filter) {
|
||||||
|
super(filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FilterCreatureForCombatBase copy() {
|
||||||
|
return new FilterCreatureForCombatBase(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class PhasedInPredicate implements Predicate<Permanent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Permanent input, Game game) {
|
||||||
|
return input.isPhasedIn();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "PhasedIn";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class CanBlockPredicate implements Predicate<Permanent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Permanent input, Game game) {
|
||||||
|
return input.getMaxBlocks() == 0 || input.getBlocking() < input.getMaxBlocks();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "CanBlock";
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,72 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
|
* permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* The views and conclusions contained in the software and documentation are those of the
|
||||||
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package mage.filter.common;
|
||||||
|
|
||||||
|
import mage.constants.AsThoughEffectType;
|
||||||
|
import mage.filter.predicate.Predicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LevelX2
|
||||||
|
*/
|
||||||
|
public class FilterCreatureForCombatBlock extends FilterCreatureForCombatBase {
|
||||||
|
|
||||||
|
public FilterCreatureForCombatBlock() {
|
||||||
|
this("");
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCreatureForCombatBlock(String name) {
|
||||||
|
super(name);
|
||||||
|
this.add(new BlockTappedPredicate());
|
||||||
|
}
|
||||||
|
|
||||||
|
public FilterCreatureForCombatBlock(final FilterCreatureForCombatBlock filter) {
|
||||||
|
super(filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FilterCreatureForCombatBlock copy() {
|
||||||
|
return new FilterCreatureForCombatBlock(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class BlockTappedPredicate implements Predicate<Permanent> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Permanent input, Game game) {
|
||||||
|
return !input.isTapped() || game.getState().getContinuousEffects().asThough(input.getId(), AsThoughEffectType.BLOCK_TAPPED, game);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return "untapped or can block tapped";
|
||||||
|
}
|
||||||
|
}
|
|
@ -37,7 +37,7 @@ import mage.abilities.keyword.CanAttackOnlyAloneAbility;
|
||||||
import mage.abilities.keyword.CantAttackAloneAbility;
|
import mage.abilities.keyword.CantAttackAloneAbility;
|
||||||
import mage.abilities.keyword.VigilanceAbility;
|
import mage.abilities.keyword.VigilanceAbility;
|
||||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||||
import mage.filter.common.FilterCreatureForCombat;
|
import mage.filter.common.FilterCreatureForCombatBlock;
|
||||||
import mage.filter.common.FilterPlaneswalkerPermanent;
|
import mage.filter.common.FilterPlaneswalkerPermanent;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.events.GameEvent;
|
import mage.game.events.GameEvent;
|
||||||
|
@ -55,7 +55,7 @@ import mage.util.trace.TraceUtil;
|
||||||
public class Combat implements Serializable, Copyable<Combat> {
|
public class Combat implements Serializable, Copyable<Combat> {
|
||||||
|
|
||||||
private static FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent();
|
private static FilterPlaneswalkerPermanent filterPlaneswalker = new FilterPlaneswalkerPermanent();
|
||||||
private static FilterCreatureForCombat filterBlockers = new FilterCreatureForCombat();
|
private static FilterCreatureForCombatBlock filterBlockers = new FilterCreatureForCombatBlock();
|
||||||
|
|
||||||
protected List<CombatGroup> groups = new ArrayList<CombatGroup>();
|
protected List<CombatGroup> groups = new ArrayList<CombatGroup>();
|
||||||
protected Map<UUID, CombatGroup> blockingGroups = new HashMap<UUID, CombatGroup>();
|
protected Map<UUID, CombatGroup> blockingGroups = new HashMap<UUID, CombatGroup>();
|
||||||
|
|
|
@ -863,7 +863,7 @@ public abstract class PermanentImpl<T extends PermanentImpl<T>> extends CardImpl
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canBlock(UUID attackerId, Game game) {
|
public boolean canBlock(UUID attackerId, Game game) {
|
||||||
if (tapped) {
|
if (tapped && !game.getState().getContinuousEffects().asThough(this.getId(), AsThoughEffectType.BLOCK_TAPPED, game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Permanent attacker = game.getPermanent(attackerId);
|
Permanent attacker = game.getPermanent(attackerId);
|
||||||
|
|
|
@ -83,6 +83,7 @@ import mage.counters.CounterType;
|
||||||
import mage.counters.Counters;
|
import mage.counters.Counters;
|
||||||
import mage.filter.FilterCard;
|
import mage.filter.FilterCard;
|
||||||
import mage.filter.common.FilterCreatureForCombat;
|
import mage.filter.common.FilterCreatureForCombat;
|
||||||
|
import mage.filter.common.FilterCreatureForCombatBlock;
|
||||||
import mage.game.ExileZone;
|
import mage.game.ExileZone;
|
||||||
import mage.game.Game;
|
import mage.game.Game;
|
||||||
import mage.game.combat.CombatGroup;
|
import mage.game.combat.CombatGroup;
|
||||||
|
@ -1468,7 +1469,7 @@ public abstract class PlayerImpl<T extends PlayerImpl<T>> implements Player, Ser
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Permanent> getAvailableBlockers(Game game) {
|
public List<Permanent> getAvailableBlockers(Game game) {
|
||||||
FilterCreatureForCombat blockFilter = new FilterCreatureForCombat();
|
FilterCreatureForCombatBlock blockFilter = new FilterCreatureForCombatBlock();
|
||||||
List<Permanent> blockers = game.getBattlefield().getAllActivePermanents(blockFilter, playerId, game);
|
List<Permanent> blockers = game.getBattlefield().getAllActivePermanents(blockFilter, playerId, game);
|
||||||
return blockers;
|
return blockers;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue