mirror of
https://github.com/correl/mage.git
synced 2024-11-29 03:00:12 +00:00
Equals should be compared with == but not equals()
This commit is contained in:
parent
1f9b51d833
commit
d93061c0bc
175 changed files with 348 additions and 344 deletions
|
@ -1046,8 +1046,8 @@ public class MageFrame extends javax.swing.JFrame implements MageClient {
|
||||||
// close & remove sideboarding or construction pane if open
|
// close & remove sideboarding or construction pane if open
|
||||||
if (window instanceof DeckEditorPane) {
|
if (window instanceof DeckEditorPane) {
|
||||||
DeckEditorPane deckEditorPane = (DeckEditorPane) window;
|
DeckEditorPane deckEditorPane = (DeckEditorPane) window;
|
||||||
if (deckEditorPane.getDeckEditorMode().equals(DeckEditorMode.LIMITED_BUILDING)
|
if (deckEditorPane.getDeckEditorMode() == DeckEditorMode.LIMITED_BUILDING
|
||||||
|| deckEditorPane.getDeckEditorMode().equals(DeckEditorMode.SIDEBOARDING)) {
|
|| deckEditorPane.getDeckEditorMode() == DeckEditorMode.SIDEBOARDING) {
|
||||||
deckEditorPane.removeFrame();
|
deckEditorPane.removeFrame();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -111,7 +111,7 @@ public class BigCard extends JComponent {
|
||||||
image = TransformedImageCache.getResizedImage((BufferedImage)image, getWidth(), getHeight());
|
image = TransformedImageCache.getResizedImage((BufferedImage)image, getWidth(), getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.cardId == null || !enlargeMode.equals(this.enlargeMode) || !this.cardId.equals(cardId)) {
|
if (this.cardId == null || enlargeMode != this.enlargeMode || !this.cardId.equals(cardId)) {
|
||||||
if (this.panel != null) {
|
if (this.panel != null) {
|
||||||
remove(this.panel);
|
remove(this.panel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -192,7 +192,7 @@ public class CardGrid extends javax.swing.JLayeredPane implements MouseListener,
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case RARITY:
|
case RARITY:
|
||||||
if (!cardImg.getOriginal().getRarity().equals(lastCard.getOriginal().getRarity())) {
|
if (cardImg.getOriginal().getRarity() != lastCard.getOriginal().getRarity()) {
|
||||||
curColumn++;
|
curColumn++;
|
||||||
curRow = 0;
|
curRow = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,10 +88,10 @@ public class ChatPanelSeparated extends ChatPanelBasic {
|
||||||
textColor = MESSAGE_COLOR;
|
textColor = MESSAGE_COLOR;
|
||||||
userSeparator = ": ";
|
userSeparator = ": ";
|
||||||
}
|
}
|
||||||
if (color.equals(ChatMessage.MessageColor.ORANGE)) {
|
if (color == ChatMessage.MessageColor.ORANGE) {
|
||||||
textColor = "Orange";
|
textColor = "Orange";
|
||||||
}
|
}
|
||||||
if (color.equals(ChatMessage.MessageColor.YELLOW)) {
|
if (color == ChatMessage.MessageColor.YELLOW) {
|
||||||
textColor = "Yellow";
|
textColor = "Yellow";
|
||||||
}
|
}
|
||||||
if (username != null && !username.isEmpty()) {
|
if (username != null && !username.isEmpty()) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class DialogContainer extends JPanel {
|
||||||
|
|
||||||
if (dialogType == DialogManager.MTGDialogs.MessageDialog) {
|
if (dialogType == DialogManager.MTGDialogs.MessageDialog) {
|
||||||
//backgroundColor = new Color(0, 255, 255, 60);
|
//backgroundColor = new Color(0, 255, 255, 60);
|
||||||
if (params.type.equals(MessageDlg.Types.Warning)) {
|
if (params.type == MessageDlg.Types.Warning) {
|
||||||
backgroundColor = new Color(255, 0, 0, 90);
|
backgroundColor = new Color(255, 0, 0, 90);
|
||||||
} else {
|
} else {
|
||||||
backgroundColor = new Color(0, 0, 0, 90);
|
backgroundColor = new Color(0, 0, 0, 90);
|
||||||
|
|
|
@ -162,7 +162,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
|
|
||||||
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId, boolean revertOrder) {
|
public void loadCards(CardsView showCards, BigCard bigCard, UUID gameId, boolean revertOrder) {
|
||||||
cards.loadCards(showCards, bigCard, gameId, revertOrder);
|
cards.loadCards(showCards, bigCard, gameId, revertOrder);
|
||||||
if (showType.equals(ShowType.GRAVEYARD)) {
|
if (showType == ShowType.GRAVEYARD) {
|
||||||
int qty = qtyCardTypes(showCards);
|
int qty = qtyCardTypes(showCards);
|
||||||
String titel = name + "'s Graveyard (" + showCards.size() + ") - " + qty + ((qty == 1) ? " Card Type" : " Card Types");
|
String titel = name + "'s Graveyard (" + showCards.size() + ") - " + qty + ((qty == 1) ? " Card Type" : " Card Types");
|
||||||
setTitle(titel);
|
setTitle(titel);
|
||||||
|
@ -173,7 +173,7 @@ public class CardInfoWindowDialog extends MageDialog {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void show() {
|
public void show() {
|
||||||
if (showType.equals(ShowType.EXILE)) {
|
if (showType == ShowType.EXILE) {
|
||||||
if (cards == null || cards.getNumberOfCards() == 0) {
|
if (cards == null || cards.getNumberOfCards() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -2958,7 +2958,7 @@ public class PreferencesDialog extends javax.swing.JDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
connection.setProxyType(configProxyType);
|
connection.setProxyType(configProxyType);
|
||||||
if (!configProxyType.equals(ProxyType.NONE)) {
|
if (configProxyType != ProxyType.NONE) {
|
||||||
String host = getCachedValue(KEY_PROXY_ADDRESS, "");
|
String host = getCachedValue(KEY_PROXY_ADDRESS, "");
|
||||||
String port = getCachedValue(KEY_PROXY_PORT, "");
|
String port = getCachedValue(KEY_PROXY_PORT, "");
|
||||||
if (!host.isEmpty() && !port.isEmpty()) {
|
if (!host.isEmpty() && !port.isEmpty()) {
|
||||||
|
|
|
@ -1144,7 +1144,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
PopUpMenuType popupMenuType = null;
|
PopUpMenuType popupMenuType = null;
|
||||||
if (options != null) {
|
if (options != null) {
|
||||||
if (options.containsKey("targetZone")) {
|
if (options.containsKey("targetZone")) {
|
||||||
if (Zone.HAND.equals(options.get("targetZone"))) { // mark selectable target cards in hand
|
if (Zone.HAND == options.get("targetZone")) { // mark selectable target cards in hand
|
||||||
List<UUID> choosen = null;
|
List<UUID> choosen = null;
|
||||||
if (options.containsKey("chosen")) {
|
if (options.containsKey("chosen")) {
|
||||||
choosen = (List<UUID>) options.get("chosen");
|
choosen = (List<UUID>) options.get("chosen");
|
||||||
|
@ -1163,7 +1163,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (options.containsKey("queryType") && PlayerQueryEvent.QueryType.PICK_ABILITY.equals(options.get("queryType"))) {
|
if (options.containsKey("queryType") && PlayerQueryEvent.QueryType.PICK_ABILITY == options.get("queryType")) {
|
||||||
popupMenuType = PopUpMenuType.TRIGGER_ORDER;
|
popupMenuType = PopUpMenuType.TRIGGER_ORDER;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1263,7 +1263,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
||||||
hideAll();
|
hideAll();
|
||||||
ShowCardsDialog showCards = new ShowCardsDialog();
|
ShowCardsDialog showCards = new ShowCardsDialog();
|
||||||
JPopupMenu popupMenu = null;
|
JPopupMenu popupMenu = null;
|
||||||
if (PopUpMenuType.TRIGGER_ORDER.equals(popupMenuType)) {
|
if (PopUpMenuType.TRIGGER_ORDER == popupMenuType) {
|
||||||
popupMenu = popupMenuTriggerOrder;
|
popupMenu = popupMenuTriggerOrder;
|
||||||
}
|
}
|
||||||
showCards.loadCards(title, cards, bigCard, gameId, required, options, popupMenu, getShowCardsEventListener(showCards));
|
showCards.loadCards(title, cards, bigCard, gameId, required, options, popupMenu, getShowCardsEventListener(showCards));
|
||||||
|
|
|
@ -145,7 +145,7 @@ public class CallbackClientImpl implements CallbackClient {
|
||||||
createChatStartMessage(panel);
|
createChatStartMessage(panel);
|
||||||
}
|
}
|
||||||
// send the message to subchat if exists and it's not a game message
|
// send the message to subchat if exists and it's not a game message
|
||||||
if (!message.getMessageType().equals(MessageType.GAME) && panel.getConnectedChat() != null) {
|
if (message.getMessageType() != MessageType.GAME && panel.getConnectedChat() != null) {
|
||||||
panel.getConnectedChat().receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), message.getMessageType(), ChatMessage.MessageColor.BLACK);
|
panel.getConnectedChat().receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), message.getMessageType(), ChatMessage.MessageColor.BLACK);
|
||||||
} else {
|
} else {
|
||||||
panel.receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), message.getMessageType(), message.getColor());
|
panel.receiveMessage(message.getUsername(), message.getMessage(), message.getTime(), message.getMessageType(), message.getColor());
|
||||||
|
@ -157,7 +157,7 @@ public class CallbackClientImpl implements CallbackClient {
|
||||||
case "serverMessage":
|
case "serverMessage":
|
||||||
if (callback.getData() != null) {
|
if (callback.getData() != null) {
|
||||||
ChatMessage message = (ChatMessage) callback.getData();
|
ChatMessage message = (ChatMessage) callback.getData();
|
||||||
if (message.getColor().equals(ChatMessage.MessageColor.RED)) {
|
if (message.getColor() == ChatMessage.MessageColor.RED) {
|
||||||
JOptionPane.showMessageDialog(null, message.getMessage(), "Server message", JOptionPane.WARNING_MESSAGE);
|
JOptionPane.showMessageDialog(null, message.getMessage(), "Server message", JOptionPane.WARNING_MESSAGE);
|
||||||
} else {
|
} else {
|
||||||
JOptionPane.showMessageDialog(null, message.getMessage(), "Server message", JOptionPane.INFORMATION_MESSAGE);
|
JOptionPane.showMessageDialog(null, message.getMessage(), "Server message", JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
|
|
@ -147,7 +147,7 @@ public final class GuiDisplayUtil {
|
||||||
for (String rule : card.getRules()) {
|
for (String rule : card.getRules()) {
|
||||||
textLines.basicTextLength += rule.length();
|
textLines.basicTextLength += rule.length();
|
||||||
}
|
}
|
||||||
if (card.getMageObjectType().equals(MageObjectType.PERMANENT)) {
|
if (card.getMageObjectType() == MageObjectType.PERMANENT) {
|
||||||
if (card.getPairedCard() != null) {
|
if (card.getPairedCard() != null) {
|
||||||
textLines.lines.add("<span color='green'><i>Paired with another creature</i></span>");
|
textLines.lines.add("<span color='green'><i>Paired with another creature</i></span>");
|
||||||
textLines.basicTextLength += 30;
|
textLines.basicTextLength += 30;
|
||||||
|
|
|
@ -65,7 +65,7 @@ public class CardPanelRenderImpl extends CardPanel {
|
||||||
if (a.getRarity() == null || b.getRarity() == null) {
|
if (a.getRarity() == null || b.getRarity() == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (!a.getRarity().equals(b.getRarity())) {
|
if (a.getRarity() != b.getRarity()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (a.getCardNumber() != null && !a.getCardNumber().equals(b.getCardNumber())) {
|
if (a.getCardNumber() != null && !a.getCardNumber().equals(b.getCardNumber())) {
|
||||||
|
|
|
@ -460,7 +460,7 @@ public class CardPluginImpl implements CardPlugin {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
// all attached permanents are grouped separately later
|
// all attached permanents are grouped separately later
|
||||||
if (!type.equals(RowType.attached) && RowType.attached.isType(permanent)) {
|
if (type != RowType.attached && RowType.attached.isType(permanent)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
Stack stack = new Stack();
|
Stack stack = new Stack();
|
||||||
|
|
|
@ -142,7 +142,7 @@ public class MythicspoilerComSource implements CardImageSource {
|
||||||
|
|
||||||
String urlDocument;
|
String urlDocument;
|
||||||
Document doc;
|
Document doc;
|
||||||
if (proxyType.equals(ProxyType.NONE)) {
|
if (proxyType == ProxyType.NONE) {
|
||||||
urlDocument = pageUrl;
|
urlDocument = pageUrl;
|
||||||
doc = Jsoup.connect(urlDocument).get();
|
doc = Jsoup.connect(urlDocument).get();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -332,7 +332,7 @@ public class WizardCardsImageSource implements CardImageSource {
|
||||||
Preferences prefs = MageFrame.getPreferences();
|
Preferences prefs = MageFrame.getPreferences();
|
||||||
Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None"));
|
Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None"));
|
||||||
Document doc;
|
Document doc;
|
||||||
if (proxyType.equals(ProxyType.NONE)) {
|
if (proxyType == ProxyType.NONE) {
|
||||||
doc = Jsoup.connect(urlString).get();
|
doc = Jsoup.connect(urlString).get();
|
||||||
} else {
|
} else {
|
||||||
String proxyServer = prefs.get("proxyAddress", "");
|
String proxyServer = prefs.get("proxyAddress", "");
|
||||||
|
|
|
@ -216,7 +216,7 @@ public final class CardImageUtils {
|
||||||
public static Proxy getProxyFromPreferences() {
|
public static Proxy getProxyFromPreferences() {
|
||||||
Preferences prefs = MageFrame.getPreferences();
|
Preferences prefs = MageFrame.getPreferences();
|
||||||
Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None"));
|
Connection.ProxyType proxyType = Connection.ProxyType.valueByText(prefs.get("proxyType", "None"));
|
||||||
if (!proxyType.equals(ProxyType.NONE)) {
|
if (proxyType != ProxyType.NONE) {
|
||||||
String proxyServer = prefs.get("proxyAddress", "");
|
String proxyServer = prefs.get("proxyAddress", "");
|
||||||
int proxyPort = Integer.parseInt(prefs.get("proxyPort", "0"));
|
int proxyPort = Integer.parseInt(prefs.get("proxyPort", "0"));
|
||||||
return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyServer, proxyPort));
|
return new Proxy(Proxy.Type.HTTP, new InetSocketAddress(proxyServer, proxyPort));
|
||||||
|
|
|
@ -167,7 +167,7 @@ class MomirEffect extends OneShotEffect {
|
||||||
while (token.getName().isEmpty() && !options.isEmpty()) {
|
while (token.getName().isEmpty() && !options.isEmpty()) {
|
||||||
int index = RandomUtil.nextInt(options.size());
|
int index = RandomUtil.nextInt(options.size());
|
||||||
ExpansionSet expansionSet = Sets.findSet(options.get(index).getSetCode());
|
ExpansionSet expansionSet = Sets.findSet(options.get(index).getSetCode());
|
||||||
if (expansionSet == null || expansionSet.getSetType().equals(SetType.CUSTOM_SET)) {
|
if (expansionSet == null || expansionSet.getSetType() == SetType.CUSTOM_SET) {
|
||||||
options.remove(index);
|
options.remove(index);
|
||||||
} else {
|
} else {
|
||||||
Card card = options.get(index).getCard();
|
Card card = options.get(index).getCard();
|
||||||
|
|
|
@ -1372,7 +1372,7 @@ public class ComputerPlayer6 extends ComputerPlayer /*implements Player*/ {
|
||||||
|
|
||||||
private boolean checkForRepeatedAction(Game sim, SimulationNode2 node, Ability action, UUID playerId) {
|
private boolean checkForRepeatedAction(Game sim, SimulationNode2 node, Ability action, UUID playerId) {
|
||||||
// pass or casting two times a spell multiple times on hand is ok
|
// pass or casting two times a spell multiple times on hand is ok
|
||||||
if (action instanceof PassAbility || action instanceof SpellAbility || action.getAbilityType().equals(AbilityType.MANA)) {
|
if (action instanceof PassAbility || action instanceof SpellAbility || action.getAbilityType() == AbilityType.MANA) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
int newVal = GameStateEvaluator2.evaluate(playerId, sim);
|
int newVal = GameStateEvaluator2.evaluate(playerId, sim);
|
||||||
|
|
|
@ -124,7 +124,7 @@ public class SimulatedPlayer2 extends ComputerPlayer {
|
||||||
List<Ability> playables = game.getPlayer(playerId).getPlayable(game, isSimulatedPlayer);
|
List<Ability> playables = game.getPlayer(playerId).getPlayable(game, isSimulatedPlayer);
|
||||||
playables = filterAbilities(game, playables, suggested);
|
playables = filterAbilities(game, playables, suggested);
|
||||||
for (Ability ability : playables) {
|
for (Ability ability : playables) {
|
||||||
if (ability.getAbilityType().equals(AbilityType.MANA)) {
|
if (ability.getAbilityType() == AbilityType.MANA) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
List<Ability> options = game.getPlayer(playerId).getPlayableOptions(ability, game);
|
List<Ability> options = game.getPlayer(playerId).getPlayableOptions(ability, game);
|
||||||
|
|
|
@ -91,7 +91,7 @@ public final class ArtificialScoringSystem {
|
||||||
Outcome outcome = effect.getOutcome();
|
Outcome outcome = effect.getOutcome();
|
||||||
if (outcome.isGood()) {
|
if (outcome.isGood()) {
|
||||||
enchantments++;
|
enchantments++;
|
||||||
} else if (!outcome.equals(Outcome.Detriment)) {
|
} else if (outcome != Outcome.Detriment) {
|
||||||
enchantments--;
|
enchantments--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ public class OutcomeOptimizer extends BaseTreeOptimizer {
|
||||||
public void filter(Game game, List<Ability> actions) {
|
public void filter(Game game, List<Ability> actions) {
|
||||||
for (Ability ability : actions) {
|
for (Ability ability : actions) {
|
||||||
for (Effect effect: ability.getEffects()) {
|
for (Effect effect: ability.getEffects()) {
|
||||||
if (effect.getOutcome().equals(Outcome.AIDontUseIt)) {
|
if (effect.getOutcome() == Outcome.AIDontUseIt) {
|
||||||
removeAbility(ability);
|
removeAbility(ability);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,7 +230,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.getOriginalTarget() instanceof TargetCardInHand
|
if (target.getOriginalTarget() instanceof TargetCardInHand
|
||||||
|| (target.getZone().equals(Zone.HAND) && (target.getOriginalTarget() instanceof TargetCard))) {
|
|| (target.getZone() == Zone.HAND && (target.getOriginalTarget() instanceof TargetCard))) {
|
||||||
List<Card> cards = new ArrayList<>();
|
List<Card> cards = new ArrayList<>();
|
||||||
for (UUID cardId : target.possibleTargets(sourceId, this.getId(), game)) {
|
for (UUID cardId : target.possibleTargets(sourceId, this.getId(), game)) {
|
||||||
Card card = game.getCard(cardId);
|
Card card = game.getCard(cardId);
|
||||||
|
@ -759,7 +759,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
}
|
}
|
||||||
UUID opponentId = game.getOpponents(playerId).iterator().next();
|
UUID opponentId = game.getOpponents(playerId).iterator().next();
|
||||||
if (target.getOriginalTarget() instanceof TargetCreatureOrPlayerAmount) {
|
if (target.getOriginalTarget() instanceof TargetCreatureOrPlayerAmount) {
|
||||||
if (outcome.equals(Outcome.Damage) && game.getPlayer(opponentId).getLife() <= target.getAmountRemaining()) {
|
if (outcome == Outcome.Damage && game.getPlayer(opponentId).getLife() <= target.getAmountRemaining()) {
|
||||||
target.addTarget(opponentId, target.getAmountRemaining(), source, game);
|
target.addTarget(opponentId, target.getAmountRemaining(), source, game);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -1265,7 +1265,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
// Be proactive! Always use abilities, the evaluation function will decide if it's good or not
|
// Be proactive! Always use abilities, the evaluation function will decide if it's good or not
|
||||||
// Otherwise some abilities won't be used by AI like LoseTargetEffect that has "bad" outcome
|
// Otherwise some abilities won't be used by AI like LoseTargetEffect that has "bad" outcome
|
||||||
// but still is good when targets opponent
|
// but still is good when targets opponent
|
||||||
return !outcome.equals(Outcome.AIDontUseIt); // Added for Desecration Demon sacrifice ability
|
return outcome != Outcome.AIDontUseIt; // Added for Desecration Demon sacrifice ability
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1276,7 +1276,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
chooseCreatureType(outcome, choice, game);
|
chooseCreatureType(outcome, choice, game);
|
||||||
}
|
}
|
||||||
// choose the correct color to pay a spell
|
// choose the correct color to pay a spell
|
||||||
if (outcome.equals(Outcome.PutManaInPool) && choice instanceof ChoiceColor && currentUnpaidMana != null) {
|
if (outcome == Outcome.PutManaInPool && choice instanceof ChoiceColor && currentUnpaidMana != null) {
|
||||||
if (currentUnpaidMana.containsColor(ColoredManaSymbol.W) && choice.getChoices().contains("White")) {
|
if (currentUnpaidMana.containsColor(ColoredManaSymbol.W) && choice.getChoices().contains("White")) {
|
||||||
choice.setChoice("White");
|
choice.setChoice("White");
|
||||||
return true;
|
return true;
|
||||||
|
@ -1319,7 +1319,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean chooseCreatureType(Outcome outcome, Choice choice, Game game) {
|
protected boolean chooseCreatureType(Outcome outcome, Choice choice, Game game) {
|
||||||
if (outcome.equals(Outcome.Detriment)) {
|
if (outcome == Outcome.Detriment) {
|
||||||
// choose a creature type of opponent on battlefield or graveyard
|
// choose a creature type of opponent on battlefield or graveyard
|
||||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(this.getId(), game)) {
|
for (Permanent permanent : game.getBattlefield().getActivePermanents(this.getId(), game)) {
|
||||||
if (game.getOpponents(this.getId()).contains(permanent.getControllerId())
|
if (game.getOpponents(this.getId()).contains(permanent.getControllerId())
|
||||||
|
@ -1391,7 +1391,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
// We don't have any valid target to choose so stop choosing
|
// We don't have any valid target to choose so stop choosing
|
||||||
return target.getTargets().size() < target.getNumberOfTargets();
|
return target.getTargets().size() < target.getNumberOfTargets();
|
||||||
}
|
}
|
||||||
if (outcome.equals(Outcome.Neutral) && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) {
|
if (outcome == Outcome.Neutral && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1415,7 +1415,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
// We don't have any valid target to choose so stop choosing
|
// We don't have any valid target to choose so stop choosing
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (outcome.equals(Outcome.Neutral) && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) {
|
if (outcome == Outcome.Neutral && target.getTargets().size() > target.getNumberOfTargets() + (target.getMaxNumberOfTargets() - target.getNumberOfTargets()) / 2) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2076,7 +2076,7 @@ public class ComputerPlayer extends PlayerImpl implements Player {
|
||||||
for (Card card : this.playableInstant) {
|
for (Card card : this.playableInstant) {
|
||||||
if (card.getSpellAbility().canActivate(playerId, game)) {
|
if (card.getSpellAbility().canActivate(playerId, game)) {
|
||||||
for (Effect effect : card.getSpellAbility().getEffects()) {
|
for (Effect effect : card.getSpellAbility().getEffects()) {
|
||||||
if (effect.getOutcome().equals(Outcome.DestroyPermanent) || effect.getOutcome().equals(Outcome.ReturnToHand)) {
|
if (effect.getOutcome() == Outcome.DestroyPermanent || effect.getOutcome() == Outcome.ReturnToHand) {
|
||||||
if (card.getSpellAbility().getTargets().get(0).canTarget(creatureId, card.getSpellAbility(), game)) {
|
if (card.getSpellAbility().getTargets().get(0).canTarget(creatureId, card.getSpellAbility(), game)) {
|
||||||
if (this.activateAbility(card.getSpellAbility(), game)) {
|
if (this.activateAbility(card.getSpellAbility(), game)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -83,11 +83,11 @@ public final class RateCard {
|
||||||
|
|
||||||
for (Ability ability : card.getAbilities()) {
|
for (Ability ability : card.getAbilities()) {
|
||||||
for (Effect effect : ability.getEffects()) {
|
for (Effect effect : ability.getEffects()) {
|
||||||
if (effect.getOutcome().equals(Outcome.Removal)) {
|
if (effect.getOutcome() == Outcome.Removal) {
|
||||||
log.debug("Found removal: " + card.getName());
|
log.debug("Found removal: " + card.getName());
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (effect.getOutcome().equals(Outcome.Damage)) {
|
if (effect.getOutcome() == Outcome.Damage) {
|
||||||
if (effect instanceof DamageTargetEffect) {
|
if (effect instanceof DamageTargetEffect) {
|
||||||
DamageTargetEffect damageEffect = (DamageTargetEffect) effect;
|
DamageTargetEffect damageEffect = (DamageTargetEffect) effect;
|
||||||
if (damageEffect.getAmount() > 1) {
|
if (damageEffect.getAmount() > 1) {
|
||||||
|
@ -100,7 +100,7 @@ public final class RateCard {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (effect.getOutcome().equals(Outcome.DestroyPermanent)) {
|
if (effect.getOutcome() == Outcome.DestroyPermanent) {
|
||||||
for (Target target : ability.getTargets()) {
|
for (Target target : ability.getTargets()) {
|
||||||
if (target instanceof TargetCreaturePermanent) {
|
if (target instanceof TargetCreaturePermanent) {
|
||||||
log.debug("Found destroyer: " + card.getName());
|
log.debug("Found destroyer: " + card.getName());
|
||||||
|
|
|
@ -297,7 +297,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean choose(Outcome outcome, Choice choice, Game game) {
|
public boolean choose(Outcome outcome, Choice choice, Game game) {
|
||||||
if (Outcome.PutManaInPool.equals(outcome)) {
|
if (Outcome.PutManaInPool == outcome) {
|
||||||
if (currentlyUnpaidMana != null
|
if (currentlyUnpaidMana != null
|
||||||
&& ManaUtil.tryToAutoSelectAManaColor(choice, currentlyUnpaidMana)) {
|
&& ManaUtil.tryToAutoSelectAManaColor(choice, currentlyUnpaidMana)) {
|
||||||
return true;
|
return true;
|
||||||
|
@ -593,12 +593,12 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (getJustActivatedType() != null && !holdingPriority) {
|
if (getJustActivatedType() != null && !holdingPriority) {
|
||||||
if (controllingPlayer.getUserData().isPassPriorityCast() && getJustActivatedType().equals(AbilityType.SPELL)) {
|
if (controllingPlayer.getUserData().isPassPriorityCast() && getJustActivatedType() == AbilityType.SPELL) {
|
||||||
setJustActivatedType(null);
|
setJustActivatedType(null);
|
||||||
pass(game);
|
pass(game);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (controllingPlayer.getUserData().isPassPriorityActivation() && getJustActivatedType().equals(AbilityType.ACTIVATED)) {
|
if (controllingPlayer.getUserData().isPassPriorityActivation() && getJustActivatedType() == AbilityType.ACTIVATED) {
|
||||||
setJustActivatedType(null);
|
setJustActivatedType(null);
|
||||||
pass(game);
|
pass(game);
|
||||||
return false;
|
return false;
|
||||||
|
@ -612,7 +612,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
if (passedUntilEndStepBeforeMyTurn) {
|
if (passedUntilEndStepBeforeMyTurn) {
|
||||||
|
|
||||||
if (!game.getTurn().getStepType().equals(PhaseStep.END_TURN)) {
|
if (game.getTurn().getStepType() != PhaseStep.END_TURN) {
|
||||||
if (passWithManaPoolCheck(game)) {
|
if (passWithManaPoolCheck(game)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -634,7 +634,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (passedUntilNextMain) {
|
if (passedUntilNextMain) {
|
||||||
if (game.getTurn().getStepType().equals(PhaseStep.POSTCOMBAT_MAIN) || game.getTurn().getStepType().equals(PhaseStep.PRECOMBAT_MAIN)) {
|
if (game.getTurn().getStepType() == PhaseStep.POSTCOMBAT_MAIN || game.getTurn().getStepType() == PhaseStep.PRECOMBAT_MAIN) {
|
||||||
// it's a main phase
|
// it's a main phase
|
||||||
if (!skippedAtLeastOnce || (!playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllMainPhases())) {
|
if (!skippedAtLeastOnce || (!playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllMainPhases())) {
|
||||||
skippedAtLeastOnce = true;
|
skippedAtLeastOnce = true;
|
||||||
|
@ -653,7 +653,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (passedUntilEndOfTurn) {
|
if (passedUntilEndOfTurn) {
|
||||||
if (game.getTurn().getStepType().equals(PhaseStep.END_TURN)) {
|
if (game.getTurn().getStepType() == PhaseStep.END_TURN) {
|
||||||
// It's end of turn phase
|
// It's end of turn phase
|
||||||
if (!skippedAtLeastOnce || (playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllEndPhases())) {
|
if (!skippedAtLeastOnce || (playerId.equals(game.getActivePlayerId()) && !this.getUserData().getUserSkipPrioritySteps().isStopOnAllEndPhases())) {
|
||||||
skippedAtLeastOnce = true;
|
skippedAtLeastOnce = true;
|
||||||
|
@ -1376,7 +1376,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!source.getAbilityType().equals(AbilityType.TRIGGERED)) {
|
if (source.getAbilityType() != AbilityType.TRIGGERED) {
|
||||||
done = true;
|
done = true;
|
||||||
}
|
}
|
||||||
if (!canRespond()) {
|
if (!canRespond()) {
|
||||||
|
@ -1516,7 +1516,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRequestAutoAnswer(PlayerAction playerAction, Game game, Object data) {
|
private void setRequestAutoAnswer(PlayerAction playerAction, Game game, Object data) {
|
||||||
if (playerAction.equals(REQUEST_AUTO_ANSWER_RESET_ALL)) {
|
if (playerAction == REQUEST_AUTO_ANSWER_RESET_ALL) {
|
||||||
requestAutoAnswerId.clear();
|
requestAutoAnswerId.clear();
|
||||||
requestAutoAnswerText.clear();
|
requestAutoAnswerText.clear();
|
||||||
return;
|
return;
|
||||||
|
@ -1541,7 +1541,7 @@ public class HumanPlayer extends PlayerImpl {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setTriggerAutoOrder(PlayerAction playerAction, Game game, Object data) {
|
private void setTriggerAutoOrder(PlayerAction playerAction, Game game, Object data) {
|
||||||
if (playerAction.equals(TRIGGER_AUTO_ORDER_RESET_ALL)) {
|
if (playerAction == TRIGGER_AUTO_ORDER_RESET_ALL) {
|
||||||
triggerAutoOrderAbilityFirst.clear();
|
triggerAutoOrderAbilityFirst.clear();
|
||||||
triggerAutoOrderAbilityLast.clear();
|
triggerAutoOrderAbilityLast.clear();
|
||||||
triggerAutoOrderNameFirst.clear();
|
triggerAutoOrderNameFirst.clear();
|
||||||
|
|
|
@ -80,42 +80,44 @@ public class AAT1 extends CardImpl {
|
||||||
public AAT1 copy() {
|
public AAT1 copy() {
|
||||||
return new AAT1(this);
|
return new AAT1(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class AAT1TriggeredAbility extends TriggeredAbilityImpl {
|
private static class AAT1TriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
public AAT1TriggeredAbility(Effect effect) {
|
public AAT1TriggeredAbility(Effect effect) {
|
||||||
super(Zone.BATTLEFIELD, effect);
|
super(Zone.BATTLEFIELD, effect);
|
||||||
}
|
|
||||||
|
|
||||||
public AAT1TriggeredAbility(AAT1TriggeredAbility ability) {
|
|
||||||
super(ability);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
|
||||||
return event.getType() == GameEvent.EventType.COUNTER_REMOVED;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
|
||||||
Card card = game.getCard(event.getTargetId());
|
|
||||||
if (event.getPlayerId().equals(game.getControllerId(sourceId))
|
|
||||||
&& card.isCreature()
|
|
||||||
&& game.getState().getZone(card.getId()) == Zone.GRAVEYARD
|
|
||||||
&& event.getData().equals("repair")) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
public AAT1TriggeredAbility(AAT1TriggeredAbility ability) {
|
||||||
public String getRule() {
|
super(ability);
|
||||||
return "Whenever a repair counter is removed from a creature card in your graveyard " + super.getRule();
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AAT1TriggeredAbility copy() {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return new AAT1TriggeredAbility(this);
|
return event.getType() == GameEvent.EventType.COUNTER_REMOVED;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
Card card = game.getCard(event.getTargetId());
|
||||||
|
if (event.getPlayerId().equals(game.getControllerId(sourceId))
|
||||||
|
&& card.isCreature()
|
||||||
|
&& game.getState().getZone(card.getId()) == Zone.GRAVEYARD
|
||||||
|
&& event.getData().equals("repair")) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule() {
|
||||||
|
return "Whenever a repair counter is removed from a creature card in your graveyard " + super.getRule();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AAT1TriggeredAbility copy() {
|
||||||
|
return new AAT1TriggeredAbility(this);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,7 @@ class AlhammarretsArchiveEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(GameEvent.EventType.GAIN_LIFE);
|
return event.getType() == GameEvent.EventType.GAIN_LIFE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -100,7 +100,7 @@ class CantBeBlockedByMoreThanOneAttachedEffect extends ContinuousEffectImpl {
|
||||||
super(duration, Outcome.Benefit);
|
super(duration, Outcome.Benefit);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.attachmentType = attachmentType;
|
this.attachmentType = attachmentType;
|
||||||
staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted" : "Equipped") + " creature can't be blocked by more than " + CardUtil.numberToText(amount) + " creature" + (amount==1 ?"":"s");
|
staticText = (attachmentType == AttachmentType.AURA ? "Enchanted" : "Equipped") + " creature can't be blocked by more than " + CardUtil.numberToText(amount) + " creature" + (amount==1 ?"":"s");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CantBeBlockedByMoreThanOneAttachedEffect(final CantBeBlockedByMoreThanOneAttachedEffect effect) {
|
public CantBeBlockedByMoreThanOneAttachedEffect(final CantBeBlockedByMoreThanOneAttachedEffect effect) {
|
||||||
|
|
|
@ -135,7 +135,7 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(GameEvent.EventType.ZONE_CHANGE);
|
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -96,7 +96,7 @@ class AnthemOfRakdosHellbentEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
return event.getType() == GameEvent.EventType.DAMAGE_CREATURE
|
||||||
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER);
|
|| event.getType() == GameEvent.EventType.DAMAGE_PLAYER;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -117,7 +117,7 @@ class AquamorphEntityReplacementEffect extends ReplacementEffectImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (event.getType().equals(EventType.TURNFACEUP)) {
|
if (event.getType() == EventType.TURNFACEUP) {
|
||||||
if (event.getTargetId().equals(source.getSourceId())) {
|
if (event.getTargetId().equals(source.getSourceId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,7 +136,7 @@ class AthreosGodOfPassageReturnEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (opponent == null || !paid) {
|
if (opponent == null || !paid) {
|
||||||
if (game.getState().getZone(creature.getId()).equals(Zone.GRAVEYARD)) {
|
if (game.getState().getZone(creature.getId()) == Zone.GRAVEYARD) {
|
||||||
controller.moveCards(game.getCard(creatureId), Zone.HAND, source, game);
|
controller.moveCards(game.getCard(creatureId), Zone.HAND, source, game);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ class AthreosDiesCreatureTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||||
if (zEvent.getFromZone().equals(Zone.BATTLEFIELD) && zEvent.getToZone().equals(Zone.GRAVEYARD)) {
|
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||||
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
|
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
|
||||||
for (Effect effect : this.getEffects()) {
|
for (Effect effect : this.getEffects()) {
|
||||||
|
|
|
@ -83,7 +83,7 @@ class BurningVengeanceOnCastAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
return event.getPlayerId().equals(controllerId) && event.getZone().equals(Zone.GRAVEYARD);
|
return event.getPlayerId().equals(controllerId) && event.getZone() == Zone.GRAVEYARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -273,7 +273,7 @@ class CelestialDawnSpendColorlessManaEffect extends AsThoughEffectImpl implement
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
|
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
|
||||||
if (mana.getWhite() == 0 && !ManaType.COLORLESS.equals(manaType)) {
|
if (mana.getWhite() == 0 && ManaType.COLORLESS != manaType) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return manaType;
|
return manaType;
|
||||||
|
|
|
@ -115,7 +115,7 @@ class ChainsOfMephistophelesReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getPhase().getStep().getType().equals(PhaseStep.DRAW)) {
|
if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getPhase().getStep().getType() == PhaseStep.DRAW) {
|
||||||
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep");
|
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep");
|
||||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -138,11 +138,11 @@ class CoffinQueenDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (GameEvent.EventType.LOST_CONTROL.equals(event.getType())
|
if (EventType.LOST_CONTROL == event.getType()
|
||||||
&& event.getSourceId().equals(getSourceId())) {
|
&& event.getSourceId().equals(getSourceId())) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return GameEvent.EventType.UNTAPPED.equals(event.getType())
|
return EventType.UNTAPPED == event.getType()
|
||||||
&& event.getTargetId() != null && event.getTargetId().equals(getSourceId());
|
&& event.getTargetId() != null && event.getTargetId().equals(getSourceId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -218,7 +218,7 @@ class DanceOfTheDeadAttachEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Card card = game.getCard(source.getFirstTarget());
|
Card card = game.getCard(source.getFirstTarget());
|
||||||
if (card != null && game.getState().getZone(source.getFirstTarget()).equals(Zone.GRAVEYARD)) {
|
if (card != null && game.getState().getZone(source.getFirstTarget()) == Zone.GRAVEYARD) {
|
||||||
// Card have no attachedTo attribute yet so write ref only to enchantment now
|
// Card have no attachedTo attribute yet so write ref only to enchantment now
|
||||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||||
if (enchantment != null) {
|
if (enchantment != null) {
|
||||||
|
|
|
@ -76,63 +76,65 @@ public class DiviningWitch extends CardImpl {
|
||||||
public DiviningWitch copy() {
|
public DiviningWitch copy() {
|
||||||
return new DiviningWitch(this);
|
return new DiviningWitch(this);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
class DiviningWitchEffect extends OneShotEffect {
|
private static class DiviningWitchEffect extends OneShotEffect {
|
||||||
|
|
||||||
DiviningWitchEffect() {
|
DiviningWitchEffect() {
|
||||||
super(Outcome.Benefit);
|
super(Outcome.Benefit);
|
||||||
this.staticText = "Name a card. Exile the top six cards of your library. Reveal cards from the top of your library until you reveal the named card, then put that card into your hand. Exile all other cards revealed this way";
|
this.staticText = "Name a card. Exile the top six cards of your library. Reveal cards from the top of your library until you reveal the named card, then put that card into your hand. Exile all other cards revealed this way";
|
||||||
}
|
}
|
||||||
|
|
||||||
DiviningWitchEffect(final DiviningWitchEffect effect) {
|
DiviningWitchEffect(final DiviningWitchEffect effect) {
|
||||||
super(effect);
|
super(effect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public DiviningWitchEffect copy() {
|
public DiviningWitchEffect copy() {
|
||||||
return new DiviningWitchEffect(this);
|
return new DiviningWitchEffect(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = game.getObject(source.getSourceId());
|
MageObject sourceObject = game.getObject(source.getSourceId());
|
||||||
if (controller != null && sourceObject != null) {
|
if (controller != null && sourceObject != null) {
|
||||||
// Name a card.
|
// Name a card.
|
||||||
Choice choice = new ChoiceImpl();
|
Choice choice = new ChoiceImpl();
|
||||||
choice.setChoices(CardRepository.instance.getNames());
|
choice.setChoices(CardRepository.instance.getNames());
|
||||||
while (!controller.choose(Outcome.Benefit, choice, game)) {
|
while (!controller.choose(Outcome.Benefit, choice, game)) {
|
||||||
if (!controller.canRespond()) {
|
if (!controller.canRespond()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
}
|
|
||||||
String name = choice.getChoice();
|
|
||||||
game.informPlayers("Card named: " + name);
|
|
||||||
|
|
||||||
// Exile the top six cards of your library,
|
|
||||||
controller.moveCards(controller.getLibrary().getTopCards(game, 6), Zone.EXILED, source, game);
|
|
||||||
|
|
||||||
// then reveal cards from the top of your library until you reveal the named card.
|
|
||||||
Cards cardsToReaveal = new CardsImpl();
|
|
||||||
Card cardToHand = null;
|
|
||||||
while (controller.getLibrary().hasCards()) {
|
|
||||||
Card card = controller.getLibrary().removeFromTop(game);
|
|
||||||
if (card != null) {
|
|
||||||
cardsToReaveal.add(card);
|
|
||||||
// Put that card into your hand
|
|
||||||
if (card.getName().equals(name)) {
|
|
||||||
cardToHand = card;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
String name = choice.getChoice();
|
||||||
|
game.informPlayers("Card named: " + name);
|
||||||
|
|
||||||
|
// Exile the top six cards of your library,
|
||||||
|
controller.moveCards(controller.getLibrary().getTopCards(game, 6), Zone.EXILED, source, game);
|
||||||
|
|
||||||
|
// then reveal cards from the top of your library until you reveal the named card.
|
||||||
|
Cards cardsToReaveal = new CardsImpl();
|
||||||
|
Card cardToHand = null;
|
||||||
|
while (controller.getLibrary().hasCards()) {
|
||||||
|
Card card = controller.getLibrary().removeFromTop(game);
|
||||||
|
if (card != null) {
|
||||||
|
cardsToReaveal.add(card);
|
||||||
|
// Put that card into your hand
|
||||||
|
if (card.getName().equals(name)) {
|
||||||
|
cardToHand = card;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
controller.moveCards(cardToHand, Zone.HAND, source, game);
|
||||||
|
controller.revealCards(sourceObject.getIdName(), cardsToReaveal, game);
|
||||||
|
cardsToReaveal.remove(cardToHand);
|
||||||
|
controller.moveCards(cardsToReaveal, Zone.EXILED, source, game);
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
controller.moveCards(cardToHand, Zone.HAND, source, game);
|
return false;
|
||||||
controller.revealCards(sourceObject.getIdName(), cardsToReaveal, game);
|
|
||||||
cardsToReaveal.remove(cardToHand);
|
|
||||||
controller.moveCards(cardsToReaveal, Zone.EXILED, source, game);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ class EliteArcanistCopyEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) {
|
if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) {
|
||||||
Card imprintedInstant = game.getCard(sourcePermanent.getImprinted().get(0));
|
Card imprintedInstant = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||||
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()).equals(Zone.EXILED)) {
|
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()) == Zone.EXILED) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
||||||
|
|
|
@ -145,7 +145,7 @@ class EpiphanyAtTheDrownyardEffect extends OneShotEffect {
|
||||||
pile2Zone = Zone.GRAVEYARD;
|
pile2Zone = Zone.GRAVEYARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(sourceObject.getLogName() + ": Pile 1, going to ").append(pile1Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(": ");
|
StringBuilder sb = new StringBuilder(sourceObject.getLogName() + ": Pile 1, going to ").append(pile1Zone == Zone.HAND ? "Hand" : "Graveyard").append(": ");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (UUID cardUuid : pile1CardsIds) {
|
for (UUID cardUuid : pile1CardsIds) {
|
||||||
i++;
|
i++;
|
||||||
|
@ -160,7 +160,7 @@ class EpiphanyAtTheDrownyardEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
game.informPlayers(sb.toString());
|
game.informPlayers(sb.toString());
|
||||||
|
|
||||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(':');
|
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone == Zone.HAND ? "Hand" : "Graveyard").append(':');
|
||||||
i = 0;
|
i = 0;
|
||||||
for (UUID cardUuid : pile2CardsIds) {
|
for (UUID cardUuid : pile2CardsIds) {
|
||||||
Card card = game.getCard(cardUuid);
|
Card card = game.getCard(cardUuid);
|
||||||
|
|
|
@ -125,7 +125,7 @@ class FactOrFictionEffect extends OneShotEffect {
|
||||||
pile2Zone = Zone.GRAVEYARD;
|
pile2Zone = Zone.GRAVEYARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder("Pile 1, going to ").append(pile1Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(": ");
|
StringBuilder sb = new StringBuilder("Pile 1, going to ").append(pile1Zone == Zone.HAND ? "Hand" : "Graveyard").append(": ");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (Card card : pile1) {
|
for (Card card : pile1) {
|
||||||
i++;
|
i++;
|
||||||
|
|
|
@ -136,7 +136,7 @@ class GiftOfImmortalityReturnEnchantmentEffect extends OneShotEffect {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Card aura = game.getCard(source.getSourceId());
|
Card aura = game.getCard(source.getSourceId());
|
||||||
if (aura != null && game.getState().getZone(aura.getId()).equals(Zone.GRAVEYARD)) {
|
if (aura != null && game.getState().getZone(aura.getId()) == Zone.GRAVEYARD) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (controller != null && creature != null) {
|
if (controller != null && creature != null) {
|
||||||
|
|
|
@ -270,7 +270,7 @@ class GontiLordOfLuxuryLookEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller != null && sourceObject != null) {
|
if (controller != null && sourceObject != null) {
|
||||||
|
|
|
@ -165,7 +165,7 @@ class GracefulReprieveDelayedEffect extends OneShotEffect {
|
||||||
Player player = game.getPlayer(permanent.getOwnerId());
|
Player player = game.getPlayer(permanent.getOwnerId());
|
||||||
if (player != null) {
|
if (player != null) {
|
||||||
Card card = game.getCard(target);
|
Card card = game.getCard(target);
|
||||||
if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) {
|
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
||||||
return card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), player.getId());
|
return card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), player.getId());
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -88,7 +88,7 @@ class GrafdiggersCageEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return EventType.ZONE_CHANGE.equals(event.getType());
|
return EventType.ZONE_CHANGE == event.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -82,7 +82,7 @@ class GreaterHarvesterAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return EventType.DAMAGED_PLAYER.equals(event.getType());
|
return EventType.DAMAGED_PLAYER == event.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -167,7 +167,7 @@ class GrimoireThiefLookEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller != null && sourceObject != null) {
|
if (controller != null && sourceObject != null) {
|
||||||
|
|
|
@ -150,8 +150,8 @@ class GruesomeEncoreReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
return event.getTargetId().equals(source.getFirstTarget())
|
return event.getTargetId().equals(source.getFirstTarget())
|
||||||
&& ((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)
|
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD
|
||||||
&& !((ZoneChangeEvent) event).getToZone().equals(Zone.EXILED);
|
&& ((ZoneChangeEvent) event).getToZone() != Zone.EXILED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -117,7 +117,7 @@ class HavengulLichPlayEffect extends AsThoughEffectImpl {
|
||||||
if (targetId != null) {
|
if (targetId != null) {
|
||||||
return targetId.equals(objectId)
|
return targetId.equals(objectId)
|
||||||
&& source.getControllerId().equals(affectedControllerId)
|
&& source.getControllerId().equals(affectedControllerId)
|
||||||
&& Zone.GRAVEYARD.equals(game.getState().getZone(objectId));
|
&& Zone.GRAVEYARD == game.getState().getZone(objectId);
|
||||||
} else {
|
} else {
|
||||||
// the target card has changed zone meanwhile, so the effect is no longer needed
|
// the target card has changed zone meanwhile, so the effect is no longer needed
|
||||||
discard();
|
discard();
|
||||||
|
|
|
@ -110,7 +110,7 @@ class HomuraReturnFlippedSourceEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Card sourceCard = game.getCard(source.getSourceId());
|
Card sourceCard = game.getCard(source.getSourceId());
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (sourceCard != null && controller != null && game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) {
|
if (sourceCard != null && controller != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
|
||||||
ContinuousEffect effect = new ConditionalContinuousEffect(new CopyTokenEffect(flipToken), FlippedCondition.getInstance(), "");
|
ContinuousEffect effect = new ConditionalContinuousEffect(new CopyTokenEffect(flipToken), FlippedCondition.getInstance(), "");
|
||||||
game.addEffect(effect, source);
|
game.addEffect(effect, source);
|
||||||
controller.moveCards(sourceCard, Zone.BATTLEFIELD, source, game);
|
controller.moveCards(sourceCard, Zone.BATTLEFIELD, source, game);
|
||||||
|
|
|
@ -95,7 +95,7 @@ class HumilityEffect extends ContinuousEffectImpl {
|
||||||
permanent.removeAllAbilities(source.getSourceId(), game);
|
permanent.removeAllAbilities(source.getSourceId(), game);
|
||||||
break;
|
break;
|
||||||
case PTChangingEffects_7:
|
case PTChangingEffects_7:
|
||||||
if (sublayer.equals(SubLayer.SetPT_7b)) {
|
if (sublayer == SubLayer.SetPT_7b) {
|
||||||
permanent.getPower().setValue(1);
|
permanent.getPower().setValue(1);
|
||||||
permanent.getToughness().setValue(1);
|
permanent.getToughness().setValue(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,7 @@ class IntetTheDreamerCastEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller != null && sourceObject != null) {
|
if (controller != null && sourceObject != null) {
|
||||||
|
@ -200,7 +200,7 @@ class IntetTheDreamerLookEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
if (affectedControllerId.equals(source.getControllerId()) && game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
MageObject sourceObject = source.getSourceObject(game);
|
MageObject sourceObject = source.getSourceObject(game);
|
||||||
if (controller != null && sourceObject != null) {
|
if (controller != null && sourceObject != null) {
|
||||||
|
|
|
@ -107,7 +107,7 @@ class IslandSanctuaryEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
return source.getControllerId().equals(event.getPlayerId()) && game.getTurn().getStepType().equals(PhaseStep.DRAW);
|
return source.getControllerId().equals(event.getPlayerId()) && game.getTurn().getStepType() == PhaseStep.DRAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -154,7 +154,7 @@ class IsochronScepterCopyEffect extends OneShotEffect {
|
||||||
Permanent scepter = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
Permanent scepter = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||||
if (scepter != null && scepter.getImprinted() != null && !scepter.getImprinted().isEmpty()) {
|
if (scepter != null && scepter.getImprinted() != null && !scepter.getImprinted().isEmpty()) {
|
||||||
Card imprintedInstant = game.getCard(scepter.getImprinted().get(0));
|
Card imprintedInstant = game.getCard(scepter.getImprinted().get(0));
|
||||||
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()).equals(Zone.EXILED)) {
|
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()) == Zone.EXILED) {
|
||||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
||||||
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
||||||
if (copiedCard != null) {
|
if (copiedCard != null) {
|
||||||
|
|
|
@ -141,7 +141,7 @@ class KalitasTraitorOfGhetEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(GameEvent.EventType.ZONE_CHANGE);
|
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -94,7 +94,7 @@ class KembasLegionEffect extends ContinuousEffectImpl {
|
||||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||||
if (permanent != null && !permanent.getAttachments().isEmpty()) {
|
if (permanent != null && !permanent.getAttachments().isEmpty()) {
|
||||||
if (layer.equals(Layer.RulesEffects)) {
|
if (layer == Layer.RulesEffects) {
|
||||||
// maxBlocks = 0 equals to "can block any number of creatures"
|
// maxBlocks = 0 equals to "can block any number of creatures"
|
||||||
if (permanent.getMaxBlocks() > 0) {
|
if (permanent.getMaxBlocks() > 0) {
|
||||||
List<UUID> attachments = permanent.getAttachments();
|
List<UUID> attachments = permanent.getAttachments();
|
||||||
|
|
|
@ -184,8 +184,8 @@ class KheruLichLordReplacementEffect extends ReplacementEffectImpl {
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
|
if (event.getType() == GameEvent.EventType.ZONE_CHANGE
|
||||||
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source))
|
&& event.getTargetId().equals(getTargetPointer().getFirst(game, source))
|
||||||
&& ((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)
|
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD
|
||||||
&& !((ZoneChangeEvent) event).getToZone().equals(Zone.EXILED)) {
|
&& ((ZoneChangeEvent) event).getToZone() != Zone.EXILED) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -154,7 +154,7 @@ class LeoninArbiterCantSearchEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return EventType.SEARCH_LIBRARY.equals(event.getType());
|
return EventType.SEARCH_LIBRARY == event.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -128,7 +128,7 @@ class LifeAndLimbEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PTChangingEffects_7:
|
case PTChangingEffects_7:
|
||||||
if (sublayer.equals(SubLayer.SetPT_7b)) {
|
if (sublayer == SubLayer.SetPT_7b) {
|
||||||
permanent.getPower().setValue(1);
|
permanent.getPower().setValue(1);
|
||||||
permanent.getToughness().setValue(1);
|
permanent.getToughness().setValue(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -187,7 +187,7 @@ class MeanderingTowershellReturnEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Card card = game.getCard(source.getSourceId());
|
Card card = game.getCard(source.getSourceId());
|
||||||
if (card != null && game.getState().getZone(source.getSourceId()).equals(Zone.EXILED)) {
|
if (card != null && game.getState().getZone(source.getSourceId()) == Zone.EXILED) {
|
||||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);
|
controller.moveCards(card, Zone.BATTLEFIELD, source, game, true, false, false, null);
|
||||||
game.getCombat().addAttackingCreature(card.getId(), game);
|
game.getCombat().addAttackingCreature(card.getId(), game);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -151,7 +151,7 @@ class MindreaverNamePredicate implements Predicate<MageObject> {
|
||||||
// A split card has the chosen name if one of its two names matches the chosen name.
|
// A split card has the chosen name if one of its two names matches the chosen name.
|
||||||
if (input instanceof SplitCard) {
|
if (input instanceof SplitCard) {
|
||||||
return cardNames.contains(((SplitCard) input).getLeftHalfCard().getName()) || cardNames.contains(((SplitCard) input).getRightHalfCard().getName());
|
return cardNames.contains(((SplitCard) input).getLeftHalfCard().getName()) || cardNames.contains(((SplitCard) input).getRightHalfCard().getName());
|
||||||
} else if (input instanceof Spell && ((Spell) input).getSpellAbility().getSpellAbilityType().equals(SpellAbilityType.SPLIT_FUSED)) {
|
} else if (input instanceof Spell && ((Spell) input).getSpellAbility().getSpellAbilityType() == SpellAbilityType.SPLIT_FUSED) {
|
||||||
SplitCard card = (SplitCard) ((Spell) input).getCard();
|
SplitCard card = (SplitCard) ((Spell) input).getCard();
|
||||||
return cardNames.contains(card.getLeftHalfCard().getName()) || cardNames.contains(card.getRightHalfCard().getName());
|
return cardNames.contains(card.getLeftHalfCard().getName()) || cardNames.contains(card.getRightHalfCard().getName());
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -114,7 +114,7 @@ class NotionThiefReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||||
if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getStep().getType().equals(PhaseStep.DRAW)) {
|
if (game.getActivePlayerId().equals(event.getPlayerId()) && game.getStep().getType() == PhaseStep.DRAW) {
|
||||||
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep");
|
CardsDrawnDuringDrawStepWatcher watcher = (CardsDrawnDuringDrawStepWatcher) game.getState().getWatchers().get("CardsDrawnDuringDrawStep");
|
||||||
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
if (watcher != null && watcher.getAmountCardsDrawn(event.getPlayerId()) > 0) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -176,7 +176,7 @@ class ObzedatGhostCouncilReturnEffect extends OneShotEffect {
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
Zone zone = game.getState().getZone(source.getSourceId());
|
Zone zone = game.getState().getZone(source.getSourceId());
|
||||||
// return it from every public zone - http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/513186-obzedat-gc-as-edh-commander
|
// return it from every public zone - http://www.mtgsalvation.com/forums/magic-fundamentals/magic-rulings/magic-rulings-archives/513186-obzedat-gc-as-edh-commander
|
||||||
if (!zone.equals(Zone.BATTLEFIELD) && !zone.equals(Zone.LIBRARY) && !zone.equals(Zone.HAND)) {
|
if (zone != Zone.BATTLEFIELD && zone != Zone.LIBRARY && zone != Zone.HAND) {
|
||||||
Player owner = game.getPlayer(card.getOwnerId());
|
Player owner = game.getPlayer(card.getOwnerId());
|
||||||
if (owner != null) {
|
if (owner != null) {
|
||||||
owner.moveCards(card, Zone.BATTLEFIELD, source, game);
|
owner.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||||
|
|
|
@ -169,7 +169,7 @@ class OtherworldlyJourneyEntersBattlefieldEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return EventType.ENTERS_THE_BATTLEFIELD.equals(event.getType());
|
return EventType.ENTERS_THE_BATTLEFIELD == event.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -94,7 +94,7 @@ class PersonalSanctuaryEffect extends PreventionEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)) {
|
if (event.getType() == GameEvent.EventType.DAMAGE_PLAYER) {
|
||||||
if (event.getTargetId().equals(source.getControllerId()) && game.getActivePlayerId().equals(source.getControllerId()))
|
if (event.getTargetId().equals(source.getControllerId()) && game.getActivePlayerId().equals(source.getControllerId()))
|
||||||
return super.applies(event, source, game);
|
return super.applies(event, source, game);
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,7 +117,7 @@ class PhantomCentaurPreventionEffect extends PreventionEffectImpl {
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
boolean removeCounter = true;
|
boolean removeCounter = true;
|
||||||
// check if in the same combat damage step already a counter was removed
|
// check if in the same combat damage step already a counter was removed
|
||||||
if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) {
|
if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) {
|
||||||
if (game.getTurnNum() == turn
|
if (game.getTurnNum() == turn
|
||||||
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
||||||
removeCounter = false;
|
removeCounter = false;
|
||||||
|
|
|
@ -116,7 +116,7 @@ class PhantomFlockPreventionEffect extends PreventionEffectImpl {
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
boolean removeCounter = true;
|
boolean removeCounter = true;
|
||||||
// check if in the same combat damage step already a counter was removed
|
// check if in the same combat damage step already a counter was removed
|
||||||
if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) {
|
if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) {
|
||||||
if (game.getTurnNum() == turn
|
if (game.getTurnNum() == turn
|
||||||
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
||||||
removeCounter = false;
|
removeCounter = false;
|
||||||
|
|
|
@ -120,7 +120,7 @@ class PhantomNishobaPreventionEffect extends PreventionEffectImpl {
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
boolean removeCounter = true;
|
boolean removeCounter = true;
|
||||||
// check if in the same combat damage step already a counter was removed
|
// check if in the same combat damage step already a counter was removed
|
||||||
if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) {
|
if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) {
|
||||||
if (game.getTurnNum() == turn
|
if (game.getTurnNum() == turn
|
||||||
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
||||||
removeCounter = false;
|
removeCounter = false;
|
||||||
|
|
|
@ -115,7 +115,7 @@ class PhantomNomadPreventionEffect extends PreventionEffectImpl {
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
boolean removeCounter = true;
|
boolean removeCounter = true;
|
||||||
// check if in the same combat damage step already a counter was removed
|
// check if in the same combat damage step already a counter was removed
|
||||||
if (game.getTurn().getPhase().getStep().getType().equals(PhaseStep.COMBAT_DAMAGE)) {
|
if (game.getTurn().getPhase().getStep().getType() == PhaseStep.COMBAT_DAMAGE) {
|
||||||
if (game.getTurnNum() == turn
|
if (game.getTurnNum() == turn
|
||||||
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
&& game.getTurn().getStep().equals(combatPhaseStep)) {
|
||||||
removeCounter = false;
|
removeCounter = false;
|
||||||
|
|
|
@ -108,7 +108,7 @@ class PharikaExileEffect extends OneShotEffect {
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
Card targetCard = game.getCard(source.getFirstTarget());
|
Card targetCard = game.getCard(source.getFirstTarget());
|
||||||
if (targetCard != null) {
|
if (targetCard != null) {
|
||||||
if (game.getState().getZone(source.getFirstTarget()).equals(Zone.GRAVEYARD)) {
|
if (game.getState().getZone(source.getFirstTarget()) == Zone.GRAVEYARD) {
|
||||||
controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
controller.moveCardToExileWithInfo(targetCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
||||||
}
|
}
|
||||||
Player tokenController = game.getPlayer(targetCard.getOwnerId());
|
Player tokenController = game.getPlayer(targetCard.getOwnerId());
|
||||||
|
|
|
@ -96,7 +96,7 @@ class PhyrexianDelverEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (creatureCard != null && controller != null) {
|
if (creatureCard != null && controller != null) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
|
if (game.getState().getZone(creatureCard.getId()) == Zone.GRAVEYARD) {
|
||||||
result = controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);
|
result = controller.moveCards(creatureCard, Zone.BATTLEFIELD, source, game);
|
||||||
}
|
}
|
||||||
controller.loseLife(creatureCard.getConvertedManaCost(), game, false);
|
controller.loseLife(creatureCard.getConvertedManaCost(), game, false);
|
||||||
|
|
|
@ -101,7 +101,7 @@ class PithingNeedleEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
MageObject object = game.getObject(event.getSourceId());
|
MageObject object = game.getObject(event.getSourceId());
|
||||||
Ability ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
Ability ability = game.getAbility(event.getTargetId(), event.getSourceId());
|
||||||
if (ability != null && object != null) {
|
if (ability != null && object != null) {
|
||||||
if (!ability.getAbilityType().equals(AbilityType.MANA)
|
if (ability.getAbilityType() != AbilityType.MANA
|
||||||
&& object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) {
|
&& object.getName().equals(game.getState().getValue(source.getSourceId().toString() + NameACardEffect.INFO_KEY))) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,7 +78,7 @@ public class PostmortemLunge extends CardImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void adjustTargets(Ability ability, Game game) {
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
if (ability.getAbilityType().equals(AbilityType.SPELL)) { // otherwise the target is also added to the delayed triggered ability
|
if (ability.getAbilityType() == AbilityType.SPELL) { // otherwise the target is also added to the delayed triggered ability
|
||||||
ability.getTargets().clear();
|
ability.getTargets().clear();
|
||||||
int xValue = ability.getManaCostsToPay().getX();
|
int xValue = ability.getManaCostsToPay().getX();
|
||||||
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue + " or less from your graveyard");
|
FilterCard filter = new FilterCreatureCard("creature card with converted mana cost " + xValue + " or less from your graveyard");
|
||||||
|
|
|
@ -101,7 +101,7 @@ class RosheenMeandererManaCondition implements Condition {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
if (AbilityType.SPELL.equals(source.getAbilityType())) {
|
if (AbilityType.SPELL == source.getAbilityType()) {
|
||||||
MageObject object = game.getObject(source.getSourceId());
|
MageObject object = game.getObject(source.getSourceId());
|
||||||
return object != null
|
return object != null
|
||||||
&& object.getManaCost().getText().contains("X");
|
&& object.getManaCost().getText().contains("X");
|
||||||
|
|
|
@ -88,7 +88,7 @@ class SacredGroundTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) {
|
if (game.getOpponents(this.getControllerId()).contains(game.getControllerId(event.getSourceId()))) {
|
||||||
ZoneChangeEvent zce = (ZoneChangeEvent) event;
|
ZoneChangeEvent zce = (ZoneChangeEvent) event;
|
||||||
if (Zone.BATTLEFIELD.equals(zce.getFromZone()) && Zone.GRAVEYARD.equals(zce.getToZone())) {
|
if (Zone.BATTLEFIELD == zce.getFromZone() && Zone.GRAVEYARD == zce.getToZone()) {
|
||||||
Permanent targetPermanent = zce.getTarget();
|
Permanent targetPermanent = zce.getTarget();
|
||||||
if (targetPermanent.isLand() && targetPermanent.getControllerId().equals(getControllerId())) {
|
if (targetPermanent.isLand() && targetPermanent.getControllerId().equals(getControllerId())) {
|
||||||
getEffects().get(0).setTargetPointer(new FixedTarget(targetPermanent.getId(), game.getState().getZoneChangeCounter(targetPermanent.getId())));
|
getEffects().get(0).setTargetPointer(new FixedTarget(targetPermanent.getId(), game.getState().getZoneChangeCounter(targetPermanent.getId())));
|
||||||
|
|
|
@ -127,7 +127,7 @@ class SerraAscendantEffect extends ContinuousEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean hasLayer(Layer layer) {
|
public boolean hasLayer(Layer layer) {
|
||||||
return Layer.AbilityAddingRemovingEffects_6.equals(layer) || Layer.PTChangingEffects_7.equals(layer);
|
return Layer.AbilityAddingRemovingEffects_6 == layer || Layer.PTChangingEffects_7 == layer;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -152,7 +152,7 @@ class SharedFatePlayEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
if (game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
Player player = game.getPlayer(affectedControllerId);
|
Player player = game.getPlayer(affectedControllerId);
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||||
UUID exileId = CardUtil.getExileZoneId(source.getSourceId().toString() + sourcePermanent.getZoneChangeCounter(game) + affectedControllerId.toString(), game);
|
UUID exileId = CardUtil.getExileZoneId(source.getSourceId().toString() + sourcePermanent.getZoneChangeCounter(game) + affectedControllerId.toString(), game);
|
||||||
|
@ -192,7 +192,7 @@ class SharedFateLookEffect extends AsThoughEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||||
if (game.getState().getZone(objectId).equals(Zone.EXILED)) {
|
if (game.getState().getZone(objectId) == Zone.EXILED) {
|
||||||
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
Permanent sourcePermanent = game.getPermanent(source.getSourceId());
|
||||||
UUID exileId = CardUtil.getExileZoneId(source.getSourceId().toString() + sourcePermanent.getZoneChangeCounter(game) + affectedControllerId.toString(), game);
|
UUID exileId = CardUtil.getExileZoneId(source.getSourceId().toString() + sourcePermanent.getZoneChangeCounter(game) + affectedControllerId.toString(), game);
|
||||||
if (exileId != null) {
|
if (exileId != null) {
|
||||||
|
|
|
@ -169,8 +169,8 @@ class SithMagicReplacementEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
if (event.getTargetId().equals(source.getFirstTarget())
|
if (event.getTargetId().equals(source.getFirstTarget())
|
||||||
&& ((ZoneChangeEvent) event).getFromZone().equals(Zone.BATTLEFIELD)
|
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD
|
||||||
&& !((ZoneChangeEvent) event).getToZone().equals(Zone.EXILED)) {
|
&& ((ZoneChangeEvent) event).getToZone() != Zone.EXILED) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -99,7 +99,7 @@ class ArtifactAbilityManaCondition extends ManaCondition implements Condition {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
if (source != null && source.getAbilityType().equals(AbilityType.ACTIVATED)) {
|
if (source != null && source.getAbilityType() == AbilityType.ACTIVATED) {
|
||||||
MageObject object = game.getObject(source.getSourceId());
|
MageObject object = game.getObject(source.getSourceId());
|
||||||
if (object != null && object.isArtifact()) {
|
if (object != null && object.isArtifact()) {
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -102,7 +102,7 @@ class SoulSeparatorEffect extends OneShotEffect {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (creatureCard != null && controller != null) {
|
if (creatureCard != null && controller != null) {
|
||||||
boolean result = false;
|
boolean result = false;
|
||||||
if (game.getState().getZone(creatureCard.getId()).equals(Zone.GRAVEYARD)) {
|
if (game.getState().getZone(creatureCard.getId()) == Zone.GRAVEYARD) {
|
||||||
result = controller.moveCardToExileWithInfo(creatureCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
result = controller.moveCardToExileWithInfo(creatureCard, null, "", source.getSourceId(), game, Zone.GRAVEYARD, true);
|
||||||
ZombieToken2 token = new ZombieToken2(creatureCard.getPower().getValue(), creatureCard.getToughness().getValue());
|
ZombieToken2 token = new ZombieToken2(creatureCard.getPower().getValue(), creatureCard.getToughness().getValue());
|
||||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||||
|
|
|
@ -188,7 +188,7 @@ class SpellbinderCopyEffect extends OneShotEffect {
|
||||||
Permanent spellbinder = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
Permanent spellbinder = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||||
if (spellbinder != null && spellbinder.getImprinted() != null && !spellbinder.getImprinted().isEmpty()) {
|
if (spellbinder != null && spellbinder.getImprinted() != null && !spellbinder.getImprinted().isEmpty()) {
|
||||||
Card imprintedInstant = game.getCard(spellbinder.getImprinted().get(0));
|
Card imprintedInstant = game.getCard(spellbinder.getImprinted().get(0));
|
||||||
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()).equals(Zone.EXILED)) {
|
if (imprintedInstant != null && game.getState().getZone(imprintedInstant.getId()) == Zone.EXILED) {
|
||||||
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
if (controller.chooseUse(outcome, new StringBuilder("Create a copy of ").append(imprintedInstant.getName()).append('?').toString(), source, game)) {
|
||||||
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
Card copiedCard = game.copyCard(imprintedInstant, source, source.getControllerId());
|
||||||
if (copiedCard != null) {
|
if (copiedCard != null) {
|
||||||
|
|
|
@ -147,7 +147,7 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
||||||
pile2Zone = Zone.GRAVEYARD;
|
pile2Zone = Zone.GRAVEYARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 1, going to ").append(pile1Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (": ");
|
StringBuilder sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 1, going to ").append(pile1Zone == Zone.HAND ?"Hand":"Graveyard").append (": ");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (UUID cardUuid : pile1CardsIds) {
|
for (UUID cardUuid : pile1CardsIds) {
|
||||||
i++;
|
i++;
|
||||||
|
@ -162,7 +162,7 @@ class SphinxOfUthuunEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
game.informPlayers(sb.toString());
|
game.informPlayers(sb.toString());
|
||||||
|
|
||||||
sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND)?"Hand":"Graveyard").append (':');
|
sb = new StringBuilder(sourceObject.getLogName()).append(": Pile 2, going to ").append(pile2Zone == Zone.HAND ?"Hand":"Graveyard").append (':');
|
||||||
i = 0;
|
i = 0;
|
||||||
for (UUID cardUuid : pile2CardsIds) {
|
for (UUID cardUuid : pile2CardsIds) {
|
||||||
Card card = game.getCard(cardUuid);
|
Card card = game.getCard(cardUuid);
|
||||||
|
|
|
@ -98,7 +98,7 @@ class StartledAwakeReturnTransformedEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
if (game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) {
|
if (game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
|
||||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + source.getSourceId(), Boolean.TRUE);
|
||||||
Card card = game.getCard(source.getSourceId());
|
Card card = game.getCard(source.getSourceId());
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
|
|
|
@ -146,7 +146,7 @@ class SteamAuguryEffect extends OneShotEffect {
|
||||||
pile2Zone = Zone.GRAVEYARD;
|
pile2Zone = Zone.GRAVEYARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
StringBuilder sb = new StringBuilder(sourceObject.getLogName() + ": Pile 1, going to ").append(pile1Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(": ");
|
StringBuilder sb = new StringBuilder(sourceObject.getLogName() + ": Pile 1, going to ").append(pile1Zone == Zone.HAND ? "Hand" : "Graveyard").append(": ");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
for (UUID cardUuid : pile1CardsIds) {
|
for (UUID cardUuid : pile1CardsIds) {
|
||||||
i++;
|
i++;
|
||||||
|
@ -161,7 +161,7 @@ class SteamAuguryEffect extends OneShotEffect {
|
||||||
}
|
}
|
||||||
game.informPlayers(sb.toString());
|
game.informPlayers(sb.toString());
|
||||||
|
|
||||||
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone.equals(Zone.HAND) ? "Hand" : "Graveyard").append(':');
|
sb = new StringBuilder(sourceObject.getLogName() + ": Pile 2, going to ").append(pile2Zone == Zone.HAND ? "Hand" : "Graveyard").append(':');
|
||||||
i = 0;
|
i = 0;
|
||||||
for (UUID cardUuid : pile2CardsIds) {
|
for (UUID cardUuid : pile2CardsIds) {
|
||||||
Card card = game.getCard(cardUuid);
|
Card card = game.getCard(cardUuid);
|
||||||
|
|
|
@ -103,7 +103,7 @@ class StinkdrinkerBanditTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(EventType.DECLARED_BLOCKERS);
|
return event.getType() == EventType.DECLARED_BLOCKERS;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -102,7 +102,7 @@ class OpponentsCantSearchLibarariesEffect extends ContinuousRuleModifyingEffectI
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return EventType.SEARCH_LIBRARY.equals(event.getType());
|
return EventType.SEARCH_LIBRARY == event.getType();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -145,7 +145,7 @@ class StrangleholdSkipExtraTurnsEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checksEventType(GameEvent event, Game game) {
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
return event.getType().equals(GameEvent.EventType.EXTRA_TURN);
|
return event.getType() == EventType.EXTRA_TURN;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -143,7 +143,7 @@ class SummonersEggPutOntoBattlefieldEffect extends OneShotEffect {
|
||||||
Permanent SummonersEgg = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
Permanent SummonersEgg = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||||
if (SummonersEgg != null && SummonersEgg.getImprinted() != null && !SummonersEgg.getImprinted().isEmpty()) {
|
if (SummonersEgg != null && SummonersEgg.getImprinted() != null && !SummonersEgg.getImprinted().isEmpty()) {
|
||||||
Card imprintedCard = game.getCard(SummonersEgg.getImprinted().get(0));
|
Card imprintedCard = game.getCard(SummonersEgg.getImprinted().get(0));
|
||||||
if (imprintedCard != null && game.getState().getZone(imprintedCard.getId()).equals(Zone.EXILED)) {
|
if (imprintedCard != null && game.getState().getZone(imprintedCard.getId()) == Zone.EXILED) {
|
||||||
//turn the exiled card face up.
|
//turn the exiled card face up.
|
||||||
imprintedCard.turnFaceUp(game, source.getControllerId());
|
imprintedCard.turnFaceUp(game, source.getControllerId());
|
||||||
//If it's a creature card,
|
//If it's a creature card,
|
||||||
|
|
|
@ -85,7 +85,7 @@ class SunglassesOfUrzaManaAsThoughtEffect extends AsThoughEffectImpl implements
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
|
public ManaType getAsThoughManaType(ManaType manaType, ManaPoolItem mana, UUID affectedControllerId, Ability source, Game game) {
|
||||||
if (mana.getWhite() > 0 && ManaType.RED.equals(manaType)) {
|
if (mana.getWhite() > 0 && ManaType.RED == manaType) {
|
||||||
return ManaType.WHITE;
|
return ManaType.WHITE;
|
||||||
}
|
}
|
||||||
return manaType;
|
return manaType;
|
||||||
|
|
|
@ -84,7 +84,7 @@ class SuppressionFieldCostReductionEffect extends CostModificationEffectImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||||
return abilityToModify.getAbilityType().equals(AbilityType.ACTIVATED);
|
return abilityToModify.getAbilityType() == AbilityType.ACTIVATED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -106,7 +106,7 @@ class SwordOfTheMeekEffect extends OneShotEffect {
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
Card equipment = game.getCard(source.getSourceId());
|
Card equipment = game.getCard(source.getSourceId());
|
||||||
Player controller = game.getPlayer(source.getControllerId());
|
Player controller = game.getPlayer(source.getControllerId());
|
||||||
if (equipment != null && controller != null && game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) {
|
if (equipment != null && controller != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
|
||||||
controller.moveCards(equipment, Zone.BATTLEFIELD, source, game);
|
controller.moveCards(equipment, Zone.BATTLEFIELD, source, game);
|
||||||
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
if (permanent != null) {
|
if (permanent != null) {
|
||||||
|
|
|
@ -107,12 +107,12 @@ class TawnossCoffinTriggeredAbility extends LeavesBattlefieldTriggeredAbility {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkEventType(GameEvent event, Game game) {
|
public boolean checkEventType(GameEvent event, Game game) {
|
||||||
return super.checkEventType(event, game) || event.getType().equals(GameEvent.EventType.UNTAPPED);
|
return super.checkEventType(event, game) || event.getType() == GameEvent.EventType.UNTAPPED;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
if (event.getType().equals(GameEvent.EventType.UNTAPPED)) {
|
if (event.getType() == GameEvent.EventType.UNTAPPED) {
|
||||||
return event.getTargetId().equals(sourceId);
|
return event.getTargetId().equals(sourceId);
|
||||||
} else {
|
} else {
|
||||||
return super.checkTrigger(event, game);
|
return super.checkTrigger(event, game);
|
||||||
|
|
|
@ -169,7 +169,7 @@ class ThoughtPrisonTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
}
|
}
|
||||||
if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) {
|
if (sourcePermanent != null && sourcePermanent.getImprinted() != null && !sourcePermanent.getImprinted().isEmpty()) {
|
||||||
Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0));
|
Card imprintedCard = game.getCard(sourcePermanent.getImprinted().get(0));
|
||||||
if (imprintedCard != null && game.getState().getZone(imprintedCard.getId()).equals(Zone.EXILED)) {
|
if (imprintedCard != null && game.getState().getZone(imprintedCard.getId()) == Zone.EXILED) {
|
||||||
// Check if spell's color matches the imprinted card
|
// Check if spell's color matches the imprinted card
|
||||||
ObjectColor spellColor = spell.getColor(game);
|
ObjectColor spellColor = spell.getColor(game);
|
||||||
ObjectColor imprintedColor = imprintedCard.getColor(game);
|
ObjectColor imprintedColor = imprintedCard.getColor(game);
|
||||||
|
|
|
@ -93,7 +93,7 @@ class TreacherousPitDwellerTriggeredAbility extends TriggeredAbilityImpl {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
return event.getTargetId().equals(getSourceId()) && ((EntersTheBattlefieldEvent) event).getFromZone().equals(Zone.GRAVEYARD);
|
return event.getTargetId().equals(getSourceId()) && ((EntersTheBattlefieldEvent) event).getFromZone() == Zone.GRAVEYARD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -149,7 +149,7 @@ class TuktukScrapperEffect extends OneShotEffect {
|
||||||
if (controller != null && targetArtifact != null) {
|
if (controller != null && targetArtifact != null) {
|
||||||
targetArtifact.destroy(source.getSourceId(), game, false);
|
targetArtifact.destroy(source.getSourceId(), game, false);
|
||||||
Player targetController = game.getPlayer(targetArtifact.getControllerId());
|
Player targetController = game.getPlayer(targetArtifact.getControllerId());
|
||||||
if (targetController != null && game.getState().getZone(targetArtifact.getId()).equals(Zone.GRAVEYARD)) {
|
if (targetController != null && game.getState().getZone(targetArtifact.getId()) == Zone.GRAVEYARD) {
|
||||||
int alliesControlled = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
|
int alliesControlled = game.getBattlefield().count(filter, source.getSourceId(), source.getControllerId(), game);
|
||||||
if (alliesControlled > 0) {
|
if (alliesControlled > 0) {
|
||||||
targetController.damage(alliesControlled, source.getSourceId(), game, false, true);
|
targetController.damage(alliesControlled, source.getSourceId(), game, false, true);
|
||||||
|
|
|
@ -92,7 +92,7 @@ class UnwindingClockEffect extends ContinuousEffectImpl {
|
||||||
if (applied == null) {
|
if (applied == null) {
|
||||||
applied = Boolean.FALSE;
|
applied = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
if (!applied && layer.equals(Layer.RulesEffects)) {
|
if (!applied && layer == Layer.RulesEffects) {
|
||||||
if (!game.getActivePlayerId().equals(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) {
|
if (!game.getActivePlayerId().equals(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) {
|
||||||
game.getState().setValue(source.getSourceId() + "applied", true);
|
game.getState().setValue(source.getSourceId() + "applied", true);
|
||||||
for (Permanent artifact : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
for (Permanent artifact : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
|
||||||
|
@ -105,7 +105,7 @@ class UnwindingClockEffect extends ContinuousEffectImpl {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (applied && layer.equals(Layer.RulesEffects)) {
|
} else if (applied && layer == Layer.RulesEffects) {
|
||||||
if (game.getStep().getType() == PhaseStep.END_TURN) {
|
if (game.getStep().getType() == PhaseStep.END_TURN) {
|
||||||
game.getState().setValue(source.getSourceId() + "applied", false);
|
game.getState().setValue(source.getSourceId() + "applied", false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,7 +106,7 @@ class UrbanBurgeoningUntapEffect extends ContinuousEffectImpl {
|
||||||
if (applied == null) {
|
if (applied == null) {
|
||||||
applied = Boolean.FALSE;
|
applied = Boolean.FALSE;
|
||||||
}
|
}
|
||||||
if (!applied && layer.equals(Layer.RulesEffects)) {
|
if (!applied && layer == Layer.RulesEffects) {
|
||||||
if (!game.getActivePlayerId().equals(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) {
|
if (!game.getActivePlayerId().equals(source.getControllerId()) && game.getStep().getType() == PhaseStep.UNTAP) {
|
||||||
game.getState().setValue(source.getSourceId() + "applied", true);
|
game.getState().setValue(source.getSourceId() + "applied", true);
|
||||||
Permanent land = game.getPermanent(source.getSourceId());
|
Permanent land = game.getPermanent(source.getSourceId());
|
||||||
|
|
|
@ -93,7 +93,7 @@ class CantBeBlockedByMoreThanOneAttachedEffect extends ContinuousEffectImpl {
|
||||||
super(duration, Outcome.Benefit);
|
super(duration, Outcome.Benefit);
|
||||||
this.amount = amount;
|
this.amount = amount;
|
||||||
this.attachmentType = attachmentType;
|
this.attachmentType = attachmentType;
|
||||||
staticText = (attachmentType.equals(AttachmentType.AURA) ? "Enchanted" : "Equipped") + " creature can't be blocked by more than " + CardUtil.numberToText(amount) + " creature" + (amount==1 ?"":"s");
|
staticText = (attachmentType == AttachmentType.AURA ? "Enchanted" : "Equipped") + " creature can't be blocked by more than " + CardUtil.numberToText(amount) + " creature" + (amount==1 ?"":"s");
|
||||||
}
|
}
|
||||||
|
|
||||||
public CantBeBlockedByMoreThanOneAttachedEffect(final CantBeBlockedByMoreThanOneAttachedEffect effect) {
|
public CantBeBlockedByMoreThanOneAttachedEffect(final CantBeBlockedByMoreThanOneAttachedEffect effect) {
|
||||||
|
|
|
@ -105,7 +105,7 @@ class WheelOfSunAndMoonEffect extends ReplacementEffectImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||||
if (zEvent.getToZone().equals(Zone.GRAVEYARD)) {
|
if (zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||||
Card card = game.getCard(event.getTargetId());
|
Card card = game.getCard(event.getTargetId());
|
||||||
if (card != null) {
|
if (card != null) {
|
||||||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||||
|
|
|
@ -127,7 +127,7 @@ class XenicPoltergeistEffect extends ContinuousEffectImpl {
|
||||||
if (super.isInactive(source, game)) {
|
if (super.isInactive(source, game)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
if (durationPhaseStep != null && durationPhaseStep.equals(game.getPhase().getStep().getType())) {
|
if (durationPhaseStep != null && durationPhaseStep == game.getPhase().getStep().getType()) {
|
||||||
if (!sameStep && game.getActivePlayerId().equals(durationPlayerId) || game.getPlayer(durationPlayerId).hasReachedNextTurnAfterLeaving()) {
|
if (!sameStep && game.getActivePlayerId().equals(durationPlayerId) || game.getPlayer(durationPlayerId).hasReachedNextTurnAfterLeaving()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -225,7 +225,7 @@ public class DragonsMaze extends ExpansionSet {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CardInfo> getCardsByRarity(Rarity rarity) {
|
public List<CardInfo> getCardsByRarity(Rarity rarity) {
|
||||||
if (rarity.equals(Rarity.COMMON)) {
|
if (rarity == Rarity.COMMON) {
|
||||||
List<CardInfo> savedCardsInfos = savedCards.get(rarity);
|
List<CardInfo> savedCardsInfos = savedCards.get(rarity);
|
||||||
if (savedCardsInfos == null) {
|
if (savedCardsInfos == null) {
|
||||||
CardCriteria criteria = new CardCriteria();
|
CardCriteria criteria = new CardCriteria();
|
||||||
|
|
|
@ -256,7 +256,7 @@ public class FateReforged extends ExpansionSet {
|
||||||
@Override
|
@Override
|
||||||
public List<CardInfo> getCardsByRarity(Rarity rarity) {
|
public List<CardInfo> getCardsByRarity(Rarity rarity) {
|
||||||
// Common cards retrievement of Fate Reforged boosters - prevent the retrievement of the common lands (e.g. Blossoming Sands)
|
// Common cards retrievement of Fate Reforged boosters - prevent the retrievement of the common lands (e.g. Blossoming Sands)
|
||||||
if (rarity.equals(Rarity.COMMON)) {
|
if (rarity == Rarity.COMMON) {
|
||||||
List<CardInfo> savedCardsInfos = savedCards.get(rarity);
|
List<CardInfo> savedCardsInfos = savedCards.get(rarity);
|
||||||
if (savedCardsInfos == null) {
|
if (savedCardsInfos == null) {
|
||||||
CardCriteria criteria = new CardCriteria();
|
CardCriteria criteria = new CardCriteria();
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class JSONParser {
|
||||||
String currentPath = "";
|
String currentPath = "";
|
||||||
for (int i = 0; i < params.length - 1; i++) {
|
for (int i = 0; i < params.length - 1; i++) {
|
||||||
String param = params[i];
|
String param = params[i];
|
||||||
if (cachePolicy.equals(CachePolicy.CACHE_ALL_LEVELS)) {
|
if (cachePolicy == CachePolicy.CACHE_ALL_LEVELS) {
|
||||||
if (!currentPath.isEmpty()) {
|
if (!currentPath.isEmpty()) {
|
||||||
currentPath += ".";
|
currentPath += ".";
|
||||||
}
|
}
|
||||||
|
@ -123,7 +123,7 @@ public class JSONParser {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if (cachePolicy.equals(CachePolicy.CACHE_ALL_LEVELS)) {
|
if (cachePolicy == CachePolicy.CACHE_ALL_LEVELS) {
|
||||||
saveToCache(currentPath, json);
|
saveToCache(currentPath, json);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue