From 0948cdb1333bfc8162f2ca2b72ba2f35848d96e0 Mon Sep 17 00:00:00 2001 From: Sloth Date: Sat, 18 Oct 2014 20:17:12 +0000 Subject: [PATCH] - Added AI support for Frenetic Efreet. --- forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java | 5 +++++ forge-gui/res/cardsfolder/f/frenetic_efreet.txt | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java b/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java index d9c75d0106e..d4234b7dff7 100644 --- a/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java +++ b/forge-ai/src/main/java/forge/ai/ability/FlipACoinAi.java @@ -1,5 +1,6 @@ package forge.ai.ability; +import forge.ai.ComputerUtil; import forge.ai.SpellAbilityAi; import forge.game.player.Player; import forge.game.spellability.SpellAbility; @@ -15,6 +16,10 @@ public class FlipACoinAi extends SpellAbilityAi { if (sa.hasParam("AILogic")) { if (sa.getParam("AILogic").equals("Never")) { return false; + } else if (sa.getParam("AILogic").equals("PhaseOut")) { + if (!ComputerUtil.predictThreatenedObjects(sa.getActivatingPlayer(), sa).contains(sa.getHostCard())) { + return false; + } } } return true; diff --git a/forge-gui/res/cardsfolder/f/frenetic_efreet.txt b/forge-gui/res/cardsfolder/f/frenetic_efreet.txt index 892ff51f7db..fc1d90bfdbf 100644 --- a/forge-gui/res/cardsfolder/f/frenetic_efreet.txt +++ b/forge-gui/res/cardsfolder/f/frenetic_efreet.txt @@ -3,9 +3,8 @@ ManaCost:1 U R Types:Creature Efreet PT:2/1 K:Flying -A:AB$ FlipACoin | Cost$ 0 | WinSubAbility$ DBPhase | LoseSubAbility$ DBSacrifice | SpellDescription$ Flip a coin. If you win the flip, Frenetic Efreet phases out. If you lose the flip, sacrifice Frenetic Efreet. (While it's phased out, it's treated as though it doesn't exist. It phases in before you untap during your next untap step.) +A:AB$ FlipACoin | Cost$ 0 | WinSubAbility$ DBPhase | LoseSubAbility$ DBSacrifice | AILogic$ PhaseOut | SpellDescription$ Flip a coin. If you win the flip, Frenetic Efreet phases out. If you lose the flip, sacrifice Frenetic Efreet. (While it's phased out, it's treated as though it doesn't exist. It phases in before you untap during your next untap step.) SVar:DBPhase:DB$ Phases | Defined$ Self SVar:DBSacrifice:DB$ Sacrifice | Defined$ Self -SVar:RemAIDeck:True SVar:Picture:http://www.wizards.com/global/images/magic/general/frenetic_efreet.jpg Oracle:Flying\n{0}: Flip a coin. If you win the flip, Frenetic Efreet phases out. If you lose the flip, sacrifice Frenetic Efreet. (While it's phased out, it's treated as though it doesn't exist. It phases in before you untap during your next untap step.)