add Mijae Djinn (from Arabian Nights)

This commit is contained in:
jendave
2011-08-06 13:28:20 +00:00
parent 6e9e39e3c7
commit 5ce3c99c2b
4 changed files with 41 additions and 0 deletions

1
.gitattributes vendored
View File

@@ -3024,6 +3024,7 @@ res/cardsfolder/might_sliver.txt -text svneol=native#text/plain
res/cardsfolder/might_weaver.txt -text svneol=native#text/plain
res/cardsfolder/mightstone.txt -text svneol=native#text/plain
res/cardsfolder/mighty_leap.txt -text svneol=native#text/plain
res/cardsfolder/mijae_djinn.txt -text svneol=native#text/plain
res/cardsfolder/mikokoro_center_of_the_sea.txt -text svneol=native#text/plain
res/cardsfolder/millstone.txt -text svneol=native#text/plain
res/cardsfolder/minamo_school_at_waters_edge.txt -text svneol=native#text/plain

View File

@@ -0,0 +1,8 @@
Name:Mijae Djinn
ManaCost:R R R
Types:Creature Djinn
Text:Whenever CARDNAME attacks, flip a coin. If you lose the flip, remove CARDNAME from combat and tap it.
PT:6/3
SVar:Rarity:Rare
SVar:Picture:http://www.wizards.com/global/images/magic/general/mijae_djinn.jpg
End

View File

@@ -1112,6 +1112,17 @@ public class CombatUtil {
AllZone.Stack.add(ability);
}//Raging Ravine
//Mijae Djinn
if(c.getName().equals("Mijae Djinn")) {
if( GameActionUtil.flipACoin(c.getController(), c)) {
//attack as normal
}
else{
AllZone.Combat.removeFromCombat(c);
c.tap();
}
}//Raging Ravine
if ((AllZone.Combat.getAttackers().length + AllZone.pwCombat.getAttackers().length) == 1)
{
if (c.getKeyword().contains("Whenever this creature attacks alone, it gets +2/+0 until end of turn.") ||

View File

@@ -4626,6 +4626,27 @@ public class GameActionUtil {
if (answer == JOptionPane.YES_OPTION) return true;
else return false;
}
public static boolean flipACoin(Player caller, Card source) {
String choice = "";
String choices[] = {"heads","tails"};
boolean flip = MyRandom.percentTrue(50);
if(caller.isHuman()) {
choice = (String) AllZone.Display.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;
}
}
/*
private static boolean showDialog(Card c) {
String[] choices = {"Yes", "No"};