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();
}
// Set repeatability
if(!model.qc.getRepeatable()) {
model.quest.addCompletedChallenge(model.qc.getId());
}
// Award credits
if (wonMatch) {
long creds = model.quest.getRewards().getCreditsToAdd(model.match);

View File

@@ -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;
@@ -199,6 +205,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; }
public void addLost() { lost++; }

View File

@@ -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);
*/
}
}