10. Quest
10. The Quest Class
10.1 Quest Initialization
Quests are initialized by creating an instance of the Quest
class. This is the main quest. Within the class, tasks can be created. Tasks are the events that must be satisfied. Once all tasks are satisfied, the quest is marked as completed, and the rewards are given to the player. When creating an instance of Quest
, two parameters are required:
name
the name of the quest
reward
reward that is given to the player after the quest is complete.
reward
parameter MUST be a list
Quests are created as such:
10.2 Quest.add_task
Quest.add_task(task)
Quests must contain tasks. The addtask()
function is used to create tasks the user must complete to complete the quest.
Tasks are created as such:
10.3 Quest.complete_task
Quest.complete_task(task)
Task completion checking is completely up to the developer. The reason for this being is so that any complexity of tasks can be checked in any way you desire. Once the Quest.completetask()
is called, the task specified in the parameters is marked as completed. If there are no remaining tasks in the quest, the reward will be given.
Usage:
Last updated