- Added the option Curse to spPumpTgt.

- Added Disfigure.
This commit is contained in:
jendave
2011-08-06 06:13:42 +00:00
parent b6d83695e8
commit 86a1929c6f
2 changed files with 39 additions and 11 deletions

View File

@@ -1,3 +1,9 @@
Disfigure
B
Instant
no text
spPumpTgtCurse:-2/-2
Serra Avatar
4 W W W
Creature Avatar

View File

@@ -4727,6 +4727,9 @@ public class CardFactory implements NewConstants {
final int NumDefense[] = {-1138};
final String DefenseX[] = {"none"};
final String Keyword[] = {"none"};
final boolean curse[] = {false};
curse[0] = k[0].contains("Curse");
String ptk[] = k[1].split("/");
@@ -4865,20 +4868,39 @@ public class CardFactory implements NewConstants {
if(curPhase.equals(Constant.Phase.Main2))
return false;
CardList list = getCreatures();
if(!list.isEmpty()) {
boolean goodt = false;
Card t = new Card();
if (curse[0]) { // Curse means spells with negative effect
CardList list = new CardList(AllZone.Human_Play.getCards());
list = list.filter(new CardListFilter() {
public boolean addCard(Card c) {
return CardFactoryUtil.canTarget(card, c) && c.isCreature();
}
});
if (NumDefense[0] < 0 && !list.isEmpty()) { // with spells that give -X/-X, compi will try to destroy a creature
int defmalus = - getNumDefense();
list = CardListUtil.filterToughness(list, defmalus);
} // -X/-X end
if (!list.isEmpty()) {
t = CardFactoryUtil.AI_getBestCreature(list);
goodt = true;
}
}
else { // no Curse means spell with positive effect
CardList list = getCreatures();
if(!list.isEmpty()) {
while(goodt == false && !list.isEmpty()) {
t = CardFactoryUtil.AI_getBestCreature(list);
if((t.getNetDefense() + defense) > 0) goodt = true;
else list.remove(t);
}
}
}
if(goodt == true) {
setTargetCard(t);
return true;
}
}
return false;
}