mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Merge branch '1779-lingering-hostage-taker-untilhostleavesplay-issue' into 'master'
Resolve "Lingering Hostage Taker (UntilHostLeavesPlay) issue" Closes #1779 See merge request core-developers/forge!4261
This commit is contained in:
@@ -251,6 +251,7 @@ public class GameAction {
|
|||||||
copied.copyChangedTextFrom(c);
|
copied.copyChangedTextFrom(c);
|
||||||
|
|
||||||
// copy exiled properties when adding to stack
|
// copy exiled properties when adding to stack
|
||||||
|
// will be cleanup later in MagicStack
|
||||||
copied.setExiledWith(c.getExiledWith());
|
copied.setExiledWith(c.getExiledWith());
|
||||||
copied.setExiledBy(c.getExiledBy());
|
copied.setExiledBy(c.getExiledBy());
|
||||||
|
|
||||||
@@ -416,13 +417,7 @@ public class GameAction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!zoneTo.is(ZoneType.Exile) && !zoneTo.is(ZoneType.Stack)) {
|
if (!zoneTo.is(ZoneType.Exile) && !zoneTo.is(ZoneType.Stack)) {
|
||||||
Card with = c.getExiledWith();
|
c.cleanupExiledWith();
|
||||||
if (with != null) {
|
|
||||||
with.removeUntilLeavesBattlefield(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
c.setExiledWith(null);
|
|
||||||
c.setExiledBy(null);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1681,6 +1681,17 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
|||||||
exiledWith = e;
|
exiledWith = e;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void cleanupExiledWith() {
|
||||||
|
if (exiledWith == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
exiledWith.removeUntilLeavesBattlefield(this);
|
||||||
|
|
||||||
|
exiledWith = null;
|
||||||
|
exiledBy = null;
|
||||||
|
}
|
||||||
|
|
||||||
public final Player getExiledBy() { return exiledBy; }
|
public final Player getExiledBy() { return exiledBy; }
|
||||||
public final void setExiledBy(final Player ep) {
|
public final void setExiledBy(final Player ep) {
|
||||||
exiledBy = ep;
|
exiledBy = ep;
|
||||||
|
|||||||
@@ -150,6 +150,7 @@ public class MagicStack /* extends MyObservable */ implements Iterable<SpellAbil
|
|||||||
|
|
||||||
source.setCastSA(cause);
|
source.setCastSA(cause);
|
||||||
}
|
}
|
||||||
|
source.cleanupExiledWith();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always add the ability here and always unfreeze the stack
|
// Always add the ability here and always unfreeze the stack
|
||||||
|
|||||||
Reference in New Issue
Block a user