mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- Cleanup.
This commit is contained in:
@@ -456,67 +456,5 @@ public abstract class AbstractCardFactory implements CardFactoryInterface {
|
||||
}
|
||||
|
||||
return CardFactoryUtil.postFactoryKeywords(card2 != null ? card2 : card);
|
||||
|
||||
// *************** START *********** START **************************
|
||||
/*else if (cardName.equals("Triangle of War")) {
|
||||
|
||||
final Target t2 = new Target(card, "Select target creature an opponent controls",
|
||||
"Creature.YouDontCtrl".split(","));
|
||||
final AbilitySub sub = new AbilitySub(card, t2) {
|
||||
private static final long serialVersionUID = -572849470457911366L;
|
||||
|
||||
@Override
|
||||
public boolean chkAIDrawback() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
final Card myc = this.getParent().getTargetCard();
|
||||
final Card oppc = this.getTargetCard();
|
||||
if (AllZoneUtil.isCardInPlay(myc) && AllZoneUtil.isCardInPlay(oppc)) {
|
||||
if (myc.canBeTargetedBy(this) && oppc.canBeTargetedBy(this)) {
|
||||
final int myPower = myc.getNetAttack();
|
||||
final int oppPower = oppc.getNetAttack();
|
||||
myc.addDamage(oppPower, oppc);
|
||||
oppc.addDamage(myPower, myc);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doTrigger(final boolean b) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
final Cost abCost = new Cost("2 Sac<1/CARDNAME>", cardName, true);
|
||||
final Target t1 = new Target(card, "Select target creature you control", "Creature.YouCtrl".split(","));
|
||||
final AbilityActivated ability = new AbilityActivated(card, abCost, t1) {
|
||||
private static final long serialVersionUID = 2312243293988795896L;
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
sub.resolve();
|
||||
}
|
||||
};
|
||||
ability.setSubAbility(sub);
|
||||
final StringBuilder sbDesc = new StringBuilder();
|
||||
sbDesc.append(abCost);
|
||||
sbDesc.append("Choose target creature you control and target creature an opponent controls. ");
|
||||
sbDesc.append("Each of those creatures deals damage equal to its power to the other.");
|
||||
ability.setDescription(sbDesc.toString());
|
||||
|
||||
final StringBuilder sbStack = new StringBuilder();
|
||||
sbStack.append(card).append(" - Each creature deals damage equal to its power to the other.");
|
||||
ability.setStackDescription(sbStack.toString());
|
||||
card.addSpellAbility(ability);
|
||||
}*/ // *************** END ************ END **************************
|
||||
|
||||
} // getCard2
|
||||
} // end class AbstractCardFactory
|
||||
|
||||
@@ -61,171 +61,6 @@ public class CardFactoryInstants {
|
||||
*/
|
||||
public static Card getCard(final Card card, final String cardName) {
|
||||
|
||||
// *************** START *********** START **************************
|
||||
/*if (cardName.equals("Fact or Fiction")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
private static final long serialVersionUID = 1481112451519L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
|
||||
Card choice = null;
|
||||
|
||||
// check for no cards in hand on resolve
|
||||
final PlayerZone library = card.getController().getZone(Constant.Zone.Library);
|
||||
final PlayerZone hand = card.getController().getZone(Constant.Zone.Hand);
|
||||
// PlayerZone Grave =
|
||||
// card.getController().getZone(Constant.Zone.Graveyard);
|
||||
final CardList cards = new CardList();
|
||||
|
||||
if (library.size() == 0) {
|
||||
JOptionPane.showMessageDialog(null, "No more cards in library.", "",
|
||||
JOptionPane.INFORMATION_MESSAGE);
|
||||
return;
|
||||
}
|
||||
int count = 5;
|
||||
if (library.size() < 5) {
|
||||
count = library.size();
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
cards.add(library.get(i));
|
||||
}
|
||||
final CardList pile1 = new CardList();
|
||||
final CardList pile2 = new CardList();
|
||||
boolean stop = false;
|
||||
int pile1CMC = 0;
|
||||
int pile2CMC = 0;
|
||||
|
||||
final StringBuilder sbMsg = new StringBuilder();
|
||||
sbMsg.append("Revealing top ").append(count).append(" cards of library: ");
|
||||
GuiUtils.getChoice(sbMsg.toString(), cards.toArray());
|
||||
// Human chooses
|
||||
if (card.getController().isComputer()) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (!stop) {
|
||||
choice = GuiUtils.getChoiceOptional("Choose cards to put into the first pile: ",
|
||||
cards.toArray());
|
||||
if (choice != null) {
|
||||
pile1.add(choice);
|
||||
cards.remove(choice);
|
||||
pile1CMC = pile1CMC + CardUtil.getConvertedManaCost(choice);
|
||||
} else {
|
||||
stop = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (!pile1.contains(library.get(i))) {
|
||||
pile2.add(library.get(i));
|
||||
pile2CMC = pile2CMC + CardUtil.getConvertedManaCost(library.get(i));
|
||||
}
|
||||
}
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("You have spilt the cards into the following piles");
|
||||
sb.append("\r\n").append("\r\n");
|
||||
sb.append("Pile 1: ").append("\r\n");
|
||||
for (int i = 0; i < pile1.size(); i++) {
|
||||
sb.append(pile1.get(i).getName()).append("\r\n");
|
||||
}
|
||||
sb.append("\r\n").append("Pile 2: ").append("\r\n");
|
||||
for (int i = 0; i < pile2.size(); i++) {
|
||||
sb.append(pile2.get(i).getName()).append("\r\n");
|
||||
}
|
||||
JOptionPane.showMessageDialog(null, sb, "", JOptionPane.INFORMATION_MESSAGE);
|
||||
if (pile1CMC >= pile2CMC) {
|
||||
final StringBuilder sbMsgP1 = new StringBuilder();
|
||||
sbMsgP1.append("Computer adds the first pile to its hand ");
|
||||
sbMsgP1.append("and puts the second pile into the graveyard");
|
||||
JOptionPane
|
||||
.showMessageDialog(null, sbMsgP1.toString(), "", JOptionPane.INFORMATION_MESSAGE);
|
||||
for (int i = 0; i < pile1.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveTo(hand, pile1.get(i));
|
||||
}
|
||||
for (int i = 0; i < pile2.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveToGraveyard(pile2.get(i));
|
||||
}
|
||||
} else {
|
||||
final StringBuilder sbMsgP2 = new StringBuilder();
|
||||
sbMsgP2.append("Computer adds the second pile to its hand and ");
|
||||
sbMsgP2.append("puts the first pile into the graveyard");
|
||||
JOptionPane
|
||||
.showMessageDialog(null, sbMsgP2.toString(), "", JOptionPane.INFORMATION_MESSAGE);
|
||||
for (int i = 0; i < pile2.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveTo(hand, pile2.get(i));
|
||||
}
|
||||
for (int i = 0; i < pile1.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveToGraveyard(pile1.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Computer chooses (It picks the highest converted
|
||||
// mana cost card and 1 random card.)
|
||||
Card biggest = null;
|
||||
biggest = library.get(0);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (CardUtil.getConvertedManaCost(biggest.getManaCost()) >= CardUtil
|
||||
.getConvertedManaCost(biggest.getManaCost())) {
|
||||
biggest = cards.get(i);
|
||||
}
|
||||
}
|
||||
pile1.add(biggest);
|
||||
cards.remove(biggest);
|
||||
if (cards.size() > 0) {
|
||||
final Card random = CardUtil.getRandom(cards.toArray());
|
||||
pile1.add(random);
|
||||
}
|
||||
for (int i = 0; i < count; i++) {
|
||||
if (!pile1.contains(library.get(i))) {
|
||||
pile2.add(library.get(i));
|
||||
}
|
||||
}
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
sb.append("Choose a pile to add to your hand: ");
|
||||
sb.append("\r\n").append("\r\n");
|
||||
sb.append("Pile 1: ").append("\r\n");
|
||||
for (int i = 0; i < pile1.size(); i++) {
|
||||
sb.append(pile1.get(i).getName()).append("\r\n");
|
||||
}
|
||||
sb.append("\r\n").append("Pile 2: ").append("\r\n");
|
||||
for (int i = 0; i < pile2.size(); i++) {
|
||||
sb.append(pile2.get(i).getName()).append("\r\n");
|
||||
}
|
||||
final Object[] possibleValues = { "Pile 1", "Pile 2" };
|
||||
final Object q = JOptionPane.showOptionDialog(null, sb, "Fact or Fiction",
|
||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, possibleValues,
|
||||
possibleValues[0]);
|
||||
if (q.equals(0)) {
|
||||
for (int i = 0; i < pile1.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveTo(hand, pile1.get(i));
|
||||
}
|
||||
for (int i = 0; i < pile2.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveToGraveyard(pile2.get(i));
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < pile2.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveTo(hand, pile2.get(i));
|
||||
}
|
||||
for (int i = 0; i < pile1.size(); i++) {
|
||||
Singletons.getModel().getGameAction().moveToGraveyard(pile1.get(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
pile1.clear();
|
||||
pile2.clear();
|
||||
} // resolve()
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
final CardList cards = AllZone.getComputerPlayer().getCardsIn(Zone.Battlefield);
|
||||
return cards.size() >= 10;
|
||||
}
|
||||
}; // SpellAbility
|
||||
|
||||
card.addSpellAbility(spell);
|
||||
}*/ // *************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
if (cardName.equals("Hurkyl's Recall")) {
|
||||
/*
|
||||
|
||||
@@ -174,78 +174,6 @@ public class CardFactorySorceries {
|
||||
spell.setBeforePayMana(runtime);
|
||||
} // *************** END ************ END **************************
|
||||
|
||||
// *************** START *********** START **************************
|
||||
/*else if (cardName.equals("Insurrection")) {
|
||||
/*
|
||||
* Untap all creatures and gain control of them until end of turn.
|
||||
* They gain haste until end of turn.
|
||||
*/
|
||||
/*final ArrayList<PlayerZone> orig = new ArrayList<PlayerZone>();
|
||||
final PlayerZone[] newZone = new PlayerZone[1];
|
||||
final ArrayList<Player> controllerEOT = new ArrayList<Player>();
|
||||
final ArrayList<Card> targets = new ArrayList<Card>();
|
||||
|
||||
final Command untilEOT = new Command() {
|
||||
private static final long serialVersionUID = -5809548350739536763L;
|
||||
|
||||
@Override
|
||||
public void execute() {
|
||||
// int i = 0;
|
||||
for (final Card target : targets) {
|
||||
// if card isn't in play, do nothing
|
||||
if (!AllZoneUtil.isCardInPlay(target)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
target.removeController(card);
|
||||
// Singletons.getModel().getGameAction().changeController(new
|
||||
// CardList(target), card.getController(),
|
||||
// controllerEOT.get(i));
|
||||
|
||||
target.removeExtrinsicKeyword("Haste");
|
||||
|
||||
// i++;
|
||||
}
|
||||
} // execute()
|
||||
}; // Command
|
||||
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
private static final long serialVersionUID = -532862769235091780L;
|
||||
|
||||
@Override
|
||||
public void resolve() {
|
||||
final CardList creatures = AllZoneUtil.getCreaturesInPlay();
|
||||
newZone[0] = card.getController().getZone(Constant.Zone.Battlefield);
|
||||
final int i = 0;
|
||||
for (final Card target : creatures) {
|
||||
if (AllZoneUtil.isCardInPlay(target)) {
|
||||
orig.add(i, AllZone.getZoneOf(target));
|
||||
controllerEOT.add(i, target.getController());
|
||||
targets.add(i, target);
|
||||
|
||||
target.addController(card);
|
||||
// Singletons.getModel().getGameAction().changeController(new
|
||||
// CardList(target), target.getController(),
|
||||
// card.getController());
|
||||
|
||||
target.untap();
|
||||
target.addExtrinsicKeyword("Haste");
|
||||
} // is card in play?
|
||||
} // end for
|
||||
AllZone.getEndOfTurn().addUntil(untilEOT);
|
||||
} // resolve()
|
||||
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
final CardList creatures = AllZoneUtil.getCreaturesInPlay(AllZone.getHumanPlayer());
|
||||
return (creatures.size() > 0) && AllZone.getPhaseHandler().getPhase().equals(Constant.Phase.MAIN1);
|
||||
} // canPlayAI()
|
||||
|
||||
}; // SpellAbility
|
||||
card.addSpellAbility(spell);
|
||||
card.setSVar("PlayMain1", "TRUE");
|
||||
}*/ // *************** END ************ END **************************
|
||||
|
||||
// *************** START *********** START **************************
|
||||
else if (cardName.equals("Brilliant Ultimatum")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
|
||||
Reference in New Issue
Block a user