From b63cc121ef8b046a397a30879bf067103cc370a2 Mon Sep 17 00:00:00 2001 From: LevelX2 Date: Thu, 27 Aug 2015 14:51:21 +0200 Subject: [PATCH] Some minor changes. --- .../src/main/java/mage/client/MageFrame.java | 5 +++-- .../mage/client/dialog/PreferencesDialog.java | 2 +- Mage.Common/src/mage/view/UserDataView.java | 6 +++++- Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java | 7 ++----- .../src/mage/sets/modernmasters/ToothAndNail.java | 12 ++++++------ .../mage/abilities/keyword/EntwineAbility.java | 1 + Mage/src/mage/players/PlayerImpl.java | 15 ++++++++++++++- 7 files changed, 32 insertions(+), 16 deletions(-) diff --git a/Mage.Client/src/main/java/mage/client/MageFrame.java b/Mage.Client/src/main/java/mage/client/MageFrame.java index 73b71ead8b..a6aef41290 100644 --- a/Mage.Client/src/main/java/mage/client/MageFrame.java +++ b/Mage.Client/src/main/java/mage/client/MageFrame.java @@ -358,6 +358,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { } else { connectDialog.showDialog(); } + setWindowTitle(); } }); @@ -369,7 +370,7 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { } } - public void setWindowTitle() { + private void setWindowTitle() { setTitle(TITLE_NAME + " Client: " + version == null ? "" : version.toString() + " Server: " + ((session != null && session.isConnected()) ? session.getVersionInfo() : "")); @@ -959,12 +960,12 @@ public class MageFrame extends javax.swing.JFrame implements MageClient { if (JOptionPane.showConfirmDialog(this, "Are you sure you want to disconnect?", "Confirm disconnect", JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) { session.disconnect(false); tablesPane.clearChat(); - setWindowTitle(); showMessage("You have disconnected"); } } else { connectDialog.showDialog(); } + setWindowTitle(); }//GEN-LAST:event_btnConnectActionPerformed public void btnAboutActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAboutActionPerformed diff --git a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java index ec880ce8f4..c7cbbb722c 100644 --- a/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java +++ b/Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java @@ -2449,7 +2449,7 @@ public class PreferencesDialog extends javax.swing.JDialog { public static UserData getUserData() { return new UserData(UserGroup.PLAYER, PreferencesDialog.selectedAvatarId, - PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "true").equals("true"), + PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_ABILITY_PICKER_FORCED, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ALLOW_REQUEST_SHOW_HAND_CARDS, "true").equals("true"), PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_CONFIRM_EMPTY_MANA_POOL, "true").equals("true"), getUserSkipPrioritySteps(), diff --git a/Mage.Common/src/mage/view/UserDataView.java b/Mage.Common/src/mage/view/UserDataView.java index 242fa32ec2..c60bbe88c5 100644 --- a/Mage.Common/src/mage/view/UserDataView.java +++ b/Mage.Common/src/mage/view/UserDataView.java @@ -20,10 +20,14 @@ public class UserDataView implements Serializable { String flagName; protected boolean askMoveToGraveOrder; - static UserData getDefaultUserDataView() { + static UserData getDefaultUserData() { return UserData.getDefaultUserDataView(); } + public static UserDataView getDefaultUserDataView() { + return new UserDataView(getDefaultUserData()); + } + public UserDataView(int avatarId, boolean showAbilityPickerForced, boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps, String flagName, boolean askMoveToGraveOrder) { this.avatarId = avatarId; diff --git a/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java b/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java index ad28ada69e..83f34843cb 100644 --- a/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java +++ b/Mage.Sets/src/mage/sets/fifthdawn/RainOfRust.java @@ -47,11 +47,8 @@ public class RainOfRust extends CardImpl { super(ownerId, 76, "Rain of Rust", Rarity.COMMON, new CardType[]{CardType.INSTANT}, "{3}{R}{R}"); this.expansionSetCode = "5DN"; - - // Choose one - - this.getSpellAbility().getModes().setMinModes(1); - this.getSpellAbility().getModes().setMaxModes(1); - //Destroy target artifact; + // Choose one - + //Destroy target artifact; this.getSpellAbility().addEffect(new DestroyTargetEffect()); this.getSpellAbility().addTarget(new TargetArtifactPermanent()); //or destroy target land. diff --git a/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java b/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java index 3902ef10ad..86f2e6936b 100644 --- a/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java +++ b/Mage.Sets/src/mage/sets/modernmasters/ToothAndNail.java @@ -55,7 +55,7 @@ public class ToothAndNail extends CardImpl { super(ownerId, 170, "Tooth and Nail", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{5}{G}{G}"); this.expansionSetCode = "MMA"; - // Choose one - + // Choose one - // Search your library for up to two creature cards, reveal them, put them into your hand, then shuffle your library; this.getSpellAbility().addEffect(new SearchLibraryPutInHandEffect(new TargetCardInLibrary(0, 2, new FilterCreatureCard()), true)); // or put up to two creature cards from your hand onto the battlefield. @@ -95,17 +95,17 @@ class ToothAndNailPutCreatureOnBattlefieldEffect extends OneShotEffect { @Override public boolean apply(Game game, Ability source) { - Player player = game.getPlayer(source.getControllerId()); - if (player == null) { + Player controller = game.getPlayer(source.getControllerId()); + if (controller == null) { return false; } TargetCardInHand target = new TargetCardInHand(0, 2, new FilterCreatureCard("creature cards")); - if (player.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { - for (UUID targetId: target.getTargets()) { + if (controller.choose(Outcome.PutCreatureInPlay, target, source.getSourceId(), game)) { + for (UUID targetId : target.getTargets()) { Card card = game.getCard(targetId); if (card != null) { - card.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), source.getControllerId()); + controller.putOntoBattlefieldWithInfo(card, game, Zone.HAND, source.getSourceId(), false); } } return true; diff --git a/Mage/src/mage/abilities/keyword/EntwineAbility.java b/Mage/src/mage/abilities/keyword/EntwineAbility.java index 141fd25162..8448463486 100644 --- a/Mage/src/mage/abilities/keyword/EntwineAbility.java +++ b/Mage/src/mage/abilities/keyword/EntwineAbility.java @@ -90,6 +90,7 @@ public class EntwineAbility extends StaticAbility implements OptionalAdditionalM } } + @Override public boolean isActivated() { if (additionalCost != null) { return additionalCost.isActivated(); diff --git a/Mage/src/mage/players/PlayerImpl.java b/Mage/src/mage/players/PlayerImpl.java index 4ee90b73ca..631b5614a3 100644 --- a/Mage/src/mage/players/PlayerImpl.java +++ b/Mage/src/mage/players/PlayerImpl.java @@ -1033,8 +1033,10 @@ public abstract class PlayerImpl implements Player, Serializable { int bookmark = game.bookmarkState(); if (ability.activate(game, false)) { if (ability.resolve(game)) { - if (ability.isUndoPossible() && storedBookmark == -1 || storedBookmark > bookmark) { // e.g. usefull for undo Nykthos, Shrine to Nyx + if (ability.isUndoPossible() && (storedBookmark == -1 || storedBookmark > bookmark)) { // e.g. usefull for undo Nykthos, Shrine to Nyx setStoredBookmark(bookmark); + } else { + resetStoredBookmark(game); } return true; } @@ -1366,6 +1368,17 @@ public abstract class PlayerImpl implements Player, Serializable { //20091005 - 502.1 List phasedOut = game.getBattlefield().getPhasedOut(playerId); for (Permanent permanent : game.getBattlefield().getPhasedIn(playerId)) { + // 502.15i When a permanent phases out, any local enchantments or Equipment + // attached to that permanent phase out at the same time. This alternate way of + // phasing out is known as phasing out "indirectly." An enchantment or Equipment + // that phased out indirectly won't phase in by itself, but instead phases in + // along with the card it's attached to. + for (UUID attachmentId : permanent.getAttachments()) { + Permanent attachment = game.getPermanent(attachmentId); + if (attachment != null) { + attachment.phaseOut(game); + } + } permanent.phaseOut(game); } for (Permanent permanent : phasedOut) {