- Wojek Embermage's Radiance ability shouldn't damage creatures with protection from it anymore, and it should also correctly deal damage when multicolored creatures are involved.

- Memnarch "gain control of target artifact" ability shouldn't trigger leaves play effects anymore.
- Added "This creature can't be blocked except by creatures with flying" keyword.
- Added new cards: Barren Glory, Silhana Ledgewalker, Treetop Scout, Treetop Rangers, Treetop Bracers, Auramancer, Cartographer, Scarland Thrinax, Femeref Enchantress, Conqueror's Pledge, Seal of Removal.
This commit is contained in:
jendave
2011-08-06 02:49:14 +00:00
parent fe32f94ef0
commit 4a943a9f7c
8 changed files with 575 additions and 23 deletions

View File

@@ -1,3 +1,71 @@
Barren Glory
4 W W
Enchantment
At the beginning of your upkeep, if you control no permanents other than Barren Glory and have no cards in hand, you win the game.
Treetop Scout
G
Creature Elf Scout
no text
1/1
This creature can't be blocked except by creatures with flying
Treetop Rangers
2 G
Creature Elf
no text
2/2
This creature can't be blocked except by creatures with flying
Treetop Bracers
1 G
Enchantment Aura
Enchanted creature gets +1/+1 and can't be blocked except by creatures with flying.
Enchant creature
Silhana Ledgewalker
1 G
Creature Elf Rogue
no text
1/1
This creature can't be blocked except by creatures with flying
This card can't be the target of spells or abilities your opponents control.
Auramancer
2 W
Creature Human
When Auramancer enters the battlefield, you may return target card from your graveyard to your hand.
2/2
Cartographer
2 G
Creature Human
When Cartographer enters the battlefield, you may return target land card from your graveyard to your hand.
2/2
Scarland Thrinax
B R G
Creature Lizard
no text
2/2
Femeref Enchantress
G W
Creature Human Druid
no text
1/2
Whenever an enchantment is put into a graveyard from the battlefield, draw a card.
Conqueror's Pledge
2 W W W
Sorcery
no text
Seal of Removal
U
Enchantment
no text
Seal of Fire
R
Enchantment

View File

@@ -1,6 +1,6 @@
program/mail=mtgrares@yahoo.com
program/forum=http://www.slightlymagic.net/forum/viewforum.php?f=26
program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 85
program/version=MTG Forge -- official beta: 09/11/02, SVN revision: 86
tokens--file=AllTokens.txt

View File

@@ -14527,13 +14527,12 @@ public class CardFactory implements NewConstants {
//TODO
}
public boolean canPlayAI() { return false; }
};//SpellAbility
//card.clearSpellAbility();
ability.setDescription("G: Discard a creature card: Search your library for a creature card, reveal that card, and put it into your hand. Then shuffle your library.");
//ability.setBeforePayMana(new Input_NoCost_TapAbility((Ability) ability));
//ability.setBeforePayMana(new Input_PayManaCost(ability));
ability.setStackDescription("Survival of the Fittest - search for a creature card and put into hand");
card.addSpellAbility(ability);
}//*************** END ************ END **************************
@@ -16687,7 +16686,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
{
final Ability ability = new Ability(card, "0")
{
public boolean canPlayAI() {return getCreature().size() != 0;}
public boolean canPlayAI() {return getCreature().size() != 0 || AllZone.Human_Life.getLife() < 4;}
public void chooseTargetAI()
{
@@ -16709,7 +16708,7 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
{
public boolean addCard(Card c)
{
//only get 1/1 flyers or 2/1 creatures
//only get 1/1 flyers or 2/1 or bigger creatures
return (2 <= c.getNetAttack()) || c.getKeyword().contains("Flying");
}
});
@@ -16741,6 +16740,140 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}, true));
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Seal of Removal"))
{
final Ability ability = new Ability(card, "0")
{
public boolean canPlayAI() {return getCreature().size() != 0;}
public void chooseTargetAI()
{
CardList list = getCreature();
list.shuffle();
setTargetCard(list.get(0));
AllZone.GameAction.sacrifice(card);
}//chooseTargetAI()
CardList getCreature()
{
CardList list = new CardList(AllZone.Computer_Play.getCards());
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.isCreature() && (c.getNetAttack() >= 3|| c.getKeyword().contains("Flying") ||
c.isEnchanted());
}
});
return list;
}//getCreature()
public void resolve()
{
if(getTargetCard() != null)
{
if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) )
{
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, getTargetCard().getOwner());
AllZone.GameAction.moveTo(hand, getTargetCard());
}
}
}//resolve()
};//SpellAbility
card.addSpellAbility(ability);
ability.setDescription("Sacrifice Seal of Removal: return target creature to its owner's hand.");
ability.setBeforePayMana(CardFactoryUtil.input_targetCreature(ability, new Command()
{
private static final long serialVersionUID = 2565599788533507611L;
public void execute()
{
AllZone.GameAction.sacrifice(card);
}
}));
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Conqueror's Pledge"))
{
SpellAbility spell = new Spell(card)
{
private static final long serialVersionUID = -2902179434079334177L;
public void resolve()
{
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
for (int i = 0; i < 6; i++)
{
Card c = new Card();
c.setOwner(card.getController());
c.setController(card.getController());
c.setName("Kor Soldier");
c.setImageName("W 1 1 Kor Soldier");
c.setManaCost("W");
c.setToken(true);
c.addType("Creature");
c.addType("Kor");
c.addType("Soldier");
c.setBaseAttack(1);
c.setBaseDefense(1);
play.add(c);
}//for
}//resolve()
};
spell.setDescription("Put six 1/1 white Kor Soldier creature tokens onto the battlefield.");
spell.setStackDescription(card.getName() + " - " + card.getController() + " puts six 1/1 white Kor Soldier creature tokens onto the battlefield.");
SpellAbility kicker = new Spell(card)
{
private static final long serialVersionUID = 1376255732058673590L;
public void resolve()
{
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
for (int i = 0; i < 12; i++)
{
Card c = new Card();
c.setOwner(card.getController());
c.setController(card.getController());
c.setName("Kor Soldier");
c.setImageName("W 1 1 Kor Soldier");
c.setManaCost("W");
c.setToken(true);
c.addType("Creature");
c.addType("Kor");
c.addType("Soldier");
c.setBaseAttack(1);
c.setBaseDefense(1);
play.add(c);
}//for
}//resolve()
};
kicker.setManaCost("8 W W W");
kicker.setDescription("Kicker 6: If Conqueror's Pledge was kicked, put twelve of those tokens onto the battlefield instead.");
kicker.setStackDescription(card.getName() + " - " + card.getController() + " puts twelve 1/1 white Kor Soldier creature tokens onto the battlefield.");
card.clearSpellAbility();
card.addSpellAbility(spell);
card.addSpellAbility(kicker);
}//*************** END ************ END **************************
// Cards with Cycling abilities
// -1 means keyword "Cycling" not found

View File

