@drincs/nqtr 0.1.14 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (217) hide show
  1. package/dist/ActivityProps-B1IaFbGD.d.ts +124 -0
  2. package/dist/ActivityProps-BmIzqtXr.d.mts +124 -0
  3. package/dist/{index-Cu8ZAiqF.d.ts → Commitment-BjkhJtTx.d.ts} +227 -220
  4. package/dist/{index-DhsRZJ3g.d.mts → Commitment-BxUQoZST.d.mts} +227 -220
  5. package/dist/{index-gJ26gdgL.d.mts → Quest-Bdm0R9LA.d.mts} +7 -12
  6. package/dist/{index-BjOzVDyw.d.ts → Quest-CxJcXETG.d.ts} +7 -12
  7. package/dist/classes/Activity.d.mts +41 -127
  8. package/dist/classes/Activity.d.ts +41 -127
  9. package/dist/classes/Activity.js +2 -151
  10. package/dist/classes/Activity.js.map +1 -1
  11. package/dist/classes/Activity.mjs +2 -148
  12. package/dist/classes/Activity.mjs.map +1 -1
  13. package/dist/classes/ActivityStoredAbstract.d.mts +3 -0
  14. package/dist/classes/ActivityStoredAbstract.d.ts +3 -0
  15. package/dist/classes/ActivityStoredAbstract.js +399 -0
  16. package/dist/classes/ActivityStoredAbstract.js.map +1 -0
  17. package/dist/classes/ActivityStoredAbstract.mjs +397 -0
  18. package/dist/classes/ActivityStoredAbstract.mjs.map +1 -0
  19. package/dist/classes/Commitment.d.mts +4 -1
  20. package/dist/classes/Commitment.d.ts +4 -1
  21. package/dist/classes/Commitment.js +5 -4
  22. package/dist/classes/Commitment.js.map +1 -1
  23. package/dist/classes/Commitment.mjs +5 -4
  24. package/dist/classes/Commitment.mjs.map +1 -1
  25. package/dist/classes/index.d.mts +9 -2
  26. package/dist/classes/index.d.ts +9 -2
  27. package/dist/classes/index.js +868 -5
  28. package/dist/classes/index.js.map +1 -1
  29. package/dist/classes/index.mjs +863 -6
  30. package/dist/classes/index.mjs.map +1 -1
  31. package/dist/classes/navigation/ActivityRoom.d.mts +5 -2
  32. package/dist/classes/navigation/ActivityRoom.d.ts +5 -2
  33. package/dist/classes/navigation/ActivityRoom.js +3 -3
  34. package/dist/classes/navigation/ActivityRoom.js.map +1 -1
  35. package/dist/classes/navigation/ActivityRoom.mjs +3 -3
  36. package/dist/classes/navigation/ActivityRoom.mjs.map +1 -1
  37. package/dist/classes/navigation/Location.d.mts +5 -2
  38. package/dist/classes/navigation/Location.d.ts +5 -2
  39. package/dist/classes/navigation/Location.js.map +1 -1
  40. package/dist/classes/navigation/Location.mjs.map +1 -1
  41. package/dist/classes/navigation/Map.d.mts +5 -2
  42. package/dist/classes/navigation/Map.d.ts +5 -2
  43. package/dist/classes/navigation/Map.js.map +1 -1
  44. package/dist/classes/navigation/Map.mjs.map +1 -1
  45. package/dist/classes/navigation/Room.d.mts +4 -1
  46. package/dist/classes/navigation/Room.d.ts +4 -1
  47. package/dist/classes/navigation/Room.js +3 -3
  48. package/dist/classes/navigation/Room.js.map +1 -1
  49. package/dist/classes/navigation/Room.mjs +3 -3
  50. package/dist/classes/navigation/Room.mjs.map +1 -1
  51. package/dist/classes/quest/Goal.d.mts +3 -6
  52. package/dist/classes/quest/Goal.d.ts +3 -6
  53. package/dist/classes/quest/Goal.js.map +1 -1
  54. package/dist/classes/quest/Goal.mjs.map +1 -1
  55. package/dist/classes/quest/Quest.d.mts +3 -1
  56. package/dist/classes/quest/Quest.d.ts +3 -1
  57. package/dist/classes/quest/Quest.js.map +1 -1
  58. package/dist/classes/quest/Quest.mjs.map +1 -1
  59. package/dist/classes/quest/Stage.d.mts +3 -1
  60. package/dist/classes/quest/Stage.d.ts +3 -1
  61. package/dist/classes/quest/Stage.js.map +1 -1
  62. package/dist/classes/quest/Stage.mjs.map +1 -1
  63. package/dist/decorators/ActivityDecorator.d.mts +16 -0
  64. package/dist/decorators/ActivityDecorator.d.ts +16 -0
  65. package/dist/decorators/ActivityDecorator.js.map +1 -1
  66. package/dist/decorators/ActivityDecorator.mjs.map +1 -1
  67. package/dist/decorators/CommitmentDecorator.d.mts +5 -2
  68. package/dist/decorators/CommitmentDecorator.d.ts +5 -2
  69. package/dist/decorators/CommitmentDecorator.js +3 -3
  70. package/dist/decorators/CommitmentDecorator.js.map +1 -1
  71. package/dist/decorators/CommitmentDecorator.mjs +3 -3
  72. package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
  73. package/dist/decorators/RoomDecorator.d.mts +9 -2
  74. package/dist/decorators/RoomDecorator.d.ts +9 -2
  75. package/dist/decorators/RoomDecorator.js.map +1 -1
  76. package/dist/decorators/RoomDecorator.mjs.map +1 -1
  77. package/dist/decorators/index.d.mts +4 -1
  78. package/dist/decorators/index.d.ts +4 -1
  79. package/dist/decorators/index.js +3 -3
  80. package/dist/decorators/index.js.map +1 -1
  81. package/dist/decorators/index.mjs +3 -3
  82. package/dist/decorators/index.mjs.map +1 -1
  83. package/dist/functions/ActivityFunctions.d.mts +5 -2
  84. package/dist/functions/ActivityFunctions.d.ts +5 -2
  85. package/dist/functions/ActivityFunctions.js.map +1 -1
  86. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  87. package/dist/functions/NavigationFunctions.d.mts +5 -2
  88. package/dist/functions/NavigationFunctions.d.ts +5 -2
  89. package/dist/functions/NavigationFunctions.js.map +1 -1
  90. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  91. package/dist/functions/RoutineFunctions.d.mts +5 -2
  92. package/dist/functions/RoutineFunctions.d.ts +5 -2
  93. package/dist/functions/RoutineFunctions.js.map +1 -1
  94. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  95. package/dist/functions/index.d.mts +5 -2
  96. package/dist/functions/index.d.ts +5 -2
  97. package/dist/functions/index.js.map +1 -1
  98. package/dist/functions/index.mjs.map +1 -1
  99. package/dist/index.d.mts +9 -4
  100. package/dist/index.d.ts +9 -4
  101. package/dist/index.js +155 -154
  102. package/dist/index.js.map +1 -1
  103. package/dist/index.mjs +155 -154
  104. package/dist/index.mjs.map +1 -1
  105. package/dist/interface/ActivityProps.d.mts +3 -0
  106. package/dist/interface/ActivityProps.d.ts +3 -0
  107. package/dist/{override/GraphicHTMLElement.js → interface/ActivityProps.js} +1 -1
  108. package/dist/interface/ActivityProps.mjs +3 -0
  109. package/dist/interface/CommitmentProps.d.mts +8 -0
  110. package/dist/interface/CommitmentProps.d.ts +8 -0
  111. package/dist/{override/OnRunActivityProps.js → interface/CommitmentProps.js} +1 -1
  112. package/dist/interface/CommitmentProps.mjs +3 -0
  113. package/dist/interface/RoomActivityMemory.d.mts +9 -0
  114. package/dist/interface/RoomActivityMemory.d.ts +9 -0
  115. package/dist/interface/RoomActivityMemory.js +4 -0
  116. package/dist/interface/RoomActivityMemory.js.map +1 -0
  117. package/dist/interface/RoomActivityMemory.mjs +3 -0
  118. package/dist/interface/RoomActivityMemory.mjs.map +1 -0
  119. package/dist/interface/RoomProps.d.mts +8 -0
  120. package/dist/interface/RoomProps.d.ts +8 -0
  121. package/dist/interface/RoomProps.js +4 -0
  122. package/dist/interface/RoomProps.js.map +1 -0
  123. package/dist/interface/RoomProps.mjs +3 -0
  124. package/dist/interface/RoomProps.mjs.map +1 -0
  125. package/dist/interface/index.d.mts +12 -0
  126. package/dist/interface/index.d.ts +12 -0
  127. package/dist/interface/index.js +4 -0
  128. package/dist/interface/index.js.map +1 -0
  129. package/dist/interface/index.mjs +3 -0
  130. package/dist/interface/index.mjs.map +1 -0
  131. package/dist/interface/navigation/LocationProps.d.mts +8 -0
  132. package/dist/interface/navigation/LocationProps.d.ts +8 -0
  133. package/dist/interface/navigation/LocationProps.js +4 -0
  134. package/dist/interface/navigation/LocationProps.js.map +1 -0
  135. package/dist/interface/navigation/LocationProps.mjs +3 -0
  136. package/dist/interface/navigation/LocationProps.mjs.map +1 -0
  137. package/dist/interface/navigation/MapProps.d.mts +8 -0
  138. package/dist/interface/navigation/MapProps.d.ts +8 -0
  139. package/dist/interface/navigation/MapProps.js +4 -0
  140. package/dist/interface/navigation/MapProps.js.map +1 -0
  141. package/dist/interface/navigation/MapProps.mjs +3 -0
  142. package/dist/interface/navigation/MapProps.mjs.map +1 -0
  143. package/dist/interface/quest/GoalProps.d.mts +7 -0
  144. package/dist/interface/quest/GoalProps.d.ts +7 -0
  145. package/dist/interface/quest/GoalProps.js +4 -0
  146. package/dist/interface/quest/GoalProps.js.map +1 -0
  147. package/dist/interface/quest/GoalProps.mjs +3 -0
  148. package/dist/interface/quest/GoalProps.mjs.map +1 -0
  149. package/dist/interface/quest/QuestProps.d.mts +9 -0
  150. package/dist/interface/quest/QuestProps.d.ts +9 -0
  151. package/dist/interface/quest/QuestProps.js +4 -0
  152. package/dist/interface/quest/QuestProps.js.map +1 -0
  153. package/dist/interface/quest/QuestProps.mjs +3 -0
  154. package/dist/interface/quest/QuestProps.mjs.map +1 -0
  155. package/dist/interface/quest/StageProps.d.mts +5 -0
  156. package/dist/interface/quest/StageProps.d.ts +5 -0
  157. package/dist/interface/quest/StageProps.js +4 -0
  158. package/dist/interface/quest/StageProps.js.map +1 -0
  159. package/dist/interface/quest/StageProps.mjs +3 -0
  160. package/dist/interface/quest/StageProps.mjs.map +1 -0
  161. package/dist/managers/TimeManager.d.mts +1 -1
  162. package/dist/managers/TimeManager.d.ts +1 -1
  163. package/dist/managers/TimeManager.js +1 -1
  164. package/dist/managers/TimeManager.js.map +1 -1
  165. package/dist/managers/TimeManager.mjs +1 -1
  166. package/dist/managers/TimeManager.mjs.map +1 -1
  167. package/dist/managers/index.js +1 -1
  168. package/dist/managers/index.js.map +1 -1
  169. package/dist/managers/index.mjs +1 -1
  170. package/dist/managers/index.mjs.map +1 -1
  171. package/dist/override/GraphicItemType.d.mts +3 -4
  172. package/dist/override/GraphicItemType.d.ts +3 -4
  173. package/dist/override/{OnRunActivityProps.d.mts → OnRunProps.d.mts} +3 -3
  174. package/dist/override/{OnRunActivityProps.d.ts → OnRunProps.d.ts} +3 -3
  175. package/dist/override/OnRunProps.js +4 -0
  176. package/dist/override/OnRunProps.js.map +1 -0
  177. package/dist/override/OnRunProps.mjs +3 -0
  178. package/dist/override/OnRunProps.mjs.map +1 -0
  179. package/dist/override/index.d.mts +1 -2
  180. package/dist/override/index.d.ts +1 -2
  181. package/dist/types/OnRunActivityEvent.d.mts +8 -0
  182. package/dist/types/OnRunActivityEvent.d.ts +8 -0
  183. package/dist/types/OnRunActivityEvent.js +4 -0
  184. package/dist/types/OnRunActivityEvent.js.map +1 -0
  185. package/dist/types/OnRunActivityEvent.mjs +3 -0
  186. package/dist/types/OnRunActivityEvent.mjs.map +1 -0
  187. package/dist/types/OnRunCommitmentEvent.d.mts +8 -0
  188. package/dist/types/OnRunCommitmentEvent.d.ts +8 -0
  189. package/dist/types/OnRunCommitmentEvent.js +4 -0
  190. package/dist/types/OnRunCommitmentEvent.js.map +1 -0
  191. package/dist/types/OnRunCommitmentEvent.mjs +3 -0
  192. package/dist/types/OnRunCommitmentEvent.mjs.map +1 -0
  193. package/dist/types/QuestsRequired.d.mts +4 -2
  194. package/dist/types/QuestsRequired.d.ts +4 -2
  195. package/dist/types/index.d.mts +4 -2
  196. package/dist/types/index.d.ts +4 -2
  197. package/package.json +1 -1
  198. package/dist/classes/navigation/index.d.mts +0 -5
  199. package/dist/classes/navigation/index.d.ts +0 -5
  200. package/dist/classes/navigation/index.js +0 -987
  201. package/dist/classes/navigation/index.js.map +0 -1
  202. package/dist/classes/navigation/index.mjs +0 -983
  203. package/dist/classes/navigation/index.mjs.map +0 -1
  204. package/dist/classes/quest/index.d.mts +0 -3
  205. package/dist/classes/quest/index.d.ts +0 -3
  206. package/dist/classes/quest/index.js +0 -133
  207. package/dist/classes/quest/index.js.map +0 -1
  208. package/dist/classes/quest/index.mjs +0 -129
  209. package/dist/classes/quest/index.mjs.map +0 -1
  210. package/dist/override/GraphicHTMLElement.d.mts +0 -7
  211. package/dist/override/GraphicHTMLElement.d.ts +0 -7
  212. package/dist/override/GraphicHTMLElement.mjs +0 -3
  213. package/dist/override/OnRunActivityProps.mjs +0 -3
  214. /package/dist/{override/GraphicHTMLElement.js.map → interface/ActivityProps.js.map} +0 -0
  215. /package/dist/{override/GraphicHTMLElement.mjs.map → interface/ActivityProps.mjs.map} +0 -0
  216. /package/dist/{override/OnRunActivityProps.js.map → interface/CommitmentProps.js.map} +0 -0
  217. /package/dist/{override/OnRunActivityProps.mjs.map → interface/CommitmentProps.mjs.map} +0 -0
