@drincs/nqtr 0.2.8 → 0.2.9

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 (61) hide show
  1. package/dist/{StageProps-ssZax5Ip.d.ts → StageProps-CCjGI625.d.ts} +4 -4
  2. package/dist/{StageProps-vuObH5D2.d.mts → StageProps-CuE_n1Wg.d.mts} +4 -4
  3. package/dist/classes/index.d.mts +1 -1
  4. package/dist/classes/index.d.ts +1 -1
  5. package/dist/classes/index.js +8 -24
  6. package/dist/classes/index.js.map +1 -1
  7. package/dist/classes/index.mjs +8 -24
  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 +8 -24
  14. package/dist/classes/quest/Quest.js.map +1 -1
  15. package/dist/classes/quest/Quest.mjs +8 -24
  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 +3 -11
  20. package/dist/classes/quest/Stage.js.map +1 -1
  21. package/dist/classes/quest/Stage.mjs +3 -11
  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 +8 -24
  26. package/dist/decorators/QuestDecorator.js.map +1 -1
  27. package/dist/decorators/QuestDecorator.mjs +8 -24
  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 +8 -24
  32. package/dist/decorators/index.js.map +1 -1
  33. package/dist/decorators/index.mjs +8 -24
  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.js.map +1 -1
  40. package/dist/functions/QuestFunctions.mjs.map +1 -1
  41. package/dist/functions/RoutineFunctions.js.map +1 -1
  42. package/dist/functions/RoutineFunctions.mjs.map +1 -1
  43. package/dist/functions/index.js.map +1 -1
  44. package/dist/functions/index.mjs.map +1 -1
  45. package/dist/index.d.mts +1 -1
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +8 -24
  48. package/dist/index.js.map +1 -1
  49. package/dist/index.mjs +8 -24
  50. package/dist/index.mjs.map +1 -1
  51. package/dist/interface/index.d.mts +1 -1
  52. package/dist/interface/index.d.ts +1 -1
  53. package/dist/interface/quest/QuestProps.d.mts +1 -1
  54. package/dist/interface/quest/QuestProps.d.ts +1 -1
  55. package/dist/interface/quest/StageProps.d.mts +1 -1
  56. package/dist/interface/quest/StageProps.d.ts +1 -1
  57. package/dist/types/QuestsRequired.d.mts +1 -1
  58. package/dist/types/QuestsRequired.d.ts +1 -1
  59. package/dist/types/index.d.mts +1 -1
  60. package/dist/types/index.d.ts +1 -1
  61. package/package.json +2 -2
@@ -60,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
60
60
  /**
61
61
  * The function that will be called when the stage starts.
62
62
  */
