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