mirror of
https://github.com/correl/mage.git
synced 2024-12-25 19:25:41 +00:00
Reverted canBlock changes
due to some incorrect banding interactions
This commit is contained in:
parent
5f5750531f
commit
f2a70193e3
1 changed files with 21 additions and 33 deletions
|
@ -1121,28 +1121,20 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
if (tapped && !game.getState().getContinuousEffects().asThough(this.getId(), AsThoughEffectType.BLOCK_TAPPED, this.getControllerId(), game)) {
|
||||
return false;
|
||||
}
|
||||
Permanent baseAttacker = game.getPermanent(attackerId);
|
||||
if (baseAttacker == null) {
|
||||
return false;
|
||||
}
|
||||
List<UUID> attackerIdsToCheck = new ArrayList<>(baseAttacker.getBandedCards()); // handles banding
|
||||
attackerIdsToCheck.add(attackerId);
|
||||
blockCheck:
|
||||
for (UUID bandedId : attackerIdsToCheck) {
|
||||
Permanent attacker = game.getPermanent(bandedId);
|
||||
Permanent attacker = game.getPermanent(attackerId);
|
||||
if (attacker == null) {
|
||||
continue blockCheck;
|
||||
return false;
|
||||
}
|
||||
// controller of attacking permanent must be an opponent
|
||||
if (!game.getPlayer(this.getControllerId()).hasOpponent(attacker.getControllerId(), game)) {
|
||||
continue blockCheck;
|
||||
return false;
|
||||
}
|
||||
//20101001 - 509.1b
|
||||
// check blocker restrictions
|
||||
for (Map.Entry<RestrictionEffect, Set<Ability>> entry : game.getContinuousEffects().getApplicableRestrictionEffects(this, game).entrySet()) {
|
||||
for (Ability ability : entry.getValue()) {
|
||||
if (!entry.getKey().canBlock(attacker, this, ability, game)) {
|
||||
continue blockCheck;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1150,16 +1142,12 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
for (Map.Entry<RestrictionEffect, Set<Ability>> restrictionEntry : game.getContinuousEffects().getApplicableRestrictionEffects(attacker, game).entrySet()) {
|
||||
for (Ability ability : restrictionEntry.getValue()) {
|
||||
if (!restrictionEntry.getKey().canBeBlocked(attacker, this, ability, game)) {
|
||||
continue blockCheck;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!attacker.hasProtectionFrom(this, game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
return !attacker.hasProtectionFrom(this, game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBlockAny(Game game) {
|
||||
|
|
Loading…
Reference in a new issue