@@ -1,14 +1,41 @@
1
- import ActivityModel, { ActivityStoredAbstract, OnRunActivityEvent, ActivityProps } from './classes/Activity.mjs';
2
- import { GraphicItemType, OnRenderGraphicItemProps } from '@drincs/nqtr/dist/override';
3
- import { StoredClassModel, CharacterBaseModel } from '@drincs/pixi-vn';
1
+ import { GraphicItemType, OnRenderGraphicItemProps, OnRunActivityProps } from '@drincs/nqtr/dist/override';
2
+ import { CharacterBaseModel, StoredClassModel } from '@drincs/pixi-vn';
4
3
  import { ExecutionTypeEnum } from './enums/ExecutionTypeEnum.mjs';
4
+ import ActivityModel from './classes/Activity.mjs';
5
+ import { a as ActivityStoredAbstract, A as ActivityProps } from './ActivityProps-BmIzqtXr.mjs';
6
+ import { OnRunActivityEvent } from './types/OnRunActivityEvent.mjs';
7
+ import { OnRunCommitmentEvent } from './types/OnRunCommitmentEvent.mjs';
5
8
 
6
- interface MapBaseModelProps {
9
+ interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> {
7
10
  /**
8
11
  * The name
9
12
  * @default ""
10
13
  */
11
14
  name?: string;
15
+ /**
16
+ * The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
17
+ * If you set 3, the commitment will be hidden into hours 1 and 2, and will be shown from hour 3.
18
+ * @default TimeManager.minDayHours
19
+ */
20
+ fromHour?: number;
21
+ /**
22
+ * The hour when the commitment ends. If the commitment is ended yet, it will be hidden.
23
+ * If you set 3, the commitment will be shown into hours 1 and 2 and will be hidden from hour 3.
24
+ * @default TimeManager.maxDayHours + 1
25
+ */
26
+ toHour?: number;
27
+ /**
28
+ * The day when the commitment starts. If the commitment is not started yet, it will be hidden.
29
+ * If you set 3, the commitment will be hidden into days 1 and 2, and will be shown from day 3.
30
+ * @default undefined
31
+ */
32
+ fromDay?: number;
33
+ /**
34
+ * The day when the commitment ends. If the commitment is ended yet, it will be deleted or hidden.
35
+ * If you set 3, the commitment will be shown into days 1 and 2 and will be deleted or hidden from day 3.
36
+ * @default undefined
37
+ */
38
+ toDay?: number;
12
39
  /**
13
40
  * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
14
41
  * Or an object to manage multiple image types. For example to have a image based on time.
@@ -23,7 +50,76 @@ interface MapBaseModelProps {
23
50
  * ```
24
51
  * @default undefined
25
52
  */
26
- renderImage?: GraphicItemType | ((map: MapBaseModel, props?: OnRenderGraphicItemProps) => GraphicItemType);
53
+ renderImage?: GraphicItemType | ((commitment: CommitmentBaseModel<TCharacter, TRoom>, props: OnRenderGraphicItemProps) => GraphicItemType);
54
+ /**
55
+ * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
56
+ * @default ExecutionTypeEnum.INTERACTION
57
+ */
58
+ executionType?: ExecutionTypeEnum;
59
+ /**
60
+ * Is a function that is called when the player interacts with the character.
61
+ * @param commitment
62
+ * @returns
63
+ * @default undefined
64
+ */
65
+ onRun?: OnRunCommitmentEvent<CommitmentBaseModel>;
66
+ /**
67
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
68
+ * If it is disabled this commitment will not be taken into consideration. So the characters will not be in the room, but will be busy with other commitments.
69
+ * @default false
70
+ */
71
+ disabled?: boolean | string;
72
+ /**
73
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
74
+ * @default false
75
+ */
76
+ hidden?: boolean | string;
77
+ }
78
+
79
+ interface LocationProps<TMap extends MapBaseModel = MapBaseModel> {
80
+ /**
81
+ * The name
82
+ * @default ""
83
+ */
84
+ name?: string;
85
+ /**
86
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
87
+ * @default false
88
+ */
89
+ disabled?: boolean | string;
90
+ /**
91
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
92
+ * @default false
93
+ */
94
+ hidden?: boolean | string;
95
+ /**
96
+ * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
97
+ * @default undefined
98
+ */
99
+ renderIcon?: GraphicItemType | ((location: LocationBaseModel<TMap>, props: OnRenderGraphicItemProps) => GraphicItemType);
100
+ }
101
+
102
+ interface MapProps {
103
+ /**
104
+ * The name
105
+ * @default ""
106
+ */
107
+ name?: string;
108
+ /**
109
+ * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
110
+ * Or an object to manage multiple image types. For example to have a image based on time.
111
+ * @example
112
+ * ```ts
113
+ * {
114
+ * "morning": "morning-background.jpg",
115
+ * "afternoon": "afternoon-background.jpg",
116
+ * "evening": "evening-background.jpg",
117
+ * "night": "night-background.jpg"
118
+ * }
119
+ * ```
120
+ * @default undefined
121
+ */
122
+ renderImage?: GraphicItemType | ((map: MapBaseModel, props: OnRenderGraphicItemProps) => GraphicItemType);
27
123
  /**
28
124
  * The neighboring maps that are available in this map.
29
125
  * @example
@@ -51,6 +147,72 @@ interface MapBaseModelProps {
51
147
  */
52
148
  hidden?: boolean | string;
53
149
  }
150
+
151
+ interface RoomProps<TLocation extends LocationBaseModel = LocationBaseModel> {
152
+ /**
153
+ * The name
154
+ * @default ""
155
+ */
156
+ name?: string;
157
+ /**
158
+ * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
159
+ * Or an object to manage multiple image types. For example to have a image based on time.
160
+ * @example
161
+ * ```ts
162
+ * {
163
+ * "morning": "morning-background.jpg",
164
+ * "afternoon": "afternoon-background.jpg",
165
+ * "evening": "evening-background.jpg",
166
+ * "night": "night-background.jpg"
167
+ * }
168
+ * ```
169
+ * @default undefined
170
+ */
171
+ renderImage?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props: OnRenderGraphicItemProps) => GraphicItemType);
172
+ /**
173
+ * The activities that are available in this room.
174
+ * @default []
175
+ */
176
+ defaultActivities?: ActivityModel[];
177
+ /**
178
+ * Whether is disabled. You can also pass a Pixi'VN flag name.
179
+ * @default false
180
+ */
181
+ disabled?: boolean | string;
182
+ /**
183
+ * Whether is hidden. You can also pass a Pixi'VN flag name.
184
+ * @default false
185
+ */
186
+ hidden?: boolean | string;
187
+ /**
188
+ * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
189
+ * @default undefined
190
+ */
191
+ renderIcon?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props: OnRenderGraphicItemProps) => GraphicItemType);
192
+ /**
193
+ * Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
194
+ * @default false
195
+ */
196
+ isEntrance?: boolean;
197
+ }
198
+
199
+ /**
200
+ * The activity generated by the room.
201
+ */
202
+ declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
203
+ constructor(id: string, room: TRoom, onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
204
+ setStorageProperty<T>(_: string, __: T | undefined): void;
205
+ getStorageProperty<T>(propertyName: string): T | undefined;
206
+ private _id;
207
+ get id(): string;
208
+ /**
209
+ * The room where the activity is.
210
+ */
211
+ private _room;
212
+ get room(): TRoom;
213
+ export(): object;
214
+ }
215
+
54
216
  /**
55
217
  * The base model of a map. I suggest you extend this class to create your own map model.
56
218
  * @example
@@ -72,7 +234,7 @@ declare class MapBaseModel extends StoredClassModel {
72
234
  * @param id The id of the map, it must be unique.
73
235
  * @param props The properties of the map.
74
236
  */
