Created
August 10, 2018 20:56
-
-
Save troy-lamerton/f2bbbd79c56eba2d4e5e14412be751b2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public int loop() { | |
if (this.stoppingCompleter) { | |
this.releaseQuestCompleter(0); | |
this.stoppingCompleter = false; | |
Log.severe("The quest completer stopped itself because it cannot continue"); | |
Time.sleep(1000); | |
return 0; | |
} | |
if (Game.getState() != Game.STATE_IN_GAME) { | |
return 100; | |
} | |
if (this.questCompleters.size() > 0) { | |
QuestCompleter qc = questCompleters.get(0); | |
if (!qc.getIsActive()) { | |
this.startQuest(questCompleters.get(0)); | |
return 1000; | |
} | |
if (qc.validate()) { | |
return qc.execute(); | |
} else { | |
this.releaseQuestCompleter(qc); | |
return 1000; | |
} | |
} | |
if (this.questCompleters.size() == 0) { | |
Time.sleep(1000); | |
if (this.startQuestUI != null) { | |
this.startQuestUI.setVisible(true); | |
} | |
} | |
return 2000; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment