mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
* Tidebinder Mage, Dungeon Geists and Shipbreaker Kraken - Fixed that the not untap effect lasted forever if the creature with the ability was destroyed or exiled while the ability was on the stack.
This commit is contained in:
parent
d702e1a3aa
commit
fee15744a1
3 changed files with 27 additions and 0 deletions
|
@ -48,6 +48,7 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
import mage.watchers.WatcherImpl;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -121,6 +122,14 @@ class DungeonGeistsEffect extends ReplacementEffectImpl<DungeonGeistsEffect> {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// Source must be on the battlefield (it's neccessary to check here because if as response to the enter
|
||||
// the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL
|
||||
// event will happen before this effect is applied ever)
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) {
|
||||
this.used = true;
|
||||
return false;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
this.used = true;
|
||||
|
|
|
@ -50,6 +50,7 @@ import mage.filter.predicate.permanent.ControllerPredicate;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.WatcherImpl;
|
||||
|
@ -126,6 +127,14 @@ class TidebinderMageEffect extends ReplacementEffectImpl<TidebinderMageEffect> {
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// Source must be on the battlefield (it's neccessary to check here because if as response to the enter
|
||||
// the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL
|
||||
// event will happen before this effect is applied ever)
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) {
|
||||
this.used = true;
|
||||
return false;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
this.used = true;
|
||||
|
|
|
@ -45,6 +45,7 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.watchers.WatcherImpl;
|
||||
|
||||
|
@ -111,6 +112,14 @@ class ShipbreakerKrakenReplacementEffect extends ReplacementEffectImpl<Shipbreak
|
|||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
// Source must be on the battlefield (it's neccessary to check here because if as response to the enter
|
||||
// the battlefield triggered ability the source dies (or will be exiled), then the ZONE_CHANGE or LOST_CONTROL
|
||||
// event will happen before this effect is applied ever)
|
||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||
if (sourcePermanent == null || !sourcePermanent.getControllerId().equals(source.getControllerId())) {
|
||||
this.used = true;
|
||||
return false;
|
||||
}
|
||||
if (event.getType() == GameEvent.EventType.LOST_CONTROL) {
|
||||
if (event.getTargetId().equals(source.getSourceId())) {
|
||||
this.used = true;
|
||||
|
|
Loading…
Reference in a new issue