- Do not consider "indirect Planeswalker burn" when deliberately evaluating a planeswalker vs. a player target (the clause must be removed and set as default later when the planeswalker redirection rule is fully removed).

This commit is contained in:
Agetian
2018-04-11 08:56:14 +03:00
parent 115720cc53
commit c20093280c
2 changed files with 10 additions and 3 deletions

View File

@@ -44,6 +44,11 @@ public abstract class DamageAiBase extends SpellAbilityAi {
}
protected boolean shouldTgtP(final Player comp, final SpellAbility sa, final int d, final boolean noPrevention) {
// TODO: once the "planeswalker redirection" rule is removed completely, just remove this code and
// remove the "burn Planeswalkers" code in the called method.
return shouldTgtP(comp, sa, d, noPrevention, false);
}
protected boolean shouldTgtP(final Player comp, final SpellAbility sa, final int d, final boolean noPrevention, final boolean noPlaneswalkerRedirection) {
int restDamage = d;
final Game game = comp.getGame();
Player enemy = ComputerUtil.getOpponentFor(comp);
@@ -78,8 +83,10 @@ public abstract class DamageAiBase extends SpellAbilityAi {
}
// burn Planeswalkers
if (Iterables.any(enemy.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANESWALKERS)) {
return true;
if (!noPlaneswalkerRedirection) {
if (Iterables.any(enemy.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANESWALKERS)) {
return true;
}
}
if (avoidTargetP(comp, sa)) {

View File

@@ -533,7 +533,7 @@ public class DamageDealAi extends DamageAiBase {
if (tgt.canTgtPlaneswalker()) {
// We can damage planeswalkers with this, consider targeting.
Card c = this.dealDamageChooseTgtPW(ai, sa, dmg, noPrevention, enemy, false);
if (c != null) {
if (c != null && !this.shouldTgtP(ai, sa, dmg, noPrevention, true)) {
tcs.add(c);
if (divided) {
final int assignedDamage = ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);