Skip to content

Commit

Permalink
Include completed Goodies for Rudolph in travel log while Christmas i…
Browse files Browse the repository at this point in the history
…s inactive

#548
  • Loading branch information
AntumDeluge committed Oct 9, 2023
1 parent 2293647 commit 975ba43
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 5 deletions.
4 changes: 1 addition & 3 deletions src/games/stendhal/server/core/rp/StendhalQuestSystem.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ public void init() {
loadQuest(new FishSoup());
loadQuest(new FishSoupForHughie());
loadQuest(new FruitsForCoralia());
loadQuest(new GoodiesForRudolph());
loadQuest(new GuessKills());
loadQuest(new HatForMonogenes());
loadQuest(new HelpTomi());
Expand Down Expand Up @@ -197,9 +198,6 @@ public void init() {
loadQuest(new ZekielsPracticalTestQuest());
loadQuest(new ZooFood());

if (Occasion.CHRISTMAS) {
loadQuest(new GoodiesForRudolph());
}
if (Occasion.EASTER) {
loadQuest(new EasterGiftsForChildren());
}
Expand Down
24 changes: 22 additions & 2 deletions src/games/stendhal/server/maps/quests/GoodiesForRudolph.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import java.util.LinkedList;
import java.util.List;

import games.stendhal.common.constants.Occasion;
import games.stendhal.server.entity.npc.ChatAction;
import games.stendhal.server.entity.npc.ConversationPhrases;
import games.stendhal.server.entity.npc.ConversationStates;
Expand Down Expand Up @@ -111,6 +112,22 @@ public List<String> getHistory(final Player player) {
return res;
}

/**
* Details are added to travel log if Christmas is active or player has completed quest.
*
* @param player
* Player for whom details are requested.
* @return
* `true` if Christmas is active or quest is completed.
*/
@Override
public boolean isVisibleOnQuestStatus(final Player player) {
if (Occasion.CHRISTMAS) {
return true;
}
return isCompleted(player);
}

private void prepareRequestingStep() {
final SpeakerNPC npc = npcs.get("Rudolph");

Expand Down Expand Up @@ -234,8 +251,11 @@ public void addToWorld() {
"Goodies for Rudolph",
"Rudolph, Santa's favorite reindeer, desperately wants some goodies.",
false);
prepareRequestingStep();
prepareBringingStep();

if (Occasion.CHRISTMAS) {
prepareRequestingStep();
prepareBringingStep();
}
}

@Override
Expand Down

0 comments on commit 975ba43

Please sign in to comment.