75
- constructor(id: string, props?: MapBaseModelProps);
237
+ constructor(id: string, props?: MapProps);
76
238
  private defaultName;
77
239
  /**
78
240
  * The name of the map.
@@ -84,7 +246,7 @@ declare class MapBaseModel extends StoredClassModel {
84
246
  /**
85
247
  * The function for rendering the image of the map.
86
248
  */
87
- get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
249
+ get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
88
250
  private defaultDisabled;
89
251
  /**
90
252
  * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
@@ -124,70 +286,74 @@ declare class MapBaseModel extends StoredClassModel {
124
286
  }
125
287
 
126
288
  /**
127
- * The activity generated by the room.
289
+ * The base model of a location. I suggest you extend this class to create your own location model.
290
+ * @example
291
+ * ```typescript
292
+ * export const mcHome = new LocationBaseModel('mc_home', mainMap, {
293
+ * name: 'MC Home',
294
+ * icon: "https://icon.jpg",
295
+ * });
296
+ * ```
128
297
  */
129
- declare class ActivityRoom<TRoom extends RoomBaseModel = RoomBaseModel> extends ActivityStoredAbstract {
130
- constructor(id: string, room: TRoom, onRun: OnRunActivityEvent<ActivityStoredAbstract>, props: ActivityProps);
131
- setStorageProperty<T>(_: string, __: T | undefined): void;
132
- getStorageProperty<T>(propertyName: string): T | undefined;
133
- private _id;
134
- get id(): string;
298
+ declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extends StoredClassModel {
135
299
  /**
136
- * The room where the activity is.
300
+ * @param id The id of the location, it must be unique.
301
+ * @param map The map where the location is.
302
+ * @param props The properties of the location.
137
303
  */
138
- private _room;
139
- get room(): TRoom;
140
- export(): object;
141
- }
142
-
143
- declare const ROOM_CATEGORY = "__nqtr-room__";
144
- interface RoomBaseModelProps<TLocation extends LocationBaseModel = LocationBaseModel> {
304
+ constructor(id: string, map: TMap, props?: LocationProps<TMap>);
305
+ private defaultName;
145
306
  /**
146
- * The name
147
- * @default ""
307
+ * The name of the location.
308
+ * If you set undefined, it will return the initial value of name.
148
309
  */
149
- name?: string;
310
+ get name(): string;
311
+ set name(value: string | undefined);
312
+ private defaultDisabled;
150
313
  /**
151
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
152
- * Or an object to manage multiple image types. For example to have a image based on time.
153
- * @example
154
- * ```ts
155
- * {
156
- * "morning": "morning-background.jpg",
157
- * "afternoon": "afternoon-background.jpg",
158
- * "evening": "evening-background.jpg",
159
- * "night": "night-background.jpg"
160
- * }
161
- * ```
162
- * @default undefined
314
+ * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
163
315
  */
164
- renderImage?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props?: OnRenderGraphicItemProps) => GraphicItemType);
316
+ get disabled(): boolean;
317
+ set disabled(value: boolean | string);
318
+ private defaultHidden;
165
319
  /**
166
- * The activities that are available in this room.
167
- * @default []
320
+ * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
168
321
  */
