From 0f72f0db8aef0d4a6fcfe18ebaffefe521ae314d Mon Sep 17 00:00:00 2001 From: Agetian Date: Sat, 3 Nov 2018 11:01:15 +0300 Subject: [PATCH] - Attempt to fix the AI never playing Fight with Fire, kicked or unkicked. --- forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java | 4 +++- forge-gui/res/cardsfolder/f/fight_with_fire.txt | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java b/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java index d55ad8aa463..a947d7cbb12 100644 --- a/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/DamageDealAi.java @@ -494,7 +494,9 @@ public class DamageDealAi extends DamageAiBase { return true; } - if (tgt.getMaxTargets(source, sa) <= 0) { + // AssumeAtLeastOneTarget is used for cards with funky targeting implementation like Fight with Fire which would + // otherwise confuse the AI by returning 0 unexpectedly during SA "AI can play" tests. + if (tgt.getMaxTargets(source, sa) <= 0 && !logic.equals("AssumeAtLeastOneTarget")) { return false; } diff --git a/forge-gui/res/cardsfolder/f/fight_with_fire.txt b/forge-gui/res/cardsfolder/f/fight_with_fire.txt index 8bf91fdea76..b4554c03165 100644 --- a/forge-gui/res/cardsfolder/f/fight_with_fire.txt +++ b/forge-gui/res/cardsfolder/f/fight_with_fire.txt @@ -2,8 +2,8 @@ Name:Fight with Fire ManaCost:2 R Types:Sorcery K:Kicker:5 R -A:SP$ DealDamage | Cost$ 2 R | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ 5 | TargetMin$ X | TargetMax$ X | References$ X | SubAbility$ DBDealDamage | SpellDescription$ CARDNAME deals 5 damage to target creature. If this spell was kicked, it deals 10 damage divided as you choose among any number of targets instead. -SVar:DBDealDamage:DB$ DealDamage | Condition$ Kicked | ValidTgts$ Creature,Player,Planeswalker | NumDmg$ 10 | TargetMin$ Y | TargetMax$ Z | DividedAsYouChoose$ Z | References$ Y,Z +A:SP$ DealDamage | Cost$ 2 R | ValidTgts$ Creature | TgtPrompt$ Select target creature | NumDmg$ 5 | TargetMin$ X | TargetMax$ X | References$ X | SubAbility$ DBDealDamage | AILogic$ AssumeAtLeastOneTarget | SpellDescription$ CARDNAME deals 5 damage to target creature. If this spell was kicked, it deals 10 damage divided as you choose among any number of targets instead. +SVar:DBDealDamage:DB$ DealDamage | Condition$ Kicked | ValidTgts$ Creature,Player,Planeswalker | NumDmg$ 10 | TargetMin$ Y | TargetMax$ Z | DividedAsYouChoose$ Z | References$ Y,Z | AILogic$ AssumeAtLeastOneTarget SVar:X:Count$Kicked.0.1 SVar:Y:Count$Kicked.1.0 SVar:Z:Count$Kicked.10.0