mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
add Mijae Djinn (from Arabian Nights)
This commit is contained in:
@@ -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.") ||
|
||||
|
||||
@@ -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"};
|
||||
|
||||
Reference in New Issue
Block a user