@@ -2407,6 +2407,21 @@ public class CardFactoryUtil
return list;
}
//do card1 and card2 share any colors?
public static boolean sharesColorWith(Card card1, Card card2)
{
ArrayList<String> card1Colors = CardUtil.getColors(card1);
ArrayList<String> card2Colors = CardUtil.getColors(card2);
for (String color : card1Colors)
{
if (card2Colors.contains(color))
return true;
}
return false;
}
//may return null
static public Card getRandomCard(CardList list)
{

View File

@@ -246,12 +246,9 @@ class CardFactory_Auras {
Command onEnchant = new Command()
{
/**
*
*/
private static final long serialVersionUID = 4941909585318384005L;
public void execute()
public void execute()
{
if (card.isEnchanting())
{
@@ -5195,8 +5192,8 @@ class CardFactory_Auras {
if (card.isEnchanting())
{
Card crd = card.getEnchanting().get(0);
crd.addSemiPermanentAttackBoost(3);
crd.addExtrinsicKeyword("First Strike");
crd.addSemiPermanentAttackBoost(3);
crd.addExtrinsicKeyword("First Strike");
}
}//execute()
@@ -5549,6 +5546,110 @@ class CardFactory_Auras {
spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Treetop Bracers"))
{
final SpellAbility spell = new Spell(card)
{
private static final long serialVersionUID = -2869740221361303938L;
public boolean canPlayAI()
{
CardList list = new CardList(AllZone.Computer_Play.getCards());
list = list.getType("Creature");
if(list.isEmpty())
return false;
//else
CardListUtil.sortAttack(list);
CardListUtil.sortFlying(list);
for (int i=0;i<list.size();i++) {
if (CardFactoryUtil.canTarget(card, list.get(i)))
{
setTargetCard(list.get(i));
return true;
}
}
return false;
}//canPlayAI()
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);
System.out.println("Enchanted: " +getTargetCard());
}
}//resolve()
};//SpellAbility
card.clearSpellAbility();
card.addSpellAbility(spell);
Command onEnchant = new Command()
{
private static final long serialVersionUID = 8913162899595309494L;
public void execute()
{
if (card.isEnchanting())
{
Card crd = card.getEnchanting().get(0);
crd.addSemiPermanentAttackBoost(1);
crd.addSemiPermanentDefenseBoost(1);
crd.addExtrinsicKeyword("This creature can't be blocked except by creatures with flying");
}
}//execute()
};//Command
Command onUnEnchant = new Command()
{
private static final long serialVersionUID = -7746673124406658713L;
public void execute()
{
if (card.isEnchanting())
{
Card crd = card.getEnchanting().get(0);
crd.addSemiPermanentAttackBoost(-1);
crd.addSemiPermanentDefenseBoost(-1);
crd.removeExtrinsicKeyword("This creature can't be blocked except by creatures with flying");
}
}//execute()
};//Command
Command onLeavesPlay = new Command()
{
private static final long serialVersionUID = 6516555370663902900L;
public void execute()
{
if (card.isEnchanting())
{
Card crd = card.getEnchanting().get(0);
card.unEnchantCard(crd);
}
}
};
card.addEnchantCommand(onEnchant);
card.addUnEnchantCommand(onUnEnchant);
card.addLeavesPlayCommand(onLeavesPlay);
spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
}//*************** END ************ END **************************
return card;
}

View File

@@ -56,8 +56,6 @@ public class CardFactory_Creatures {
//*************** START *********** START **************************
else if(cardName.equals("Shinka Gatekeeper"))
{
@@ -6808,12 +6806,16 @@ public class CardFactory_Creatures {
if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) )
{
CardList list = getRadiance(getTargetCard());
for(int i = 0; i < list.size(); i++)
list.get(i).addDamage(1);
for(int i = 0; i < list.size(); i++) {
if (CardFactoryUtil.canDamage(card, list.get(i)))
list.get(i).addDamage(1);
}
}
}//resolve()
//parameter Card c, is included in CardList
//no multi-colored cards
CardList getRadiance(Card c)
{
String color = CardUtil.getColor(c);
@@ -6833,11 +6835,12 @@ public class CardFactory_Creatures {
list = list.getType("Creature");
for(int i = 0; i < list.size(); i++)
if(CardUtil.getColor(list.get(i)).equals(color))
if(CardFactoryUtil.sharesColorWith(list.get(i), c))
sameColor.add(list.get(i));
return sameColor;
}
};//SpellAbility
card.addSpellAbility(ability);
ability.setDescription("Radiance - tap: Wojek Embermage deals 1 damage to target creature and each other creature that shares a color with it.");
@@ -9101,16 +9104,17 @@ public class CardFactory_Creatures {
{
if(AllZone.GameAction.isCardInPlay(getTargetCard()) && CardFactoryUtil.canTarget(card, getTargetCard()) )
{
//gain control of target artifact
((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTriggers(false);
((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTriggers(false);
//gain control of target artifact
PlayerZone from = AllZone.getZone(Constant.Zone.Play, getTargetCard().getController());
from.remove(getTargetCard());
getTargetCard().setController(card.getController());
((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTriggers(false);
((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTriggers(false);
PlayerZone to = AllZone.getZone(Constant.Zone.Play, card.getController());
to.add(getTargetCard());
to.setUpdate(true);
@@ -15684,6 +15688,170 @@ public class CardFactory_Creatures {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Scarland Thrinax"))
{
final SpellAbility a2 = new Ability(card, "0")
{
public void resolve()
{
Card c = getTargetCard();
if(AllZone.GameAction.isCardInPlay(c))
{
//AllZone.getZone(c).remove(c);
AllZone.GameAction.sacrifice(c);
if(AllZone.GameAction.isCardInPlay(card))
card.addCounter(Counters.P1P1, 1);
}
}
public boolean canPlayAI()
{
return false;
}
public boolean canPlay()
{
SpellAbility sa;
//this is a hack, check the stack to see if this card has an ability on the stack
//if so, we can't use the ability: this is to prevent using a limited ability too many times
for (int i=0; i<AllZone.Stack.size(); i++)
{
sa = AllZone.Stack.peek(i);
if (sa.getSourceCard().equals(card))
return false;
}
if (super.canPlay())
return true;
return false;
}
};//SpellAbility
Input runtime = new Input()
{
private static final long serialVersionUID = 8445133749305465286L;
public void showMessage()
{
CardList creats = new CardList(AllZone.getZone(Constant.Zone.Play, card.getController()).getCards());
creats = creats.getType("Creature");
stopSetNext(CardFactoryUtil.input_targetSpecific(a2, creats, "Select a creature to sacrifice.",false));
}
};
card.addSpellAbility(a2);
a2.setDescription("Sacrifice a creature: Put a +1/+1 counter on " +card.getName() +".");
a2.setStackDescription(card.getName() + " gets a +1/+1 counter.");
a2.setBeforePayMana(runtime);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Cartographer"))
{
final SpellAbility ability = new Ability(card, "0")
{
public void resolve()
{
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), grave))
{
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
AllZone.GameAction.moveTo(hand, getTargetCard());
}
}//resolve()
};
Command intoPlay = new Command()
{
private static final long serialVersionUID = -3887243972980889087L;
public void execute()
{
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
CardList lands = new CardList(grave.getCards());
lands = lands.getType("Land");
String controller = card.getController();
if(lands.size() == 0)
return;
if(controller.equals(Constant.Player.Human))
{
Object o = AllZone.Display.getChoiceOptional("Select target land", lands.toArray());
if(o != null)
{
ability.setTargetCard((Card)o);
AllZone.Stack.add(ability);
}
}
else //computer
{
lands.shuffle();
ability.setTargetCard(lands.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Auramancer"))
{
final SpellAbility ability = new Ability(card, "0")
{
public void resolve()
{
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
if(AllZone.GameAction.isCardInZone(getTargetCard(), grave))
{
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
AllZone.GameAction.moveTo(hand, getTargetCard());
}
}//resolve()
};
Command intoPlay = new Command()
{
private static final long serialVersionUID = 25590819729244894L;
public void execute()
{
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, card.getController());
CardList enchantments = new CardList(grave.getCards());
enchantments = enchantments.getType("Enchantment");
String controller = card.getController();
if(enchantments.size() == 0)
return;
if(controller.equals(Constant.Player.Human))
{
Object o = AllZone.Display.getChoiceOptional("Select target enchantment", enchantments.toArray());
if(o != null)
{
ability.setTargetCard((Card)o);
AllZone.Stack.add(ability);
}
}
else //computer
{
enchantments.shuffle();
ability.setTargetCard(enchantments.get(0));
AllZone.Stack.add(ability);
}
}//execute()
};//Command
card.addComesIntoPlayCommand(intoPlay);
}//*************** END ************ END **************************
// Cards with Cycling abilities
// -1 means keyword "Cycling" not found

View File

@@ -115,6 +115,10 @@ public class CombatUtil
return false;
}
if (attacker.getKeyword().contains("This creature can't be blocked except by creatures with flying") && !blocker.getKeyword().contains("Flying"))
return false;
if (attacker.getKeyword().contains("Horsemanship"))
{
if (!blocker.getKeyword().contains("Horsemanship"))

View File

@@ -48,6 +48,7 @@ public class GameActionUtil
upkeep_Dragon_Broodmother(); //put this before bitterblossom and mycoloth, so that they will resolve FIRST
upkeep_Bitterblossom();
upkeep_Battle_of_Wits();
upkeep_Barren_Glory();
upkeep_Felidar_Sovereign();
upkeep_Klass();
upkeep_Convalescence();
@@ -1134,7 +1135,6 @@ public class GameActionUtil
}
AllZone.EndOfTurn.addUntil(untilEOT);
}
};
@@ -1211,8 +1211,10 @@ public class GameActionUtil
{
if (destroyed.isCreature())
executeDestroyCreatureCardEffects(c, destroyed);
else if (destroyed.isLand())
if (destroyed.isLand())
executeDestroyLandCardEffects(c, destroyed);
if (destroyed.isEnchantment())
executeDestroyEnchantmentCardEffects(c, destroyed);
}
private static boolean showDialog(Card c)
@@ -1434,6 +1436,37 @@ public class GameActionUtil
//***LANDS END HERE***
//***ENCHANTMENTS START HERE***
public static void executeDestroyEnchantmentCardEffects(Card c, Card destroyed)
{
if (c.getName().equals("Femeref Enchantress"))
destroyEnchantment_Femeref_Enchantress(c, destroyed);
}
//***
public static void destroyEnchantment_Femeref_Enchantress(Card c, Card destroyed)
{
final Card crd = c;
Ability ability = new Ability(c, "0")
{
public void resolve()
{
String player = crd.getController();
AllZone.GameAction.drawCard(player);
}
};
ability.setStackDescription("Femeref Enchantress - " + c.getController() + " draws a card.");
AllZone.Stack.add(ability);
}
//***ENCHANTMENTS END HERE***
public static void executeLandfallEffects(Card c)
{
if (c.getName().equals("Rampaging Baloths"))
@@ -3910,6 +3943,36 @@ public class GameActionUtil
}// if
}// upkeep_Battle_of_Wits
private static void upkeep_Barren_Glory()
{
final String player = AllZone.Phase.getActivePlayer();
PlayerZone playZone = AllZone.getZone(Constant.Zone.Play, player);
PlayerZone handZone = AllZone.getZone(Constant.Zone.Hand, player);
CardList list = new CardList(playZone.getCards());
CardList playList = new CardList(playZone.getCards());
list = list.getName("Barren Glory");
if (playList.size() == 1 && list.size() == 1 && handZone.size() == 0)
{
Ability ability = new Ability(list.get(0), "0")
{
public void resolve()
{
String opponent = AllZone.GameAction.getOpponent(player);
PlayerLife life = AllZone.GameAction
.getPlayerLife(opponent);
life.setLife(0);
}
};// Ability
ability.setStackDescription("Barren Glory - " + player
+ " wins the game");
AllZone.Stack.add(ability);
}// if
}// upkeep_Barren_Glory
private static void upkeep_Sleeper_Agent()
{
final String player = AllZone.Phase.getActivePlayer();