Repeatability activated for quest challenge events.

This commit is contained in:
Doublestrike
2011-09-28 11:19:34 +00:00
parent 7a432393d2
commit d041d189d1
3 changed files with 33 additions and 9 deletions

View File

@@ -428,6 +428,11 @@ public class Gui_WinLose extends JFrame implements NewConstants {
giveBooster(); giveBooster();
} }
// Set repeatability
if(!model.qc.getRepeatable()) {
model.quest.addCompletedChallenge(model.qc.getId());
}
// Award credits // Award credits
if (wonMatch) { if (wonMatch) {
long creds = model.quest.getRewards().getCreditsToAdd(model.match); long creds = model.quest.getRewards().getCreditsToAdd(model.match);

View File

@@ -152,7 +152,7 @@ public final class QuestData {
life = mode.equals(FANTASY) ? 15 : 20; life = mode.equals(FANTASY) ? 15 : 20;
} }
// All belongins // All belongings
public QuestInventory getInventory() { return inventory; } public QuestInventory getInventory() { return inventory; }
public QuestPetManager getPetManager() { return petManager; } public QuestPetManager getPetManager() { return petManager; }
// Cards - class uses data from here // 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 setAvailableChallenges(final List<Integer> list) { availableChallenges = list; }
public void clearAvailableChallenges() { availableChallenges.clear(); } public void clearAvailableChallenges() { availableChallenges.clear(); }
/**
* <p>getCompletedChallenges.</p>
* Returns stored list of non-repeatable challenge IDs.
*
* @return List<Integer>
*/
public List<Integer> getCompletedChallenges() { public List<Integer> getCompletedChallenges() {
// This should be phased out after a while, when // This should be phased out after a while, when
// old quest decks have been updated. (changes made 19-9-11) // old quest decks have been updated. (changes made 19-9-11)
// Also, poorly named - this should be "getLockedChalleneges" or similar.
if(completedQuests != null) { if(completedQuests != null) {
completedChallenges = completedQuests; completedChallenges = completedQuests;
completedQuests = null; completedQuests = null;
@@ -199,6 +205,18 @@ public final class QuestData {
return completedChallenges != null ? new ArrayList<Integer>(completedChallenges) : null; 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 // Wins & Losses
public int getLost() { return lost; } public int getLost() { return lost; }
public void addLost() { lost++; } public void addLost() { lost++; }

View File

@@ -1,6 +1,8 @@
package forge.quest.gui.main; package forge.quest.gui.main;
//import javax.swing.JLabel; import javax.swing.JLabel;
import forge.gui.GuiUtils;
/** /**
* <p>QuestQuestPanel.</p> * <p>QuestQuestPanel.</p>
@@ -10,7 +12,7 @@ package forge.quest.gui.main;
@SuppressWarnings("serial") @SuppressWarnings("serial")
public class QuestChallengePanel extends QuestSelectablePanel { public class QuestChallengePanel extends QuestSelectablePanel {
//private JLabel repeatabilityLabel; private JLabel repeatabilityLabel;
/** <p>QuestChallengePanel.</p> /** <p>QuestChallengePanel.</p>
* Constructor, using challenge data instance. * Constructor, using challenge data instance.
@@ -20,16 +22,15 @@ public class QuestChallengePanel extends QuestSelectablePanel {
public QuestChallengePanel(QuestChallenge q) { public QuestChallengePanel(QuestChallenge q) {
super(q); super(q);
// Repeatability is currently meaningless. GuiUtils.addGap(super.rootPanel,7);
// Can be added here later if necessary.
/* if (q.getRepeatable()) {
* if (q.getRepeatable()) {
repeatabilityLabel = new JLabel("This challenge is repeatable"); repeatabilityLabel = new JLabel("This challenge is repeatable");
} else { } else {
repeatabilityLabel = new JLabel("This challenge is not repeatable"); repeatabilityLabel = new JLabel("This challenge is not repeatable");
} }
super.rootPanel.add(repeatabilityLabel); super.rootPanel.add(repeatabilityLabel);
*/
} }
} }