63
- get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
63
+ get onStart(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
64
64
  private _onEnd?;
65
65
  /**
66
66
  * The function that will be called when the stage ends.
67
67
  */
68
- get onEnd(): undefined | ((props: OnStartEndStageQuest) => void);
68
+ get onEnd(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
69
69
  }
70
70
  declare class StageQuest extends Stage {
71
71
  constructor(id: string, props: StageProps);
@@ -157,12 +157,12 @@ declare class Quest extends StoredClassModel {
157
157
  /**
158
158
  * The function that will be called when the quest starts.
159
159
  */
160
- get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
160
+ get onStart(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
161
161
  private _onNextStage?;
162
162
  /**
163
163
  * The function that will be called when the quest goes to the next stage.
164
164
  */
165
- get onNextStage(): undefined | ((props: OnStartEndStageQuest) => void);
165
+ get onNextStage(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
166
166
  /**
167
167
  * Start the quest.
168
168
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
@@ -60,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
60
60
  /**
61
61
  * The function that will be called when the stage starts.
62
62
  */
63
- get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
63
+ get onStart(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
64
64
  private _onEnd?;
65
65
  /**
66
66
  * The function that will be called when the stage ends.
67
67
  */
68
- get onEnd(): undefined | ((props: OnStartEndStageQuest) => void);
68
+ get onEnd(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
69
69
  }
70
70
  declare class StageQuest extends Stage {
71
71
  constructor(id: string, props: StageProps);
@@ -157,12 +157,12 @@ declare class Quest extends StoredClassModel {
157
157
  /**
158
158
  * The function that will be called when the quest starts.
159
159
  */
160
- get onStart(): undefined | ((props: OnStartEndStageQuest) => void);
160
+ get onStart(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
161
161
  private _onNextStage?;
162
162
  /**
163
163
  * The function that will be called when the quest goes to the next stage.
164
164
  */
165
- get onNextStage(): undefined | ((props: OnStartEndStageQuest) => void);
165
+ get onNextStage(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
166
166
  /**
167
167
  * Start the quest.
168
168
  * @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
@@ -1,6 +1,6 @@
1
1
  export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-BHB-jYOi.mjs';
2
2
  export { default as Goal } from './quest/Goal.mjs';
3
- export { Q as Quest, S as Stage } from '../StageProps-vuObH5D2.mjs';
3
+ export { Q as Quest, S as Stage } from '../StageProps-CuE_n1Wg.mjs';
4
4
  import '@drincs/nqtr/dist/override';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../ActivityProps-D45DQdcT.mjs';
@@ -1,6 +1,6 @@
1
1
  export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-D-1lsnnU.js';
2
2
  export { default as Goal } from './quest/Goal.js';
3
- export { Q as Quest, S as Stage } from '../StageProps-ssZax5Ip.js';
3
+ export { Q as Quest, S as Stage } from '../StageProps-CCjGI625.js';
4
4
  import '@drincs/nqtr/dist/override';
5
5
  import '@drincs/pixi-vn';
6
6
  import '../ActivityProps-BkHX8xkA.js';
@@ -1064,21 +1064,13 @@ var Stage = class extends pixiVn.StoredClassModel {
1064
1064
  * The function that will be called when the stage starts.
1065
1065
  */
1066
1066
  get onStart() {
1067
- let onStart = this._onStart;
1068
- if (onStart === void 0) {
1069
- return void 0;
1070
- }
1071
- return (props) => onStart(this, props);
1067
+ return this._onStart;
1072
1068
  }
1073
1069
  /**
1074
1070
  * The function that will be called when the stage ends.
1075
1071
  */
1076
1072
  get onEnd() {
1077
- let onEnd = this._onEnd;
1078
- if (onEnd === void 0) {
1079
- return void 0;
1080
- }
1081
- return (props) => onEnd(this, props);
1073
+ return this._onEnd;
1082
1074
  }
1083
1075
  };
1084
1076
  var StageQuest = class extends Stage {
@@ -1181,7 +1173,7 @@ var StageQuest = class extends Stage {
1181
1173
  if (this.canStart) {
1182
1174
  this.started = true;
1183
1175
  if (this.onStart) {
1184
- this.onStart(props);
1176
+ this.onStart(this, props);
1185
1177
  }
1186
1178
  } else {
1187
1179
  console.warn(`[NQTR] Stage ${this.id} can't start`);
@@ -1297,21 +1289,13 @@ var Quest = class extends pixiVn.StoredClassModel {
1297
1289
  * The function that will be called when the quest starts.
1298
1290
  */
1299
1291
  get onStart() {
1300
- let onStart = this._onStart;
1301
- if (onStart === void 0) {
1302
- return void 0;
1303
- }
1304
- return (props) => onStart(this, props);
1292
+ return this._onStart;
1305
1293
  }
1306
1294
  /**
1307
1295
  * The function that will be called when the quest goes to the next stage.
1308
1296
  */
1309
1297
  get onNextStage() {
1310
- let onNext = this._onNextStage;
1311
- if (onNext === void 0) {
1312
- return void 0;
1313
- }
1314
- return (props) => onNext(this, props);
1298
+ return this._onNextStage;
1315
1299
  }
1316
1300
  /**
1317
1301
  * Start the quest.
@@ -1330,7 +1314,7 @@ var Quest = class extends pixiVn.StoredClassModel {
1330
1314
  this.currentStageIndex = 0;
1331
1315
  let currentStage = this.currentStage;
1332
1316
  if (currentStage && currentStage.start) {
1333
- this.onStart && this.onStart(props);
1317
+ this.onStart && this.onStart(this, props);
1334
1318
  return currentStage.start(props);
1335
1319
  } else {
1336
1320
  console.error(`[NQTR] Quest ${this.id} has no start stage`);
@@ -1396,9 +1380,9 @@ var Quest = class extends pixiVn.StoredClassModel {
1396
1380
  return false;
1397
1381
  }
1398
1382
  this.currentStageIndex = currentStageIndex + 1;
1399
- this.onNextStage && this.onNextStage(props);
1383
+ this.onNextStage && this.onNextStage(this, props);
1400
1384
  if (prevStage && prevStage.onEnd) {
1401
- prevStage.onEnd(props);
1385
+ prevStage.onEnd(prevStage, props);
1402
1386
  }
1403
1387
  let nextCurrentStage = this.currentStage;
1404
1388
  if (nextCurrentStage) {