mirror of
https://github.com/magefree/mage.git
synced 2025-12-28 14:32:06 -08:00
Fix Uba Mask (#11514)
* Update Uba Mask exile zone to clear at end of turn * Fix Uba Mask zcc issue. Closes #11512
This commit is contained in:
parent
bac50ca010
commit
2e75b73802
1 changed files with 23 additions and 3 deletions
|
|
@ -10,6 +10,7 @@ import mage.cards.Card;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.game.ExileZone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
|
|
@ -66,7 +67,17 @@ class UbaMaskReplacementEffect extends ReplacementEffectImpl {
|
|||
if (player != null && sourceObject != null) {
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
if (player.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName())) {
|
||||
UUID exileId = CardUtil.getExileZoneId(
|
||||
player.getId().toString()
|
||||
+ "-" + game.getState().getTurnNum()
|
||||
+ "-" + sourceObject.getIdName()
|
||||
+ "-" + sourceObject.getZoneChangeCounter(game), game
|
||||
);
|
||||
String exileName = sourceObject.getIdName() + " play on turn " + game.getState().getTurnNum()
|
||||
+ " for " + player.getName();
|
||||
game.getExile().createZone(exileId, exileName).setCleanupOnEndTurn(true);
|
||||
|
||||
if (player.moveCardsToExile(card, source, game, true, exileId, exileName)) {
|
||||
UbaMaskExiledCardsWatcher watcher = game.getState().getWatcher(UbaMaskExiledCardsWatcher.class);
|
||||
if (watcher != null) {
|
||||
watcher.addExiledCard(event.getPlayerId(), card, game);
|
||||
|
|
@ -91,7 +102,7 @@ class UbaMaskReplacementEffect extends ReplacementEffectImpl {
|
|||
class UbaMaskPlayEffect extends AsThoughEffectImpl {
|
||||
|
||||
public UbaMaskPlayEffect() {
|
||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.EndOfGame, Outcome.Benefit);
|
||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "Each player may play lands and cast spells from among cards they exiled with {this} this turn";
|
||||
}
|
||||
|
||||
|
|
@ -119,8 +130,17 @@ class UbaMaskPlayEffect extends AsThoughEffectImpl {
|
|||
UbaMaskExiledCardsWatcher watcher = game.getState().getWatcher(UbaMaskExiledCardsWatcher.class);
|
||||
if (watcher != null) {
|
||||
List<MageObjectReference> exiledThisTurn = watcher.getUbaMaskExiledCardsThisTurn(affectedControllerId);
|
||||
UUID exileId = CardUtil.getExileZoneId(
|
||||
affectedControllerId
|
||||
+ "-" + game.getState().getTurnNum()
|
||||
+ "-" + source.getSourceObject(game).getIdName()
|
||||
+ "-" + source.getSourceObject(game).getZoneChangeCounter(game), game
|
||||
);
|
||||
ExileZone exileZone = game.getExile().getExileZone(exileId);
|
||||
return exiledThisTurn != null
|
||||
&& exiledThisTurn.contains(new MageObjectReference(card, game));
|
||||
&& exiledThisTurn.contains(new MageObjectReference(card, game))
|
||||
&& exileZone != null
|
||||
&& exileZone.contains(objectId);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue