mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Repeatability activated for quest challenge events.
This commit is contained in:
@@ -427,6 +427,11 @@ public class Gui_WinLose extends JFrame implements NewConstants {
|
||||
if (model.quest.getRewards().willGiveBooster(wonMatch)) {
|
||||
giveBooster();
|
||||
}
|
||||
|
||||
// Set repeatability
|
||||
if(!model.qc.getRepeatable()) {
|
||||
model.quest.addCompletedChallenge(model.qc.getId());
|
||||
}
|
||||
|
||||
// Award credits
|
||||
if (wonMatch) {
|
||||
|
||||
@@ -152,7 +152,7 @@ public final class QuestData {
|
||||
life = mode.equals(FANTASY) ? 15 : 20;
|
||||
}
|
||||
|
||||
// All belongins
|
||||
// All belongings
|
||||
public QuestInventory getInventory() { return inventory; }
|
||||
public QuestPetManager getPetManager() { return petManager; }
|
||||
// Cards - class uses data from here
|
||||
@@ -187,10 +187,16 @@ public final class QuestData {
|
||||
public void setAvailableChallenges(final List<Integer> list) { availableChallenges = list; }
|
||||
public void clearAvailableChallenges() { availableChallenges.clear(); }
|
||||
|
||||
|
||||
/**
|
||||
* <p>getCompletedChallenges.</p>
|
||||
* Returns stored list of non-repeatable challenge IDs.
|
||||
*
|
||||
* @return List<Integer>
|
||||
*/
|
||||
public List<Integer> getCompletedChallenges() {
|
||||
// This should be phased out after a while, when
|
||||
// old quest decks have been updated. (changes made 19-9-11)
|
||||
// Also, poorly named - this should be "getLockedChalleneges" or similar.
|
||||
if(completedQuests != null) {
|
||||
completedChallenges = completedQuests;
|
||||
completedQuests = null;
|
||||
@@ -198,6 +204,18 @@ public final class QuestData {
|
||||
|
||||
return completedChallenges != null ? new ArrayList<Integer>(completedChallenges) : null;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>addCompletedChallenge.</p>
|
||||
* Add non-repeatable challenge ID to list.
|
||||
*
|
||||
* @param int i
|
||||
*/
|
||||
|
||||
// Poorly named - this should be "setLockedChalleneges" or similar.
|
||||
public void addCompletedChallenge(int i) {
|
||||
completedChallenges.add(i);
|
||||
}
|
||||
|
||||
// Wins & Losses
|
||||
public int getLost() { return lost; }
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package forge.quest.gui.main;
|
||||
|
||||
//import javax.swing.JLabel;
|
||||
import javax.swing.JLabel;
|
||||
|
||||
import forge.gui.GuiUtils;
|
||||
|
||||
/**
|
||||
* <p>QuestQuestPanel.</p>
|
||||
@@ -10,7 +12,7 @@ package forge.quest.gui.main;
|
||||
@SuppressWarnings("serial")
|
||||
public class QuestChallengePanel extends QuestSelectablePanel {
|
||||
|
||||
//private JLabel repeatabilityLabel;
|
||||
private JLabel repeatabilityLabel;
|
||||
|
||||
/** <p>QuestChallengePanel.</p>
|
||||
* Constructor, using challenge data instance.
|
||||
@@ -20,16 +22,15 @@ public class QuestChallengePanel extends QuestSelectablePanel {
|
||||
public QuestChallengePanel(QuestChallenge q) {
|
||||
super(q);
|
||||
|
||||
// Repeatability is currently meaningless.
|
||||
// Can be added here later if necessary.
|
||||
/*
|
||||
* if (q.getRepeatable()) {
|
||||
GuiUtils.addGap(super.rootPanel,7);
|
||||
|
||||
if (q.getRepeatable()) {
|
||||
repeatabilityLabel = new JLabel("This challenge is repeatable");
|
||||
} else {
|
||||
repeatabilityLabel = new JLabel("This challenge is not repeatable");
|
||||
}
|
||||
|
||||
super.rootPanel.add(repeatabilityLabel);
|
||||
*/
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user