mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
fixed Curtain of Light targeting, updated how being unblocked is checked
This commit is contained in:
parent
3b0b923b7c
commit
2733d736d5
5 changed files with 19 additions and 22 deletions
|
|
@ -29,7 +29,6 @@ package mage.filter.predicate.permanent;
|
|||
|
||||
import mage.filter.predicate.Predicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
|
|
@ -40,12 +39,7 @@ public class BlockedPredicate implements Predicate<Permanent> {
|
|||
|
||||
@Override
|
||||
public boolean apply(Permanent input, Game game) {
|
||||
for (CombatGroup combatGroup : game.getCombat().getGroups()) {
|
||||
if (!combatGroup.getBlockers().isEmpty() && combatGroup.getAttackers().contains(input.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
return input.isBlocked(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -193,6 +193,8 @@ public interface Permanent extends Card, Controllable {
|
|||
|
||||
boolean isAttacking();
|
||||
|
||||
boolean isBlocked(Game game);
|
||||
|
||||
int getBlocking();
|
||||
|
||||
void setAttacking(boolean attacking);
|
||||
|
|
|
|||
|
|
@ -48,6 +48,7 @@ import mage.game.Game;
|
|||
import mage.game.GameState;
|
||||
import mage.game.ZoneChangeInfo;
|
||||
import mage.game.ZonesHandler;
|
||||
import mage.game.combat.CombatGroup;
|
||||
import mage.game.command.CommandObject;
|
||||
import mage.game.events.*;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
|
@ -509,6 +510,16 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
return attacking;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBlocked(Game game) {
|
||||
for (CombatGroup combatGroup : game.getCombat().getGroups()) {
|
||||
if (combatGroup.getBlocked() && combatGroup.getAttackers().contains(this.getId())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getBlocking() {
|
||||
return blocking;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue