add The Abyss (from Legends)

This commit is contained in:
jendave
2011-08-06 09:11:24 +00:00
parent b4c0c19cd8
commit bad99f3ede
4 changed files with 75 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -4134,6 +4134,7 @@ res/cardsfolder/thallid_germinator.txt -text svneol=native#text/plain
res/cardsfolder/thallid_shell_dweller.txt -text svneol=native#text/plain
res/cardsfolder/that_which_was_taken.txt -text svneol=native#text/plain
res/cardsfolder/thaumatog.txt -text svneol=native#text/plain
res/cardsfolder/the_abyss.txt -text svneol=native#text/plain
res/cardsfolder/the_hive.txt -text svneol=native#text/plain
res/cardsfolder/the_lady_of_the_mountain.txt -text svneol=native#text/plain
res/cardsfolder/the_rack.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,7 @@
Name:The Abyss
ManaCost:3 B
Types:World Enchantment
Text:At the beginning of each player's upkeep, destroy target nonartifact creature that player controls of his or her choice. It can't be regenerated.
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/the_abyss.jpg
End

View File

@@ -469,6 +469,12 @@ public class AllZoneUtil {
}
};
public static CardListFilter nonartifacts = new CardListFilter() {
public boolean addCard(Card c) {
return !c.isArtifact();
}
};
public static CardListFilter lands = new CardListFilter() {
public boolean addCard(Card c) {
return c.isLand();

View File

@@ -23,6 +23,7 @@ public class GameActionUtil {
AllZone.GameAction.CheckWheneverKeyword(AllZone.CardFactory.HumanNullCard, "BeginningOfUpkeep", null);
upkeep_The_Abyss();
upkeep_Yawgmoth_Demon();
upkeep_Lord_of_the_Pit();
upkeep_Drop_of_Honey();
@@ -3384,6 +3385,66 @@ public class GameActionUtil {
}
}
}//damageUpkeepCost
private static void upkeep_The_Abyss() {
/*
* At the beginning of each player's upkeep, destroy target
* nonartifact creature that player controls of his or her
* choice. It can't be regenerated.
*/
final String player = AllZone.Phase.getActivePlayer();
final CardList cards = AllZoneUtil.getCardsInPlay("The Abyss");
for(Card c:cards) {
final Card abyss = c;
final Ability sacrificeCreature = new Ability(abyss, "") {
@Override
public void resolve() {
if(player.equals(Constant.Player.Human)) {
AllZone.InputControl.setInput( new Input() {
private static final long serialVersionUID = 4820011040853968644L;
public void showMessage() {
AllZone.Display.showMessage(abyss.getName()+" - Select one nonartifact creature to destroy");
ButtonUtil.disableAll();
}
public void selectCard(Card selected, PlayerZone zone) {
//probably need to restrict by controller also
if(selected.isCreature() && !selected.isArtifact() && zone.is(Constant.Zone.Play)
&& zone.getPlayer().equals(Constant.Player.Human)) {
AllZone.GameAction.destroyNoRegeneration(selected);
stop();
}
}//selectCard()
});//Input
}
else { //computer
CardList targets = abyss_getTargets(player);
CardList indestruct = targets.getKeyword("Indestructible");
if(indestruct.size() > 0) {
AllZone.GameAction.destroyNoRegeneration(indestruct.get(0));
}
else {
Card target = CardFactoryUtil.AI_getWorstCreature(targets);
if(null == target) {
//must be nothing valid to destroy
}
else AllZone.GameAction.destroyNoRegeneration(target);
}
}
}//resolve
};//sacrificeCreature
sacrificeCreature.setStackDescription(abyss.getName()+" - destroy a nonartifact creatur of your choice.");
if(abyss_getTargets(player).size() > 0)
AllZone.Stack.add(sacrificeCreature);
}//end for
}//The Abyss
private static CardList abyss_getTargets(final String player) {
CardList creats = AllZoneUtil.getCreaturesInPlay(player);
creats = creats.filter(AllZoneUtil.nonartifacts);
return creats;
}
private static void upkeep_Yawgmoth_Demon() {
/*