mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
* Orzhov Advokist - Fixed that the attack preventing effect did not work correctly.
This commit is contained in:
parent
3d9b51bec3
commit
4b4aef8ed5
3 changed files with 39 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue