- Fixed the first ability of Phylactery Lich to not use the stack (which fixes it for the AI, but the human input still delays it until the always trigger kicks in).

This commit is contained in:
Sloth
2011-11-09 19:57:54 +00:00
parent 16de603c69
commit 23141df2a3

View File

@@ -522,8 +522,7 @@ public class CardFactoryCreatures {
public void selectCard(final Card card, final PlayerZone zone) { public void selectCard(final Card card, final PlayerZone zone) {
if (card.isArtifact() && zone.is(Constant.Zone.Battlefield) if (card.isArtifact() && zone.is(Constant.Zone.Battlefield)
&& card.getController().isHuman()) { && card.getController().isHuman()) {
ability.setTargetCard(card); card.addCounter(Counters.PHYLACTERY, 1);
AllZone.getStack().add(ability);
this.stop(); this.stop();
} }
} }
@@ -538,13 +537,29 @@ public class CardFactoryCreatures {
} }
} else { // computer } else { // computer
final Object o = getArt.execute(); CardList art = AllZone.getComputerPlayer().getCardsIn(Zone.Battlefield);
// should never happen, but just in case art = art.filter(new CardListFilter() {
if (o != null) { @Override
ability.setTargetCard((Card) o); public boolean addCard(final Card c) {
AllZone.getStack().addSimultaneousStackEntry(ability); return c.isArtifact();
}
});
CardList list = new CardList(art.toArray());
list = list.filter(new CardListFilter() {
@Override
public boolean addCard(final Card c) {
return c.getIntrinsicKeyword().contains("Indestructible");
}
});
Card chosen = null;
if (!list.isEmpty()) {
chosen = list.get(0);
} else if (!art.isEmpty()) {
chosen = art.get(0);
} }
chosen.addCounter(Counters.PHYLACTERY, 1);
} // else } // else
} // execute() } // execute()
}; };