-
Notifications
You must be signed in to change notification settings - Fork 2
/
classes.txt
136 lines (108 loc) · 6.85 KB
/
classes.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
This file contains the structure for our classes and enums
*Enums*
- QuestStatus
- Description
Contains the current status of our quest. Important to address the progress
- Values
- NotStarted -- Player hasn't accepted this quest yet
- InProgress -- The quest is currently in progress by the Player
- Completed -- Quest has been completed but is yet to be delivered
- Delivered -- Quest is completed and delivered
- QuestAcceptType
- Description
Determines the behavior on how should this quest be accepted by a player
- Values
- Automatic -- If it should automatically accept the quest if it finds it to be available
- Manual -- The developer sets the behavior on how this quest should be accepted
- QuestDeliverType
- Description
Determines the behavior on how should this quest be delivered by a player
- Values
- Automatic -- Should automatically deliver the quest as soon as it is completed
- Manual -- The developer sets the behavior on how this quest should be delivered
- QuestRepeatableType
- Description
This determines if the quest is repeatable and if yes then which rules should it follow
- Values
NonRepeatable -- Cannot repeat this quest
Daily -- Can repeat it once per day (resets every 22 hours)
Weekly -- Can repeat it once per week (resets ever 6 days + 22 hours)
Custom -- Is repeatable but it must be enabled again by the developer
*Classes*
- Objective
- Description
Objective contain the objective for our quest and all the relevant static data
for it to be displayed to the user
- Properties
- ObjectiveId: string -- The ID that will be used by our module managers to update the objective
- Name: string -- The name of our objective
- Description: string -- The description of this objective
- CustomData: {[string]: any} -- Contains any sort of custom data that the developer might want to add to it
- QuestObjectiveProgress
- Description
Contains the dynamic data for our quest objectives
- Functions
TO DO
- Properties
- CurrentProgress: number -- The current progress
- TargetProgress: number -- The required amount to reach our target progress
- _Completed: boolean -- If the quest has been completed already or not
- QuestObjective
- Description
Contains the progress and goal for our quest. This will determine whether the user has completed the quest
or not
- Functions
- Add: (amount: number) -> () -- Adds to the current progress by the amount
- Remove: (amount: number) -> () -- Removes the current progress by the amount
- Set: (newAmount: number) -> () -- Sets the current progress to this amount
- IsCompleted: () -> boolean -- Returns whether this objective has been completed or not
- _CheckProgress: () -> () -- Checks the progress of our quest objective and sets completed to true if needed
- _GetSavingFormat: () -> {[string]: any} -- Returns a hash map with all the data required to save in a data store
- Properties
- QuestObjectiveProgress: QuestObjectiveProgress -- The dynamic data that determines the progress of our quest
- Objective: Objective -- Pointer to our static data
- CustomData: {[string]: any} -- Contains any sort of custom data that the developer might want to add to it
- QuestProgress
- Description
Contains all the data that is dynamic and player specific. This is the data that should be stored by
the developer on his desired DataStore system
- Properties
- _QuestObjectiveProgresses: {QuestObjectiveProgress} -- The progress of our quest objectives for this quest
- _QuestStatus: QuestStatus -- Current status of our quest
- _CompletedCount: number -- Amount of times that this quest has been completed
- _FirstCompletedTick: number? -- UTC of the first time that this quest has been repeated
- _LastCompletedTick: number? -- UTC of the last time that this quest has been repeated
- QuestLifeCycle
- Description
This contains all the behavior of our quests. It's within this class that we should
code how our quest behaves
TO DO
- Quest
- Description
This is the main class of the library as it contains all the relevant data of a quest. It contains
how the quest is called, how it is managed, what objectives are required and etc.
- Functions
- GetQuestStatus: () -> QuestStatus -- Gets the current quest status
- CanStart: () -> boolean -- If the player can or cannot start the quest
- GetFirstCompletedTick: () -> number? -- First time the player completed the quest. Will return nil if never
- GetLastCompletedTick: () -> number? -- Last time the player completed the quest. Will return nil if never
- AddObjective: (amount: number) -> () -- Adds to the current progress by the amount
- RemoveObjective: (amount: number) -> () -- Removes the current progress by the amount
- SetObjective: (newAmount: number) -> () -- Sets the current progress to this amount
- _GetSavingFormat: () -> {[string]: any} -- Returns a hash map with all the data required to save in a data store
- _CheckProgress: () -> () -- Whenever an objective gets updated we check whether we can change this quest progress or not
- Properties
- Name: string -- The name of our quest
- Description: string -- The Description of our quest
- QuestId: string -- A unique identifier for our quest
- QuestAcceptType: QuestAcceptType -- Determines the behavior for how the quest is accepted
- QuestDeliverType: QuestDeliverType -- Determines the behavior for how the quest is delivered
- QuestRepeatableType: QuestRepeatableType -- If the quest is repeatable or not
- QuestStart: number? -- This property allows the developer to set a date at which the quest becomes available. This means the quest cannot be accepted before this time UTC
- QuestEnd: number? -- Similar to quest start this allows the develoepr to set a date at which the quest becomes unavailable. This means that the quest can no longer be accepted/completed after this date UTC
- RequiredQuests: {string} -- An array of strings with the required QuestIds in order for this quest to be allowed to be given to a player
- LifeCycles: {string} -- An array of strings with the IDs of our quest lifecycles.
- CustomData: {[string]: any} -- Contains any sort of custom data that the developer might want to add to it
- QuestObjectives: {QuestObjective} -- An array with all the objectives required to complete this quest
// Data below will be saved
- _QuestProgress: QuestProgress -- The dynamic data for our quest