mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
- Slight change to the code for Kor Firewalker. Now uses JOptionPane.showConfirmDialog(YES_NO_OPTION), this now gives the human a choice to gain or not gain life.
This commit is contained in:
@@ -2880,38 +2880,48 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
public static void playCard_Kor_Firewalker(Card c) {
|
public static void playCard_Kor_Firewalker(Card c) {
|
||||||
|
|
||||||
final PlayerZone play = AllZone.getZone(Constant.Zone.Play,
|
final PlayerZone play = AllZone.getZone(Constant.Zone.Play, Constant.Player.Human);
|
||||||
Constant.Player.Human);
|
final PlayerZone comp = AllZone.getZone(Constant.Zone.Play, Constant.Player.Computer);
|
||||||
final PlayerZone comp = AllZone.getZone(Constant.Zone.Play,
|
|
||||||
Constant.Player.Computer);
|
|
||||||
|
|
||||||
CardList list = new CardList();
|
CardList list = new CardList();
|
||||||
list.addAll(play.getCards());
|
list.addAll(play.getCards());
|
||||||
list.addAll(comp.getCards());
|
list.addAll(comp.getCards());
|
||||||
|
|
||||||
list = list.getName("Kor Firewalker");
|
list = list.getName("Kor Firewalker");
|
||||||
|
|
||||||
if (list.size() > 0) {
|
if (list.size() > 0) {
|
||||||
ArrayList<String> cl=CardUtil.getColors(c);
|
ArrayList<String> cl=CardUtil.getColors(c);
|
||||||
if (cl.contains(Constant.Color.Red))
|
if (cl.contains(Constant.Color.Red)) {
|
||||||
{
|
for (int i=0;i<list.size();i++) {
|
||||||
for (int i=0;i<list.size();i++)
|
|
||||||
{
|
|
||||||
final Card card = list.get(i);
|
final Card card = list.get(i);
|
||||||
Ability ability2 = new Ability(card, "0")
|
|
||||||
{
|
Ability ability2 = new Ability(card, "0") {
|
||||||
public void resolve()
|
public void resolve() {
|
||||||
{
|
if (card.getController().equals("Human")) {
|
||||||
|
StringBuffer title = new StringBuffer();
|
||||||
|
title.append("Kor Firewalker Ability");
|
||||||
|
StringBuffer message = new StringBuffer();
|
||||||
|
message.append("Will you gain 1 life?");
|
||||||
|
int choice = JOptionPane.showConfirmDialog(null, message.toString(), title.toString(), JOptionPane.YES_NO_OPTION);
|
||||||
|
|
||||||
|
if (choice == JOptionPane.YES_OPTION) {
|
||||||
AllZone.GameAction.getPlayerLife(card.getController()).addLife(1);
|
AllZone.GameAction.getPlayerLife(card.getController()).addLife(1);
|
||||||
} //resolve
|
}
|
||||||
}; //ability
|
}// Human
|
||||||
ability2.setStackDescription(card.getName() + " - "
|
|
||||||
+ c.getController() + " played a Red spell," + card.getController()+" gains 1 life.");
|
if (card.getController().equals("Computer")) {
|
||||||
|
AllZone.GameAction.getPlayerLife(card.getController()).addLife(1);
|
||||||
|
}// Computer
|
||||||
|
}// resolve()
|
||||||
|
};//ability2
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(card.getName()).append(" - ").append(c.getController()).append(" played a Red spell, ");
|
||||||
|
sb.append(card.getController()).append(" gains 1 life.");
|
||||||
|
ability2.setStackDescription(sb.toString());
|
||||||
AllZone.Stack.add(ability2);
|
AllZone.Stack.add(ability2);
|
||||||
}
|
}
|
||||||
}//if
|
}//if
|
||||||
}
|
}
|
||||||
|
|
||||||
}//Kor Firewalker
|
}//Kor Firewalker
|
||||||
|
|
||||||
public static void playCard_Curse_of_Wizardry(final Card c) {
|
public static void playCard_Curse_of_Wizardry(final Card c) {
|
||||||
|
|||||||
Reference in New Issue
Block a user