mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Fixed #209. Aura enchantments targeting controlled creatures go to graveyard as a stet based effect, if controller of the enchanted creature is another than enchantment's controller.
This commit is contained in:
parent
c7bdc5719d
commit
9e9256cd82
1 changed files with 12 additions and 3 deletions
|
@ -88,6 +88,7 @@ import java.io.IOException;
|
|||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import java.util.Map.Entry;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
|
||||
|
||||
public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializable {
|
||||
|
@ -1134,9 +1135,17 @@ public abstract class GameImpl<T extends GameImpl<T>> implements Game, Serializa
|
|||
}
|
||||
else {
|
||||
Filter auraFilter = perm.getSpellAbility().getTargets().get(0).getFilter();
|
||||
if (!auraFilter.match(attachedTo, this) || attachedTo.hasProtectionFrom(perm, this)) {
|
||||
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) {
|
||||
somethingHappened = true;
|
||||
if (auraFilter instanceof FilterControlledCreaturePermanent) {
|
||||
if (!((FilterControlledCreaturePermanent)auraFilter).match(attachedTo, perm.getId(), perm.getControllerId(), this) || attachedTo.hasProtectionFrom(perm, this)) {
|
||||
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) {
|
||||
somethingHappened = true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!auraFilter.match(attachedTo, this) || attachedTo.hasProtectionFrom(perm, this)) {
|
||||
if (perm.moveToZone(Zone.GRAVEYARD, null, this, false)) {
|
||||
somethingHappened = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue