diff --git a/.gitattributes b/.gitattributes
index d22f8cbdd01..2b79d5ee00b 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -9872,12 +9872,12 @@ src/main/java/forge/quest/gui/bazaar/QuestBazaarItem.java svneol=native#text/pla
src/main/java/forge/quest/gui/bazaar/QuestBazaarPanel.java svneol=native#text/plain
src/main/java/forge/quest/gui/bazaar/QuestBazaarStall.java svneol=native#text/plain
src/main/java/forge/quest/gui/bazaar/package-info.java svneol=native#text/plain
+src/main/java/forge/quest/gui/main/QuestChallenge.java svneol=native#text/plain
+src/main/java/forge/quest/gui/main/QuestChallengePanel.java -text
src/main/java/forge/quest/gui/main/QuestDuel.java svneol=native#text/plain
src/main/java/forge/quest/gui/main/QuestDuelPanel.java -text
src/main/java/forge/quest/gui/main/QuestEvent.java -text
src/main/java/forge/quest/gui/main/QuestEventManager.java svneol=native#text/plain
-src/main/java/forge/quest/gui/main/QuestQuest.java svneol=native#text/plain
-src/main/java/forge/quest/gui/main/QuestQuestPanel.java -text
src/main/java/forge/quest/gui/main/QuestSelectablePanel.java -text
src/main/java/forge/quest/gui/main/package-info.java svneol=native#text/plain
src/main/java/forge/quest/gui/package-info.java svneol=native#text/plain
diff --git a/res/quest/quest.properties b/res/quest/quest.properties
index 72557702c77..f5d302e5400 100644
--- a/res/quest/quest.properties
+++ b/res/quest/quest.properties
@@ -4,12 +4,6 @@ rare--file=rare.txt
price--file=all-prices.txt
boosterprice--file=booster-prices.txt
-quests--file=quests.txt
-
-easy--file=easy.txt
-medium--file=medium.txt
-hard--file=hard.txt
-veryhard--file=veryhard.txt
data-xml--file=questData.dat
data--file=questData
diff --git a/src/main/java/forge/AllZone.java b/src/main/java/forge/AllZone.java
index d74209b8385..08f034a4f43 100644
--- a/src/main/java/forge/AllZone.java
+++ b/src/main/java/forge/AllZone.java
@@ -17,7 +17,7 @@ import forge.properties.ForgeProps;
import forge.properties.NewConstants;
import forge.quest.data.QuestMatchState;
import forge.quest.data.QuestData;
-import forge.quest.gui.main.QuestQuest;
+import forge.quest.gui.main.QuestChallenge;
/**
* Please use public getters and setters instead of direct field access.
@@ -42,8 +42,8 @@ public final class AllZone implements NewConstants {
/** Global questData. */
private static forge.quest.data.QuestData questData = null;
- /** Global QuestAssignment. */
- private static QuestQuest questquest = null;
+ /** Global QuestChallenge. */
+ private static QuestChallenge questChallenge = null;
/** Constant NAME_CHANGER. */
private static final NameChanger NAME_CHANGER = new NameChanger();
@@ -62,7 +62,7 @@ public final class AllZone implements NewConstants {
private static GameSummary gameInfo = new GameSummary();
/**
- * Match State for quests are stored in a QuestMatchState class instance.
+ * Match State for challenges are stored in a QuestMatchState class instance.
*
* @deprecated Variable 'matchState' must be private and have accessor methods.
*/
@@ -132,23 +132,22 @@ public final class AllZone implements NewConstants {
}
/**
- *
getQuestAssignment.
+ *getQuestChallenge.
* * @return a {@link forge.Quest_Assignment} object. * @since 1.0.15 */ - public static QuestQuest getQuestQuest() { - return questquest; + public static QuestChallenge getQuestChallenge() { + return questChallenge; } /** - *setQuestAssignment.
+ *setQuestChallenge.
* - * @param assignment a {@link forge.Quest_Assignment} object. - * @since 1.0.15 + * @param q */ - public static void setQuestQuest(final QuestQuest q) { - questquest = q; + public static void setQuestChallenge(final QuestChallenge q) { + questChallenge = q; } /** diff --git a/src/main/java/forge/GameAction.java b/src/main/java/forge/GameAction.java index f7b5c84d87e..9fb8e3eb444 100644 --- a/src/main/java/forge/GameAction.java +++ b/src/main/java/forge/GameAction.java @@ -29,7 +29,7 @@ import forge.gui.input.Input_PayManaCost_Ability; import forge.item.CardPrinted; import forge.properties.ForgeProps; import forge.properties.NewConstants.LANG.GameAction.GAMEACTION_TEXT; -import forge.quest.gui.main.QuestQuest; +import forge.quest.gui.main.QuestChallenge; import java.util.ArrayList; import java.util.Comparator; @@ -654,7 +654,7 @@ public class GameAction { AllZone.getDisplay().savePrefs(); frame.setEnabled(false); //frame.dispose(); - Gui_WinLose gwl = new Gui_WinLose(AllZone.getMatchState(), AllZone.getQuestData(), AllZone.getQuestQuest()); + Gui_WinLose gwl = new Gui_WinLose(AllZone.getMatchState(), AllZone.getQuestData(), AllZone.getQuestChallenge()); //gwl.setAlwaysOnTop(true); gwl.toFront(); canShowWinLose = false; @@ -1090,15 +1090,15 @@ public class GameAction { * @param computer a {@link forge.CardList} object. */ public final void newGame(final Deck humanDeck, final Deck computerDeck, final CardList human, - final CardList computer, final int humanLife, final int computerLife, final QuestQuest qq) + final CardList computer, final int humanLife, final int computerLife, final QuestChallenge qc) { this.newGame(humanDeck, computerDeck); AllZone.getComputerPlayer().setLife(computerLife, null); AllZone.getHumanPlayer().setLife(humanLife, null); - if (qq != null) { - computer.addAll(forge.quest.data.QuestUtil.getComputerStartingCards(AllZone.getQuestData(), AllZone.getQuestQuest())); + if (qc != null) { + computer.addAll(forge.quest.data.QuestUtil.getComputerStartingCards(AllZone.getQuestData(), AllZone.getQuestChallenge())); } for (Card c : human) { diff --git a/src/main/java/forge/Gui_WinLose.java b/src/main/java/forge/Gui_WinLose.java index 43b48e13f1f..4fddbe16446 100644 --- a/src/main/java/forge/Gui_WinLose.java +++ b/src/main/java/forge/Gui_WinLose.java @@ -17,7 +17,7 @@ import forge.quest.data.QuestData; import forge.quest.data.QuestMatchState; import forge.quest.data.QuestPreferences; import forge.quest.gui.QuestFrame; -import forge.quest.gui.main.QuestQuest; +import forge.quest.gui.main.QuestChallenge; import forge.view.swing.OldGuiNewGame; import net.miginfocom.swing.MigLayout; @@ -66,7 +66,7 @@ public class Gui_WinLose extends JFrame implements NewConstants { private class WinLoseModel { public QuestMatchState match; public QuestData quest; - public QuestQuest qq; + public QuestChallenge qc; } private WinLoseModel model; @@ -76,13 +76,13 @@ public class Gui_WinLose extends JFrame implements NewConstants { * * @param matchState a QuestMatchState * @param quest a QuestData object - * @param qa a Quest_Assignment object + * @param chall a QuestChallenge object */ - public Gui_WinLose(final QuestMatchState matchState, final QuestData quest, final QuestQuest qq) { + public Gui_WinLose(final QuestMatchState matchState, final QuestData quest, final QuestChallenge chall) { model = new WinLoseModel(); model.match = matchState; model.quest = quest; - model.qq = qq; + model.qc = chall; try { jbInit(); @@ -187,25 +187,25 @@ public class Gui_WinLose extends JFrame implements NewConstants { void prepareForNextRound() { if (Constant.Quest.fantasyQuest[0]) { int extraLife = 0; - if (model.qq != null) { + if (model.qc != null) { if (model.quest.getInventory().hasItem("Zeppelin")) { extraLife = 3; } } //AllZone.getGameAction().newGame(Constant.Runtime.HumanDeck[0], Constant.Runtime.ComputerDeck[0], //humanList, computerList, humanLife, computerLife); - CardList humanList = forge.quest.data.QuestUtil.getHumanStartingCards(model.quest, model.qq); + CardList humanList = forge.quest.data.QuestUtil.getHumanStartingCards(model.quest, model.qc); CardList computerList = new CardList(); int humanLife = model.quest.getLife() + extraLife; int computerLife = 20; - if (model.qq != null) { - computerLife = model.qq.getAILife(); + if (model.qc != null) { + computerLife = model.qc.getAILife(); } AllZone.getGameAction().newGame(Constant.Runtime.HumanDeck[0], Constant.Runtime.ComputerDeck[0], - humanList, computerList, humanLife, computerLife, model.qq); + humanList, computerList, humanLife, computerLife, model.qc); } else { AllZone.getGameAction().newGame(Constant.Runtime.HumanDeck[0], Constant.Runtime.ComputerDeck[0]); } @@ -355,15 +355,15 @@ public class Gui_WinLose extends JFrame implements NewConstants { model.quest.getCards().clearShopList(); - if (model.quest.getAvailableQuests() != null) { - model.quest.clearAvailableQuests(); + if (model.quest.getAvailableChallenges() != null) { + model.quest.clearAvailableChallenges(); } model.quest.getCards().resetNewList(); giveQuestRewards(wonMatch); model.match.reset(); - AllZone.setQuestQuest(null); + AllZone.setQuestChallenge(null); model.quest.saveData(); @@ -441,32 +441,32 @@ public class Gui_WinLose extends JFrame implements NewConstants { } // Rewards from QuestAssignment - if (wonMatch && model.qq != null) { - model.quest.addQuestsPlayed(); + if (wonMatch && model.qc != null) { + model.quest.addChallengesPlayed(); - ListQuestData class.
* @@ -72,10 +68,10 @@ public final class QuestData { ItemPoolNO_DECKS_AVAILABLE="No decks available" */
private static final String NO_DECKS_AVAILABLE = "No decks available";
- /** Constant BATTLES="Battles" */
- private static final String BATTLES = "Battles";
- /** Constant QUESTS="Quests" */
- private static final String QUESTS = "Quests";
+ /** Constant DUELS="Duels" */
+ private static final String DUELS = "Duels";
+ /** Constant CHALLENGES="Challenges" */
+ private static final String CHALLENGES = "Challenges";
//TODO: Make this ordering permanent
/** Constant lastUsedDeck="//TODO: Make this ordering permanent" */
@@ -198,14 +198,14 @@ public class QuestMainPanel extends QuestAbstractPanel {
}
- questButton.addActionListener(new ActionListener() {
+ eventButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent actionEvent) {
- QuestMainPanel.this.showQuests();
+ QuestMainPanel.this.showChallenges();
}
});
- eastComponents.add(questButton);
- questButton.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 18));
- questButton.setPreferredSize(new Dimension(0, 60));
+ eastComponents.add(eventButton);
+ eventButton.setFont(new Font(Font.SANS_SERIF, Font.BOLD, 18));
+ eventButton.setPreferredSize(new Dimension(0, 60));
playButton.addActionListener(new ActionListener() {
@@ -249,7 +249,7 @@ public class QuestMainPanel extends QuestAbstractPanel {
panel.add(Box.createVerticalGlue());
- panel.add(questButton);
+ panel.add(eventButton);
this.nextQuestLabel.setFont(new Font(Font.DIALOG, Font.PLAIN, 11));
panel.add(nextQuestLabel);
GuiUtils.addGap(panel);
@@ -398,7 +398,7 @@ public class QuestMainPanel extends QuestAbstractPanel {
JPanel DuelPanel = new JPanel();
QuestDuelPanel duelEvent;
DuelPanel.setLayout(new BoxLayout(DuelPanel, BoxLayout.Y_AXIS));
- DuelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Available Battles"));
+ DuelPanel.setBorder(new TitledBorder(new EtchedBorder(), "Available Duels"));
ListcreateQuestPanel.
- * Makes a parent panel, then selectable panel instances for all available battles. + *createChallengePanel.
+ * Makes a parent panel, then selectable panel instances for all available challenges. * * @return a {@link javax.swing.JPanel} object. */ - private JPanel createQuestPanel() { - JPanel QuestPanel = new JPanel(); + private JPanel createChallengePanel() { + JPanel ChallengePanel = new JPanel(); QuestSelectablePanel selpan; - QuestPanel.setLayout(new BoxLayout(QuestPanel, BoxLayout.Y_AXIS)); - QuestPanel.setBorder(new TitledBorder(new EtchedBorder(), "Available Quests")); + ChallengePanel.setLayout(new BoxLayout(ChallengePanel, BoxLayout.Y_AXIS)); + ChallengePanel.setBorder(new TitledBorder(new EtchedBorder(), "Available Challenges")); - ListnextQuestInWins.
+ *nextChallengeInWins.
* * @return a int. */ - private int nextQuestInWins() { + private int nextChallengeInWins() { // Number of wins was 25, lowereing the number to 20 to help short term questers. if (questData.getWin() < 20) { @@ -576,7 +576,7 @@ public class QuestMainPanel extends QuestAbstractPanel { } // The int mul has been lowered by one, should face special opps more frequently. - int questsPlayed = questData.getQuestsPlayed(); + int challengesPlayed = questData.getChallengesPlayed(); int mul = 5; if (questData.getInventory().hasItem("Zeppelin")) { @@ -585,7 +585,7 @@ public class QuestMainPanel extends QuestAbstractPanel { mul = 4; } - int delta = (questsPlayed * mul) - questData.getWin(); + int delta = (challengesPlayed * mul) - questData.getWin(); return (delta > 0) ? delta : 0; } @@ -679,8 +679,8 @@ public class QuestMainPanel extends QuestAbstractPanel { Constant.Runtime.Smooth[0] = smoothLandCheckBox.isSelected(); AllZone.getMatchState().reset(); - if (isShowingQuests) { - setupQuest(humanDeck); + if (isShowingChallenges) { + setupChallenge(humanDeck); } else { setupDuel(humanDeck); } @@ -706,17 +706,17 @@ public class QuestMainPanel extends QuestAbstractPanel { } /** - *setupQuest.
+ *setupChallenge.
* * @param humanDeck a {@link forge.deck.Deck} object. */ - private void setupQuest(Deck humanDeck) { - QuestQuest selectedQuest = (QuestQuest)selectedOpponent.getEvent(); + private void setupChallenge(Deck humanDeck) { + QuestChallenge selectedChallenge = (QuestChallenge)selectedOpponent.getEvent(); Deck computer = selectedOpponent.getEvent().getEventDeck(); Constant.Runtime.ComputerDeck[0] = computer; - AllZone.setQuestQuest(selectedQuest); + AllZone.setQuestChallenge(selectedChallenge); int extraLife = 0; @@ -725,8 +725,8 @@ public class QuestMainPanel extends QuestAbstractPanel { } AllZone.getGameAction().newGame(humanDeck, computer, - forge.quest.data.QuestUtil.getHumanStartingCards(questData, selectedQuest), new CardList(), - questData.getLife() + extraLife, selectedQuest.getAILife(), selectedQuest); + forge.quest.data.QuestUtil.getHumanStartingCards(questData, selectedChallenge), new CardList(), + questData.getLife() + extraLife, selectedChallenge.getAILife(), selectedChallenge); } @@ -740,15 +740,15 @@ public class QuestMainPanel extends QuestAbstractPanel { } /** - *showQuests.
+ *showChallenges.
*/ - void showQuests() { - if (isShowingQuests) { - isShowingQuests = false; - questButton.setText("Quests"); + void showChallenges() { + if (isShowingChallenges) { + isShowingChallenges = false; + eventButton.setText("Challenges"); } else { - isShowingQuests = true; - questButton.setText("Battles"); + isShowingChallenges = true; + eventButton.setText("Duels"); } if (selectedOpponent != null) { diff --git a/src/main/java/forge/quest/gui/main/QuestQuest.java b/src/main/java/forge/quest/gui/main/QuestChallenge.java similarity index 98% rename from src/main/java/forge/quest/gui/main/QuestQuest.java rename to src/main/java/forge/quest/gui/main/QuestChallenge.java index 6c9ad3458c8..6e53834a589 100644 --- a/src/main/java/forge/quest/gui/main/QuestQuest.java +++ b/src/main/java/forge/quest/gui/main/QuestChallenge.java @@ -13,7 +13,7 @@ import java.util.List; * deck, and quest-specific properties. * */ -public class QuestQuest extends QuestEvent { +public class QuestChallenge extends QuestEvent { // ID (default -1, should be explicitly set at later time.) public int id = -1; diff --git a/src/main/java/forge/quest/gui/main/QuestQuestPanel.java b/src/main/java/forge/quest/gui/main/QuestChallengePanel.java similarity index 56% rename from src/main/java/forge/quest/gui/main/QuestQuestPanel.java rename to src/main/java/forge/quest/gui/main/QuestChallengePanel.java index cc53dc735b0..ce4c7fd48f3 100644 --- a/src/main/java/forge/quest/gui/main/QuestQuestPanel.java +++ b/src/main/java/forge/quest/gui/main/QuestChallengePanel.java @@ -8,25 +8,25 @@ package forge.quest.gui.main; */ @SuppressWarnings("serial") -public class QuestQuestPanel extends QuestSelectablePanel { +public class QuestChallengePanel extends QuestSelectablePanel { //private JLabel repeatabilityLabel; - /**QuestQuestPanel.
- * Constructor, using quest data instance. + /**QuestChallengePanel.
+ * Constructor, using challenge data instance. * - * @param {@link forge.quest.gui.main.QuestDuel} + * @param {@link forge.quest.gui.main.QuestChallenge} */ - public QuestQuestPanel(QuestQuest q) { + public QuestChallengePanel(QuestChallenge q) { super(q); // Repeatability is currently meaningless. // Can be added here later if necessary. /* * if (q.getRepeatable()) { - repeatabilityLabel = new JLabel("This quest is repeatable"); + repeatabilityLabel = new JLabel("This challenge is repeatable"); } else { - repeatabilityLabel = new JLabel("This quest is not repeatable"); + repeatabilityLabel = new JLabel("This challenge is not repeatable"); } super.rootPanel.add(repeatabilityLabel); diff --git a/src/main/java/forge/quest/gui/main/QuestEventManager.java b/src/main/java/forge/quest/gui/main/QuestEventManager.java index 36d7901f612..d1edb13d998 100644 --- a/src/main/java/forge/quest/gui/main/QuestEventManager.java +++ b/src/main/java/forge/quest/gui/main/QuestEventManager.java @@ -28,17 +28,16 @@ public class QuestEventManager { public ListassembleAllEvents.
* - * Reads all quest and battle files to extract quest data. - * Instantiates all duel and quest events, and difficulty lists accordingly. - * Should be used sparingly. + * Reads all duel and challenge files and instantiates all events, + * and difficulty lists accordingly. Should be used sparingly. */ public void assembleAllEvents() { this.allDuels = new ArrayListassembleQuestUniquedata.
- * Handler for any unique data contained in quest files. + *assembleChallengeUniquedata.
+ * Handler for any unique data contained in a challenge file. * * @param contents - * @param qq + * @param qc */ - private void assembleQuestUniquedata(ListgetAllQuests.
- * Returns complete list of all quest objects. + *getAllChallenges.
+ * Returns complete list of all challenge objects. * * @return a {@link java.util.List} object. */ - public ListgetChallengeOpponentByNumber.
+ * Returns specific challenge event using its ID. + * This is to make sure that the opponents do not change + * when the deck editor is launched. + * + * @param n + * @return + */ + private QuestChallenge getChallengeEventByNumber(int n) { + for(QuestChallenge qc : allChallenges) { + if(qc.getId()==n) { + return qc; } } return null; @@ -358,51 +366,51 @@ public class QuestEventManager { } /** - *generateQuests.
- * Generates an array of new quest opponents based on current win conditions. + *generateChallenges.
+ * Generates an array of new challenge opponents based on current win conditions. * * @return a {@link java.util.List} object. */ - public List