Reverted canBlock changes

due to some incorrect banding interactions
This commit is contained in:
L_J 2018-02-16 13:59:04 +00:00 committed by GitHub
parent 5f5750531f
commit f2a70193e3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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) {