diff --git a/.gitattributes b/.gitattributes index a309ed0e363..7f115ef46c3 100644 --- a/.gitattributes +++ b/.gitattributes @@ -2921,6 +2921,7 @@ res/cardsfolder/f/frazzle.txt svneol=native#text/plain res/cardsfolder/f/freed_from_the_real.txt svneol=native#text/plain res/cardsfolder/f/freewind_equenaut.txt svneol=native#text/plain res/cardsfolder/f/freewind_falcon.txt svneol=native#text/plain +res/cardsfolder/f/frenetic_efreet.txt -text res/cardsfolder/f/frenetic_ogre.txt svneol=native#text/plain res/cardsfolder/f/frenetic_raptor.txt svneol=native#text/plain res/cardsfolder/f/frenetic_sliver.txt -text diff --git a/res/cardsfolder/f/frenetic_efreet.txt b/res/cardsfolder/f/frenetic_efreet.txt new file mode 100644 index 00000000000..a9f85e60fdf --- /dev/null +++ b/res/cardsfolder/f/frenetic_efreet.txt @@ -0,0 +1,15 @@ +Name:Frenetic Efreet +ManaCost:1 U R +Types:Creature Efreet +Text:no text +PT:2/1 +K:Flying +A:AB$ FlipACoin | Cost$ 0 | WinSubAbility$ DBPhase | LoseSubAbility$ DBDestroy | 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:DBDestroy:DB$ Destroy | Defined$ Self +SVar:RemAIDeck:True +SVar:Rarity:Rare +SVar:Picture:http://www.wizards.com/global/images/magic/general/frenetic_efreet.jpg +SetInfo:MIR|Rare|http://magiccards.info/scans/en/mr/324.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.) +End \ No newline at end of file diff --git a/src/main/java/forge/GameActionUtil.java b/src/main/java/forge/GameActionUtil.java index df707eb1327..c175928245f 100644 --- a/src/main/java/forge/GameActionUtil.java +++ b/src/main/java/forge/GameActionUtil.java @@ -661,22 +661,20 @@ public final class GameActionUtil { public static boolean flipACoin(final Player caller, final Card source) { String choice = ""; String[] choices = {"heads", "tails"}; - boolean flip = (50 > MyRandom.random.nextInt(100)); + + boolean flip = MyRandom.random.nextBoolean(); if (caller.isHuman()) { choice = (String) GuiUtils.getChoice(source.getName() + " - Call coin flip", choices); } else { choice = choices[MyRandom.random.nextInt(2)]; } - if ((flip == true && choice.equals("heads")) || (flip == false && choice.equals("tails"))) { - JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + " wins flip.", - source.getName(), JOptionPane.PLAIN_MESSAGE); - return true; - } else { - JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + " loses flip.", - source.getName(), JOptionPane.PLAIN_MESSAGE); - return false; - } + boolean winFlip = flip == choice.equals("heads"); + String winMsg = winFlip ? " wins flip." : " loses flip."; + + JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + winMsg, + source.getName(), JOptionPane.PLAIN_MESSAGE); + return winFlip; } /** diff --git a/src/main/java/forge/card/abilityFactory/AbilityFactory_PermanentState.java b/src/main/java/forge/card/abilityFactory/AbilityFactory_PermanentState.java index a3acb098404..178f8519dfb 100644 --- a/src/main/java/forge/card/abilityFactory/AbilityFactory_PermanentState.java +++ b/src/main/java/forge/card/abilityFactory/AbilityFactory_PermanentState.java @@ -2013,7 +2013,9 @@ public class AbilityFactory_PermanentState { } for (Card tgtC : tgtCards) { - tgtC.phase(); + if (!tgtC.isPhasedOut()) { + tgtC.phase(); + } } } }// end of AbilityFactory_PermanentState class