- Added an addStackingExtrinsicKeyword method to Card.java.

- Added another phase after the declare attackers phase during the human player's turn as well (can cast instants/abilities). The main reason for this change is that before this, the computer would decide on its blockers while triggered abilities of attackers hadn't happened yet.
- AI should target the human player's creatures now with Seal of Removal.  
- Deleted GUI_PictureHQ.java for now, since it causes compile errors.
This commit is contained in:
jendave
2011-08-06 03:25:34 +00:00
parent c4e118f5f2
commit e8c4fecd6f
7 changed files with 16 additions and 91 deletions

1
.gitattributes vendored
View File

@@ -140,7 +140,6 @@ src/forge/FileUtil.java -text svneol=native#text/plain
src/forge/GUI_DeckAnalysis.java -text svneol=native#text/plain
src/forge/GUI_Filter.java -text svneol=native#text/plain
src/forge/GUI_ImportPicture.java -text svneol=native#text/plain
src/forge/GUI_PictureHQ.java -text svneol=native#text/plain
src/forge/GUI_Quest_Filter.java -text svneol=native#text/plain
src/forge/GameAction.java svneol=native#text/plain
src/forge/GameActionUtil.java svneol=native#text/plain

View File

@@ -1301,6 +1301,14 @@ public class Card extends MyObservable {
//}
}
public void addStackingExtrinsicKeyword(String s) {
if (s.startsWith("tap: add")) manaAbility.add(new Ability_Mana(this, s)
{
private static final long serialVersionUID = 2443750124751086033L;
});
else extrinsicKeyword.add(s);
}
public void removeExtrinsicKeyword(String s) {
extrinsicKeyword.remove(s);
this.updateObservers();

View File

@@ -14288,7 +14288,6 @@ public class CardFactory implements NewConstants {
}//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Primal Boost"))
{
@@ -15699,13 +15698,13 @@ return land.size() > 1 && CardFactoryUtil.AI_isMainPhase();
}//chooseTargetAI()
CardList getCreature()
{
CardList list = new CardList(AllZone.Computer_Play.getCards());
CardList list = new CardList(AllZone.Human_Play.getCards());
list = list.filter(new CardListFilter()
{
public boolean addCard(Card c)
{
return c.isCreature() && (c.getNetAttack() >= 3|| c.getKeyword().contains("Flying") ||
c.isEnchanted());
c.isEnchanted()) && CardFactoryUtil.canTarget(card, c);
}
});
return list;

View File

@@ -736,7 +736,7 @@ public class CombatUtil
final boolean[] canAttack = new boolean[1];
canAttack[0] = false;
//if (AllZone.Phase.getPhase().equals(Constant.Phase.Combat_Declare_Attackers))
if (AllZone.Phase.getPhase().equals("Declare Blockers") ||
if ( /*AllZone.Phase.getPhase().equals("Declare Blockers") || */
AllZone.Phase.getPhase().equals(Constant.Phase.Combat_Declare_Attackers_InstantAbility))
{
//if (!c.getCreatureAttackedThisTurn())
@@ -794,7 +794,7 @@ public class CombatUtil
public static void checkDeclareAttackers(Card c) //this method checks triggered effects of attacking creatures, right before defending player declares blockers
{
//human does not have an "attackers_instantAbility" phase during his turn (yet), so triggers will happen at the beginning of declare blockers
if (AllZone.Phase.getPhase().equals("Declare Blockers") ||
if ( /*AllZone.Phase.getPhase().equals("Declare Blockers") ||*/
AllZone.Phase.getPhase().equals(Constant.Phase.Combat_Declare_Attackers_InstantAbility))
{

View File

@@ -1,84 +0,0 @@
package forge;
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.io.*;
/**
* This code was edited or generated using CloudGarden's Jigloo SWT/Swing GUI
* Builder, which is free for non-commercial use. If Jigloo is being used
* commercially (ie, by a corporation, company or business for any purpose
* whatever) then you should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details. Use of Jigloo implies
* acceptance of these licensing terms. A COMMERCIAL LICENSE HAS NOT BEEN
* PURCHASED FOR THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED LEGALLY FOR
* ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class GUI_PictureHQ extends JDialog {
private static final long serialVersionUID = 7046993858415055058L;
public JPanel jPanelPictureHQ;
public PicturePanel jPictureContainer;
public GUI_PictureHQ(JFrame frame, Card c) {
super(frame);
this.setUndecorated(true);
setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
jPanelPictureHQ = new JPanel();
BorderLayout jPanelPictureHQLayout = new BorderLayout();
jPanelPictureHQ.setLayout(jPanelPictureHQLayout);
getContentPane().add(jPanelPictureHQ, BorderLayout.CENTER);
jPanelPictureHQ.setBorder(BorderFactory.createEtchedBorder());
//jPanelPictureHQ.removeAll();
jPictureContainer = GuiDisplayUtil.getPictureHQ(c);
jPanelPictureHQ.add(jPictureContainer);
//jPanelPictureHQ.revalidate();
jPanelPictureHQ.addMouseListener(new CustomListener());
pack();
}
public void letsGo(JFrame frame, Card c) throws IOException {
// nantuko: we don't need this. why not just use {this} instance?
// GUI_PictureHQ trayWindow = new GUI_PictureHQ(frame, c);
int heightHQ = GuiDisplayUtil.getPictureHQheight(c);
int widthHQ = GuiDisplayUtil.getPictureHQwidth(c);
setBounds(frame.getBounds().x + frame.getBounds().width - widthHQ - 17, frame.getBounds().y + frame.getBounds().height - heightHQ - 17,
widthHQ, heightHQ);
// nantuko: now we will update the card image only as its container is singleton now
jPictureContainer.updateCardImage(GuiDisplayUtil.getPictureHQFile(c));
pack();
setVisible(true);
}
public class CustomListener implements MouseListener {
public void mouseClicked(MouseEvent e) {
}
public void mouseEntered(MouseEvent e) {
}
public void mouseExited(MouseEvent e) {
//dispose();
setVisible(false);
}
public void mousePressed(MouseEvent e) {
}
public void mouseReleased(MouseEvent e) {
}
}
}

View File

@@ -313,6 +313,7 @@ import java.util.*;
{
return new Computer_Cleanup();
}
/*
else if (phase.equals(Constant.Phase.Combat_Declare_Blockers))
{
CardList list = new CardList();
@@ -346,6 +347,7 @@ import java.util.*;
return AllZone.Computer;
}
else
*/
return AllZone.Computer;
}//Computer

View File

@@ -17,6 +17,7 @@ public class Phase extends MyObservable
{Constant.Player.Human , Constant.Phase.Draw} ,
{Constant.Player.Human , Constant.Phase.Main1} ,
{Constant.Player.Human , Constant.Phase.Combat_Declare_Attackers} ,
{Constant.Player.Human , Constant.Phase.Combat_Declare_Attackers_InstantAbility},
{Constant.Player.Computer , Constant.Phase.Combat_Declare_Blockers} ,
{Constant.Player.Human , Constant.Phase.Combat_Declare_Blockers_InstantAbility} ,
{Constant.Player.Computer , Constant.Phase.Combat_Declare_Blockers_InstantAbility} ,