mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
- Converted Fact or Fiction to script.
- Added Sphinx of Uthuun.
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -8294,6 +8294,7 @@ res/cardsfolder/s/sphinx_of_jwar_isle.txt svneol=native#text/plain
|
||||
res/cardsfolder/s/sphinx_of_lost_truths.txt svneol=native#text/plain
|
||||
res/cardsfolder/s/sphinx_of_magosi.txt svneol=native#text/plain
|
||||
res/cardsfolder/s/sphinx_of_the_steel_wind.txt svneol=native#text/plain
|
||||
res/cardsfolder/s/sphinx_of_uthuun.txt -text
|
||||
res/cardsfolder/s/sphinx_sovereign.txt svneol=native#text/plain
|
||||
res/cardsfolder/s/sphinx_summoner.txt svneol=native#text/plain
|
||||
res/cardsfolder/s/sphinxs_herald.txt -text
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
Name:Fact or Fiction
|
||||
ManaCost:3 U
|
||||
Types:Instant
|
||||
Text:Reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard.
|
||||
Text:no text
|
||||
A:SP$ Dig | Cost$ 3 U | DigNum$ 5 | Reveal$ True | RememberRevealed$ True | NoMove$ True | SubAbility$ DBTwoPiles | SpellDescription$ Reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard.
|
||||
SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | ChosenPile$ DBHand | ChosenPile$ DBHand | UnchosenPile$ DBGrave
|
||||
SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand
|
||||
SVar:DBGrave:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Graveyard
|
||||
SVar:Rarity:Uncommon
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/fact_or_fiction.jpg
|
||||
SetInfo:INV|Uncommon|http://magiccards.info/scans/en/in/57.jpg
|
||||
|
||||
17
res/cardsfolder/s/sphinx_of_uthuun.txt
Normal file
17
res/cardsfolder/s/sphinx_of_uthuun.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
Name:Sphinx of Uthuun
|
||||
ManaCost:5 U U
|
||||
Types:Creature Sphinx
|
||||
Text:no text
|
||||
PT:5/5
|
||||
K:Flying
|
||||
T:Mode$ ChangesZone | Origin$ Any | Destination$ Battlefield | ValidCard$ Card.Self | Execute$ TrigChangeZone | TriggerDescription$ When CARDNAME enters the battlefield, reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard.
|
||||
SVar:TrigChangeZone:AB$Dig | Cost$ 0 | DigNum$ 5 | Reveal$ True | RememberRevealed$ True | NoMove$ True | SubAbility$ DBTwoPiles | SpellDescription$ Reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard.
|
||||
SVar:DBTwoPiles:DB$ TwoPiles | Defined$ You | DefinedCards$ Remembered | Separator$ Opponent | ChosenPile$ DBHand | ChosenPile$ DBHand | UnchosenPile$ DBGrave
|
||||
SVar:DBHand:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Hand
|
||||
SVar:DBGrave:DB$ ChangeZone | Defined$ Remembered | Origin$ Library | Destination$ Graveyard | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/sphinx_of_uthuun.jpg
|
||||
SetInfo:M12|Rare|http://magiccards.info/scans/en/m12/76.jpg
|
||||
Oracle:Flying\nWhen Sphinx of Uthuun enters the battlefield, reveal the top five cards of your library. An opponent separates those cards into two piles. Put one pile into your hand and the other into your graveyard.
|
||||
End
|
||||
@@ -816,9 +816,15 @@ public final class AbilityFactoryChangeZone {
|
||||
}
|
||||
}
|
||||
|
||||
int changeNum = params.containsKey("ChangeNum") ? AbilityFactory.calculateAmount(card,
|
||||
params.get("ChangeNum"), sa) : 1;
|
||||
|
||||
CardList fetchList;
|
||||
if (defined) {
|
||||
fetchList = new CardList(AbilityFactory.getDefinedCards(card, params.get("Defined"), sa));
|
||||
if (!params.containsKey("ChangeNum")) {
|
||||
changeNum = fetchList.size();
|
||||
}
|
||||
} else if (!origin.contains(Zone.Library) && !origin.contains(Zone.Hand)) {
|
||||
fetchList = AllZoneUtil.getCardsIn(origin);
|
||||
} else {
|
||||
@@ -844,9 +850,6 @@ public final class AbilityFactoryChangeZone {
|
||||
|
||||
final PlayerZone destZone = player.getZone(destination);
|
||||
|
||||
final int changeNum = params.containsKey("ChangeNum") ? AbilityFactory.calculateAmount(card,
|
||||
params.get("ChangeNum"), sa) : 1;
|
||||
|
||||
final String remember = params.get("RememberChanged");
|
||||
final String imprint = params.get("Imprint");
|
||||
|
||||
@@ -865,7 +868,7 @@ public final class AbilityFactoryChangeZone {
|
||||
} else if (params.containsKey("Mandatory")) {
|
||||
o = GuiUtils.getChoice("Select a card", fetchList.toArray());
|
||||
} else if (params.containsKey("Defined")) {
|
||||
o = fetchList.get(i);
|
||||
o = fetchList.get(0);
|
||||
} else {
|
||||
o = GuiUtils.getChoiceOptional("Select a card", fetchList.toArray());
|
||||
}
|
||||
@@ -985,9 +988,15 @@ public final class AbilityFactoryChangeZone {
|
||||
type = "Card";
|
||||
}
|
||||
|
||||
int changeNum = params.containsKey("ChangeNum") ? AbilityFactory.calculateAmount(card,
|
||||
params.get("ChangeNum"), sa) : 1;
|
||||
|
||||
CardList fetchList;
|
||||
if (defined) {
|
||||
fetchList = new CardList(AbilityFactory.getDefinedCards(card, params.get("Defined"), sa));
|
||||
if (!params.containsKey("ChangeNum")) {
|
||||
changeNum = fetchList.size();
|
||||
}
|
||||
} else if (!origin.contains(Zone.Library) && !origin.contains(Zone.Hand)) {
|
||||
fetchList = AllZoneUtil.getCardsIn(origin);
|
||||
fetchList = AbilityFactory.filterListByType(fetchList, type, sa);
|
||||
@@ -1002,15 +1011,13 @@ public final class AbilityFactoryChangeZone {
|
||||
|
||||
final CardList fetched = new CardList();
|
||||
|
||||
final int changeNum = params.containsKey("ChangeNum") ? AbilityFactory.calculateAmount(card,
|
||||
params.get("ChangeNum"), sa) : 1;
|
||||
|
||||
final String remember = params.get("RememberChanged");
|
||||
final String imprint = params.get("Imprint");
|
||||
|
||||
if (params.containsKey("Unimprint")) {
|
||||
card.clearImprinted();
|
||||
}
|
||||
System.out.println("change fetchList:" + fetchList);
|
||||
|
||||
for (int i = 0; i < changeNum; i++) {
|
||||
if ((fetchList.size() == 0) || (destination == null)) {
|
||||
@@ -1053,8 +1060,10 @@ public final class AbilityFactoryChangeZone {
|
||||
}
|
||||
|
||||
fetched.add(c);
|
||||
if (!defined) {
|
||||
fetchList.remove(c);
|
||||
}
|
||||
}
|
||||
|
||||
if (origin.contains(Zone.Library) && !defined) {
|
||||
player.shuffle();
|
||||
|
||||
@@ -26,6 +26,8 @@ import javax.swing.JOptionPane;
|
||||
import forge.AllZone;
|
||||
import forge.Card;
|
||||
import forge.CardList;
|
||||
import forge.CardUtil;
|
||||
import forge.Constant;
|
||||
import forge.Constant.Zone;
|
||||
import forge.GameActionUtil;
|
||||
import forge.Player;
|
||||
@@ -615,6 +617,12 @@ public final class AbilityFactoryClash {
|
||||
private static void twoPilesResolve(final AbilityFactory af, final SpellAbility sa) {
|
||||
final HashMap<String, String> params = af.getMapParams();
|
||||
final Card card = af.getHostCard();
|
||||
Constant.Zone zone = null;
|
||||
boolean pile1WasChosen = true;
|
||||
|
||||
if (params.containsKey("Origin")) {
|
||||
zone = Constant.Zone.smartValueOf(params.get("Zone"));
|
||||
}
|
||||
|
||||
String valid = "";
|
||||
if (params.containsKey("ValidCards")) {
|
||||
@@ -644,8 +652,14 @@ public final class AbilityFactoryClash {
|
||||
if ((tgt == null) || p.canBeTargetedBy(sa)) {
|
||||
final ArrayList<Card> pile1 = new ArrayList<Card>();
|
||||
final ArrayList<Card> pile2 = new ArrayList<Card>();
|
||||
CardList pool = p.getCardsIn(Zone.Battlefield);
|
||||
CardList pool = new CardList();
|
||||
if (params.containsKey("DefinedCards")) {
|
||||
pool = new CardList(AbilityFactory.getDefinedCards(sa.getSourceCard(), params.get("DefinedCards"), sa));
|
||||
} else {
|
||||
pool = p.getCardsIn(zone);
|
||||
}
|
||||
pool = pool.getValidCards(valid, card.getController(), card);
|
||||
int size = pool.size();
|
||||
|
||||
// first, separate the cards into piles
|
||||
if (separator.isHuman()) {
|
||||
@@ -657,12 +671,36 @@ public final class AbilityFactoryClash {
|
||||
for (final Card c : pool) {
|
||||
pile2.add(c);
|
||||
}
|
||||
} else {
|
||||
// TODO - not implemented
|
||||
} else if (size > 0) {
|
||||
//computer separates
|
||||
Card biggest = null;
|
||||
Card smallest = null;
|
||||
biggest = pool.get(0);
|
||||
smallest = pool.get(0);
|
||||
|
||||
for (Card c : pool) {
|
||||
if (c.getCMC() >= biggest.getCMC()) {
|
||||
biggest = c;
|
||||
}
|
||||
if (c.getCMC() <= smallest.getCMC()) {
|
||||
smallest = c;
|
||||
}
|
||||
}
|
||||
pile1.add(biggest);
|
||||
|
||||
if (size > 3) {
|
||||
pile1.add(smallest);
|
||||
}
|
||||
for (Card c : pool) {
|
||||
if (!pile1.contains(c)) {
|
||||
pile2.add(c);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("Pile 1:" + pile1);
|
||||
System.out.println("Pile 2:" + pile2);
|
||||
card.clearRemembered();
|
||||
|
||||
// then, the chooser picks a pile
|
||||
if (chooser.isHuman()) {
|
||||
@@ -693,6 +731,7 @@ public final class AbilityFactoryClash {
|
||||
for (final Card z : pile2) {
|
||||
card.addRemembered(z);
|
||||
}
|
||||
pile1WasChosen = false;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -715,6 +754,7 @@ public final class AbilityFactoryClash {
|
||||
for (final Card c : pile2) {
|
||||
card.addRemembered(c);
|
||||
}
|
||||
pile1WasChosen = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -727,6 +767,27 @@ public final class AbilityFactoryClash {
|
||||
|
||||
AbilityFactory.resolve(action, false);
|
||||
}
|
||||
|
||||
// take action on the chosen pile
|
||||
if (params.containsKey("UnchosenPile")) {
|
||||
//switch the remembered cards
|
||||
card.clearRemembered();
|
||||
if (pile1WasChosen) {
|
||||
for (final Card c : pile2) {
|
||||
card.addRemembered(c);
|
||||
}
|
||||
} else {
|
||||
for (final Card c : pile1) {
|
||||
card.addRemembered(c);
|
||||
}
|
||||
}
|
||||
final AbilityFactory afPile = new AbilityFactory();
|
||||
final SpellAbility action = afPile.getAbility(card.getSVar(params.get("UnchosenPile")), card);
|
||||
action.setActivatingPlayer(sa.getActivatingPlayer());
|
||||
((AbilitySub) action).setParent(sa);
|
||||
|
||||
AbilityFactory.resolve(action, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} // end twoPiles resolve
|
||||
|
||||
@@ -65,7 +65,7 @@ public class CardFactoryInstants {
|
||||
public static Card getCard(final Card card, final String cardName) {
|
||||
|
||||
// *************** START *********** START **************************
|
||||
if (cardName.equals("Fact or Fiction")) {
|
||||
/*if (cardName.equals("Fact or Fiction")) {
|
||||
final SpellAbility spell = new Spell(card) {
|
||||
private static final long serialVersionUID = 1481112451519L;
|
||||
|
||||
@@ -227,10 +227,10 @@ public class CardFactoryInstants {
|
||||
}; // SpellAbility
|
||||
|
||||
card.addSpellAbility(spell);
|
||||
} // *************** END ************ END **************************
|
||||
}*/ // *************** END ************ END **************************
|
||||
|
||||
//*************** START *********** START **************************
|
||||
else if (cardName.equals("Hurkyl's Recall")) {
|
||||
if (cardName.equals("Hurkyl's Recall")) {
|
||||
/*
|
||||
* Return all artifacts target player owns to his or her hand.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user