- 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
@@ -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);
@@ -15863,7 +15857,6 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START ************************** //*************** START *********** START **************************
else if(cardName.equals("Nameless Inversion")) { else if(cardName.equals("Nameless Inversion")) {
SpellAbility spell = new Spell(card) { SpellAbility spell = new Spell(card) {