@drincs/nqtr 0.2.5 → 0.2.7

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 (85) hide show
  1. package/dist/{StageProps-vR-NLl0n.d.ts → StageProps-Bok_NwL7.d.ts} +29 -11
  2. package/dist/{StageProps-W85kcacG.d.mts → StageProps-CFQizpZF.d.mts} +29 -11
  3. package/dist/classes/index.d.mts +1 -1
  4. package/dist/classes/index.d.ts +1 -1
  5. package/dist/classes/index.js +34 -2
  6. package/dist/classes/index.js.map +1 -1
  7. package/dist/classes/index.mjs +34 -2
  8. package/dist/classes/index.mjs.map +1 -1
  9. package/dist/classes/navigation/Room.js.map +1 -1
  10. package/dist/classes/navigation/Room.mjs.map +1 -1
  11. package/dist/classes/quest/Quest.d.mts +1 -1
  12. package/dist/classes/quest/Quest.d.ts +1 -1
  13. package/dist/classes/quest/Quest.js +34 -2
  14. package/dist/classes/quest/Quest.js.map +1 -1
  15. package/dist/classes/quest/Quest.mjs +34 -2
  16. package/dist/classes/quest/Quest.mjs.map +1 -1
  17. package/dist/classes/quest/Stage.d.mts +1 -1
  18. package/dist/classes/quest/Stage.d.ts +1 -1
  19. package/dist/classes/quest/Stage.js +10 -2
  20. package/dist/classes/quest/Stage.js.map +1 -1
  21. package/dist/classes/quest/Stage.mjs +10 -2
  22. package/dist/classes/quest/Stage.mjs.map +1 -1
  23. package/dist/decorators/QuestDecorator.d.mts +1 -1
  24. package/dist/decorators/QuestDecorator.d.ts +1 -1
  25. package/dist/decorators/QuestDecorator.js +34 -2
  26. package/dist/decorators/QuestDecorator.js.map +1 -1
  27. package/dist/decorators/QuestDecorator.mjs +34 -2
  28. package/dist/decorators/QuestDecorator.mjs.map +1 -1
  29. package/dist/decorators/index.d.mts +1 -1
  30. package/dist/decorators/index.d.ts +1 -1
  31. package/dist/decorators/index.js +34 -2
  32. package/dist/decorators/index.js.map +1 -1
  33. package/dist/decorators/index.mjs +34 -2
  34. package/dist/decorators/index.mjs.map +1 -1
  35. package/dist/functions/ActivityFunctions.js.map +1 -1
  36. package/dist/functions/ActivityFunctions.mjs.map +1 -1
  37. package/dist/functions/NavigationFunctions.js.map +1 -1
  38. package/dist/functions/NavigationFunctions.mjs.map +1 -1
  39. package/dist/functions/QuestFunctions.d.mts +2 -2
  40. package/dist/functions/QuestFunctions.d.ts +2 -2
  41. package/dist/functions/QuestFunctions.js.map +1 -1
  42. package/dist/functions/QuestFunctions.mjs.map +1 -1
  43. package/dist/functions/RoutineFunctions.js.map +1 -1
  44. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  45. package/dist/functions/index.js.map +1 -1
  46. package/dist/functions/index.mjs.map +1 -1
  47. package/dist/index.d.mts +1 -1
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +34 -2
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +34 -2
  52. package/dist/index.mjs.map +1 -1
  53. package/dist/interface/index.d.mts +1 -1
  54. package/dist/interface/index.d.ts +1 -1
  55. package/dist/interface/quest/QuestProps.d.mts +1 -1
  56. package/dist/interface/quest/QuestProps.d.ts +1 -1
  57. package/dist/interface/quest/StageProps.d.mts +1 -1
  58. package/dist/interface/quest/StageProps.d.ts +1 -1
  59. package/dist/override/{OnStartStageQuest.d.mts → OnStartEndStageQuest.d.mts} +3 -3
  60. package/dist/override/{OnStartStageQuest.d.ts → OnStartEndStageQuest.d.ts} +3 -3
  61. package/dist/override/OnStartEndStageQuest.js +4 -0
  62. package/dist/override/OnStartEndStageQuest.mjs +3 -0
  63. package/dist/override/index.d.mts +1 -3
  64. package/dist/override/index.d.ts +1 -3
  65. package/dist/types/QuestsRequired.d.mts +1 -1
  66. package/dist/types/QuestsRequired.d.ts +1 -1
  67. package/dist/types/index.d.mts +1 -1
  68. package/dist/types/index.d.ts +1 -1
  69. package/package.json +2 -2
  70. package/dist/override/OnEndStageQuest.d.mts +0 -19
  71. package/dist/override/OnEndStageQuest.d.ts +0 -19
  72. package/dist/override/OnEndStageQuest.js +0 -4
  73. package/dist/override/OnEndStageQuest.mjs +0 -3
  74. package/dist/override/OnNextStageQuest.d.mts +0 -19
  75. package/dist/override/OnNextStageQuest.d.ts +0 -19
  76. package/dist/override/OnNextStageQuest.js +0 -4
  77. package/dist/override/OnNextStageQuest.js.map +0 -1
  78. package/dist/override/OnNextStageQuest.mjs +0 -3
  79. package/dist/override/OnNextStageQuest.mjs.map +0 -1
  80. package/dist/override/OnStartStageQuest.js +0 -4
  81. package/dist/override/OnStartStageQuest.js.map +0 -1
  82. package/dist/override/OnStartStageQuest.mjs +0 -3
  83. package/dist/override/OnStartStageQuest.mjs.map +0 -1
  84. /package/dist/override/{OnEndStageQuest.js.map → OnStartEndStageQuest.js.map} +0 -0
  85. /package/dist/override/{OnEndStageQuest.mjs.map → OnStartEndStageQuest.mjs.map} +0 -0
@@ -1062,13 +1062,21 @@ var Stage = class extends StoredClassModel {
1062
1062
  * The function that will be called when the stage starts.
1063
1063
  */
1064
1064
  get onStart() {
1065
- return this._onStart;
1065
+ let onStart = this._onStart;
1066
+ if (onStart === void 0) {
1067
+ return void 0;
1068
+ }
1069
+ return (props) => onStart(this, props);
1066
1070
  }
1067
1071
  /**
1068
1072
  * The function that will be called when the stage ends.
1069
1073
  */
1070
1074
  get onEnd() {
1071
- return this._onEnd;
1075
+ let onEnd = this._onEnd;
1076
+ if (onEnd === void 0) {
1077
+ return void 0;
1078
+ }
1079
+ return (props) => onEnd(this, props);
1072
1080
  }
1073
1081
  };
1074
1082
  var StageQuest = class extends Stage {
@@ -1190,6 +1198,8 @@ var Quest = class extends StoredClassModel {
1190
1198
  this._renderIcon = props.renderIcon;
1191
1199
  this._renderImage = props.renderImage;
1192
1200
  this._isInDevelopment = props.isInDevelopment || false;
1201
+ this._onStart = props.onStart;
1202
+ this._onNextStage = props.onNextStage;
1193
1203
  }
1194
1204
  /**
1195
1205
  * The stages of the quest.
@@ -1281,6 +1291,26 @@ var Quest = class extends StoredClassModel {
1281
1291
  }
1282
1292
  return this.currentStageIndex > this.stages.length - 1;
1283
1293
  }
1294
+ /**
1295
+ * The function that will be called when the quest starts.
1296
+ */
1297
+ get onStart() {
1298
+ let onStart = this._onStart;
1299
+ if (onStart === void 0) {
1300
+ return void 0;
1301
+ }
1302
+ return (props) => onStart(this, props);
1303
+ }
1304
+ /**
1305
+ * The function that will be called when the quest goes to the next stage.
1306
+ */
1307
+ get onNextStage() {
1308
+ let onNext = this._onNextStage;
1309
+ if (onNext === void 0) {
1310
+ return void 0;
1311
+ }
1312
+ return (props) => onNext(this, props);
1313
+ }
1284
1314
  /**
1285
1315
  * Start the quest.
1286
1316
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
@@ -1298,6 +1328,7 @@ var Quest = class extends StoredClassModel {
1298
1328
  this.currentStageIndex = 0;
1299
1329
  let currentStage = this.currentStage;
1300
1330
  if (currentStage && currentStage.start) {
1331
+ this.onStart && this.onStart(props);
1301
1332
  return currentStage.start(props);
1302
1333
  } else {
1303
1334
  console.error(`[NQTR] Quest ${this.id} has no start stage`);
@@ -1366,6 +1397,7 @@ var Quest = class extends StoredClassModel {
1366
1397
  return false;
1367
1398
  }
1368
1399
  this.currentStageIndex = currentStageIndex + 1;
1400
+ this.onNextStage && this.onNextStage(endProps);
1369
1401
  if (prevStage && prevStage.onEnd) {
1370
1402
  prevStage.onEnd(endProps);
1371
1403
  }