169
- defaultActivities?: ActivityModel[];
322
+ get hidden(): boolean;
323
+ set hidden(value: boolean | string);
324
+ private _renderIcon?;
170
325
  /**
171
- * Whether is disabled. You can also pass a Pixi'VN flag name.
172
- * @default false
326
+ * The function for rendering the icon of the location.
173
327
  */
174
- disabled?: boolean | string;
328
+ get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
329
+ private _map;
175
330
  /**
176
- * Whether is hidden. You can also pass a Pixi'VN flag name.
177
- * @default false
331
+ * The map where the location is.
178
332
  */
179
- hidden?: boolean | string;
333
+ get map(): TMap;
180
334
  /**
181
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
182
- * @default undefined
335
+ * Get the entrance room of the location.
336
+ * You can cast the room to a specific type that extends RoomBaseModel.
337
+ * @returns The entrance room or the first room if there is no entrance.
338
+ * @example
339
+ * ```typescript
340
+ * const entranceHome = new RoomBaseModel("entrance-home", home, { isEntrance: true })
341
+ * saveRoom(entranceHome)
342
+ * const home = new LocationBaseModel("home", map, { name: "Home" })
343
+ *
344
+ * const entrance = home.getEntrance() // entrance === entranceHome
345
+ * ```
183
346
  */
184
- renderIcon?: GraphicItemType | ((room: RoomBaseModel<TLocation>, props?: OnRenderGraphicItemProps) => GraphicItemType);
347
+ getEntrance<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom | undefined;
185
348
  /**
186
- * Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
187
- * @default false
349
+ * Get all rooms in the location.
350
+ * You can cast the rooms to a specific type that extends RoomBaseModel.
351
+ * @returns The rooms in the location.
188
352
  */
189
- isEntrance?: boolean;
353
+ getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
190
354
  }
355
+
356
+ declare const ROOM_CATEGORY = "__nqtr-room__";
191
357
  /**
192
358
  * The base model of a room. I suggest you extend this class to create your own room model.
193
359
  * You must use the saveRoom function to save the room in the registered rooms.
@@ -208,7 +374,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
208
374
  * @param location The location where the room is.
209
375
  * @param props The properties of the room.
210
376
  */
211
- constructor(id: string, location: TLocation, props?: RoomBaseModelProps<TLocation>);
377
+ constructor(id: string, location: TLocation, props?: RoomProps<TLocation>);
212
378
  private _location;
213
379
  /**
214
380
  * The location where the room is.
@@ -230,7 +396,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
230
396
  /**
231
397
  * The function for rendering the image of the room.
232
398
  */
233
- get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
399
+ get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
234
400
  private defaultActivityIds;
235
401
  /**
236
402
  * The activities that are available in this room.
@@ -289,7 +455,7 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
289
455
  /**
290
456
  * The function for rendering the icon of the room.
291
457
  */
292
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
458
+ get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
293
459
  /**
294
460
  * Get the character commitments of the room.
295
461
  * @returns The character commitments of the room.
@@ -297,165 +463,6 @@ declare class RoomBaseModel<TLocation extends LocationBaseModel = LocationBaseMo
297
463
  getRoutine<TCommitment extends CommitmentBaseModel = CommitmentBaseModel>(): TCommitment[];
298
464
  }
299
465
 
300
- interface LocationBaseModelProps<TMap extends MapBaseModel = MapBaseModel> {
301
- /**
302
- * The name
303
- * @default ""
304
- */
305
- name?: string;
306
- /**
307
- * Whether is disabled. You can also pass a Pixi'VN flag name.
308
- * @default false
309
- */
310
- disabled?: boolean | string;
311
- /**
312
- * Whether is hidden. You can also pass a Pixi'VN flag name.
313
- * @default false
314
- */
315
- hidden?: boolean | string;
316
- /**
317
- * The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
318
- * @default undefined
319
- */
320
- renderIcon?: GraphicItemType | ((location: LocationBaseModel<TMap>, props?: OnRenderGraphicItemProps) => GraphicItemType);
321
- }
322
- /**
323
- * The base model of a location. I suggest you extend this class to create your own location model.
324
- * @example
325
- * ```typescript
326
- * export const mcHome = new LocationBaseModel('mc_home', mainMap, {
327
- * name: 'MC Home',
328
- * icon: "https://icon.jpg",
329
- * });
330
- * ```
331
- */
332
- declare class LocationBaseModel<TMap extends MapBaseModel = MapBaseModel> extends StoredClassModel {
333
- /**
334
- * @param id The id of the location, it must be unique.
335
- * @param map The map where the location is.
336
- * @param props The properties of the location.
337
- */
338
- constructor(id: string, map: TMap, props?: LocationBaseModelProps<TMap>);
339
- private defaultName;
340
- /**
341
- * The name of the location.
342
- * If you set undefined, it will return the initial value of name.
343
- */
344
- get name(): string;
345
- set name(value: string | undefined);
346
- private defaultDisabled;
347
- /**
348
- * Whether is disabled. If it is a string, it is a Pixi'VN flag name.
349
- */
350
- get disabled(): boolean;
351
- set disabled(value: boolean | string);
352
- private defaultHidden;
353
- /**
354
- * Whether is hidden. If it is a string, it is a Pixi'VN flag name.
355
- */
356
- get hidden(): boolean;
357
- set hidden(value: boolean | string);
358
- private _renderIcon?;
359
- /**
360
- * The function for rendering the icon of the location.
361
- */
362
- get renderIcon(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
363
- private _map;
364
- /**
365
- * The map where the location is.
366
- */
367
- get map(): TMap;
368
- /**
369
- * Get the entrance room of the location.
370
- * You can cast the room to a specific type that extends RoomBaseModel.
371
- * @returns The entrance room or the first room if there is no entrance.
372
- * @example
373
- * ```typescript
374
- * const entranceHome = new RoomBaseModel("entrance-home", home, { isEntrance: true })
375
- * saveRoom(entranceHome)
376
- * const home = new LocationBaseModel("home", map, { name: "Home" })
377
- *
378
- * const entrance = home.getEntrance() // entrance === entranceHome
379
- * ```
380
- */
381
- getEntrance<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom | undefined;
382
- /**
383
- * Get all rooms in the location.
384
- * You can cast the rooms to a specific type that extends RoomBaseModel.
385
- * @returns The rooms in the location.
386
- */
387
- getRooms<TRoom extends RoomBaseModel = RoomBaseModel>(): TRoom[];
388
- }
389
-
390
- interface CommitmentBaseModelProps<TCharacter extends CharacterBaseModel = CharacterBaseModel, TRoom extends RoomBaseModel = RoomBaseModel> {
391
- /**
392
- * The name
393
- * @default ""
394
- */
395
- name?: string;
396
- /**
397
- * The hour when the commitment starts. If the commitment is not started yet, it will be hidden.
398
- * If you set 3, the commitment will be hidden into hours 1 and 2, and will be shown from hour 3.
399
- * @default TimeManager.minDayHours
400
- */
401
- fromHour?: number;
402
- /**
403
- * The hour when the commitment ends. If the commitment is ended yet, it will be hidden.
404
- * If you set 3, the commitment will be shown into hours 1 and 2 and will be hidden from hour 3.
405
- * @default TimeManager.maxDayHours + 1
406
- */
407
- toHour?: number;
408
- /**
409
- * The day when the commitment starts. If the commitment is not started yet, it will be hidden.
410
- * If you set 3, the commitment will be hidden into days 1 and 2, and will be shown from day 3.
411
- * @default undefined
412
- */
413
- fromDay?: number;
414
- /**
415
- * The day when the commitment ends. If the commitment is ended yet, it will be deleted or hidden.
416
- * If you set 3, the commitment will be shown into days 1 and 2 and will be deleted or hidden from day 3.
417
- * @default undefined
418
- */
419
- toDay?: number;
420
- /**
421
- * The image. It can be a string, an Element or a Pixi'VN Canvas Item.
422
- * Or an object to manage multiple image types. For example to have a image based on time.
423
- * @example
424
- * ```ts
425
- * {
426
- * "morning": "morning-background.jpg",
427
- * "afternoon": "afternoon-background.jpg",
428
- * "evening": "evening-background.jpg",
429
- * "night": "night-background.jpg"
430
- * }
431
- * ```
432
- * @default undefined
433
- */
434
- renderImage?: GraphicItemType | ((commitment: CommitmentBaseModel<TCharacter, TRoom>, props?: OnRenderGraphicItemProps) => GraphicItemType);
435
- /**
436
- * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
437
- * @default ExecutionTypeEnum.INTERACTION
438
- */
439
- executionType?: ExecutionTypeEnum;
440
- /**
441
- * Is a function that is called when the player interacts with the character.
442
- * @param commitment
443
- * @returns
444
- * @default undefined
445
- */
446
- onRun?: (commitment: CommitmentBaseModel) => void;
447
- /**
448
- * Whether is disabled. You can also pass a Pixi'VN flag name.
449
- * If it is disabled this commitment will not be taken into consideration. So the characters will not be in the room, but will be busy with other commitments.
450
- * @default false
451
- */
452
- disabled?: boolean | string;
453
- /**
454
- * Whether is hidden. You can also pass a Pixi'VN flag name.
455
- * @default false
456
- */
457
- hidden?: boolean | string;
458
- }
459
466
  /**
460
467
  * The base model of a commitment. I suggest you extend this class to create your own commitment model.
461
468
  * You must use the saveRoom function to save the commitment in the registered commitments.
@@ -468,7 +475,7 @@ interface CommitmentBaseModelProps<TCharacter extends CharacterBaseModel = Chara
468
475
  * onRun: (commitment) => {
469
476
  * // Do something
470
477
  * }
471
- })
478
+ * })
472
479
  * saveCommitment(mcRoom)
473
480
  * ```
474
481
  */
@@ -479,7 +486,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
479
486
  * @param room The room where the commitment is.
480
487
  * @param props The properties of the commitment.
481
488
  */
482
- constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentBaseModelProps<TCharacter, TRoom>);
489
+ constructor(id: string, character: TCharacter | TCharacter[] | undefined, room: TRoom, props: CommitmentProps<TCharacter, TRoom>);
483
490
  private _characters;
484
491
  /**
485
492
  * The character or characters that are in the commitment and so in the room.
@@ -527,7 +534,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
527
534
  /**
528
535
  * The function for rendering the image of the room.
529
536
  */
530
- get renderImage(): ((props?: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
537
+ get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
531
538
  private _executionType;
532
539
  /**
533
540
  * Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
@@ -537,7 +544,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
537
544
  /**
538
545
  * Is a function that is called when the player interacts with the character.
539
546
  */
540
- onRun(): void;
547
+ onRun(): undefined | ((props: OnRunActivityProps) => void);
541
548
  private defaultDisabled;
542
549
  /**
543
550
  * Whether is disabled. You can also pass a Pixi'VN flag name.
@@ -557,4 +564,4 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
557
564
  isExpired(): boolean;
558
565
  }
559
566
 
560
- export { ActivityRoom as A, CommitmentBaseModel as C, LocationBaseModel as L, MapBaseModel as M, RoomBaseModel as R, type CommitmentBaseModelProps as a, type LocationBaseModelProps as b, type MapBaseModelProps as c, type RoomBaseModelProps as d, ROOM_CATEGORY as e };
567
+ export { ActivityRoom as A, CommitmentBaseModel as C, LocationBaseModel as L, MapBaseModel as M, RoomBaseModel as R, type CommitmentProps as a, type LocationProps as b, type MapProps as c, type RoomProps as d, ROOM_CATEGORY as e };
@@ -1,12 +1,13 @@
1
- import Goal from './classes/quest/Goal.mjs';
2
1
  import { StoredClassModel } from '@drincs/pixi-vn';
2
+ import Goal from './classes/quest/Goal.mjs';
3
+ import QuestProps from './interface/quest/QuestProps.mjs';
3
4
 
4
5
  type QuestsRequiredType<TQuest extends QuestBaseModel = QuestBaseModel> = {
5
6
  quest: TQuest;
6
7
  stageNumber: number;
7
8
  } | TQuest;
8
9
 
9
- interface StageBaseModelProps {
10
+ interface StageProps {
10
11
  goals?: Goal[];
11
12
  name?: string;
12
13
  description?: string;
@@ -19,8 +20,9 @@ interface StageBaseModelProps {
19
20
  onStart: () => void;
20
21
  onEnd: () => void;
21
22
  }
23
+
22
24
  declare class StageBaseModel extends StoredClassModel {
23
- constructor(id: string, props: StageBaseModelProps);
25
+ constructor(id: string, props: StageProps);
24
26
  private _completed;
25
27
  get completed(): boolean;
26
28
  private _active;
@@ -50,15 +52,8 @@ declare class StageBaseModel extends StoredClassModel {
50
52
  get onEnd(): () => void;
51
53
  }
52
54
 
53
- interface QuestBaseModelProps {
54
- name?: string;
55
- description?: string;
56
- icon?: string;
57
- image?: string;
58
- isInDevelopment?: boolean;
59
- }
60
55
  declare class QuestBaseModel<TStage extends StageBaseModel = StageBaseModel> extends StoredClassModel {
61
- constructor(id: string, stages: TStage[], props: QuestBaseModelProps);
56
+ constructor(id: string, stages: TStage[], props: QuestProps);
62
57
  private _stages;
63
58
  get stages(): TStage[];
64
59
  private _name;
@@ -73,4 +68,4 @@ declare class QuestBaseModel<TStage extends StageBaseModel = StageBaseModel> ext
73
68
  get isInDevelopment(): boolean;
74
69
  }
75
70
 
76
- export { QuestBaseModel as Q, StageBaseModel as S, type QuestBaseModelProps as a, type StageBaseModelProps as b, type QuestsRequiredType as c };
71
+ export { QuestBaseModel as Q, StageBaseModel as S, type StageProps as a, type QuestsRequiredType as b };
@@ -1,12 +1,13 @@
1
- import Goal from './classes/quest/Goal.js';
2
1
  import { StoredClassModel } from '@drincs/pixi-vn';
2
+ import Goal from './classes/quest/Goal.js';
3
+ import QuestProps from './interface/quest/QuestProps.js';
3
4
 
4
5
  type QuestsRequiredType<TQuest extends QuestBaseModel = QuestBaseModel> = {
5
6
  quest: TQuest;
6
7
  stageNumber: number;
7
8
  } | TQuest;
8
9
 
9
- interface StageBaseModelProps {
10
+ interface StageProps {
10
11
  goals?: Goal[];
11
12
  name?: string;
12
13
  description?: string;
@@ -19,8 +20,9 @@ interface StageBaseModelProps {
19
20
  onStart: () => void;
20
21
  onEnd: () => void;
21
22
  }
23
+
22
24
  declare class StageBaseModel extends StoredClassModel {
23
- constructor(id: string, props: StageBaseModelProps);
25
+ constructor(id: string, props: StageProps);
24
26
  private _completed;
25
27
  get completed(): boolean;
26
28
  private _active;
@@ -50,15 +52,8 @@ declare class StageBaseModel extends StoredClassModel {
50
52
  get onEnd(): () => void;
51
53
  }
52
54
 
53
- interface QuestBaseModelProps {
54
- name?: string;
55
- description?: string;
56
- icon?: string;
57
- image?: string;
58
- isInDevelopment?: boolean;
59
- }
60
55
  declare class QuestBaseModel<TStage extends StageBaseModel = StageBaseModel> extends StoredClassModel {
61
- constructor(id: string, stages: TStage[], props: QuestBaseModelProps);
56
+ constructor(id: string, stages: TStage[], props: QuestProps);
62
57
  private _stages;
63
58
  get stages(): TStage[];
64
59
  private _name;
@@ -73,4 +68,4 @@ declare class QuestBaseModel<TStage extends StageBaseModel = StageBaseModel> ext
73
68
  get isInDevelopment(): boolean;
74
69
  }
75
70
 
76
- export { QuestBaseModel as Q, StageBaseModel as S, type QuestBaseModelProps as a, type StageBaseModelProps as b, type QuestsRequiredType as c };
71
+ export { QuestBaseModel as Q, StageBaseModel as S, type StageProps as a, type QuestsRequiredType as b };