From 4fd455533361ce76be4f4ff38efb51ac4f83bfff Mon Sep 17 00:00:00 2001 From: jendave Date: Sat, 6 Aug 2011 05:19:57 +0000 Subject: [PATCH] Added my Megrim deck called Saruman 3 --- .gitattributes | 3 +- res/quest/decks/Saruman 3.dck | 26 + res/quest/hard.txt | 1 + src/forge/Gui_Quest.java | 1578 +++++++++++++++++---------------- 4 files changed, 819 insertions(+), 789 deletions(-) create mode 100644 res/quest/decks/Saruman 3.dck diff --git a/.gitattributes b/.gitattributes index 2628a76ebf6..b8b9633fd1b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -253,6 +253,7 @@ res/quest/decks/Rocky[!!-~]2.dck -text res/quest/decks/Rocky[!!-~]3.dck -text res/quest/decks/Rogue[!!-~]3.dck -text res/quest/decks/Samantha[!!-~]Stephens[!!-~]3.dck -text +res/quest/decks/Saruman[!!-~]3.dck -text res/quest/decks/Scooby[!!-~]Doo[!!-~]3.dck -text res/quest/decks/Scotty[!!-~]2.dck -text res/quest/decks/Seabiscuit[!!-~]1.dck -text @@ -433,7 +434,7 @@ src/forge/Gui_MultipleBlockers.java svneol=native#text/plain src/forge/Gui_NewGame.java svneol=native#text/plain src/forge/Gui_PetShop.java -text svneol=native#text/plain src/forge/Gui_PlantShop.java -text svneol=native#text/plain -src/forge/Gui_Quest.java svneol=native#text/plain +src/forge/Gui_Quest.java -text svneol=native#text/plain src/forge/Gui_QuestOptions.java svneol=native#text/plain src/forge/Gui_Quest_Assignments.java -text svneol=native#text/plain src/forge/Gui_Quest_DeckEditor.java -text svneol=native#text/plain diff --git a/res/quest/decks/Saruman 3.dck b/res/quest/decks/Saruman 3.dck new file mode 100644 index 00000000000..27b8867ca7f --- /dev/null +++ b/res/quest/decks/Saruman 3.dck @@ -0,0 +1,26 @@ +Saruman 3 +[general] +constructed +[main] +4 Underground Sea +4 Badlands +4 Volcanic Island +4 Crumbling Necropolis +2 Swamp +1 Mox Jet +1 Mox Ruby +1 Mox Sapphire +4 Megrim +4 Liliana's Caress +4 Burning Inquiry +1 Wheel of Fortune +4 Wheel and Deal +1 Windfall +4 Blightning +4 Hymn to Tourach +4 Stupor +4 Sinkhole +3 Rain of Tears +1 Ancestral Recall +1 Damnation +[sideboard] diff --git a/res/quest/hard.txt b/res/quest/hard.txt index 7bffff448ba..3be08f12094 100644 --- a/res/quest/hard.txt +++ b/res/quest/hard.txt @@ -66,6 +66,7 @@ Rocky 3 Rogue 3 Samantha Stephens 3 Scooby Doo 3 +Saruman 3 Seabiscuit 3 Secret Squirrel 3 Sherlock Holmes 3 diff --git a/src/forge/Gui_Quest.java b/src/forge/Gui_Quest.java index 2e36787741d..99f83772d4d 100644 --- a/src/forge/Gui_Quest.java +++ b/src/forge/Gui_Quest.java @@ -1,788 +1,790 @@ -package forge; -import java.awt.Color; -import java.awt.Dimension; -import java.awt.Rectangle; -import java.awt.event.ActionEvent; -import java.awt.event.WindowAdapter; -import java.awt.event.WindowEvent; -import java.io.File; -import java.util.ArrayList; -import java.util.Collections; - -import javax.swing.BorderFactory; -import javax.swing.ButtonGroup; -import javax.swing.ImageIcon; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JComboBox; -import javax.swing.JFrame; -import javax.swing.JLabel; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.JRadioButton; -import javax.swing.JScrollPane; -import javax.swing.JTextArea; -import javax.swing.SwingConstants; -import javax.swing.border.Border; -import javax.swing.border.TitledBorder; - -import forge.error.ErrorViewer; -import forge.properties.ForgeProps; -import forge.properties.NewConstants; - - -//presumes AllZone.QuestData is not null -//AllZone.QuestData should be set by Gui_QuestOptions -public class Gui_Quest extends JFrame implements NewConstants{ - private static final long serialVersionUID = -6432089669283627896L; - - private QuestData questData; - - private JLabel jLabel1 = new JLabel(); - private JLabel difficultyLabel = new JLabel(); - private JLabel winLostLabel = new JLabel(); - private JLabel rankLabel = new JLabel(); - private JLabel creditsLabel = new JLabel(); - private JLabel lifeLabel = new JLabel(); - @SuppressWarnings("unused") - // border1 - private Border border1; - private TitledBorder titledBorder1; - private TitledBorder titledBorder2; - private JButton infoButton = new JButton(); - private JButton otherShopsButton = new JButton(); - private JButton cardShopButton = new JButton(); - private JButton deckEditorButton = new JButton(); - private JPanel jPanel2 = new JPanel(); - private JPanel jPanel3 = new JPanel(); - private JButton playGameButton = new JButton(); - private JButton questsButton = new JButton(); - - private JRadioButton oppTwoRadio = new JRadioButton(); - private JRadioButton oppOneRadio = new JRadioButton(); - private JRadioButton oppThreeRadio = new JRadioButton(); - private JLabel jLabel5 = new JLabel(); - private JComboBox deckComboBox = new JComboBox(); - private JComboBox petComboBox = new JComboBox(); - private ButtonGroup oppGroup = new ButtonGroup(); - private static JCheckBox smoothLandCheckBox = new JCheckBox("", false); - private static JCheckBox resizeCheckbox = new JCheckBox("", true); - private static JCheckBox millLoseCheckBox = new JCheckBox("", true); - - public static void main(String[] args) { - new Gui_Quest(); - } - - public Gui_Quest() { - questData = AllZone.QuestData; - - try { - jbInit(); - } catch(Exception ex) { - ErrorViewer.showError(ex); - } - setup(); - - setVisible(true); - } - - private void setup() { - //center window on the screen - Dimension screen = this.getToolkit().getScreenSize(); - setBounds(screen.width / 4, 50, //position - 500, 615); //size - - //if user closes this window, go back to "Quest Options" screen - this.addWindowListener(new WindowAdapter() { - @Override - public void windowClosing(WindowEvent ev) { - Gui_Quest.this.dispose(); - new Gui_QuestOptions(); - } - }); - - //set labels - difficultyLabel.setText(questData.getDifficulty() + " - " + questData.getMode()); - rankLabel.setText(questData.getRank()); - creditsLabel.setText("Credits: " + questData.getCredits()); - - if (questData.getMode().equals("Fantasy")) - { - int life = questData.getLife(); - if (life<15) - questData.setLife(15); - lifeLabel.setText("Max Life: "+questData.getLife()); - } - - String s = questData.getWin() + " wins / " + questData.getLost() + " losses"; - winLostLabel.setText(s); - - String[] op = questData.getOpponents(); - oppOneRadio.setText(op[0]); - oppTwoRadio.setText(op[1]); - oppThreeRadio.setText(op[2]); - - - //get deck names as Strings - ArrayList list = questData.getDeckNames(); - Collections.sort(list); - for(int i = 0; i < list.size(); i++) - deckComboBox.addItem(list.get(i)); - - if(Constant.Runtime.HumanDeck[0] != null) deckComboBox.setSelectedItem(Constant.Runtime.HumanDeck[0].getName()); - - if ("Fantasy".equals(questData.getMode())) - { - - } - - - }//setup() - - private void jbInit() throws Exception { - border1 = BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)); - titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), - "Choices"); - titledBorder2 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), - "Settings"); - jLabel1.setFont(new java.awt.Font("Dialog", 0, 25)); - jLabel1.setHorizontalAlignment(SwingConstants.CENTER); - jLabel1.setText("Quest Mode"); - jLabel1.setBounds(new Rectangle(1, 7, 499, 45)); - this.setResizable(false); - this.setTitle("Quest Mode"); - this.getContentPane().setLayout(null); - difficultyLabel.setText("Medium"); - difficultyLabel.setBounds(new Rectangle(1, 52, 499, 41)); - difficultyLabel.setFont(new java.awt.Font("Dialog", 0, 25)); - difficultyLabel.setHorizontalAlignment(SwingConstants.CENTER); - winLostLabel.setText("23 wins / 10 losses"); - winLostLabel.setBounds(new Rectangle(1, 130, 499, 43)); - winLostLabel.setFont(new java.awt.Font("Dialog", 0, 25)); - winLostLabel.setHorizontalAlignment(SwingConstants.CENTER); - winLostLabel.setHorizontalTextPosition(SwingConstants.CENTER); - rankLabel.setText("Card Flopper"); - rankLabel.setBounds(new Rectangle(1, 93, 499, 37)); - rankLabel.setFont(new java.awt.Font("Dialog", 0, 25)); - rankLabel.setHorizontalAlignment(SwingConstants.CENTER); - creditsLabel.setBounds(new Rectangle(1, 175, 499, 15)); - //creditsLabel.setText("Credits: 1000"); - creditsLabel.setHorizontalAlignment(SwingConstants.CENTER); - creditsLabel.setHorizontalTextPosition(SwingConstants.CENTER); - - - infoButton.setBounds(new Rectangle(338, 235, 142, 28)); - infoButton.setFont(new java.awt.Font("Dialog", 0, 13)); - infoButton.setText("Opponent Notes"); - infoButton.addActionListener(new java.awt.event.ActionListener() { - public void actionPerformed(ActionEvent e) { - infoButton_actionPerformed(e); - } - }); - - //if (questData.getMode().equals("Fantasy")) - if ("Fantasy".equals(questData.getMode())) - { - //petComboBox.removeAll(); - ArrayList petList = QuestUtil.getPetNames(questData); - for (int i=0;i list = questData.getDeckNames(); + Collections.sort(list); + for(int i = 0; i < list.size(); i++) + deckComboBox.addItem(list.get(i)); + + if(Constant.Runtime.HumanDeck[0] != null) deckComboBox.setSelectedItem(Constant.Runtime.HumanDeck[0].getName()); + + if ("Fantasy".equals(questData.getMode())) + { + + } + + + }//setup() + + private void jbInit() throws Exception { + border1 = BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)); + titledBorder1 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), + "Choices"); + titledBorder2 = new TitledBorder(BorderFactory.createEtchedBorder(Color.white, new Color(148, 145, 140)), + "Settings"); + jLabel1.setFont(new java.awt.Font("Dialog", 0, 25)); + jLabel1.setHorizontalAlignment(SwingConstants.CENTER); + jLabel1.setText("Quest Mode"); + jLabel1.setBounds(new Rectangle(1, 7, 499, 45)); + this.setResizable(false); + this.setTitle("Quest Mode"); + this.getContentPane().setLayout(null); + difficultyLabel.setText("Medium"); + difficultyLabel.setBounds(new Rectangle(1, 52, 499, 41)); + difficultyLabel.setFont(new java.awt.Font("Dialog", 0, 25)); + difficultyLabel.setHorizontalAlignment(SwingConstants.CENTER); + winLostLabel.setText("23 wins / 10 losses"); + winLostLabel.setBounds(new Rectangle(1, 130, 499, 43)); + winLostLabel.setFont(new java.awt.Font("Dialog", 0, 25)); + winLostLabel.setHorizontalAlignment(SwingConstants.CENTER); + winLostLabel.setHorizontalTextPosition(SwingConstants.CENTER); + rankLabel.setText("Card Flopper"); + rankLabel.setBounds(new Rectangle(1, 93, 499, 37)); + rankLabel.setFont(new java.awt.Font("Dialog", 0, 25)); + rankLabel.setHorizontalAlignment(SwingConstants.CENTER); + creditsLabel.setBounds(new Rectangle(1, 175, 499, 15)); + //creditsLabel.setText("Credits: 1000"); + creditsLabel.setHorizontalAlignment(SwingConstants.CENTER); + creditsLabel.setHorizontalTextPosition(SwingConstants.CENTER); + + + infoButton.setBounds(new Rectangle(338, 235, 142, 28)); + infoButton.setFont(new java.awt.Font("Dialog", 0, 13)); + infoButton.setText("Opponent Notes"); + infoButton.addActionListener(new java.awt.event.ActionListener() { + public void actionPerformed(ActionEvent e) { + infoButton_actionPerformed(e); + } + }); + + //if (questData.getMode().equals("Fantasy")) + if ("Fantasy".equals(questData.getMode())) + { + //petComboBox.removeAll(); + ArrayList petList = QuestUtil.getPetNames(questData); + for (int i=0;i