mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 20:59:14 -08:00
* Squelch - Fixed that wrongly spells could be targeted.
This commit is contained in:
parent
3875381546
commit
da0c7d4d06
1 changed files with 6 additions and 6 deletions
|
|
@ -38,6 +38,7 @@ import mage.abilities.ActivatedAbility;
|
||||||
import mage.abilities.effects.common.CounterTargetEffect;
|
import mage.abilities.effects.common.CounterTargetEffect;
|
||||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
import mage.constants.AbilityType;
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
import mage.filter.Filter;
|
import mage.filter.Filter;
|
||||||
import mage.filter.FilterAbility;
|
import mage.filter.FilterAbility;
|
||||||
|
|
@ -96,10 +97,7 @@ class ActivatedAbilityTarget extends TargetObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
StackObject stackObject = game.getStack().getStackObject(id);
|
StackObject stackObject = game.getStack().getStackObject(id);
|
||||||
if (stackObject.getStackAbility() != null && (stackObject.getStackAbility() instanceof ActivatedAbility)) {
|
return stackObject != null && stackObject.getStackAbility() != null && stackObject.getStackAbility().getAbilityType().equals(AbilityType.ACTIVATED);
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -110,7 +108,9 @@ class ActivatedAbilityTarget extends TargetObject {
|
||||||
@Override
|
@Override
|
||||||
public boolean canChoose(UUID sourceControllerId, Game game) {
|
public boolean canChoose(UUID sourceControllerId, Game game) {
|
||||||
for (StackObject stackObject : game.getStack()) {
|
for (StackObject stackObject : game.getStack()) {
|
||||||
if (stackObject.getStackAbility() != null && (stackObject.getStackAbility() instanceof ActivatedAbility) && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
|
if (stackObject.getStackAbility() != null
|
||||||
|
&& stackObject.getStackAbility().getAbilityType().equals(AbilityType.ACTIVATED)
|
||||||
|
&& game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -126,7 +126,7 @@ class ActivatedAbilityTarget extends TargetObject {
|
||||||
public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
|
public Set<UUID> possibleTargets(UUID sourceControllerId, Game game) {
|
||||||
Set<UUID> possibleTargets = new HashSet<>();
|
Set<UUID> possibleTargets = new HashSet<>();
|
||||||
for (StackObject stackObject : game.getStack()) {
|
for (StackObject stackObject : game.getStack()) {
|
||||||
if (stackObject.getStackAbility() != null && (stackObject.getStackAbility() instanceof ActivatedAbility) && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
|
if (stackObject.getStackAbility().getAbilityType().equals(AbilityType.ACTIVATED) && game.getPlayer(sourceControllerId).getInRange().contains(stackObject.getStackAbility().getControllerId())) {
|
||||||
possibleTargets.add(stackObject.getStackAbility().getId());
|
possibleTargets.add(stackObject.getStackAbility().getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue