Skip to content

Commit

Permalink
Adventure quest updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jjayers99 committed Jan 6, 2024
1 parent 9f56af8 commit 87f6ad4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -279,10 +279,10 @@ public AdventureQuestController.QuestStatus handleEvent(AdventureQuestEvent even
&& ++progress1 >= count1 ? COMPLETE : status;
break;
case Clear:
if (!event.clear) {
break;
if (event.clear && event.winner) {
status = COMPLETE;
}
//intentional fallthrough to DEFEAT
break;
case Defeat:
if (event.type != AdventureQuestEventType.MATCHCOMPLETE)
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,50 +154,45 @@ public enum QuestStatus{
private List<EnemySprite> enemySpriteList= new ArrayList<>();
private int nextQuestID = 0;
public void showQuestDialogs(GameStage stage) {
if (dialogQueue.peek() == null)
{
inDialog = false; //occasionally this wasn't clearing, causing dialogs to stop displaying
}
List<AdventureQuestData> finishedQuests = new ArrayList<>();

for (AdventureQuestData quest : Current.player().getQuests()) {
DialogData prologue = quest.getPrologue();
if (prologue != null && (!prologue.text.isEmpty()) ){
if (prologue != null){
dialogQueue.add(prologue);
}
for (AdventureQuestStage questStage : quest.stages)
{
if (questStage.getStatus() == INACTIVE)
continue;
if (questStage.prologue != null && (!questStage.prologue.text.isEmpty()) && !questStage.prologueDisplayed){
if (questStage.prologue != null && !questStage.prologueDisplayed){
questStage.prologueDisplayed = true;
dialogQueue.add(questStage.prologue);
}

if (questStage.getStatus() == FAILED && questStage.failureDialog != null && !questStage.failureDialog.text.isEmpty()){
if (questStage.getStatus() == FAILED && questStage.failureDialog != null){
dialogQueue.add(questStage.failureDialog);
continue;
}

if (questStage.getStatus() == COMPLETE && questStage.epilogue != null && (!questStage.epilogue.text.isEmpty()) && !questStage.epilogueDisplayed){
if (questStage.getStatus() == COMPLETE && questStage.epilogue != null && !questStage.epilogueDisplayed){
questStage.epilogueDisplayed = true;
dialogQueue.add(questStage.epilogue);
}
}

if (quest.failed){
finishedQuests.add(quest);
if (quest.failureDialog != null && !quest.failureDialog.text.isEmpty()){
if (quest.failureDialog != null){
dialogQueue.add(quest.failureDialog);
}
}

if (!quest.completed)
continue;
DialogData epilogue = quest.getEpilogue();
if (epilogue != null && (!epilogue.text.isEmpty())){
if (epilogue != null){
dialogQueue.add(epilogue);

}
finishedQuests.add(quest);
updateQuestComplete(quest);
Expand Down
25 changes: 22 additions & 3 deletions forge-gui/res/adventure/Shandalar/world/quests.json
Original file line number Diff line number Diff line change
Expand Up @@ -4335,7 +4335,7 @@
"id": 16,
"isTemplate": true,
"name": "Clearing the ledger",
"description": "Clear out all enemies in the $(poi_1)and report back",
"description": "Clear out all enemies in the $(poi_1) and report back",
"offerDialog": {
"text": "As you introduce yourself to the inside of the local inn for the night, another patron approaches you.",
"options": [
Expand Down Expand Up @@ -5654,7 +5654,25 @@
"text": "You walk back into the town with the requested cargo of $(enemy_1)s. You're unsure if they will be useful, but the dwarf seems extremely excited to begin his work. (+3 Local Reputation) ",
"options": [
{
"name": "You try to talk to him, but the dwarf is completely lost in his work already. You take the bundle he was carrying, assuming it to be your rewards. (Complete Quest)"
"action": [
{
"grantRewards": [
{
"type": "gold",
"count": 500
},
{
"type": "card",
"count": 4,
"addMaxCount": 4,
"rarity": [
"Common",
"Uncommon"
]
}
]
}
],"name": "You try to talk to him, but the dwarf is completely lost in his work already. You take the bundle he was carrying, assuming it to be your rewards. (Complete Quest)"
}
]
},
Expand Down Expand Up @@ -9704,6 +9722,7 @@
"enemyTags": [
"Captain"
],
"mixedEnemies": true,
"prologue": {
"text": "Sir Donovan's directions are very precise, and you find the mining operation without much trouble. There is, however, an obvious sign of trouble when you arrive.",
"options": [
Expand Down Expand Up @@ -9768,7 +9787,7 @@
"description": "Use Donovan's amulet to contact him.",
"mapFlag": "Quest_ShardMines_EpilogueComplete",
"mapFlagValue": 1,
"here": true,
"worldMapOK": true,
"objective": "QuestFlag",
"prologue": {
"text": "When you are ready, you should use the amulet he gave you to tell Sir Donovan about the pirates, and that they've been dealt with.",
Expand Down

0 comments on commit 87f6ad4

Please sign in to comment.