- Cleanup.

This commit is contained in:
Agetian
2017-01-26 19:44:26 +00:00
parent 32ff2b77e7
commit 334e315e3a

View File

@@ -705,8 +705,8 @@ public class DamageDealAi extends DamageAiBase {
private boolean doXLifeDrainLogic(Player ai, SpellAbility sa, int origDmg) { private boolean doXLifeDrainLogic(Player ai, SpellAbility sa, int origDmg) {
Card source = sa.getHostCard(); Card source = sa.getHostCard();
int dmg = origDmg - source.getCMC(); // otherwise AI incorrectly calculates mana it can afford int dmg = origDmg - source.getCMC(); // otherwise AI incorrectly calculates mana it can afford
Player opponent = ai.getOpponents().min(PlayerPredicates.compareByLife()); Player opponent = ai.getOpponents().min(PlayerPredicates.compareByLife());
if (dmg < 3 && dmg < opponent.getLife()) { if (dmg < 3 && dmg < opponent.getLife()) {
return false; return false;
} }
@@ -733,7 +733,7 @@ public class DamageDealAi extends DamageAiBase {
saTgt = saTgt.getParent(); saTgt = saTgt.getParent();
} }
saTgt.resetTargets(); saTgt.resetTargets();
saTgt.getTargets().add((tgtCreature != null && dmg < opponent.getLife()) ? tgtCreature : opponent); saTgt.getTargets().add(tgtCreature != null && dmg < opponent.getLife() ? tgtCreature : opponent);
// TODO: this currently does not work for Soul Burn because of xColorManaPaid (B/R) which the AI doesn't set // TODO: this currently does not work for Soul Burn because of xColorManaPaid (B/R) which the AI doesn't set
source.setSVar("PayX", Integer.toString(dmg)); source.setSVar("PayX", Integer.toString(dmg));