@drincs/nqtr 0.2.0 → 0.2.2

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 (117) hide show
  1. package/dist/{StageProps-xLLR0rjD.d.mts → StageProps-D002cyay.d.mts} +109 -2
  2. package/dist/{StageProps-DCZkZHwZ.d.ts → StageProps-DleWO-vf.d.ts} +109 -2
  3. package/dist/classes/Commitment.d.mts +2 -2
  4. package/dist/classes/Commitment.d.ts +2 -2
  5. package/dist/classes/index.d.mts +4 -4
  6. package/dist/classes/index.d.ts +4 -4
  7. package/dist/classes/index.js +38 -131
  8. package/dist/classes/index.js.map +1 -1
  9. package/dist/classes/index.mjs +40 -132
  10. package/dist/classes/index.mjs.map +1 -1
  11. package/dist/classes/navigation/ActivityRoom.d.mts +2 -2
  12. package/dist/classes/navigation/ActivityRoom.d.ts +2 -2
  13. package/dist/classes/navigation/Location.d.mts +3 -3
  14. package/dist/classes/navigation/Location.d.ts +3 -3
  15. package/dist/classes/navigation/Map.d.mts +3 -3
  16. package/dist/classes/navigation/Map.d.ts +3 -3
  17. package/dist/classes/navigation/Room.d.mts +1 -1
  18. package/dist/classes/navigation/Room.d.ts +1 -1
  19. package/dist/classes/navigation/Room.js +43 -43
  20. package/dist/classes/navigation/Room.js.map +1 -1
  21. package/dist/classes/navigation/Room.mjs +43 -43
  22. package/dist/classes/navigation/Room.mjs.map +1 -1
  23. package/dist/classes/quest/Goal.d.mts +18 -0
  24. package/dist/classes/quest/Goal.d.ts +18 -0
  25. package/dist/classes/quest/Goal.js +18 -0
  26. package/dist/classes/quest/Goal.js.map +1 -1
  27. package/dist/classes/quest/Goal.mjs +18 -0
  28. package/dist/classes/quest/Goal.mjs.map +1 -1
  29. package/dist/classes/quest/Quest.d.mts +1 -1
  30. package/dist/classes/quest/Quest.d.ts +1 -1
  31. package/dist/classes/quest/Quest.js +206 -25
  32. package/dist/classes/quest/Quest.js.map +1 -1
  33. package/dist/classes/quest/Quest.mjs +206 -25
  34. package/dist/classes/quest/Quest.mjs.map +1 -1
  35. package/dist/classes/quest/Stage.d.mts +1 -1
  36. package/dist/classes/quest/Stage.d.ts +1 -1
  37. package/dist/classes/quest/Stage.js +95 -8
  38. package/dist/classes/quest/Stage.js.map +1 -1
  39. package/dist/classes/quest/Stage.mjs +95 -8
  40. package/dist/classes/quest/Stage.mjs.map +1 -1
  41. package/dist/decorators/ActivityDecorator.d.mts +10 -11
  42. package/dist/decorators/ActivityDecorator.d.ts +10 -11
  43. package/dist/decorators/ActivityDecorator.js +384 -9
  44. package/dist/decorators/ActivityDecorator.js.map +1 -1
  45. package/dist/decorators/ActivityDecorator.mjs +384 -9
  46. package/dist/decorators/ActivityDecorator.mjs.map +1 -1
  47. package/dist/decorators/CommitmentDecorator.d.mts +3 -3
  48. package/dist/decorators/CommitmentDecorator.d.ts +3 -3
  49. package/dist/decorators/CommitmentDecorator.js +1 -1
  50. package/dist/decorators/CommitmentDecorator.js.map +1 -1
  51. package/dist/decorators/CommitmentDecorator.mjs +1 -1
  52. package/dist/decorators/CommitmentDecorator.mjs.map +1 -1
  53. package/dist/decorators/QuestDecorator.d.mts +4 -3
  54. package/dist/decorators/QuestDecorator.d.ts +4 -3
  55. package/dist/decorators/QuestDecorator.js +206 -25
  56. package/dist/decorators/QuestDecorator.js.map +1 -1
  57. package/dist/decorators/QuestDecorator.mjs +206 -25
  58. package/dist/decorators/QuestDecorator.mjs.map +1 -1
  59. package/dist/decorators/RoomDecorator.d.mts +3 -3
  60. package/dist/decorators/RoomDecorator.d.ts +3 -3
  61. package/dist/decorators/index.d.mts +3 -3
  62. package/dist/decorators/index.d.ts +3 -3
  63. package/dist/decorators/index.js +427 -115
  64. package/dist/decorators/index.js.map +1 -1
  65. package/dist/decorators/index.mjs +428 -116
  66. package/dist/decorators/index.mjs.map +1 -1
  67. package/dist/functions/ActivityFunctions.d.mts +3 -3
  68. package/dist/functions/ActivityFunctions.d.ts +3 -3
  69. package/dist/functions/ActivityFunctions.js.map +1 -1
  70. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  71. package/dist/functions/NavigationFunctions.d.mts +3 -3
  72. package/dist/functions/NavigationFunctions.d.ts +3 -3
  73. package/dist/functions/NavigationFunctions.js.map +1 -1
  74. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  75. package/dist/functions/QuestFunctions.d.mts +8 -0
  76. package/dist/functions/QuestFunctions.d.ts +8 -0
  77. package/dist/functions/QuestFunctions.js +21 -0
  78. package/dist/functions/QuestFunctions.js.map +1 -0
  79. package/dist/functions/QuestFunctions.mjs +19 -0
  80. package/dist/functions/QuestFunctions.mjs.map +1 -0
  81. package/dist/functions/RoutineFunctions.d.mts +3 -3
  82. package/dist/functions/RoutineFunctions.d.ts +3 -3
  83. package/dist/functions/RoutineFunctions.js.map +1 -1
  84. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  85. package/dist/functions/index.d.mts +4 -3
  86. package/dist/functions/index.d.ts +4 -3
  87. package/dist/functions/index.js +13 -0
  88. package/dist/functions/index.js.map +1 -1
  89. package/dist/functions/index.mjs +13 -1
  90. package/dist/functions/index.mjs.map +1 -1
  91. package/dist/index.d.mts +6 -5
  92. package/dist/index.d.ts +6 -5
  93. package/dist/index.js +354 -166
  94. package/dist/index.js.map +1 -1
  95. package/dist/index.mjs +354 -166
  96. package/dist/index.mjs.map +1 -1
  97. package/dist/interface/CommitmentProps.d.mts +2 -2
  98. package/dist/interface/CommitmentProps.d.ts +2 -2
  99. package/dist/interface/RoomProps.d.mts +2 -2
  100. package/dist/interface/RoomProps.d.ts +2 -2
  101. package/dist/interface/index.d.mts +3 -3
  102. package/dist/interface/index.d.ts +3 -3
  103. package/dist/interface/navigation/LocationProps.d.mts +3 -3
  104. package/dist/interface/navigation/LocationProps.d.ts +3 -3
  105. package/dist/interface/navigation/MapProps.d.mts +3 -3
  106. package/dist/interface/navigation/MapProps.d.ts +3 -3
  107. package/dist/interface/quest/QuestProps.d.mts +1 -1
  108. package/dist/interface/quest/QuestProps.d.ts +1 -1
  109. package/dist/interface/quest/StageProps.d.mts +1 -1
  110. package/dist/interface/quest/StageProps.d.ts +1 -1
  111. package/dist/types/QuestsRequired.d.mts +1 -1
  112. package/dist/types/QuestsRequired.d.ts +1 -1
  113. package/dist/types/index.d.mts +1 -1
  114. package/dist/types/index.d.ts +1 -1
  115. package/package.json +1 -1
  116. package/dist/{Commitment-BJTIpBQ5.d.ts → Commitment-D3LPSbFX.d.ts} +2 -2
  117. package/dist/{Commitment-CtNWnNQX.d.mts → Commitment-Eox2652k.d.mts} +2 -2
@@ -1,4 +1,4 @@
1
- import { getFlag, StoredClassModel, GameStorageManager } from '@drincs/pixi-vn';
1
+ import { StoredClassModel, getFlag, GameStorageManager } from '@drincs/pixi-vn';
2
2
 
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropSymbols = Object.getOwnPropertySymbols;
@@ -259,136 +259,7 @@ var TimeManager = class _TimeManager {
259
259
  }
260
260
  };
261
261
 
262
- // src/classes/Activity.ts
263
- var ActivityModel = class {
264
- /**
265
- * @param id The activity id, that must be unique.
266
- * @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
267
- * @param props The activity properties.
268
- */
269
- constructor(id, onRun, props) {
270
- this._id = id;
271
- this._name = props.name;
272
- this._fromHour = props.fromHour;
273
- this._toHour = props.toHour;
274
- this._fromDay = props.fromDay;
275
- this._toDay = props.toDay;
276
- this._disabled = props.disabled || false;
277
- this._hidden = props.hidden || false;
278
- this._renderIcon = props.renderIcon;
279
- this._onRun = onRun;
280
- }
281
- /**
282
- * The activity id, that is unique.
283
- */
284
- get id() {
285
- return this._id;
286
- }
287
- /**
288
- * The name
289
- */
290
- get name() {
291
- return this._name;
292
- }
293
- /**
294
- * The hour when the activity starts. If the activity is not started yet, it will be hidden.
295
- */
296
- get fromHour() {
297
- return this._fromHour;
298
- }
299
- /**
300
- * The hour when the activity ends. If the activity is ended yet, it will be hidden.
301
- */
302
- get toHour() {
303
- return this._toHour;
304
- }
305
- /**
306
- * The day when the activity starts. If the activity is not started yet, it will be hidden.
307
- */
308
- get fromDay() {
309
- return this._fromDay;
310
- }
311
- /**
312
- * The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
313
- */
314
- get toDay() {
315
- return this._toDay;
316
- }
317
- /**
318
- * Whether is disabled.
319
- */
320
- get disabled() {
321
- if (typeof this._disabled === "string") {
322
- return getFlag(this._disabled);
323
- }
324
- return this._disabled;
325
- }
326
- /**
327
- * Whether is hidden. If the activity is not started yet, it will be hidden.
328
- */
329
- get hidden() {
330
- if (this.fromDay && this.fromDay > TimeManager.currentDay) {
331
- return true;
332
- }
333
- if (!this.isDeadline) {
334
- return true;
335
- }
336
- if (typeof this._hidden === "string") {
337
- return getFlag(this._hidden);
338
- }
339
- return this._hidden;
340
- }
341
- /**
342
- * The function for rendering the icon of the activity.
343
- */
344
- get renderIcon() {
345
- let render = this._renderIcon;
346
- if (render === void 0) {
347
- return void 0;
348
- }
349
- if (typeof render === "function") {
350
- return (props) => {
351
- return render(this, props);
352
- };
353
- }
354
- return (props) => render;
355
- }
356
- get _initialOnRun() {
357
- return this._onRun;
358
- }
359
- /**
360
- * The function that is called when the activity is runned.
361
- */
362
- get run() {
363
- return (props) => this._onRun(this, props);
364
- }
365
- /**
366
- * Whether the activity is a deadline.
367
- * @returns Whether the activity is a deadline.
368
- */
369
- isDeadline() {
370
- if (this.toDay && this.toDay <= TimeManager.currentDay) {
371
- return true;
372
- }
373
- return false;
374
- }
375
- /**
376
- * Export the activity properties.
377
- * @returns The activity properties.
378
- */
379
- export() {
380
- return {
381
- name: this._name,
382
- fromHour: this._fromHour,
383
- toHour: this._toHour,
384
- fromDay: this._fromDay,
385
- toDay: this._toDay,
386
- disabled: this._disabled,
387
- hidden: this._hidden,
388
- renderIcon: this._renderIcon
389
- };
390
- }
391
- };
262
+ // src/classes/Commitment.ts
392
263
  var COMMITMENT_CATEGORY = "__nqtr-commitment__";
393
264
  var CommitmentBaseModel = class extends StoredClassModel {
394
265
  /**
@@ -1035,9 +906,15 @@ var Goal = class extends StoredClassModel {
1035
906
  get description() {
1036
907
  return this._description;
1037
908
  }
909
+ /**
910
+ * The number of times the goal must be completed.
911
+ */
1038
912
  get need() {
1039
913
  return this._need;
1040
914
  }
915
+ /**
916
+ * The default number of times the goal has been completed.
917
+ */
1041
918
  get defaultHave() {
1042
919
  return this._defaultHave;
1043
920
  }
@@ -1061,12 +938,21 @@ var Stage = class extends StoredClassModel {
1061
938
  this._onStart = props.onStart;
1062
939
  this._onEnd = props.onEnd;
1063
940
  }
941
+ /**
942
+ * The name of the stage.
943
+ */
1064
944
  get name() {
1065
945
  return this._name;
1066
946
  }
947
+ /**
948
+ * The description of the stage.
949
+ */
1067
950
  get description() {
1068
951
  return this._description;
1069
952
  }
953
+ /**
954
+ * The advice description of the stage.
955
+ */
1070
956
  get adviceDescription() {
1071
957
  return this._adviceDescription;
1072
958
  }
@@ -1085,6 +971,10 @@ var Stage = class extends StoredClassModel {
1085
971
  }
1086
972
  return (props) => render;
1087
973
  }
