Added Spreading Seas (A bit dodgy), Chalice of the Void, Teferi's Puzzle Box and Cruel Ultimatum.

This commit is contained in:
jendave
2011-08-06 04:47:10 +00:00
parent 6d4aaf8a05
commit 54253eaba3
7 changed files with 393 additions and 5 deletions

View File

@@ -17,8 +17,8 @@ abstract public class Ability extends SpellAbility {
@Override
public boolean canPlay() {
// if(getSourceCard().isCreature() && (!getSourceCard().hasSickness()))
return AllZone.GameAction.isCardInPlay(getSourceCard()) && !getSourceCard().isFaceDown();
return AllZone.GameAction.isCardInPlay(getSourceCard()) && !getSourceCard().isFaceDown() && getSourceCard().getName().equals("Spreading Seas") == false; // For Spreading Seas
// return false;
}
}

View File

@@ -7507,6 +7507,141 @@ public class CardFactory implements NewConstants {
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Cruel Ultimatum")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -6598023699468746L;
@Override
public void resolve() {
// Opponent Sacrifices Creature
String player = card.getController();
AllZone.Display.showMessage("Sacrifice a Creature: ");
ButtonUtil.enableOnlyCancel();
PlayerZone play = AllZone.getZone(Constant.Zone.Play, AllZone.GameAction.getOpponent(card.getController()));
CardList creature2 = new CardList();
creature2.addAll(play.getCards());
creature2 = creature2.getType("Creature");
if(player != "Human"){
if(creature2.size() > 0) {
Card[] Target = new Card[creature2.size()];
for(int i = 0; i < creature2.size(); i++) {
Card crd = creature2.get(i);
Target[i] = crd;
}
Object check = AllZone.Display.getChoice("Select creature", Target);
if(check != null) {
setTargetCard((Card) check);
}
}
} else {
if(creature2.size() > 0) {
Card smallest = creature2.get(0);
for(int i = 0; i < creature2.size(); i++)
if(smallest.getNetAttack() < creature2.get(i).getNetAttack()) smallest = creature2.get(i);
setTargetCard(smallest);
}
}
Card c = getTargetCard();
AllZone.GameAction.sacrifice(c);
// Opponent Discards 3 Cards
PlayerZone Ohand = AllZone.getZone(Constant.Zone.Hand, AllZone.GameAction.getOpponent(card.getController()));
Card h[] = Ohand.getCards();
Card[] handChoices = Ohand.getCards();
int Handsize = 3;
if(h.length <= 3) Handsize = h.length;
String opponent = AllZone.GameAction.getOpponent(card.getController());
Card choice = null;
for(int i = 0; i < Handsize; i++) {
AllZone.Display.showMessage("Select a card to discard " + (3 - i) + " more to discard");
ButtonUtil.enableOnlyCancel();
handChoices = Ohand.getCards();
//human chooses
if(opponent.equals(Constant.Player.Human)) {
choice = AllZone.Display.getChoice("Choose", handChoices);
} else//computer chooses
{
choice = CardUtil.getRandom(handChoices);
}
AllZone.GameAction.discard(choice);
}
// Opponent Loses 5 Life
PlayerLife target = AllZone.GameAction.getPlayerLife(opponent);
target.subtractLife(5);
// Player Returns Creature Card from Graveyard to Hand
if(player == "Human") {
AllZone.Display.showMessage("Return a creature from your graveyard to your hand: ");
ButtonUtil.enableOnlyCancel();
}
CardList creature = new CardList();
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
if(zone != null) {
creature.addAll(zone.getCards());
creature = creature.getType("Creature");
if(player == "Human"){
Card[] Target = new Card[creature.size()];
for(int i = 0; i < creature.size(); i++) {
Card crd = creature.get(i);
Target[i] = crd;
}
Object check = AllZone.Display.getChoiceOptional("Select creature", Target);
if(check != null) {
setTargetCard((Card) check);
}
} else {
Card biggest = creature.get(0);
for(int i = 0; i < creature.size(); i++)
if(biggest.getNetAttack() < creature.get(i).getNetAttack()) biggest = creature.get(i);
setTargetCard(biggest);
}
Card c2 = getTargetCard();
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
if(AllZone.GameAction.isCardInZone(c2, grave)) {
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
AllZone.GameAction.moveTo(hand, c2);
}
}
// Player Draws 3 Cards
for(int i = 0; i < 3; i++) {
AllZone.GameAction.drawCard(card.getController());
}
// Player Gains 5 Life
PlayerLife playerlife = AllZone.GameAction.getPlayerLife(card.getController());
playerlife.addLife(5);
} // Resolve
public boolean canPlayAI() {
String opponent = AllZone.GameAction.getOpponent(card.getController());
PlayerLife target = AllZone.GameAction.getPlayerLife(opponent);
PlayerZone Lib = AllZone.getZone(Constant.Zone.Library, card.getController());
CardList Deck = new CardList();
Deck.addAll(Lib.getCards());
PlayerZone play = AllZone.getZone(Constant.Zone.Play, AllZone.GameAction.getOpponent(card.getController()));
CardList creature = new CardList();
creature.addAll(play.getCards());
creature = creature.getType("Creature");
PlayerZone zone = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
CardList creature2 = new CardList();
creature2.addAll(zone.getCards());
creature2 = creature2.getType("Creature");
return (Deck.size() > 2 && (target.getLife() <= 5 || (creature.size() > 0 && creature2.size() > 0)));
}
};//SpellAbility
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Tendrils of Agony")) {
SpellAbility spell = new Spell(card) {
@@ -13933,6 +14068,19 @@ public class CardFactory implements NewConstants {
card.addSpellAbility(spell);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Chalice of the Void")) {
Command intoPlay = new Command() {
private static final long serialVersionUID = -7679939432259603542L;
public void execute() {
int XCounters = card.getXManaCostPaid();
card.addCounter(Counters.CHARGE, XCounters);
}
};
card.addComesIntoPlayCommand(intoPlay);
}
//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Counterbalance")) {

View File

@@ -5,6 +5,8 @@ package forge;
import java.util.ArrayList;
import java.util.StringTokenizer;
import javax.swing.JOptionPane;
class CardFactory_Auras {
@@ -605,6 +607,144 @@ class CardFactory_Auras {
};
spell.setBeforePayMana(runtime);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Spreading Seas")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 53941812202244498L;
@Override
public boolean canPlayAI() {
CardList list = new CardList(AllZone.Human_Play.getCards());
list = list.getType("Land");
if(list.isEmpty()) return false;
setTargetCard(list.get(0));
return true;
}//canPlayAI()
@Override
public void resolve() {
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
play.add(card);
Card c = getTargetCard();
if(AllZone.GameAction.isCardInPlay(c) && CardFactoryUtil.canTarget(card, c)) card.enchantCard(c);
}//resolve()
};//SpellAbility
card.clearSpellAbility();
card.addSpellAbility(spell);
Command onEnchant = new Command() {
private static final long serialVersionUID = 3528675502863241126L;
public void execute() {
if(card.isEnchanting()) {
Card crd = card.getEnchanting().get(0);
crd.removeType("Swamp");
crd.removeType("Forest");
crd.removeType("Island");
crd.removeType("Plains");
crd.removeType("Mountain");
crd.addType("Island");
SpellAbility[] Abilities = crd.getSpellAbility();
for(int i = 0; i < Abilities.length; i++) {
card.addSpellAbility(Abilities[i]);
}
crd.clearSpellAbility();
crd.addSpellAbility(new Ability_Mana(card, "tap: add U") {
private static final long serialVersionUID = 787103012484588884L;
});
}
}//execute()
};//Command
Command onUnEnchant = new Command() {
private static final long serialVersionUID = -2021446345291180334L;
public void execute() {
if(card.isEnchanting()) {
Card crd = card.getEnchanting().get(0);
ArrayList<Card> Seas = crd.getEnchantedBy();
int Count = 0;
for(int i = 0; i < Seas.size(); i++) {
if(Seas.get(i).getName().equals("Spreading Seas")) Count = Count + 1;
}
if(Count == 1) {
crd.removeType("Island");
crd.removeType("Land");
crd.removeType("Basic");
crd.removeType("Snow");
crd.removeType("Legendary");
crd.clearSpellAbility();
Card c = AllZone.CardFactory.copyCard(crd);
ArrayList<String> Types = c.getType();
SpellAbility[] Abilities = card.getSpellAbility();
for(int i = 0; i < Types.size(); i++) {
crd.addType(Types.get(i));
}
for(int i = 0; i < Abilities.length; i++) {
crd.addSpellAbility(Abilities[i]);
}
JOptionPane.showMessageDialog(null, Abilities, "", JOptionPane.INFORMATION_MESSAGE);
// Restoring the card gives it the abilities from the copied card. This card is not in play and has no counters and thus the Dark Depths Error
}
}
}//execute()
};//Command
Command onLeavesPlay = new Command() {
private static final long serialVersionUID = -4543302260602460839L;
public void execute() {
if(card.isEnchanting()) {
Card crd = card.getEnchanting().get(0);
card.unEnchantCard(crd);
}
}
};
card.addEnchantCommand(onEnchant);
card.addUnEnchantCommand(onUnEnchant);
card.addLeavesPlayCommand(onLeavesPlay);
Input runtime = new Input() {
private static final long serialVersionUID = -6237279587146079880L;
@Override
public void showMessage() {
PlayerZone comp = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
PlayerZone hum = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human);
CardList land = new CardList();
land.addAll(comp.getCards());
land.addAll(hum.getCards());
land = land.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.isLand();
}
});
stopSetNext(CardFactoryUtil.input_targetSpecific(spell, land, "Select target land", true,
false));
}
};
spell.setBeforePayMana(runtime);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Cursed Land")) {

