mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
Removing all references to Mind's Desire
This commit is contained in:
@@ -335,7 +335,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
// Hidden keywords won't be displayed on the card
|
||||
private final ArrayList<String> hiddenExtrinsicKeyword = new ArrayList<String>();
|
||||
private ArrayList<String> prevIntrinsicKeyword = new ArrayList<String>();
|
||||
private final ArrayList<Card> attachedByMindsDesire = new ArrayList<Card>();
|
||||
|
||||
// which equipment cards are equipping this card?
|
||||
private ArrayList<Card> equippedBy = new ArrayList<Card>();
|
||||
// equipping size will always be 0 or 1
|
||||
@@ -4285,58 +4285,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
||||
gameEntity.removeEnchantedBy(this);
|
||||
}
|
||||
}
|
||||
|
||||
// array size might equal 0, will NEVER be null
|
||||
/**
|
||||
* <p>
|
||||
* getAttachedCards.
|
||||
* </p>
|
||||
*
|
||||
* @return an array of {@link forge.Card} objects.
|
||||
*/
|
||||
public final Card[] getAttachedCardsByMindsDesire() {
|
||||
final Card[] c = new Card[this.attachedByMindsDesire.size()];
|
||||
this.attachedByMindsDesire.toArray(c);
|
||||
return c;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* hasAttachedCards.
|
||||
* </p>
|
||||
*
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean hasAttachedCardsByMindsDesire() {
|
||||
return this.getAttachedCardsByMindsDesire().length != 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* attachCard.
|
||||
* </p>
|
||||
*
|
||||
* @param c
|
||||
* a {@link forge.Card} object.
|
||||
*/
|
||||
public final void attachCardByMindsDesire(final Card c) {
|
||||
this.attachedByMindsDesire.add(c);
|
||||
this.updateObservers();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* unattachCard.
|
||||
* </p>
|
||||
*
|
||||
* @param c
|
||||
* a {@link forge.Card} object.
|
||||
*/
|
||||
public final void unattachCardByMindDesire(final Card c) {
|
||||
this.attachedByMindsDesire.remove(c);
|
||||
this.updateObservers();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Setter for the field <code>type</code>.
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
package forge;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.Map.Entry;
|
||||
@@ -1832,27 +1831,6 @@ public class GameAction {
|
||||
// local enchantments are always attached to something
|
||||
// if Card is "Equipment", returns true if attached to something
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* isAttachee.
|
||||
* </p>
|
||||
*
|
||||
* @param c
|
||||
* a {@link forge.Card} object.
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean isAttacheeByMindsDesire(final Card c) {
|
||||
final CardList list = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
final Card[] cc = list.getCard(i).getAttachedCardsByMindsDesire();
|
||||
if (Arrays.binarySearch(cc, c) >= 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
} // isAttached(Card c)
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -287,8 +287,7 @@ public final class GuiDisplayUtil {
|
||||
final ArrayList<Card> a = new ArrayList<Card>();
|
||||
for (int i = 0; i < c.length; i++) {
|
||||
if (((!(c[i].isCreature() || c[i].isEnchantment() || c[i].isArtifact() || c[i].isPlaneswalker()) || (c[i]
|
||||
.isLand() && c[i].isArtifact() && !c[i].isCreature() && !c[i].isEnchantment())) && !AllZone
|
||||
.getGameAction().isAttacheeByMindsDesire(c[i]))
|
||||
.isLand() && c[i].isArtifact() && !c[i].isCreature() && !c[i].isEnchantment())))
|
||||
|| (c[i].getName().startsWith("Mox") && !c[i].getName().equals("Mox Diamond"))) {
|
||||
a.add(c[i]);
|
||||
}
|
||||
|
||||
@@ -246,198 +246,6 @@ public class CardFactorySorceries {
|
||||
card.setSVar("PlayMain1", "TRUE");
|
||||
} // *************** END ************ END **************************
|
||||
|
||||
// *************** START *********** START **************************
|
||||
/*else if (cardName.equals("Mind's Desire")) {
|
||||
final Spell playCreature = new Spell(card) {
|
||||
private static final long serialVersionUID = 53838791023456795L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
final Player player = card.getController();
|
||||
final PlayerZone play = player.getZone(Constant.Zone.Battlefield);
|
||||
final PlayerZone rfg = player.getZone(Constant.Zone.Exile);
|
||||
final Card[] attached = card.getAttachedCardsByMindsDesire();
|
||||
rfg.remove(attached[0]);
|
||||
play.add(attached[0]);
|
||||
card.unattachCardByMindDesire(attached[0]);
|
||||
} // resolve()
|
||||
}; // SpellAbility
|
||||
|
||||
final Ability freeCast = new Ability(card, "0") {
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
Card target = null;
|
||||
Card c = null;
|
||||
final Player player = card.getController();
|
||||
if (player.isHuman()) {
|
||||
final Card[] attached = this.getSourceCard().getAttachedCardsByMindsDesire();
|
||||
final Card[] choices = new Card[attached.length];
|
||||
boolean systemsGo = true;
|
||||
if (AllZone.getStack().size() > 0) {
|
||||
final CardList config = new CardList();
|
||||
for (final Card element : attached) {
|
||||
if (element.isInstant() || element.hasKeyword("Flash")) {
|
||||
config.add(element);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < config.size(); i++) {
|
||||
final Card crd = config.get(i);
|
||||
choices[i] = crd;
|
||||
}
|
||||
if (config.size() == 0) {
|
||||
systemsGo = false;
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < attached.length; i++) {
|
||||
choices[i] = attached[i];
|
||||
}
|
||||
}
|
||||
Object check = null;
|
||||
if (systemsGo) {
|
||||
check = GuiUtils.getChoiceOptional("Select Card to play for free", choices);
|
||||
if (check != null) {
|
||||
target = ((Card) check);
|
||||
}
|
||||
if (target != null) {
|
||||
c = AllZone.getCardFactory().copyCard(target);
|
||||
}
|
||||
|
||||
if (c != null) {
|
||||
if (c.isLand()) {
|
||||
if (player.canPlayLand()) {
|
||||
player.playLand(c);
|
||||
} else {
|
||||
JOptionPane.showMessageDialog(null, "You can't play any more lands this turn.",
|
||||
"", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
} else if (c.isPermanent() && c.isAura()) {
|
||||
c.removeIntrinsicKeyword("Flash"); // Stops
|
||||
// the
|
||||
// player
|
||||
// from
|
||||
// re-casting
|
||||
// the
|
||||
// flash
|
||||
// spell.
|
||||
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append(c.getName()).append(" - Copied from Mind's Desire");
|
||||
playCreature.setStackDescription(sb.toString());
|
||||
|
||||
final Card[] reAttach = new Card[attached.length];
|
||||
reAttach[0] = c;
|
||||
int reAttachCount = 0;
|
||||
for (final Card element : attached) {
|
||||
if (element != target) {
|
||||
reAttachCount = reAttachCount + 1;
|
||||
reAttach[reAttachCount] = element;
|
||||
}
|
||||
}
|
||||
// Clear Attached List
|
||||
for (final Card element : attached) {
|
||||
card.unattachCardByMindDesire(element);
|
||||
}
|
||||
// Re-add
|
||||
for (final Card element : reAttach) {
|
||||
if (element != null) {
|
||||
card.attachCardByMindsDesire(element);
|
||||
}
|
||||
}
|
||||
target.addSpellAbility(playCreature);
|
||||
AllZone.getStack().add(playCreature);
|
||||
} else {
|
||||
AllZone.getGameAction().playCardNoCost(c);
|
||||
card.unattachCardByMindDesire(c);
|
||||
}
|
||||
} else {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Player cancelled or there is no more ");
|
||||
sb.append("cards available on Mind's Desire.");
|
||||
JOptionPane.showMessageDialog(null, sb.toString(), "", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
} else {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("You can only play an instant at this point in time, ");
|
||||
sb.append("but none are attached to Mind's Desire.");
|
||||
JOptionPane.showMessageDialog(null, sb.toString(), "", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return false;
|
||||
}
|
||||
|
||||
};
|
||||
freeCast.setStackDescription("Mind's Desire - play card without paying its mana cost.");
|
||||
|
||||
final Command intoPlay = new Command() {
|
||||
private static final long serialVersionUID = 920148510259054021L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
final Player player = AllZone.getPhaseHandler().getPlayerTurn();
|
||||
final PlayerZone play = player.getZone(Constant.Zone.Battlefield);
|
||||
Card mindsD = card;
|
||||
if (player.isHuman()) {
|
||||
card.getController().shuffle();
|
||||
}
|
||||
CardList mindsList = player.getCardsIn(Zone.Battlefield);
|
||||
mindsList = mindsList.getName("Mind's Desire");
|
||||
mindsList.remove(card);
|
||||
if (mindsList.size() > 0) {
|
||||
play.remove(card);
|
||||
mindsD = mindsList.get(0);
|
||||
} else {
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Click Mind's Desire to see the available cards ");
|
||||
sb.append("to play without paying its mana cost.");
|
||||
JOptionPane.showMessageDialog(null, sb.toString(), "", JOptionPane.INFORMATION_MESSAGE);
|
||||
}
|
||||
final CardList libList = player.getCardsIn(Zone.Library);
|
||||
Card c = null;
|
||||
if (libList.size() > 0) {
|
||||
c = libList.get(0);
|
||||
final PlayerZone rfg = player.getZone(Constant.Zone.Exile);
|
||||
AllZone.getGameAction().moveTo(rfg, c);
|
||||
mindsD.attachCardByMindsDesire(c);
|
||||
}
|
||||
final Card minds = card;
|
||||
// AllZone.getGameAction().exile(Minds);
|
||||
minds.setImmutable(true);
|
||||
final Command untilEOT = new Command() {
|
||||
private static final long serialVersionUID = -28032591440730370L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
final Player player = AllZone.getPhaseHandler().getPlayerTurn();
|
||||
final PlayerZone play = player.getZone(Constant.Zone.Battlefield);
|
||||
play.remove(minds);
|
||||
}
|
||||
};
|
||||
AllZone.getEndOfTurn().addUntil(untilEOT);
|
||||
}
|
||||
|
||||
};
|
||||
final SpellAbility spell = new SpellPermanent(card) {
|
||||
private static final long serialVersionUID = -2940969025405788931L;
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
card.addComesIntoPlayCommand(intoPlay);
|
||||
|
||||
card.addSpellAbility(spell);
|
||||
card.addSpellAbility(freeCast);
|
||||
spell.setDescription("");
|
||||
}*/
|
||||
// *************** END ************ END **************************
|
||||
|
||||
// *************** START *********** START **************************
|
||||
else if (cardName.equals("Brilliant Ultimatum")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
@@ -452,19 +452,6 @@ public class CardDetailPanel extends JPanel implements CardContainer {
|
||||
area.append("Must block an attacker");
|
||||
}
|
||||
|
||||
if (card.hasAttachedCardsByMindsDesire()) {
|
||||
if (area.length() != 0) {
|
||||
area.append("\n");
|
||||
}
|
||||
final Card[] cards = card.getAttachedCardsByMindsDesire();
|
||||
area.append("=Attached: ");
|
||||
for (final Card c : cards) {
|
||||
area.append(c.getName());
|
||||
area.append(" ");
|
||||
}
|
||||
area.append("=");
|
||||
}
|
||||
|
||||
this.cdArea.setText(area.toString());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user