mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- Update AF_Damage to properly care about legal targets.
This commit is contained in:
@@ -131,19 +131,17 @@ import java.util.Random;
|
||||
}
|
||||
|
||||
private Card chooseTgtC(final int d, final boolean noPrevention) {
|
||||
CardList hPlay = AllZoneUtil.getPlayerCardsInPlay(AllZone.HumanPlayer);
|
||||
hPlay = hPlay.getValidCards(AF.getAbTgt().getValidTgts(), AllZone.ComputerPlayer, AF.getHostCard());
|
||||
|
||||
PlayerZone human = AllZone.getZone(Constant.Zone.Battlefield, AllZone.HumanPlayer);
|
||||
CardList hPlay = new CardList(human.getCards());
|
||||
hPlay = hPlay.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
int restDamage = d;
|
||||
if (!noPrevention)
|
||||
restDamage = c.staticDamagePrevention(d,AF.getHostCard(),false);
|
||||
// will include creatures already dealt damage
|
||||
return c.isCreature() && (c.getKillDamage() <= restDamage)
|
||||
&& CardFactoryUtil.canTarget(AF.getHostCard(), c)
|
||||
&& !c.getKeyword().contains("Indestructible")
|
||||
&& !(c.getSVar("SacMe").length() > 0);
|
||||
return c.getKillDamage() <= restDamage && CardFactoryUtil.canTarget(AF.getHostCard(), c)
|
||||
&& !c.getKeyword().contains("Indestructible") && !(c.getSVar("SacMe").length() > 0);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -152,14 +150,6 @@ import java.util.Random;
|
||||
return best;
|
||||
}
|
||||
|
||||
// Combo alert!! Casting burn on your own Stuffy Dolls is a waste
|
||||
/*
|
||||
PlayerZone compy = AllZone.getZone(Constant.Zone.Play, AllZone.ComputerPlayer);
|
||||
CardList cPlay = new CardList(compy.getCards());
|
||||
if(cPlay.size() > 0) for(int i = 0; i < cPlay.size(); i++)
|
||||
if(cPlay.get(i).getName().equals("Stuffy Doll")) return cPlay.get(i);
|
||||
*/
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -188,7 +178,7 @@ import java.util.Random;
|
||||
|
||||
// TODO handle proper calculation of X values based on Cost
|
||||
|
||||
// todo: this should only happen during Players EOT
|
||||
// todo: this should only happen during Players EOT or if Stuffy is going to die
|
||||
if(AF.getHostCard().equals("Stuffy Doll")) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user