mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- 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:
@@ -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) {
|
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;
|
int restDamage = d;
|
||||||
final Game game = comp.getGame();
|
final Game game = comp.getGame();
|
||||||
Player enemy = ComputerUtil.getOpponentFor(comp);
|
Player enemy = ComputerUtil.getOpponentFor(comp);
|
||||||
@@ -78,8 +83,10 @@ public abstract class DamageAiBase extends SpellAbilityAi {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// burn Planeswalkers
|
// burn Planeswalkers
|
||||||
if (Iterables.any(enemy.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANESWALKERS)) {
|
if (!noPlaneswalkerRedirection) {
|
||||||
return true;
|
if (Iterables.any(enemy.getCardsIn(ZoneType.Battlefield), CardPredicates.Presets.PLANESWALKERS)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (avoidTargetP(comp, sa)) {
|
if (avoidTargetP(comp, sa)) {
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ public class DamageDealAi extends DamageAiBase {
|
|||||||
if (tgt.canTgtPlaneswalker()) {
|
if (tgt.canTgtPlaneswalker()) {
|
||||||
// We can damage planeswalkers with this, consider targeting.
|
// We can damage planeswalkers with this, consider targeting.
|
||||||
Card c = this.dealDamageChooseTgtPW(ai, sa, dmg, noPrevention, enemy, false);
|
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);
|
tcs.add(c);
|
||||||
if (divided) {
|
if (divided) {
|
||||||
final int assignedDamage = ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);
|
final int assignedDamage = ComputerUtilCombat.getEnoughDamageToKill(c, dmg, source, false, noPrevention);
|
||||||
|
|||||||
Reference in New Issue
Block a user