mirror of
https://github.com/magefree/mage.git
synced 2026-01-24 04:09:54 -08:00
Merge origin/master into Network_Upgrade
Conflicts: Mage.Client/src/main/java/mage/client/MageFrame.java Mage.Client/src/main/java/mage/client/dialog/PreferencesDialog.java Mage.Common/src/mage/view/UserDataView.java
This commit is contained in:
commit
ad9f325b72
7 changed files with 1964 additions and 1951 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -2446,17 +2446,17 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
|||
}
|
||||
}
|
||||
|
||||
public static UserDataView getUserData(){
|
||||
return new UserDataView(UserGroup.PLAYER,
|
||||
PreferencesDialog.selectedAvatarId,
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_SHOW_TOOLTIPS_ANY_ZONE, "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(),
|
||||
MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT, "true").equals("true"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, "true").equals("true")
|
||||
public static UserData getUserData() {
|
||||
return new UserData(UserGroup.PLAYER,
|
||||
PreferencesDialog.selectedAvatarId,
|
||||
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(),
|
||||
MageFrame.getPreferences().get(KEY_CONNECT_FLAG, "world"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_ASK_MOVE_TO_GRAVE_ORDER, "true").equals("true"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT, "true").equals("true"),
|
||||
PreferencesDialog.getCachedValue(PreferencesDialog.KEY_GAME_MANA_AUTOPAYMENT_ONLY_ONE, "true").equals("true")
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,138 +1,138 @@
|
|||
package mage.view;
|
||||
|
||||
import java.io.Serializable;
|
||||
import mage.players.net.UserData;
|
||||
import mage.players.net.UserGroup;
|
||||
import mage.players.net.UserSkipPrioritySteps;
|
||||
|
||||
/**
|
||||
* Transfer object for {@link mage.players.net.UserData}
|
||||
*
|
||||
* @author ayrat
|
||||
*/
|
||||
public class UserDataView implements Serializable {
|
||||
|
||||
protected int groupId;
|
||||
protected int avatarId;
|
||||
protected boolean showAbilityPickerForced;
|
||||
protected boolean allowRequestShowHandCards;
|
||||
protected boolean confirmEmptyManaPool;
|
||||
protected UserSkipPrioritySteps userSkipPrioritySteps;
|
||||
protected String flagName;
|
||||
protected boolean askMoveToGraveOrder;
|
||||
protected boolean manaPoolAutomatic;
|
||||
protected boolean manaPoolAutomaticRestricted;
|
||||
|
||||
static UserData getDefaultUserDataView() {
|
||||
return UserData.getDefaultUserDataView();
|
||||
}
|
||||
|
||||
public UserDataView(UserGroup userGroup, int avatarId, boolean showAbilityPickerForced,
|
||||
boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps,
|
||||
String flagName, boolean askMoveToGraveOrder, boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) {
|
||||
this.groupId = userGroup.getGroupId();
|
||||
this.avatarId = avatarId;
|
||||
this.showAbilityPickerForced = showAbilityPickerForced;
|
||||
this.allowRequestShowHandCards = allowRequestShowHandCards;
|
||||
this.userSkipPrioritySteps = userSkipPrioritySteps;
|
||||
this.confirmEmptyManaPool = confirmEmptyManaPool;
|
||||
this.flagName = flagName;
|
||||
this.askMoveToGraveOrder = askMoveToGraveOrder;
|
||||
this.manaPoolAutomatic = manaPoolAutomatic;
|
||||
this.manaPoolAutomaticRestricted = manaPoolAutomaticRestricted;
|
||||
}
|
||||
|
||||
public void update(UserData userData) {
|
||||
this.groupId = userData.getGroupId();
|
||||
this.avatarId = userData.getAvatarId();
|
||||
this.showAbilityPickerForced = userData.isShowAbilityPickerForced();
|
||||
this.allowRequestShowHandCards = userData.isAllowRequestShowHandCards();
|
||||
this.userSkipPrioritySteps = userData.getUserSkipPrioritySteps();
|
||||
this.confirmEmptyManaPool = userData.confirmEmptyManaPool();
|
||||
this.flagName = userData.getFlagName();
|
||||
this.askMoveToGraveOrder = userData.askMoveToGraveOrder();
|
||||
this.manaPoolAutomatic = userData.isManaPoolAutomatic();
|
||||
this.manaPoolAutomaticRestricted = userData.isManaPoolAutomaticRestricted();
|
||||
}
|
||||
|
||||
public void setGroupId(int groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public int getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public int getAvatarId() {
|
||||
return avatarId;
|
||||
}
|
||||
|
||||
public void setAvatarId(int avatarId) {
|
||||
this.avatarId = avatarId;
|
||||
}
|
||||
|
||||
public boolean isShowAbilityPickerForced() {
|
||||
return showAbilityPickerForced;
|
||||
}
|
||||
|
||||
public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
|
||||
this.showAbilityPickerForced = showAbilityPickerForced;
|
||||
}
|
||||
|
||||
public boolean isAllowRequestShowHandCards() {
|
||||
return allowRequestShowHandCards;
|
||||
}
|
||||
|
||||
public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
|
||||
this.allowRequestShowHandCards = allowRequestShowHandCards;
|
||||
}
|
||||
|
||||
public UserSkipPrioritySteps getUserSkipPrioritySteps() {
|
||||
return userSkipPrioritySteps;
|
||||
}
|
||||
|
||||
public void setUserSkipPrioritySteps(UserSkipPrioritySteps userSkipPrioritySteps) {
|
||||
this.userSkipPrioritySteps = userSkipPrioritySteps;
|
||||
}
|
||||
|
||||
public boolean confirmEmptyManaPool() {
|
||||
return confirmEmptyManaPool;
|
||||
}
|
||||
|
||||
public void setConfirmEmptyManaPool(boolean confirmEmptyManaPool) {
|
||||
this.confirmEmptyManaPool = confirmEmptyManaPool;
|
||||
}
|
||||
|
||||
public String getFlagName() {
|
||||
return flagName;
|
||||
}
|
||||
|
||||
public void setFlagName(String flagName) {
|
||||
this.flagName = flagName;
|
||||
}
|
||||
|
||||
public boolean askMoveToGraveOrder() {
|
||||
return askMoveToGraveOrder;
|
||||
}
|
||||
|
||||
public void setAskMoveToGraveOrder(boolean askMoveToGraveOrder) {
|
||||
this.askMoveToGraveOrder = askMoveToGraveOrder;
|
||||
}
|
||||
|
||||
public boolean isManaPoolAutomatic() {
|
||||
return manaPoolAutomatic;
|
||||
}
|
||||
|
||||
public void setManaPoolAutomatic(boolean manaPoolAutomatic) {
|
||||
this.manaPoolAutomatic = manaPoolAutomatic;
|
||||
}
|
||||
|
||||
public boolean isManaPoolAutomaticRestricted() {
|
||||
return manaPoolAutomaticRestricted;
|
||||
}
|
||||
|
||||
public void setManaPoolAutomaticRestricted(boolean manaPoolAutomaticRestricted) {
|
||||
this.manaPoolAutomaticRestricted = manaPoolAutomaticRestricted;
|
||||
}
|
||||
|
||||
}
|
||||
package mage.view;
|
||||
|
||||
import java.io.Serializable;
|
||||
import mage.players.net.UserData;
|
||||
import mage.players.net.UserGroup;
|
||||
import mage.players.net.UserSkipPrioritySteps;
|
||||
|
||||
/**
|
||||
* Transfer object for {@link mage.players.net.UserData}
|
||||
*
|
||||
* @author ayrat
|
||||
*/
|
||||
public class UserDataView implements Serializable {
|
||||
|
||||
protected int groupId;
|
||||
protected int avatarId;
|
||||
protected boolean showAbilityPickerForced;
|
||||
protected boolean allowRequestShowHandCards;
|
||||
protected boolean confirmEmptyManaPool;
|
||||
protected UserSkipPrioritySteps userSkipPrioritySteps;
|
||||
protected String flagName;
|
||||
protected boolean askMoveToGraveOrder;
|
||||
protected boolean manaPoolAutomatic;
|
||||
protected boolean manaPoolAutomaticRestricted;
|
||||
|
||||
static UserData getDefaultUserData() {
|
||||
return UserData.getDefaultUserDataView();
|
||||
}
|
||||
|
||||
public UserDataView(UserGroup userGroup, int avatarId, boolean showAbilityPickerForced,
|
||||
boolean allowRequestShowHandCards, boolean confirmEmptyManaPool, UserSkipPrioritySteps userSkipPrioritySteps,
|
||||
String flagName, boolean askMoveToGraveOrder, boolean manaPoolAutomatic, boolean manaPoolAutomaticRestricted) {
|
||||
this.groupId = userGroup.getGroupId();
|
||||
this.avatarId = avatarId;
|
||||
this.showAbilityPickerForced = showAbilityPickerForced;
|
||||
this.allowRequestShowHandCards = allowRequestShowHandCards;
|
||||
this.userSkipPrioritySteps = userSkipPrioritySteps;
|
||||
this.confirmEmptyManaPool = confirmEmptyManaPool;
|
||||
this.flagName = flagName;
|
||||
this.askMoveToGraveOrder = askMoveToGraveOrder;
|
||||
this.manaPoolAutomatic = manaPoolAutomatic;
|
||||
this.manaPoolAutomaticRestricted = manaPoolAutomaticRestricted;
|
||||
}
|
||||
|
||||
public void update(UserData userData) {
|
||||
this.groupId = userData.getGroupId();
|
||||
this.avatarId = userData.getAvatarId();
|
||||
this.showAbilityPickerForced = userData.isShowAbilityPickerForced();
|
||||
this.allowRequestShowHandCards = userData.isAllowRequestShowHandCards();
|
||||
this.userSkipPrioritySteps = userData.getUserSkipPrioritySteps();
|
||||
this.confirmEmptyManaPool = userData.confirmEmptyManaPool();
|
||||
this.flagName = userData.getFlagName();
|
||||
this.askMoveToGraveOrder = userData.askMoveToGraveOrder();
|
||||
this.manaPoolAutomatic = userData.isManaPoolAutomatic();
|
||||
this.manaPoolAutomaticRestricted = userData.isManaPoolAutomaticRestricted();
|
||||
}
|
||||
|
||||
public void setGroupId(int groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public int getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public int getAvatarId() {
|
||||
return avatarId;
|
||||
}
|
||||
|
||||
public void setAvatarId(int avatarId) {
|
||||
this.avatarId = avatarId;
|
||||
}
|
||||
|
||||
public boolean isShowAbilityPickerForced() {
|
||||
return showAbilityPickerForced;
|
||||
}
|
||||
|
||||
public void setShowAbilityPickerForced(boolean showAbilityPickerForced) {
|
||||
this.showAbilityPickerForced = showAbilityPickerForced;
|
||||
}
|
||||
|
||||
public boolean isAllowRequestShowHandCards() {
|
||||
return allowRequestShowHandCards;
|
||||
}
|
||||
|
||||
public void setAllowRequestShowHandCards(boolean allowRequestShowHandCards) {
|
||||
this.allowRequestShowHandCards = allowRequestShowHandCards;
|
||||
}
|
||||
|
||||
public UserSkipPrioritySteps getUserSkipPrioritySteps() {
|
||||
return userSkipPrioritySteps;
|
||||
}
|
||||
|
||||
public void setUserSkipPrioritySteps(UserSkipPrioritySteps userSkipPrioritySteps) {
|
||||
this.userSkipPrioritySteps = userSkipPrioritySteps;
|
||||
}
|
||||
|
||||
public boolean confirmEmptyManaPool() {
|
||||
return confirmEmptyManaPool;
|
||||
}
|
||||
|
||||
public void setConfirmEmptyManaPool(boolean confirmEmptyManaPool) {
|
||||
this.confirmEmptyManaPool = confirmEmptyManaPool;
|
||||
}
|
||||
|
||||
public String getFlagName() {
|
||||
return flagName;
|
||||
}
|
||||
|
||||
public void setFlagName(String flagName) {
|
||||
this.flagName = flagName;
|
||||
}
|
||||
|
||||
public boolean askMoveToGraveOrder() {
|
||||
return askMoveToGraveOrder;
|
||||
}
|
||||
|
||||
public void setAskMoveToGraveOrder(boolean askMoveToGraveOrder) {
|
||||
this.askMoveToGraveOrder = askMoveToGraveOrder;
|
||||
}
|
||||
|
||||
public boolean isManaPoolAutomatic() {
|
||||
return manaPoolAutomatic;
|
||||
}
|
||||
|
||||
public void setManaPoolAutomatic(boolean manaPoolAutomatic) {
|
||||
this.manaPoolAutomatic = manaPoolAutomatic;
|
||||
}
|
||||
|
||||
public boolean isManaPoolAutomaticRestricted() {
|
||||
return manaPoolAutomaticRestricted;
|
||||
}
|
||||
|
||||
public void setManaPoolAutomaticRestricted(boolean manaPoolAutomaticRestricted) {
|
||||
this.manaPoolAutomaticRestricted = manaPoolAutomaticRestricted;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -90,6 +90,7 @@ public class EntwineAbility extends StaticAbility implements OptionalAdditionalM
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActivated() {
|
||||
if (additionalCost != null) {
|
||||
return additionalCost.isActivated();
|
||||
|
|
|
|||
|
|
@ -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<Permanent> 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue