forked from External/mage
Fixed Issue 270.
114.4. A spell or ability on the stack is an illegal target for itself.
This commit is contained in:
parent
7a610a27a6
commit
e949d046df
1 changed files with 16 additions and 11 deletions
|
|
@ -28,9 +28,6 @@
|
|||
|
||||
package mage.target;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.filter.FilterSpell;
|
||||
|
|
@ -38,6 +35,10 @@ import mage.game.Game;
|
|||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.StackObject;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -76,14 +77,18 @@ public class TargetSpell extends TargetObject<TargetSpell> {
|
|||
return filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
Spell spell = game.getStack().getSpell(id);
|
||||
if (spell != null) {
|
||||
return filter.match(spell);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
// rule 114.4. A spell or ability on the stack is an illegal target for itself.
|
||||
if (source != null && source.getId().equals(id)) {
|
||||
return false;
|
||||
}
|
||||
Spell spell = game.getStack().getSpell(id);
|
||||
if (spell != null) {
|
||||
return filter.match(spell);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue