fix Exception in Lich Lord of Unx when life > library.size()

This commit is contained in:
jendave
2011-08-06 08:08:45 +00:00
parent 2cc3b37fb3
commit c8795e14c6

View File

@@ -15812,24 +15812,18 @@ public class CardFactory_Creatures {
public void resolve() { public void resolve() {
if(getTargetPlayer() != null) { if(getTargetPlayer() != null) {
PlayerZone lib = AllZone.getZone(Constant.Zone.Library, getTargetPlayer()); PlayerZone lib = AllZone.getZone(Constant.Zone.Library, getTargetPlayer());
PlayerZone grave = AllZone.getZone(Constant.Zone.Graveyard, getTargetPlayer());
for(int i = 0; i < countZombies(); i++) { for(int i = 0; i < countZombies(); i++) {
Card c = lib.get(0); //probably should be updated to AllZone.GameAction.mill(getTargetPlayer(),1);
lib.remove(0); if(lib.size() > 0) {
grave.add(c); AllZone.GameAction.moveToGraveyard(lib.get(0));
}
AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(1,card); AllZone.GameAction.getPlayerLife(getTargetPlayer()).subtractLife(1,card);
} }
} }
} }//end resolve
public int countZombies() { public int countZombies() {
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController()); return AllZoneUtil.getPlayerTypeInPlay(card.getController(), "Zombie").size();
CardList list = new CardList(play.getCards());
list = list.getType("Zombie");
return list.size();
} }
}; };
@@ -15838,8 +15832,7 @@ public class CardFactory_Creatures {
ability2.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability2)); ability2.setBeforePayMana(CardFactoryUtil.input_targetPlayer(ability2));
card.addSpellAbility(ability); card.addSpellAbility(ability);
card.addSpellAbility(ability2); card.addSpellAbility(ability2);
}//*************** END ************ END ************************** }//*************** END ************ END **************************