mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
Activate Ripple prompt now uses standard showYesNoDialog
This commit is contained in:
@@ -224,16 +224,7 @@ public final class GameActionUtil {
|
|||||||
final Player controller = c.getController();
|
final Player controller = c.getController();
|
||||||
final Card rippleCard = c;
|
final Card rippleCard = c;
|
||||||
boolean activateRipple = false;
|
boolean activateRipple = false;
|
||||||
if (controller.isHuman()) {
|
if (controller.isComputer() || GameActionUtil.showYesNoDialog(c, "Activate Ripple for " + c + "?")) {
|
||||||
final Object[] possibleValues = { "Yes", "No" };
|
|
||||||
AllZone.getDisplay().showMessage("Activate Ripple? ");
|
|
||||||
final Object q = JOptionPane.showOptionDialog(null, "Activate Ripple for " + c, "Ripple",
|
|
||||||
JOptionPane.DEFAULT_OPTION, JOptionPane.INFORMATION_MESSAGE, null, possibleValues,
|
|
||||||
possibleValues[0]);
|
|
||||||
if (q.equals(0)) {
|
|
||||||
activateRipple = true;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
activateRipple = true;
|
activateRipple = true;
|
||||||
}
|
}
|
||||||
if (activateRipple) {
|
if (activateRipple) {
|
||||||
@@ -306,7 +297,7 @@ public final class GameActionUtil {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
ripple.execute();
|
ripple.execute();
|
||||||
} // playCard_Ripple()
|
} // playCardRipple()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -837,7 +828,7 @@ public final class GameActionUtil {
|
|||||||
|
|
||||||
final StringBuilder sb = new StringBuilder();
|
final StringBuilder sb = new StringBuilder();
|
||||||
sb.append(lich.getName()).append(" - ").append(lich.getController());
|
sb.append(lich.getName()).append(" - ").append(lich.getController());
|
||||||
sb.append(" sacrifices ").append(damage).append(" nontoken Permanents.");
|
sb.append(" sacrifices ").append(damage).append(" nontoken permanents.");
|
||||||
ability.setStackDescription(sb.toString());
|
ability.setStackDescription(sb.toString());
|
||||||
|
|
||||||
AllZone.getStack().addSimultaneousStackEntry(ability);
|
AllZone.getStack().addSimultaneousStackEntry(ability);
|
||||||
@@ -1176,7 +1167,7 @@ public final class GameActionUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* playerCombatDamage_Spawnwrithe.
|
* playerCombatDamageSpawnwrithe.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @param c
|
* @param c
|
||||||
@@ -1208,7 +1199,7 @@ public final class GameActionUtil {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Constant <code>Elspeth_Emblem</code>. */
|
/** Constant <code>elspethEmblem</code>. */
|
||||||
private static Command elspethEmblem = new Command() {
|
private static Command elspethEmblem = new Command() {
|
||||||
|
|
||||||
private static final long serialVersionUID = 7414127991531889390L;
|
private static final long serialVersionUID = 7414127991531889390L;
|
||||||
@@ -1386,9 +1377,9 @@ public final class GameActionUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// is a card of a certain type/color present?
|
||||||
|
if (specialConditions.contains("isPresent")) {
|
||||||
|
|
||||||
if (specialConditions.contains("isPresent")) { // is a card of a certain
|
|
||||||
// type/color present?
|
|
||||||
final String requirements = specialConditions.replaceAll("isPresent ", "");
|
final String requirements = specialConditions.replaceAll("isPresent ", "");
|
||||||
CardList cardsinPlay = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
CardList cardsinPlay = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||||
final String[] conditions = requirements.split(",");
|
final String[] conditions = requirements.split(",");
|
||||||
@@ -1397,9 +1388,8 @@ public final class GameActionUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (specialConditions.contains("isInGraveyard")) { // is a card of a
|
//is a card of a certain type/color present in yard
|
||||||
// certain type/color
|
if (specialConditions.contains("isInGraveyard")) {
|
||||||
// present in yard?
|
|
||||||
final String requirements = specialConditions.replaceAll("isInGraveyard ", "");
|
final String requirements = specialConditions.replaceAll("isInGraveyard ", "");
|
||||||
CardList cardsinYards = AllZoneUtil.getCardsIn(Zone.Graveyard);
|
CardList cardsinYards = AllZoneUtil.getCardsIn(Zone.Graveyard);
|
||||||
final String[] conditions = requirements.split(",");
|
final String[] conditions = requirements.split(",");
|
||||||
@@ -1408,9 +1398,8 @@ public final class GameActionUtil {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (specialConditions.contains("isNotPresent")) { // is no card of a
|
//is no card of a certain type/color present?
|
||||||
// certain type/color
|
if (specialConditions.contains("isNotPresent")) {
|
||||||
// present?
|
|
||||||
final String requirements = specialConditions.replaceAll("isNotPresent ", "");
|
final String requirements = specialConditions.replaceAll("isNotPresent ", "");
|
||||||
CardList cardsInPlay = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
CardList cardsInPlay = AllZoneUtil.getCardsIn(Zone.Battlefield);
|
||||||
final String[] conditions = requirements.split(",");
|
final String[] conditions = requirements.split(",");
|
||||||
@@ -1557,7 +1546,7 @@ public final class GameActionUtil {
|
|||||||
|
|
||||||
}; // stLandManaAbilities
|
}; // stLandManaAbilities
|
||||||
|
|
||||||
/** Constant <code>Coat_of_Arms</code>. */
|
/** Constant <code>coatOfArms</code>. */
|
||||||
private static Command coatOfArms = new Command() {
|
private static Command coatOfArms = new Command() {
|
||||||
private static final long serialVersionUID = 583505612126735693L;
|
private static final long serialVersionUID = 583505612126735693L;
|
||||||
|
|
||||||
@@ -1609,7 +1598,7 @@ public final class GameActionUtil {
|
|||||||
} // for inner
|
} // for inner
|
||||||
} // for outer
|
} // for outer
|
||||||
} // execute
|
} // execute
|
||||||
}; // Coat of Arms
|
}; // coatOfArms
|
||||||
|
|
||||||
private static Command alphaStatus = new Command() {
|
private static Command alphaStatus = new Command() {
|
||||||
private static final long serialVersionUID = -3213793711304934358L;
|
private static final long serialVersionUID = -3213793711304934358L;
|
||||||
@@ -1704,7 +1693,7 @@ public final class GameActionUtil {
|
|||||||
} // execute
|
} // execute
|
||||||
}; // Ajani Avatar
|
}; // Ajani Avatar
|
||||||
|
|
||||||
/** Constant <code>Old_Man_of_the_Sea</code>. */
|
/** Constant <code>oldManOfTheSea</code>. */
|
||||||
private static Command oldManOfTheSea = new Command() {
|
private static Command oldManOfTheSea = new Command() {
|
||||||
private static final long serialVersionUID = 8076177362922156784L;
|
private static final long serialVersionUID = 8076177362922156784L;
|
||||||
|
|
||||||
@@ -1724,7 +1713,7 @@ public final class GameActionUtil {
|
|||||||
}
|
}
|
||||||
}; // Old Man of the Sea
|
}; // Old Man of the Sea
|
||||||
|
|
||||||
/** Constant <code>Homarid</code>. */
|
/** Constant <code>homarid</code>. */
|
||||||
private static Command homarid = new Command() {
|
private static Command homarid = new Command() {
|
||||||
private static final long serialVersionUID = 7156319758035295773L;
|
private static final long serialVersionUID = 7156319758035295773L;
|
||||||
|
|
||||||
@@ -1741,7 +1730,7 @@ public final class GameActionUtil {
|
|||||||
} // execute()
|
} // execute()
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Constant <code>Liu_Bei</code>. */
|
/** Constant <code>liuBei</code>. */
|
||||||
private static Command liuBei = new Command() {
|
private static Command liuBei = new Command() {
|
||||||
|
|
||||||
private static final long serialVersionUID = 4235093010715735727L;
|
private static final long serialVersionUID = 4235093010715735727L;
|
||||||
@@ -1781,7 +1770,7 @@ public final class GameActionUtil {
|
|||||||
|
|
||||||
}; // Liu_Bei
|
}; // Liu_Bei
|
||||||
|
|
||||||
/** Constant <code>Sound_the_Call_Wolf</code>. */
|
/** Constant <code>soundTheCallWolf</code>. */
|
||||||
private static Command soundTheCallWolf = new Command() {
|
private static Command soundTheCallWolf = new Command() {
|
||||||
private static final long serialVersionUID = 4614281706799537283L;
|
private static final long serialVersionUID = 4614281706799537283L;
|
||||||
|
|
||||||
@@ -1810,7 +1799,7 @@ public final class GameActionUtil {
|
|||||||
return list.size();
|
return list.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
}; // Sound_the_Call_Wolf
|
}; // sounTheCallWolf
|
||||||
|
|
||||||
/** Constant <code>Tarmogoyf</code>. */
|
/** Constant <code>Tarmogoyf</code>. */
|
||||||
private static Command tarmogoyf = new Command() {
|
private static Command tarmogoyf = new Command() {
|
||||||
@@ -1948,11 +1937,11 @@ public final class GameActionUtil {
|
|||||||
/**
|
/**
|
||||||
* Sets the commands.
|
* Sets the commands.
|
||||||
*
|
*
|
||||||
* @param commands
|
* @param commands0
|
||||||
* the commands to set
|
* the commands to set
|
||||||
*/
|
*/
|
||||||
public static void setCommands(final HashMap<String, Command> commands) {
|
public static void setCommands(final HashMap<String, Command> commands0) {
|
||||||
GameActionUtil.commands = commands; // TODO: Add 0 to parameter's name.
|
GameActionUtil.commands = commands0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user