mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
- Found and fixed a bug in the GameActionUtil.playCard_Enchantress_Draw() code. Added a JOptionPane.showConfirmDialog() to Verduran Enchantress and Mesa Enchantress, you are now asked if you want to draw a card for these two only. Argothian Enchantress and Enchantress's Presence forces you to draw a card. Added some AI to the computer's choice.
This commit is contained in:
@@ -1,12 +0,0 @@
|
|||||||
#Forge
|
|
||||||
#Mon Aug 23 19:15:41 CEST 2010
|
|
||||||
gui.laf=com.sun.java.swing.plaf.windows.WindowsLookAndFeel
|
|
||||||
AI.stack.land=false
|
|
||||||
gui.new=true
|
|
||||||
stack.offset=tiny
|
|
||||||
card.images.size=medium
|
|
||||||
card.overlay=true
|
|
||||||
card.scale.larger.than.original=true
|
|
||||||
stack.max.size=3
|
|
||||||
gui.laf.fonts=false
|
|
||||||
loss.condition.milling=true
|
|
||||||
|
|||||||
@@ -2560,42 +2560,67 @@ public class GameActionUtil {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void playCard_Enchantress_Draw(Card c) {
|
public static void playCard_Enchantress_Draw(Card c) {
|
||||||
|
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController());
|
PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController());
|
||||||
|
CardList list = new CardList();
|
||||||
|
list.addAll(play.getCards());
|
||||||
|
|
||||||
CardList list = new CardList();
|
list = list.filter(new CardListFilter() {
|
||||||
list.addAll(play.getCards());
|
public boolean addCard(Card crd) {
|
||||||
|
if (crd.getName().equals("Verduran Enchantress") || crd.getName().equals("Enchantress's Presence")
|
||||||
|
|| crd.getName().equals("Mesa Enchantress") || crd.getName().equals("Argothian Enchantress")) return true;
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
list = list.filter(new CardListFilter() {
|
if (c.isEnchantment()) {
|
||||||
public boolean addCard(Card crd) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
if(crd.getName().equals("Verduran Enchantress") || crd.getName().equals("Enchantress's Presence")
|
final Card card = list.get(i); //was "list.get(0);"
|
||||||
|| crd.getName().equals("Mesa Enchantress")
|
|
||||||
|| crd.getName().equals("Argothian Enchantress")) return true;
|
|
||||||
else return false;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//list = list.getName("Verduran Enchantress");
|
|
||||||
|
|
||||||
if(c.isEnchantment()) {
|
Ability ability2 = new Ability(card, "0") {
|
||||||
for(int i = 0; i < list.size(); i++) {
|
@Override
|
||||||
final Card card = list.get(0);
|
public void resolve() {
|
||||||
|
Boolean mayDrawNotMust = (card.getName().equals("Verduran Enchantress") || card.getName().equals("Mesa Enchantress"));
|
||||||
Ability ability2 = new Ability(card, "0") {
|
int choice = 0;
|
||||||
@Override
|
|
||||||
public void resolve() {
|
if (card.getController().equals("Human")) {
|
||||||
// draws a card
|
if (mayDrawNotMust) {
|
||||||
AllZone.GameAction.drawCard(card.getController());
|
StringBuffer title = new StringBuffer();
|
||||||
}
|
title.append(card.getName()).append(" Ability");
|
||||||
}; // ability2
|
StringBuffer message = new StringBuffer();
|
||||||
|
message.append("Will you draw a card?");
|
||||||
ability2.setStackDescription(card.getName() + " - " + c.getController()
|
choice = JOptionPane.showConfirmDialog(null, message.toString(), title.toString(), JOptionPane.YES_NO_OPTION);
|
||||||
+ " plays an enchantment spell and draws a card");
|
}// May Draw a card
|
||||||
AllZone.Stack.add(ability2);
|
|
||||||
|
if ((mayDrawNotMust && choice == JOptionPane.YES_OPTION) || !mayDrawNotMust) {
|
||||||
} // for
|
AllZone.GameAction.drawCard(card.getController());
|
||||||
}// if isEnchantment()
|
}
|
||||||
}
|
}// Human
|
||||||
|
|
||||||
|
if (card.getController().equals("Computer")) {
|
||||||
|
int compLibSize = AllZone.getZone(Constant.Zone.Library, Constant.Player.Computer).size();
|
||||||
|
int compHandSize = AllZone.getZone(Constant.Zone.Hand, Constant.Player.Computer).size();
|
||||||
|
if ((!mayDrawNotMust) || (mayDrawNotMust && compLibSize >= 5 && compHandSize <= 7)) {
|
||||||
|
AllZone.GameAction.drawCard(card.getController());
|
||||||
|
}
|
||||||
|
}// Computer
|
||||||
|
}// resolve()
|
||||||
|
};// ability2
|
||||||
|
|
||||||
|
StringBuffer sb = new StringBuffer();
|
||||||
|
sb.append(card.getName()).append(" - ").append(c.getController()).append(" plays an enchantment spell and ");
|
||||||
|
if (card.getName().equals("Verduran Enchantress") || card.getName().equals("Mesa Enchantress")) {
|
||||||
|
sb.append("may draw a card.");
|
||||||
|
} else {
|
||||||
|
sb.append("draws a card.");
|
||||||
|
}
|
||||||
|
|
||||||
|
ability2.setStackDescription(sb.toString());
|
||||||
|
AllZone.Stack.add(ability2);
|
||||||
|
}// for
|
||||||
|
}// if isEnchantment()
|
||||||
|
}// playCard_Enchantress_Draw()
|
||||||
|
|
||||||
public static void playCard_Gilt_Leaf_Archdruid(Card c) {
|
public static void playCard_Gilt_Leaf_Archdruid(Card c) {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user