View File

@@ -1250,7 +1250,7 @@ class CardFactory_Lands {
if(sa.getSourceCard().equals(card)) return false;
}
if(card.getCounters(Counters.ICE) > 0 && AllZone.GameAction.isCardInPlay(card)) return true;
if(card.getCounters(Counters.ICE) > 0 && AllZone.GameAction.isCardInPlay(card) && card.isEnchantedBy("Spreading Seas") == false) return true; // Dodgy Fix to Spreading Seas
else return false;
}
@@ -1278,7 +1278,7 @@ class CardFactory_Lands {
//TODO - this should probably be a state effect
@Override
public boolean canPlay() {
return card.getCounters(Counters.ICE) == 0 && AllZone.GameAction.isCardInPlay(card);
return card.getCounters(Counters.ICE) == 0 && AllZone.GameAction.isCardInPlay(card)&& card.isEnchantedBy("Spreading Seas") == false; // Dodgy Fix to Spreading Seas
}
@Override

View File

@@ -109,6 +109,7 @@ public class GameActionUtil {
// cause black vise to do an extra point of
// damage if black vise was in play
upkeep_Font_of_Mythos();
upkeep_Teferi_Puzzle_Box();
upkeep_Overbeing_of_Myth();
upkeep_AI_Aluren(); // experimental, just have the AI dump his small
@@ -263,6 +264,7 @@ public class GameActionUtil {
playCard_Storm(c);
playCard_Dovescape(c); //keep this one top
playCard_Chalice_of_the_Void(c);
playCard_Vengevine(c);
playCard_Demigod_of_Revenge(c);
playCard_Halcyon_Glaze(c);
@@ -270,7 +272,7 @@ public class GameActionUtil {
playCard_Infernal_Kirin(c);
playCard_Cloudhoof_Kirin(c);
playCard_Bounteous_Kirin(c);
playCard_Emberstrike_Duo(c);
playCard_Emberstrike_Duo(c);
playCard_Gravelgill_Duo(c);
playCard_Safehold_Duo(c);
playCard_Tattermunge_Duo(c);
@@ -1095,7 +1097,33 @@ public class GameActionUtil {
}//Gravelgill Duo
public static void playCard_Chalice_of_the_Void(Card c) {
CardList list = AllZoneUtil.getCardsInPlay();
list = list.getName("Chalice of the Void");
if(list.size() > 0) {
for(int i = 0; i < list.size(); i++) {
final Card card = list.get(i);
final SpellAbility sa = AllZone.Stack.peek();
Ability ability2 = new Ability(card, "0") {
@Override
public void resolve() {
AllZone.Stack.pop();
AllZone.GameAction.moveToGraveyard(sa.getSourceCard());
}
}; // ability2
ability2.setStackDescription(card.getName() + " - " + c.getController()
+ " played a spell with same amount of charge counters on Chalice of the Void. The spell is countered");
int convertedManaSpell = CardUtil.getConvertedManaCost(sa.getSourceCard().getManaCost());
if(sa.isSpell() == true && card.getCounters(Counters.CHARGE) == convertedManaSpell) AllZone.Stack.add(ability2);
}
}//if
} // Chalice_of_the_Void
public static void playCard_Safehold_Duo(Card c) {
final String controller = c.getController();
@@ -8390,6 +8418,52 @@ public class GameActionUtil {
AllZone.GameAction.drawCard(player);
}
}// upkeep_Font_of_Mythos()
private static void upkeep_Teferi_Puzzle_Box() {
final String player = AllZone.Phase.getActivePlayer();
CardList list = new CardList();
list.addAll(AllZone.Human_Play.getCards());
list.addAll(AllZone.Computer_Play.getCards());
list = list.getName("Teferi's Puzzle Box");
PlayerZone Playerhand = AllZone.getZone(Constant.Zone.Hand, player);
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, player);
CardList hand = new CardList();
Card[] handlist = null;
if(list.size() > 0) {
AllZone.Display.showMessage("Shuffle cards back into your library: ");
ButtonUtil.enableOnlyCancel();
AllZone.GameAction.drawCard(player); // Player draws a card in the draw phase before this card activates
hand.addAll(Playerhand.getCards());
int Count = hand.size();
for(int i = 0; i < list.size(); i++) {
if(player == "Human") {
for(int e = 0; e < Count; e++) {
if(hand.size() == 0) hand.addAll(Playerhand.getCards());
handlist = hand.toArray();
Object check = AllZone.Display.getChoice("Select card to put on bottom of library", handlist);
if(check != null) {
Card target = ((Card) check);
hand.remove(target);
AllZone.GameAction.moveTo(lib, target);
}
}
}else {
for(int x = 0; x < hand.size(); x++) hand.remove(hand.get(x));
hand.addAll(Playerhand.getCards());
for(int e = 0; e < hand.size(); e++) {
AllZone.GameAction.moveTo(lib, hand.get(e));
}
}
if(i == list.size() - 1) Count = Count - 1; // To remove the effect of the initial hack draw
for(int d = 0; d < Count; d++) {
AllZone.GameAction.drawCard(player);
}
}
}
}// Teferi_Puzzle_Box
private static void upkeep_Overbeing_of_Myth() {
final String player = AllZone.Phase.getActivePlayer();