mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-17 11:18:01 +00:00
- AI improvements to the DealDamage AF.
This commit is contained in:
@@ -174,6 +174,10 @@ import java.util.Random;
|
||||
}
|
||||
|
||||
private boolean shouldTgtP(int d) {
|
||||
|
||||
if (AllZone.HumanPlayer.reducePlayerDamageToZero(AF.getHostCard(), false)
|
||||
|| !AllZone.HumanPlayer.canTarget(AF.getHostCard())) return false;
|
||||
|
||||
PlayerZone compHand = AllZone.getZone(Constant.Zone.Hand, AllZone.ComputerPlayer);
|
||||
CardList hand = new CardList(compHand.getCards());
|
||||
|
||||
@@ -227,7 +231,7 @@ import java.util.Random;
|
||||
}
|
||||
if (AF.getAbCost().getSubCounter()) {
|
||||
// +1/+1 counters only if damage from this ability would kill the human, otherwise ok
|
||||
if(AllZone.HumanPlayer.getLife() - damage > 0 || !AF.getAbCost().getCounterType().equals(Counters.P1P1))
|
||||
if(AllZone.HumanPlayer.getLife() - damage > 0 && AF.getAbCost().getCounterType().equals(Counters.P1P1))
|
||||
return false;
|
||||
}
|
||||
if (AF.getAbCost().getLifeCost()) {
|
||||
|
||||
@@ -268,7 +268,7 @@ public class AbilityFactory_Pump {
|
||||
if (addsKeywords) {
|
||||
list = list.filter(new CardListFilter() {
|
||||
public boolean addCard(Card c) {
|
||||
return c.hasAnyKeyword(KWs); // don't add duplicate negative keywords
|
||||
return !c.hasAnyKeyword(KWs); // don't add duplicate negative keywords
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -211,7 +211,7 @@ public abstract class Player extends MyObservable{
|
||||
GameActionUtil.executePlayerDamageEffects(this, source, damageToDo, false);
|
||||
}
|
||||
|
||||
private boolean reducePlayerDamageToZero(final Card source, final boolean isCombat) {
|
||||
public boolean reducePlayerDamageToZero(final Card source, final boolean isCombat) {
|
||||
boolean reduce = false;
|
||||
if(isCombat) {
|
||||
//for future use
|
||||
|
||||
Reference in New Issue
Block a user