974
+ /**
975
+ * The list of goals that the player needs to complete to finish the stage.
976
+ * This is the list set by the developer. if you want to get the current goals, use the goals property.
977
+ */
1088
978
  get defaultGoals() {
1089
979
  return this._defaultGoals;
1090
980
  }
@@ -1094,21 +984,39 @@ var Stage = class extends StoredClassModel {
1094
984
  get flags() {
1095
985
  return this._flags;
1096
986
  }
987
+ /**
988
+ * The number of days required to start the stage.
989
+ */
1097
990
  get daysRequiredToStart() {
1098
991
  return this._daysRequiredToStart || 0;
1099
992
  }
993
+ /**
994
+ * The list of flags required to start the stage.
995
+ */
1100
996
  get flagsRequiredToStart() {
1101
997
  return this._flagsRequiredToStart;
1102
998
  }
999
+ /**
1000
+ * The list of quests required to start the stage.
1001
+ */
1103
1002
  get questsRequiredToStart() {
1104
1003
  return this._questsRequiredToStart || [];
1105
1004
  }
1005
+ /**
1006
+ * The description of the request to start the stage.
1007
+ */
1106
1008
  get requestDescriptionToStart() {
1107
1009
  return this._requestDescriptionToStart;
1108
1010
  }
1011
+ /**
1012
+ * The function that will be called when the stage starts.
1013
+ */
1109
1014
  get onStart() {
1110
1015
  return this._onStart;
1111
1016
  }
1017
+ /**
1018
+ * The function that will be called when the stage ends.
1019
+ */
1112
1020
  get onEnd() {
1113
1021
  return this._onEnd;
1114
1022
  }
@@ -1385,6 +1293,6 @@ var RoomBaseModel = class extends StoredClassModel {
1385
1293
  }
1386
1294
  };
1387
1295
 
1388
- export { ActivityModel, ActivityRoom, CommitmentBaseModel, Goal, LocationBaseModel, MapBaseModel, RoomBaseModel, Stage };
1296
+ export { ActivityRoom, CommitmentBaseModel, Goal, LocationBaseModel, MapBaseModel, RoomBaseModel, Stage };
1389
1297
  //# sourceMappingURL=out.js.map
1390
1298
  //# sourceMappingURL=index.mjs.map