mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
- Slight change to Hystrodon. Added AI and a JOptionPane.showConfirmDialog() which will allow both the human and the computer to decide to draw or not to draw a card.
This commit is contained in:
@@ -5469,7 +5469,7 @@ public class GameActionUtil {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void playerCombatDamage_Hystrodon(Card c) {
|
private static void playerCombatDamage_Hystrodon(final Card c) {
|
||||||
final String player = c.getController();
|
final String player = c.getController();
|
||||||
final int power = c.getNetAttack();
|
final int power = c.getNetAttack();
|
||||||
|
|
||||||
@@ -5477,15 +5477,35 @@ public class GameActionUtil {
|
|||||||
Ability ability2 = new Ability(c, "0") {
|
Ability ability2 = new Ability(c, "0") {
|
||||||
@Override
|
@Override
|
||||||
public void resolve() {
|
public void resolve() {
|
||||||
|
if (player.equals("Human")) {
|
||||||
|
StringBuffer title = new StringBuffer();
|
||||||
|
title.append(c.getName()).append(" Ability");
|
||||||
|
StringBuffer message = new StringBuffer();
|
||||||
|
message.append("Will you draw a card?");
|
||||||
|
int choice = JOptionPane.showConfirmDialog(null, message.toString(), title.toString(), JOptionPane.YES_NO_OPTION);
|
||||||
|
|
||||||
|
if (choice == JOptionPane.YES_OPTION) {
|
||||||
AllZone.GameAction.drawCard(player);
|
AllZone.GameAction.drawCard(player);
|
||||||
}
|
}// May Draw a card
|
||||||
|
}// Human
|
||||||
|
|
||||||
|
if (player.equals("Computer")) {
|
||||||
|
int compLibSize = AllZone.getZone(Constant.Zone.Library, player).size();
|
||||||
|
int compHandSize = AllZone.getZone(Constant.Zone.Hand, player).size();
|
||||||
|
|
||||||
|
if (compLibSize >= 5 && compHandSize < 7) {
|
||||||
|
AllZone.GameAction.drawCard(player);
|
||||||
|
}// May Draw a card
|
||||||
|
}// Computer
|
||||||
|
}//resolve()
|
||||||
};// ability2
|
};// ability2
|
||||||
|
|
||||||
ability2.setStackDescription(c.getName() + " - " + player + " draws a card.");
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(c.getName()).append(" - ").append(player).append(" may draw a card.");
|
||||||
|
ability2.setStackDescription(sb.toString());
|
||||||
AllZone.Stack.add(ability2);
|
AllZone.Stack.add(ability2);
|
||||||
}// if
|
}// if
|
||||||
|
}//playerCombatDamage_Hystrodon()
|
||||||
}
|
|
||||||
|
|
||||||
private static void playerCombatDamage_Glint_Eye_Nephilim(Card c) {
|
private static void playerCombatDamage_Glint_Eye_Nephilim(Card c) {
|
||||||
final String player = c.getController();
|
final String player = c.getController();
|
||||||
|
|||||||
Reference in New Issue
Block a user