mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Added the option Curse to spPumpTgt.
- Added Disfigure.
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
Disfigure
|
||||
B
|
||||
Instant
|
||||
no text
|
||||
spPumpTgtCurse:-2/-2
|
||||
|
||||
Serra Avatar
|
||||
4 W W W
|
||||
Creature Avatar
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user