mirror of
https://github.com/correl/mage.git
synced 2025-03-17 01:06:26 -09: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,44 +1121,32 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
||||||
if (tapped && !game.getState().getContinuousEffects().asThough(this.getId(), AsThoughEffectType.BLOCK_TAPPED, this.getControllerId(), game)) {
|
if (tapped && !game.getState().getContinuousEffects().asThough(this.getId(), AsThoughEffectType.BLOCK_TAPPED, this.getControllerId(), game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
Permanent baseAttacker = game.getPermanent(attackerId);
|
Permanent attacker = game.getPermanent(attackerId);
|
||||||
if (baseAttacker == null) {
|
if (attacker == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
List<UUID> attackerIdsToCheck = new ArrayList<>(baseAttacker.getBandedCards()); // handles banding
|
// controller of attacking permanent must be an opponent
|
||||||
attackerIdsToCheck.add(attackerId);
|
if (!game.getPlayer(this.getControllerId()).hasOpponent(attacker.getControllerId(), game)) {
|
||||||
blockCheck:
|
return false;
|
||||||
for (UUID bandedId : attackerIdsToCheck) {
|
}
|
||||||
Permanent attacker = game.getPermanent(bandedId);
|
//20101001 - 509.1b
|
||||||
if (attacker == null) {
|
// check blocker restrictions
|
||||||
continue blockCheck;
|
for (Map.Entry<RestrictionEffect, Set<Ability>> entry : game.getContinuousEffects().getApplicableRestrictionEffects(this, game).entrySet()) {
|
||||||
}
|
for (Ability ability : entry.getValue()) {
|
||||||
// controller of attacking permanent must be an opponent
|
if (!entry.getKey().canBlock(attacker, this, ability, game)) {
|
||||||
if (!game.getPlayer(this.getControllerId()).hasOpponent(attacker.getControllerId(), game)) {
|
return false;
|
||||||
continue blockCheck;
|
|
||||||
}
|
|
||||||
//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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// check also attacker's restriction effects
|
|
||||||
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;
|
// check also attacker's restriction effects
|
||||||
|
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)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return !attacker.hasProtectionFrom(this, game);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Add table
Reference in a new issue