Currently quests have to be written in a javascript file which is a pretty terrible experience for builders that aren't also programmers.
High level plans
Allow quests to be defined in a YAML file like items and npcs. This will allow for quests to be created entirely in Soma (assuming the required goal and reward type classes exist)
Implementation Details
Rewards
Quest#reward should be an array of QuestReward objects that have give and display methods.
Example reward types
CurrencyReward
ItemReward(array items)
** if items is an array render ItemUtil.displayItem by splitting two item displays on \r\n, looping over Max(item 1 arr len, item 2 arr len), use ''
ExperienceReward
ChoiceReward - A reward type that accepts an array<Reward> and will allow user to choose one of the rewards
Goals
Quest Goals should have the option to require completion in order and to only reveal subsequent goals when preceding goals are completed, e.g., travel to Room A, once that's done, Travel to Room B appears as the goal
Core changes
quests.js should be replaced by quests.yml
New bundle types: quest-rewards and quest-goals
Update BundleManager to load in new reward and goal bundles, assign reward and goals to QuestFactory
There will be some changes needed to QuestFactory#create for instantiating the goals and rewards
QuestGoal should get a new static bool validate(config) method that is called during bundle load to halt server startup if there is a quest with a bad config
Bundle changes
The ranvier-quests bundle will have to move the goals from lib to the new quest-goals bundle type
ranvier-areas will have to rewrite the quests.js to the new format
Currently quests have to be written in a javascript file which is a pretty terrible experience for builders that aren't also programmers.
High level plans
Allow quests to be defined in a YAML file like items and npcs. This will allow for quests to be created entirely in Soma (assuming the required goal and reward type classes exist)
Implementation Details
Rewards
Quest#reward should be an array of
QuestReward
objects that havegive
anddisplay
methods.Example reward types
array<Reward>
and will allow user to choose one of the rewardsGoals
Quest Goals should have the option to require completion in order and to only reveal subsequent goals when preceding goals are completed, e.g., travel to Room A, once that's done, Travel to Room B appears as the goal
Core changes
quests.js
should be replaced byquests.yml
quest-rewards
andquest-goals
BundleManager
to load in new reward and goal bundles, assign reward and goals toQuestFactory
QuestFactory#create
for instantiating the goals and rewardsQuestGoal
should get a new staticbool validate(config)
method that is called during bundle load to halt server startup if there is a quest with a bad configBundle changes
ranvier-quests
bundle will have to move the goals fromlib
to the newquest-goals
bundle typeranvier-areas
will have to rewrite thequests.js
to the new format