mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- Added Phyrexian Portal
- Simplified Two Piles logic allowed for FaceDown piles
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -6911,6 +6911,7 @@ res/cardsfolder/p/phyrexian_monitor.txt svneol=native#text/plain
|
|||||||
res/cardsfolder/p/phyrexian_negator.txt svneol=native#text/plain
|
res/cardsfolder/p/phyrexian_negator.txt svneol=native#text/plain
|
||||||
res/cardsfolder/p/phyrexian_obliterator.txt svneol=native#text/plain
|
res/cardsfolder/p/phyrexian_obliterator.txt svneol=native#text/plain
|
||||||
res/cardsfolder/p/phyrexian_plaguelord.txt svneol=native#text/plain
|
res/cardsfolder/p/phyrexian_plaguelord.txt svneol=native#text/plain
|
||||||
|
res/cardsfolder/p/phyrexian_portal.txt -text
|
||||||
res/cardsfolder/p/phyrexian_processor.txt svneol=native#text/plain
|
res/cardsfolder/p/phyrexian_processor.txt svneol=native#text/plain
|
||||||
res/cardsfolder/p/phyrexian_prowler.txt svneol=native#text/plain
|
res/cardsfolder/p/phyrexian_prowler.txt svneol=native#text/plain
|
||||||
res/cardsfolder/p/phyrexian_rager.txt svneol=native#text/plain
|
res/cardsfolder/p/phyrexian_rager.txt svneol=native#text/plain
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ Name:Demonic Tutor
|
|||||||
ManaCost:1 B
|
ManaCost:1 B
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
Text:no text
|
Text:no text
|
||||||
A:SP$ ChangeZone | Cost$ 1 B| Origin$ Library | Destination$ Hand | ChangeType$ Card | ChangeNum$ 1 | Mandatory$ True | SpellDescription$ Search your library for a card and put that card into your hand. Then shuffle your library.
|
A:SP$ ChangeZone | Cost$ 1 B | Origin$ Library | Destination$ Hand | ChangeType$ Card | ChangeNum$ 1 | Mandatory$ True | SpellDescription$ Search your library for a card and put that card into your hand. Then shuffle your library.
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Rarity:Uncommon
|
SVar:Rarity:Uncommon
|
||||||
SVar:Picture:http://resources.wizards.com/magic/cards/3e/en-us/card1155.jpg
|
SVar:Picture:http://resources.wizards.com/magic/cards/3e/en-us/card1155.jpg
|
||||||
|
|||||||
17
res/cardsfolder/p/phyrexian_portal.txt
Normal file
17
res/cardsfolder/p/phyrexian_portal.txt
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
Name:Phyrexian Portal
|
||||||
|
ManaCost:3
|
||||||
|
Types:Artifact
|
||||||
|
Text:no text
|
||||||
|
A:AB$ Dig | Cost$ 3 | DigNum$ 10 | RememberRevealed$ True | NoMove$ True | Choser$ Opponent | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | SubAbility$ DBTwoPiles | SpellDescription$ If your library has ten or more cards in it, target opponent looks at the top ten cards of your library and separates them into two face-down piles. Exile one of those piles. Search the other pile for a card, put it into your hand, then shuffle the rest of that pile into your library. | StackDescription$ If your library has ten or more cards in it, target opponent looks at the top ten cards of your library and separates them into two face-down piles. Exile one of those piles. Search the other pile for a card, put it into your hand, then shuffle the rest of that pile into your library.
|
||||||
|
SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | FaceDown$ True | ConditionCheckSVar$ X | ConditionSVarCompare$ GE10 | ChosenPile$ DBHand | UnchosenPile$ DBExile | SubAbility$ DBCleanup
|
||||||
|
SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand | ChangeType$ Card | ChangeNum$ 1 | Mandatory$ True | Shuffle$ True
|
||||||
|
SVar:DBExile:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Exile
|
||||||
|
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||||
|
# This variable may be incorrect if the controller changes while the ability is on the stack
|
||||||
|
SVar:X:Count$InYourLibrary
|
||||||
|
SVar:Rarity:Rare
|
||||||
|
SVar:RemAIDeck:True
|
||||||
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/phyrexian_portal.jpg
|
||||||
|
SetInfo:ALL|Rare|http://magiccards.info/scans/en/ai/168.jpg
|
||||||
|
Oracle:{3}: If your library has ten or more cards in it, target opponent looks at the top ten cards of your library and separates them into two face-down piles. Exile one of those piles. Search the other pile for a card, put it into your hand, then shuffle the rest of that pile into your library.
|
||||||
|
End
|
||||||
@@ -770,6 +770,7 @@ public final class AbilityFactoryClash {
|
|||||||
for (final Card c : l) {
|
for (final Card c : l) {
|
||||||
pile1.add(c);
|
pile1.add(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (final Card c : pool) {
|
for (final Card c : pool) {
|
||||||
if (!pile1.contains(c)) {
|
if (!pile1.contains(c)) {
|
||||||
pile2.add(c);
|
pile2.add(c);
|
||||||
@@ -806,67 +807,8 @@ public final class AbilityFactoryClash {
|
|||||||
System.out.println("Pile 2:" + pile2);
|
System.out.println("Pile 2:" + pile2);
|
||||||
card.clearRemembered();
|
card.clearRemembered();
|
||||||
|
|
||||||
// then, the chooser picks a pile
|
pile1WasChosen = selectPiles(params, sa, pile1, pile2, chooser, card, pool);
|
||||||
if (chooser.isHuman()) {
|
|
||||||
final Card[] disp = new Card[pile1.size() + pile2.size() + 2];
|
|
||||||
disp[0] = new Card();
|
|
||||||
disp[0].setName("Pile 1");
|
|
||||||
for (int i = 0; i < pile1.size(); i++) {
|
|
||||||
disp[1 + i] = pile1.get(i);
|
|
||||||
}
|
|
||||||
disp[pile1.size() + 1] = new Card();
|
|
||||||
disp[pile1.size() + 1].setName("Pile 2");
|
|
||||||
for (int i = 0; i < pile2.size(); i++) {
|
|
||||||
disp[pile1.size() + i + 2] = pile2.get(i);
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure Pile 1 or Pile 2 is clicked on
|
|
||||||
boolean chosen = false;
|
|
||||||
while (!chosen) {
|
|
||||||
final Object o = GuiUtils.chooseOne("Choose a pile", disp);
|
|
||||||
final Card c = (Card) o;
|
|
||||||
if (c.getName().equals("Pile 1")) {
|
|
||||||
chosen = true;
|
|
||||||
for (final Card z : pile1) {
|
|
||||||
card.addRemembered(z);
|
|
||||||
}
|
|
||||||
} else if (c.getName().equals("Pile 2")) {
|
|
||||||
chosen = true;
|
|
||||||
for (final Card z : pile2) {
|
|
||||||
card.addRemembered(z);
|
|
||||||
}
|
|
||||||
pile1WasChosen = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
int cmc1 = CardFactoryUtil.evaluatePermanentList(new CardList(pile1));
|
|
||||||
int cmc2 = CardFactoryUtil.evaluatePermanentList(new CardList(pile2));
|
|
||||||
if (pool.getNotType("Creature").isEmpty()) {
|
|
||||||
cmc1 = CardFactoryUtil.evaluateCreatureList(new CardList(pile1));
|
|
||||||
cmc2 = CardFactoryUtil.evaluateCreatureList(new CardList(pile2));
|
|
||||||
System.out.println("value:" + cmc1 + " " + cmc2);
|
|
||||||
}
|
|
||||||
|
|
||||||
// for now, this assumes that the outcome will be bad
|
|
||||||
// TODO: This should really have a ChooseLogic param to
|
|
||||||
// figure this out
|
|
||||||
if (cmc2 > cmc1) {
|
|
||||||
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 1", "",
|
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
for (final Card c : pile1) {
|
|
||||||
card.addRemembered(c);
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 2", "",
|
|
||||||
JOptionPane.INFORMATION_MESSAGE);
|
|
||||||
for (final Card c : pile2) {
|
|
||||||
card.addRemembered(c);
|
|
||||||
}
|
|
||||||
pile1WasChosen = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// take action on the chosen pile
|
// take action on the chosen pile
|
||||||
if (params.containsKey("ChosenPile")) {
|
if (params.containsKey("ChosenPile")) {
|
||||||
final AbilityFactory afPile = new AbilityFactory();
|
final AbilityFactory afPile = new AbilityFactory();
|
||||||
@@ -901,4 +843,93 @@ public final class AbilityFactoryClash {
|
|||||||
}
|
}
|
||||||
} // end twoPiles resolve
|
} // end twoPiles resolve
|
||||||
|
|
||||||
|
private static boolean selectPiles(final HashMap<String, String> params, final SpellAbility sa, ArrayList<Card> pile1, ArrayList<Card> pile2,
|
||||||
|
Player chooser, Card card, CardList pool) {
|
||||||
|
boolean pile1WasChosen = true;
|
||||||
|
// then, the chooser picks a pile
|
||||||
|
|
||||||
|
if (params.containsKey("FaceDown")) {
|
||||||
|
// Used for Phyrexian Portal, FaceDown Pile choosing
|
||||||
|
if (chooser.isHuman()) {
|
||||||
|
final String p1Str = String.format("Pile 1 (%s cards)", pile1.size());
|
||||||
|
final String p2Str = String.format("Pile 2 (%s cards)", pile2.size());
|
||||||
|
|
||||||
|
final String message = String.format("Choose a pile\n%s or %s", p1Str, p2Str);
|
||||||
|
|
||||||
|
final Object[] possibleValues = { p1Str , p2Str };
|
||||||
|
|
||||||
|
final Object playDraw = JOptionPane.showOptionDialog(null, message, "Choose a Pile",
|
||||||
|
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null,
|
||||||
|
possibleValues, possibleValues[0]);
|
||||||
|
|
||||||
|
pile1WasChosen = playDraw.equals(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// AI will choose the first pile if it is larger or the same
|
||||||
|
// TODO Improve this to be slightly more random to not be so predictable
|
||||||
|
pile1WasChosen = pile1.size() >= pile2.size();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (chooser.isHuman()) {
|
||||||
|
final Card[] disp = new Card[pile1.size() + pile2.size() + 2];
|
||||||
|
disp[0] = new Card();
|
||||||
|
disp[0].setName("Pile 1");
|
||||||
|
for (int i = 0; i < pile1.size(); i++) {
|
||||||
|
disp[1 + i] = pile1.get(i);
|
||||||
|
}
|
||||||
|
disp[pile1.size() + 1] = new Card();
|
||||||
|
disp[pile1.size() + 1].setName("Pile 2");
|
||||||
|
for (int i = 0; i < pile2.size(); i++) {
|
||||||
|
disp[pile1.size() + i + 2] = pile2.get(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
// make sure Pile 1 or Pile 2 is clicked on
|
||||||
|
while (true) {
|
||||||
|
final Object o = GuiUtils.chooseOne("Choose a pile", disp);
|
||||||
|
final Card c = (Card) o;
|
||||||
|
String name = c.getName();
|
||||||
|
|
||||||
|
if (!(name.equals("Pile 1") || name.equals("Pile 2"))) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
pile1WasChosen = name.equals("Pile 1");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
int cmc1 = CardFactoryUtil.evaluatePermanentList(new CardList(pile1));
|
||||||
|
int cmc2 = CardFactoryUtil.evaluatePermanentList(new CardList(pile2));
|
||||||
|
if (pool.getNotType("Creature").isEmpty()) {
|
||||||
|
cmc1 = CardFactoryUtil.evaluateCreatureList(new CardList(pile1));
|
||||||
|
cmc2 = CardFactoryUtil.evaluateCreatureList(new CardList(pile2));
|
||||||
|
System.out.println("value:" + cmc1 + " " + cmc2);
|
||||||
|
}
|
||||||
|
|
||||||
|
// for now, this assumes that the outcome will be bad
|
||||||
|
// TODO: This should really have a ChooseLogic param to
|
||||||
|
// figure this out
|
||||||
|
pile1WasChosen = cmc1 >= cmc2;
|
||||||
|
if (pile1WasChosen) {
|
||||||
|
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 1", "",
|
||||||
|
JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
} else {
|
||||||
|
JOptionPane.showMessageDialog(null, "Computer chooses the Pile 2", "",
|
||||||
|
JOptionPane.INFORMATION_MESSAGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pile1WasChosen) {
|
||||||
|
for (final Card z : pile1) {
|
||||||
|
card.addRemembered(z);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (final Card z : pile2) {
|
||||||
|
card.addRemembered(z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return pile1WasChosen;
|
||||||
|
}
|
||||||
} // end class AbilityFactory_Clash
|
} // end class AbilityFactory_Clash
|
||||||
|
|||||||
@@ -226,6 +226,11 @@ public final class AbilityFactoryReveal {
|
|||||||
} else {
|
} else {
|
||||||
sb.append(" ");
|
sb.append(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (params.containsKey("StackDescription")) {
|
||||||
|
sb.append(params.get("StackDescription"));
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
ArrayList<Player> tgtPlayers;
|
ArrayList<Player> tgtPlayers;
|
||||||
|
|
||||||
@@ -467,7 +472,7 @@ public final class AbilityFactoryReveal {
|
|||||||
cardsRevealed = true;
|
cardsRevealed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((params.containsKey("RememberRevealed")) && cardsRevealed) {
|
if ((params.containsKey("RememberRevealed")) && !params.containsKey("RevealValid")) {
|
||||||
for (final Card one : top) {
|
for (final Card one : top) {
|
||||||
host.addRemembered(one);
|
host.addRemembered(one);
|
||||||
}
|
}
|
||||||
@@ -2232,7 +2237,7 @@ public final class AbilityFactoryReveal {
|
|||||||
} else {
|
} else {
|
||||||
sb.append(sa.getSourceCard()).append(" - ");
|
sb.append(sa.getSourceCard()).append(" - ");
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Player> tgtPlayers;
|
ArrayList<Player> tgtPlayers;
|
||||||
|
|
||||||
final Target tgt = sa.getTarget();
|
final Target tgt = sa.getTarget();
|
||||||
|
|||||||
Reference in New Issue
Block a user