mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 18:58:00 +00:00
Fix Wanderlust from breaking other quests
This commit is contained in:
@@ -146,17 +146,16 @@ public class AdventureQuestController implements Serializable {
|
||||
}
|
||||
private Map<String, Long> nextQuestDate = new HashMap<>();
|
||||
private int maximumSideQuests = 5; //todo: move to configuration file
|
||||
private transient boolean inDialog = false;
|
||||
private transient MapDialog activeDialog = null;
|
||||
private transient Array<AdventureQuestData> allQuests = new Array<>();
|
||||
private transient Array<AdventureQuestData> allSideQuests = new Array<>();
|
||||
private final transient Array<AdventureQuestData> allSideQuests = new Array<>();
|
||||
private Queue<DialogData> dialogQueue = new LinkedList<>();
|
||||
private Map<String,Date> questAvailability = new HashMap<>();
|
||||
public PointOfInterest mostRecentPOI;
|
||||
private List<EnemySprite> enemySpriteList= new ArrayList<>();
|
||||
private final List<EnemySprite> enemySpriteList= new ArrayList<>();
|
||||
private int nextQuestID = 0;
|
||||
public void showQuestDialogs(GameStage stage) {
|
||||
List<AdventureQuestData> finishedQuests = new ArrayList<>();
|
||||
|
||||
for (AdventureQuestData quest : Current.player().getQuests()) {
|
||||
DialogData prologue = quest.getPrologue();
|
||||
if (prologue != null){
|
||||
@@ -198,12 +197,12 @@ public class AdventureQuestController implements Serializable {
|
||||
finishedQuests.add(quest);
|
||||
updateQuestComplete(quest);
|
||||
}
|
||||
if (!inDialog){
|
||||
inDialog = true;
|
||||
|
||||
if (activeDialog == null && !dialogQueue.isEmpty()){
|
||||
displayNextDialog((MapStage) stage);
|
||||
}
|
||||
for (AdventureQuestData toRemove : finishedQuests) {
|
||||
|
||||
for (AdventureQuestData toRemove : finishedQuests) {
|
||||
if (!toRemove.failed && locationHasMoreQuests()){
|
||||
nextQuestDate.remove(toRemove.sourceID);
|
||||
}
|
||||
@@ -219,32 +218,32 @@ public class AdventureQuestController implements Serializable {
|
||||
return new Random().nextFloat() <= 0.85f;
|
||||
}
|
||||
public void displayNextDialog(MapStage stage){
|
||||
if (dialogQueue.peek() == null)
|
||||
{
|
||||
inDialog = false;
|
||||
if (dialogQueue.peek() == null) {
|
||||
activeDialog = null;
|
||||
return;
|
||||
}
|
||||
|
||||
DialogData data = dialogQueue.remove();
|
||||
MapDialog dialog = new MapDialog(data, stage, -1, null);
|
||||
|
||||
activeDialog = new MapDialog(data, stage, -1, null);
|
||||
if (data.options == null || data.options.length == 0) {
|
||||
dialog.setEffects(data.action);
|
||||
activeDialog.setEffects(data.action);
|
||||
displayNextDialog(stage);
|
||||
return;
|
||||
}
|
||||
|
||||
stage.showDialog();
|
||||
dialog.activate();
|
||||
activeDialog.activate();
|
||||
ChangeListener listen = new ChangeListener() {
|
||||
@Override
|
||||
public void changed(ChangeEvent changeEvent, Actor actor) {
|
||||
activeDialog = null;
|
||||
|
||||
displayNextDialog(stage);
|
||||
}
|
||||
};
|
||||
dialog.addDialogCompleteListener(listen);
|
||||
if (data.options == null || data.options.length == 0)
|
||||
{
|
||||
activeDialog.addDialogCompleteListener(listen);
|
||||
// Seems weird that data would be null here, but not null up there. Are we changingi these values inside activate?
|
||||
if (data.options == null || data.options.length == 0) {
|
||||
displayNextDialog(stage);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user