mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
* Brutal Expulsion - Fixed that the spell could wrongly target itself on the stack.
This commit is contained in:
parent
21061ac928
commit
b2cc5b59c6
1 changed files with 14 additions and 6 deletions
|
@ -117,13 +117,15 @@ public class TargetSpellOrPermanent extends TargetImpl {
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
if (source != null) {
|
if (source != null) {
|
||||||
MageObject targetSource = game.getObject(source.getSourceId());
|
MageObject targetSource = game.getObject(source.getSourceId());
|
||||||
return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
|
return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game)
|
||||||
|
&& filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
|
||||||
} else {
|
} else {
|
||||||
return filter.match(permanent, game);
|
return filter.match(permanent, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Spell spell = game.getStack().getSpell(id);
|
Spell spell = game.getStack().getSpell(id);
|
||||||
if (spell != null) {
|
if (spell != null
|
||||||
|
&& !source.getSourceId().equals(id)) { // 114.4. A spell or ability on the stack is an illegal target for itself.
|
||||||
return filter.match(spell, game);
|
return filter.match(spell, game);
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -151,7 +153,9 @@ public class TargetSpellOrPermanent extends TargetImpl {
|
||||||
MageObject targetSource = game.getObject(sourceId);
|
MageObject targetSource = game.getObject(sourceId);
|
||||||
for (StackObject stackObject : game.getStack()) {
|
for (StackObject stackObject : game.getStack()) {
|
||||||
Spell spell = game.getStack().getSpell(stackObject.getId());
|
Spell spell = game.getStack().getSpell(stackObject.getId());
|
||||||
if (spell != null && filter.match(spell, sourceId, sourceControllerId, game)) {
|
if (spell != null
|
||||||
|
&& !sourceId.equals(spell.getSourceId())
|
||||||
|
&& filter.match(spell, sourceId, sourceControllerId, game)) {
|
||||||
count++;
|
count++;
|
||||||
if (count >= this.minNumberOfTargets) {
|
if (count >= this.minNumberOfTargets) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -184,7 +188,8 @@ public class TargetSpellOrPermanent extends TargetImpl {
|
||||||
int count = 0;
|
int count = 0;
|
||||||
for (StackObject stackObject : game.getStack()) {
|
for (StackObject stackObject : game.getStack()) {
|
||||||
Spell spell = game.getStack().getSpell(stackObject.getId());
|
Spell spell = game.getStack().getSpell(stackObject.getId());
|
||||||
if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) {
|
if (spell != null
|
||||||
|
&& filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) {
|
||||||
count++;
|
count++;
|
||||||
if (count >= this.minNumberOfTargets) {
|
if (count >= this.minNumberOfTargets) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -208,7 +213,9 @@ public class TargetSpellOrPermanent extends TargetImpl {
|
||||||
MageObject targetSource = game.getObject(sourceId);
|
MageObject targetSource = game.getObject(sourceId);
|
||||||
for (StackObject stackObject : game.getStack()) {
|
for (StackObject stackObject : game.getStack()) {
|
||||||
Spell spell = game.getStack().getSpell(stackObject.getId());
|
Spell spell = game.getStack().getSpell(stackObject.getId());
|
||||||
if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) {
|
if (spell != null
|
||||||
|
&& !sourceId.equals(spell.getSourceId())
|
||||||
|
&& filter.match(spell, sourceId, sourceControllerId, game)) {
|
||||||
possibleTargets.add(spell.getId());
|
possibleTargets.add(spell.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -225,7 +232,8 @@ public class TargetSpellOrPermanent extends TargetImpl {
|
||||||
Set<UUID> possibleTargets = new HashSet<>();
|
Set<UUID> possibleTargets = new HashSet<>();
|
||||||
for (StackObject stackObject : game.getStack()) {
|
for (StackObject stackObject : game.getStack()) {
|
||||||
Spell spell = game.getStack().getSpell(stackObject.getId());
|
Spell spell = game.getStack().getSpell(stackObject.getId());
|
||||||
if (spell != null && filter.match(spell, null, sourceControllerId, game) && filter.match(spell, game)) {
|
if (spell != null
|
||||||
|
&& filter.match(spell, null, sourceControllerId, game)) {
|
||||||
possibleTargets.add(spell.getId());
|
possibleTargets.add(spell.getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue