* Orzhov Advokist - Fixed that the attack preventing effect did not work correctly.

This commit is contained in:
LevelX2 2016-12-11 16:25:08 +01:00
parent 3d9b51bec3
commit 4b4aef8ed5
3 changed files with 39 additions and 5 deletions

View file

@ -75,8 +75,13 @@ public class CantAttackYouAllEffect extends RestrictionEffect {
@Override
public boolean canAttack(Permanent attacker, UUID defenderId, Ability source, Game game) {
return (!alsoPlaneswalker && !defenderId.equals(source.getControllerId()))
|| (alsoPlaneswalker && !(source.getControllerId().equals(game.getCombat().getDefendingPlayerId(attacker.getId(), game))));
if (alsoPlaneswalker) {
Permanent planeswalker = game.getPermanent(defenderId);
if (planeswalker != null) {
defenderId = planeswalker.getControllerId();
}
}
return !defenderId.equals(source.getControllerId());
}
@Override