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)) {
|
if (model.quest.getRewards().willGiveBooster(wonMatch)) {
|
||||||
giveBooster();
|
giveBooster();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set repeatability
|
||||||
|
if(!model.qc.getRepeatable()) {
|
||||||
|
model.quest.addCompletedChallenge(model.qc.getId());
|
||||||
|
}
|
||||||
|
|
||||||
// Award credits
|
// Award credits
|
||||||
if (wonMatch) {
|
if (wonMatch) {
|
||||||
|
|||||||
@@ -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;
|
||||||
@@ -198,6 +204,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; }
|
||||||
|
|||||||
@@ -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);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user