mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
Add Frenetic Efreet
Some cleanup in AF_Phases and GameActionUtil.FlipACoin
This commit is contained in:
1
.gitattributes
vendored
1
.gitattributes
vendored
@@ -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/freed_from_the_real.txt svneol=native#text/plain
|
||||||
res/cardsfolder/f/freewind_equenaut.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/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_ogre.txt svneol=native#text/plain
|
||||||
res/cardsfolder/f/frenetic_raptor.txt svneol=native#text/plain
|
res/cardsfolder/f/frenetic_raptor.txt svneol=native#text/plain
|
||||||
res/cardsfolder/f/frenetic_sliver.txt -text
|
res/cardsfolder/f/frenetic_sliver.txt -text
|
||||||
|
|||||||
15
res/cardsfolder/f/frenetic_efreet.txt
Normal file
15
res/cardsfolder/f/frenetic_efreet.txt
Normal file
@@ -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
|
||||||
@@ -661,22 +661,20 @@ public final class GameActionUtil {
|
|||||||
public static boolean flipACoin(final Player caller, final Card source) {
|
public static boolean flipACoin(final Player caller, final Card source) {
|
||||||
String choice = "";
|
String choice = "";
|
||||||
String[] choices = {"heads", "tails"};
|
String[] choices = {"heads", "tails"};
|
||||||
boolean flip = (50 > MyRandom.random.nextInt(100));
|
|
||||||
|
boolean flip = MyRandom.random.nextBoolean();
|
||||||
if (caller.isHuman()) {
|
if (caller.isHuman()) {
|
||||||
choice = (String) GuiUtils.getChoice(source.getName() + " - Call coin flip", choices);
|
choice = (String) GuiUtils.getChoice(source.getName() + " - Call coin flip", choices);
|
||||||
} else {
|
} else {
|
||||||
choice = choices[MyRandom.random.nextInt(2)];
|
choice = choices[MyRandom.random.nextInt(2)];
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flip == true && choice.equals("heads")) || (flip == false && choice.equals("tails"))) {
|
boolean winFlip = flip == choice.equals("heads");
|
||||||
JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + " wins flip.",
|
String winMsg = winFlip ? " wins flip." : " loses flip.";
|
||||||
source.getName(), JOptionPane.PLAIN_MESSAGE);
|
|
||||||
return true;
|
JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + winMsg,
|
||||||
} else {
|
source.getName(), JOptionPane.PLAIN_MESSAGE);
|
||||||
JOptionPane.showMessageDialog(null, source.getName() + " - " + caller + " loses flip.",
|
return winFlip;
|
||||||
source.getName(), JOptionPane.PLAIN_MESSAGE);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2013,7 +2013,9 @@ public class AbilityFactory_PermanentState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (Card tgtC : tgtCards) {
|
for (Card tgtC : tgtCards) {
|
||||||
tgtC.phase();
|
if (!tgtC.isPhasedOut()) {
|
||||||
|
tgtC.phase();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}// end of AbilityFactory_PermanentState class
|
}// end of AbilityFactory_PermanentState class
|
||||||
|
|||||||
Reference in New Issue
Block a user