These cards were converted to keyword in the past. The original code objects were commented out when they were keyword-ed. I have deleted these commented out code objects:

Brave the Elements through Warrior's Honor
Tanglebloom
Sacred Nectar
Reviving Dose
Hymn to Tourach
Haze of Rage
Renewed Faith through Nourish
Wit's End
Coercion
Brainbite
This commit is contained in:
jendave
2011-08-06 05:34:48 +00:00
parent b083e63429
commit eec50f51f8

View File

@@ -4394,272 +4394,6 @@ public class CardFactory implements NewConstants {
card.addSpellAbility(spell);
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
if(cardName.equals("Brave the Elements")
|| cardName.equals("Burst of Speed")
|| cardName.equals("Dance of Shadows") || cardName.equals("Desperate Charge")
|| cardName.equals("Glorious Charge") || cardName.equals("Kjeldoran War Cry")
|| cardName.equals("Magnify") || cardName.equals("Nature's Cloak")
|| cardName.equals("Nocturnal Raid") || cardName.equals("Overrun")
|| cardName.equals("Path of Anger's Flame") || cardName.equals("Resuscitate")
|| cardName.equals("Righteous Charge") || cardName.equals("Scare Tactics")
|| cardName.equals("Shield Wall") || cardName.equals("Solidarity")
|| cardName.equals("Steadfastness") || cardName.equals("Tortoise Formation")
|| cardName.equals("Tromp the Domains") || cardName.equals("Valorous Charge")
|| cardName.equals("Virtuous Charge") || cardName.equals("Vitalizing Wind")
|| cardName.equals("Warrior's Charge") || cardName.equals("Warrior's Honor")) {
SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -5844664906503221006L;
@Override
public boolean canPlayAI() {
return getAttacker() != null;
}
public Card getAttacker() {
//target creatures that is going to attack
Combat c = ComputerUtil.getAttackers();
Card[] att = c.getAttackers();
if(cardName.equals("Dance of Shadows") || cardName.equals("Overrun")
|| cardName.equals("Tromp the Domains")) {
if(att.length > 2) // Effect best used with a few creatures
return att[0];
else return null;
}
if(cardName.equals("Brave the Elements")
|| cardName.equals("Burst of Speed") || cardName.equals("Chorus of Woe")
|| cardName.equals("Desperate Charge") || cardName.equals("Glorious Charge")
|| cardName.equals("Kjeldoran War Cry") || cardName.equals("Magnify")
|| cardName.equals("Nature's Cloak") || cardName.equals("Nocturnal Raid")
|| cardName.equals("Path of Anger's Flame") || cardName.equals("Resuscitate")
|| cardName.equals("Righteous Charge") || cardName.equals("Scare Tactics")
|| cardName.equals("Shield Wall") || cardName.equals("Solidarity")
|| cardName.equals("Steadfastness") || cardName.equals("Tortoise Formation")
|| cardName.equals("Valorous Charge") || cardName.equals("Vitalizing Wind")
|| cardName.equals("Virtuous Charge") || cardName.equals("Warrior's Charge")
|| cardName.equals("Warrior's Honor")) {
if(att.length > 1) // Effect best used on at least a couple creatures
return att[0];
else return null;
}
return null;
}//getAttacker()
int getPowerBoost() {
if(cardName.equals("Tromp the Domains")) return getTtDBoost();
if(cardName.equals("Kjeldoran War Cry")) return getKWCBoost();
if(cardName.equals("Chorus of Woe") || cardName.equals("Dance of Shadows")
|| cardName.equals("Glorious Charge") || cardName.equals("Magnify")
|| cardName.equals("Scare Tactics") || cardName.equals("Virtuous Charge")
|| cardName.equals("Warrior's Charge") || cardName.equals("Warrior's Honor")) return 1;
if(cardName.equals("Desperate Charge") || cardName.equals("Nocturnal Raid")
|| cardName.equals("Path of Anger's Flame") || cardName.equals("Righteous Charge")
|| cardName.equals("Valorous Charge")) return 2;
if(cardName.equals("Overrun")) return 3;
if(cardName.equals("Vitalizing Wind")) return 7;
return 0;
}//getPowerBoost()
int getToughBoost() {
if(cardName.equals("Tromp the Domains")) return getTtDBoost();
if(cardName.equals("Kjeldoran War Cry")) return getKWCBoost();
if(cardName.equals("Glorious Charge") || cardName.equals("Magnify")
|| cardName.equals("Virtuous Charge") || cardName.equals("Warrior's Charge")
|| cardName.equals("Warrior's Honor")) return 1;
if(cardName.equals("Righteous Charge") || cardName.equals("Shield Wall")) return 2;
if(cardName.equals("Overrun") || cardName.equals("Steadfastness")) return 3;
if(cardName.equals("Solidarity")) return 5;
if(cardName.equals("Vitalizing Wind")) return 7;
return 0;
}//getToughBoost()
String getKeywordBoost() {
if(cardName.equals("Brave the Elements")) {
String theColor = getChosenColor();
return "Protection from " + theColor;
}
if(cardName.equals("Burst of Speed")) return "Haste";
if(cardName.equals("Overrun") || cardName.equals("Tromp the Domains")) return "Trample";
if(cardName.equals("Dance of Shadows")) return "Fear";
if(cardName.equals("Nature's Cloak")) return "Forestwalk";
if(cardName.equals("Resuscitate")) return "RegenerateMe:1";
if(cardName.equals("Tortoise Formation")) return "Shroud";
return "None";
}//getKeywordBoost()
String getChosenColor() {
// Choose color for protection in Brave the Elements
String color = "";
if (card.getController().equals(Constant.Player.Human)) {
String[] colors = Constant.Color.Colors;
colors[colors.length-1] = null;
Object o = AllZone.Display.getChoice("Choose color", colors);
color = (String)o;
}
else
{
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, Constant.Player.Human);
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Human);
CardList list = new CardList();
list.addAll(lib.getCards());
list.addAll(hand.getCards());
if (list.size() > 0)
{
String mpcolor = CardFactoryUtil.getMostProminentColor(list);
if (!mpcolor.equals(""))
color = mpcolor;
else
color = "black";
}
else
{
color = "black";
}
}
return color;
} // getChosenColor
int getTtDBoost() // Tromp the Domains - +1/+1 for each basic land you control
{
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
CardList land = new CardList(play.getCards());
String basic[] = {"Forest", "Plains", "Mountain", "Island", "Swamp"};
int count = 0;
for(int i = 0; i < basic.length; i++) {
CardList c = land.getType(basic[i]);
if(!c.isEmpty()) count++;
}
return count;
}//getTtDBoost
int getKWCBoost() // Kjeldoran War Cry - +X/+X, X = 1 + Num(KWC in All Graveyards)
{
PlayerZone hYard = AllZone.getZone(Constant.Zone.Graveyard, Constant.Player.Human);
PlayerZone cYard = AllZone.getZone(Constant.Zone.Graveyard, Constant.Player.Computer);
CardList allYards = new CardList();
allYards.addAll(hYard.getCards());
allYards.addAll(cYard.getCards());
allYards = allYards.getName("Kjeldoran War Cry");
return allYards.size() + 1;
}//getKWCBoost
@Override
public void resolve() {
final int pboost = getPowerBoost();
final int tboost = getToughBoost();
final String kboost = getKeywordBoost();
CardList list = new CardList();
if(cardName.equals("Brave the Elements") // Creatures "you" Control
|| cardName.equals("Burst of Speed")
|| cardName.equals("Chorus of Woe") || cardName.equals("Dance of Shadows")
|| cardName.equals("Desperate Charge") || cardName.equals("Glorious Charge")
|| cardName.equals("Kjeldoran War Cry") || cardName.equals("Nature's Cloak")
|| cardName.equals("Overrun") || cardName.equals("Path of Anger's Flame")
|| cardName.equals("Resuscitate") || cardName.equals("Righteous Charge")
|| cardName.equals("Scare Tactics") || cardName.equals("Shield Wall")
|| cardName.equals("Solidarity") || cardName.equals("Steadfastness")
|| cardName.equals("Tortoise Formation") || cardName.equals("Virtuous Charge")
|| cardName.equals("Vitalizing Wind") || cardName.equals("Warrior's Charge")
|| cardName.equals("Warrior's Honor")) {
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
list.addAll(play.getCards());
if(cardName.equals("Nature's Cloak")) {
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return CardUtil.getColors(c).contains(Constant.Color.Green);
}
});
} else if(cardName.equals("Brave the Elements")) {
// White creatures you control
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return CardUtil.getColors(c).contains(Constant.Color.White);
}
});
}
}
if(cardName.equals("Magnify") || // All Creatures in Play
cardName.equals("Nocturnal Raid") || // All Black Creatures in Play
cardName.equals("Valorous Charge")) // All White Creatures in Play
{
PlayerZone human = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human);
PlayerZone comp = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
list.addAll(human.getCards());
list.addAll(comp.getCards());
if(cardName.equals("Nocturnal Raid")) list = list.getColor("B");
if(cardName.equals("Valorous Charge")) list = list.getColor("W");
}
for(int i = 0; i < list.size(); i++) {
final Card[] target = new Card[1];
target[0] = list.get(i);
final Command untilEOT = new Command() {
private static final long serialVersionUID = 5063161656920609389L;
public void execute() {
if(AllZone.GameAction.isCardInPlay(target[0])) {
target[0].addTempAttackBoost(-pboost);
target[0].addTempDefenseBoost(-tboost);
if(!kboost.equals("None")) target[0].removeExtrinsicKeyword(kboost);
}
}
};//Command
if(AllZone.GameAction.isCardInPlay(target[0])) {
target[0].addTempAttackBoost(pboost);
target[0].addTempDefenseBoost(tboost);
if(!kboost.equals("None")) target[0].addExtrinsicKeyword(kboost);
AllZone.EndOfTurn.addUntil(untilEOT);
}//if
}//for
}//resolve()
};
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if(cardName.equals("Pyrohemia")) {
@@ -4856,31 +4590,6 @@ public class CardFactory implements NewConstants {
ability.setStackDescription("Destroy all artifacts, creatures, and enchantments.");
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Tanglebloom")) {
final SpellAbility a1 = new Ability_Tap(card, "1") {
private static final long serialVersionUID = -6395076857898740906L;
@Override
public boolean canPlayAI() {
return AllZone.Phase.getPhase().equals(Constant.Phase.Main2);
}
@Override
public void resolve() {
AllZone.GameAction.getPlayerLife(card.getController()).addLife(1);
}
};//SpellAbility
card.addSpellAbility(a1);
a1.setDescription("1, tap: You gain 1 life.");
a1.setStackDescription("Tanglebloom - " + card.getController() + " gains 1 life.");
a1.setBeforePayMana(new Input_PayManaCost(a1));
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if(cardName.equals("Conspiracy") || cardName.equals("Cover of Darkness")
@@ -6436,34 +6145,6 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Sacred Nectar")) {
SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -2280675656970845618L;
@Override
public boolean canPlay() {
setStackDescription(card.getName() + " - " + card.getController() + " gains 4 life.");
return super.canPlay();
}
@Override
public void resolve() {
PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController());
life.addLife(4);
}
};
spell.setDescription("You gain 4 life.");
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if(cardName.equals("Tremor")) {
SpellAbility spell = new Spell(card) {
@@ -6508,27 +6189,6 @@ public class CardFactory implements NewConstants {
card.addSpellAbility(spell);
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Reviving Dose")) {
SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -3239301336328919121L;
@Override
public void resolve() {
PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController());
life.addLife(3);
// AllZone.GameAction.drawCard(card.getController());
}
};
spell.setStackDescription(card.getName() + " - " + card.getController() + " gains 3 life.");
card.clearSpellAbility();
card.addSpellAbility(spell);
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if(cardName.equals("Swords to Plowshares")) {
@@ -6829,32 +6489,6 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
if(cardName.equals("Hymn to Tourach")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 42470566751344693L;
@Override
public boolean canPlayAI() {
return AllZone.Human_Hand.size() > 0;
}
@Override
public void resolve() {
String opponent = AllZone.GameAction.getOpponent(card.getController());
AllZone.GameAction.discardRandom(opponent);
AllZone.GameAction.discardRandom(opponent);
}
};//SpellAbility
card.clearSpellAbility();
card.addSpellAbility(spell);
card.setSVar("PlayMain1", "TRUE");
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if(cardName.equals("Beacon of Destruction")) {
final SpellAbility spell = new Spell(card) {
@@ -7820,114 +7454,6 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Haze of Rage")) {
final Card crd = card;
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -73841582690849205L;
@Override
public boolean canPlayAI() {
return getAttacker() == true && AllZone.Phase.getPhase().equals(Constant.Phase.Main1);
}
public boolean getAttacker() {
String Computer = AllZone.Phase.getActivePlayer();
PlayerZone ComputerPlayZone = AllZone.getZone(Constant.Zone.Play, Computer);
CardList ComputerCreatureList = new CardList(ComputerPlayZone.getCards());
ComputerCreatureList = ComputerCreatureList.getType("Creature");
ComputerCreatureList = ComputerCreatureList.filter(new CardListFilter() {
public boolean addCard(Card c) {
return c.getNetAttack() >= 2 && CardFactoryUtil.canTarget(card, getTargetCard());
}
});
return (ComputerCreatureList.size() != 0);
}//getAttacker()
@Override
public void resolve() {
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
CardList start = new CardList(play.getCards());
final CardList list = start.getType("Creature");
for(int i = 0; i < list.size(); i++) {
list.get(i).addTempAttackBoost(1);
}
play.updateObservers();
Command untilEOT = new Command() {
private static final long serialVersionUID = -28032591440730370L;
public void execute() {
for(int i = 0; i < list.size(); i++)
if(AllZone.GameAction.isCardInPlay(list.get(i))) {
list.get(i).addTempAttackBoost(-1);
}
}
};
AllZone.EndOfTurn.addUntil(untilEOT);
}//resolve()
};//SpellAbility
final SpellAbility Card_Buyback = new Spell(card) {
private static final long serialVersionUID = 3898017438147188882L;
@Override
public boolean canPlayAI() {
return getAttacker() != null;
}
public Card getAttacker() {
//target creature that is going to attack
Combat c = ComputerUtil.getAttackers();
Card[] att = c.getAttackers();
if(att.length != 0) return att[0];
else return null;
}//getAttacker()
@Override
public void resolve() {
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
CardList start = new CardList(play.getCards());
final CardList list = start.getType("Creature");
for(int i = 0; i < list.size(); i++) {
list.get(i).addTempAttackBoost(1);
}
play.updateObservers();
Command untilEOT = new Command() {
private static final long serialVersionUID = -28032591440730370L;
public void execute() {
for(int i = 0; i < list.size(); i++)
if(AllZone.GameAction.isCardInPlay(list.get(i))) {
list.get(i).addTempAttackBoost(-1);
}
}
};
AllZone.EndOfTurn.addUntil(untilEOT);
}//resolve()
};//SpellAbility
Card_Buyback.setManaCost("3 R");
Card_Buyback.setAdditionalManaCost("2");
spell.setDescription("Creatures you control get +1/+0 until end of turn. Storm (When you cast this spell, copy it for each spell cast before it this turn.)");
Card_Buyback.setDescription("Buyback 2 - Pay 3 R, put this card into your hand as it resolves.");
spell.setStackDescription(crd + " - Creatures you control get +1/+0 until end of turn.");
Card_Buyback.setStackDescription(crd + " - Creatures you control get +1/+0 until end of turn.");
Card_Buyback.setIsBuyBackAbility(true);
card.clearSpellAbility();
card.addSpellAbility(spell);
card.addSpellAbility(Card_Buyback);
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if(cardName.equals("Astral Steel")) {
final SpellAbility spell = new Spell(card) {
@@ -9532,48 +9058,6 @@ public class CardFactory implements NewConstants {
card.setSVar("PlayMain1", "TRUE");
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Renewed Faith") || cardName.equals("Rejuvenate")
|| cardName.equals("Dosan's Oldest Chant") || cardName.equals("Nourish") ){
SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -1133816506198725425L;
@Override
public boolean canPlay() {
setStackDescription(card.getName() + " - " + card.getController() + " gains 6 life.");
return super.canPlay();
}
@Override
public void resolve() {
PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController());
life.addLife(6);
}
};
String desc = "You gain 6 life.";
if(cardName.equals("Renewed Faith")) desc = desc
+ "\r\nWhen you cycle Renewed Faith, you may gain 2 life.";
spell.setDescription(desc);
card.clearSpellAbility();
card.addSpellAbility(spell);
if(cardName.equals("Renewed Faith")) {
// card.addSpellAbility(CardFactoryUtil.ability_cycle(card, "1 W"));
card.addCycleCommand(new Command() {
private static final long serialVersionUID = 7699412574052780825L;
public void execute() {
PlayerLife life = AllZone.GameAction.getPlayerLife(card.getController());
life.addLife(2);
}
});
}
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if (cardName.equals("Renewed Faith")) {
@@ -9676,31 +9160,6 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Wit's End")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 3829311830858468029L;
@Override
public void resolve() {
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, getTargetPlayer());
Card c[] = hand.getCards();
for(int i = 0; i < c.length; i++)
AllZone.GameAction.discard(c[i]);
}
};
spell.setChooseTargetAI(CardFactoryUtil.AI_targetHuman());
card.clearSpellAbility();
card.addSpellAbility(spell);
card.setSVar("PlayMain1", "TRUE");
spell.setBeforePayMana(CardFactoryUtil.input_targetPlayer(spell));
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
else if(cardName.equals("Cranial Extraction")) {
final SpellAbility spell = new Spell(card) {
@@ -9805,102 +9264,6 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END **************************
/*
//*************** START *********** START **************************
else if(cardName.equals("Coercion")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 7200945225788294439L;
@Override
public void resolve() {
String opponent = AllZone.GameAction.getOpponent(card.getController());
Card choice = null;
//check for no cards in hand on resolve
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, opponent);
Card[] handChoices = removeLand(hand.getCards());
if(handChoices.length == 0) return;
//human chooses
if(opponent.equals(Constant.Player.Computer)) {
choice = AllZone.Display.getChoice("Choose", handChoices);
} else//computer chooses
{
choice = CardUtil.getRandom(handChoices);
}
AllZone.GameAction.discard(choice);
}//resolve()
@Override
public boolean canPlayAI() {
Card[] c = removeLand(AllZone.Human_Hand.getCards());
return 0 < c.length;
}
Card[] removeLand(Card[] in) {
return in;
}//removeLand()
};//SpellAbility spell
card.clearSpellAbility();
card.addSpellAbility(spell);
spell.setBeforePayMana(new Input_PayManaCost(spell));
}//*************** END ************ END **************************
*/
/*
//*************** START *********** START **************************
else if(cardName.equals("Brainbite")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = 6967309558624188256L;
@Override
public void resolve() {
String opponent = AllZone.GameAction.getOpponent(card.getController());
Card choice = null;
//check for no cards in hand on resolve
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, opponent);
Card[] handChoices = removeLand(hand.getCards());
if(handChoices.length == 0) {
// AllZone.GameAction.drawCard(card.getController());
return;
}
//human chooses
if(opponent.equals(Constant.Player.Computer)) {
choice = AllZone.Display.getChoice("Choose", handChoices);
} else//computer chooses
{
choice = CardUtil.getRandom(handChoices);
}
AllZone.GameAction.discard(choice);
AllZone.GameAction.drawCard(card.getController());
}//resolve()
@Override
public boolean canPlayAI() {
Card[] c = removeLand(AllZone.Human_Hand.getCards());
return 0 < c.length;
}
Card[] removeLand(Card[] in) {
return in;
}//removeLand()
};//SpellAbility spell
card.clearSpellAbility();
card.addSpellAbility(spell);
spell.setBeforePayMana(new Input_PayManaCost(spell));
}//*************** END ************ END **************************
*/
//*************** START *********** START **************************
if(cardName.equals("Midsummer Revel")) {