- Minor fixes for Necropotence and Yawgmoth's Bargain.

--Can only pay life that is available 
--Cards are still gained even if Necro isn't in play during the end step.
--Bargain now uses the draw function
This commit is contained in:
jendave
2011-08-06 05:22:53 +00:00
parent 01aa211d5a
commit 765b102c48

View File

@@ -13313,13 +13313,7 @@ public class CardFactory implements NewConstants {
final SpellAbility ability = new Ability(card, "0") { final SpellAbility ability = new Ability(card, "0") {
@Override @Override
public void resolve() { public void resolve() {
PlayerZone library = AllZone.getZone(Constant.Zone.Library, card.getController()); AllZone.GameAction.drawCard(card.getController());
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
if(library.size() != 0) {
Card c = library.get(0);
library.remove(0);
hand.add(c);
}
} }
@Override @Override
@@ -13330,7 +13324,7 @@ public class CardFactory implements NewConstants {
ability.setDescription("Pay 1 life: Draw a card."); ability.setDescription("Pay 1 life: Draw a card.");
ability.setStackDescription(card.getName() + " - Pay 1 life: Draw a card."); ability.setStackDescription(card.getName() + " - Pay 1 life: Draw a card.");
card.addSpellAbility(ability); card.addSpellAbility(ability);
//instead of paying mana, pay life and add to stack //instead of paying mana, pay life and add to stack
@@ -13341,11 +13335,12 @@ public class CardFactory implements NewConstants {
@Override @Override
public void showMessage() { public void showMessage() {
AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(1,card); boolean paid = AllZone.GameAction.payLife(card.getController(), 1, card);
//this order is very important, do not change //this order is very important, do not change
stop(); stop();
AllZone.Stack.push(ability); if (paid)
AllZone.Stack.push(ability);
} }
};//Input };//Input
ability.setBeforePayMana(payLife); ability.setBeforePayMana(payLife);
@@ -13359,16 +13354,14 @@ public class CardFactory implements NewConstants {
private static final long serialVersionUID = 4511445425867383336L; private static final long serialVersionUID = 4511445425867383336L;
public void execute() { public void execute() {
if(AllZone.GameAction.isCardInPlay(card)) { //put cards removed by Necropotence into player's hand
//put cards removed by Necropotence into player's hand if(necroCards.size() > 0) {
if(necroCards.size() > 0) { PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
PlayerZone hand = AllZone.getZone(Constant.Zone.Hand, card.getController());
for(int i = 0; i < necroCards.size(); i++) {
for(int i = 0; i < necroCards.size(); i++) { hand.add(necroCards.get(i));
hand.add(necroCards.get(i));
}
necroCards.clear();
} }
necroCards.clear();
} }
} }
}; };
@@ -13405,11 +13398,12 @@ public class CardFactory implements NewConstants {
@Override @Override
public void showMessage() { public void showMessage() {
AllZone.GameAction.getPlayerLife(card.getController()).subtractLife(1,card); boolean paid = AllZone.GameAction.payLife(card.getController(), 1, card);
//this order is very important, do not change //this order is very important, do not change
stop(); stop();
AllZone.Stack.push(ability); if (paid)
AllZone.Stack.push(ability);
} }
};//Input };//Input
ability.setBeforePayMana(payLife); ability.setBeforePayMana(payLife);
@@ -15860,8 +15854,7 @@ public class CardFactory implements NewConstants {
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.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.setStackDescription("Survival of the Fittest - search for a creature card and put into hand"); ability.setStackDescription("Survival of the Fittest - search for a creature card and put into hand");
card.addSpellAbility(ability); card.addSpellAbility(ability);
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************