@drincs/nqtr 0.2.7 → 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 (63) hide show
  1. package/dist/{StageProps-Bok_NwL7.d.ts → StageProps-CCjGI625.d.ts} +18 -21
  2. package/dist/{StageProps-CFQizpZF.d.mts → StageProps-CuE_n1Wg.d.mts} +18 -21
  3. package/dist/classes/index.d.mts +1 -1
  4. package/dist/classes/index.d.ts +1 -1
  5. package/dist/classes/index.js +17 -36
  6. package/dist/classes/index.js.map +1 -1
  7. package/dist/classes/index.mjs +17 -36
  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 +17 -36
  14. package/dist/classes/quest/Quest.js.map +1 -1
  15. package/dist/classes/quest/Quest.mjs +17 -36
  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 +17 -36
  26. package/dist/decorators/QuestDecorator.js.map +1 -1
  27. package/dist/decorators/QuestDecorator.mjs +17 -36
  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 +17 -36
  32. package/dist/decorators/index.js.map +1 -1
  33. package/dist/decorators/index.mjs +17 -36
  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 +17 -36
  50. package/dist/index.js.map +1 -1
  51. package/dist/index.mjs +17 -36
  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/types/QuestsRequired.d.mts +1 -1
  60. package/dist/types/QuestsRequired.d.ts +1 -1
  61. package/dist/types/index.d.mts +1 -1
  62. package/dist/types/index.d.ts +1 -1
  63. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1279,21 +1279,13 @@ var Stage = class extends pixiVn.StoredClassModel {
1279
1279
  * The function that will be called when the stage starts.
1280
1280
  */
1281
1281
  get onStart() {
1282
- let onStart = this._onStart;
1283
- if (onStart === void 0) {
1284
- return void 0;
1285
- }
1286
- return (props) => onStart(this, props);
1282
+ return this._onStart;
1287
1283
  }
1288
1284
  /**
1289
1285
  * The function that will be called when the stage ends.
1290
1286
  */
1291
1287
  get onEnd() {
1292
- let onEnd = this._onEnd;
1293
- if (onEnd === void 0) {
1294
- return void 0;
1295
- }
1296
- return (props) => onEnd(this, props);
1288
+ return this._onEnd;
1297
1289
  }
1298
1290
  };
1299
1291
  var StageQuest = class extends Stage {
@@ -1396,7 +1388,7 @@ var StageQuest = class extends Stage {
1396
1388
  if (this.canStart) {
1397
1389
  this.started = true;
1398
1390
  if (this.onStart) {
1399
- this.onStart(props);
1391
+ this.onStart(this, props);
1400
1392
  }
1401
1393
  } else {
1402
1394
  console.warn(`[NQTR] Stage ${this.id} can't start`);
@@ -1512,21 +1504,13 @@ var Quest = class extends pixiVn.StoredClassModel {
1512
1504
  * The function that will be called when the quest starts.
1513
1505
  */
1514
1506
  get onStart() {
1515
- let onStart = this._onStart;
1516
- if (onStart === void 0) {
1517
- return void 0;
1518
- }
1519
- return (props) => onStart(this, props);
1507
+ return this._onStart;
1520
1508
  }
1521
1509
  /**
1522
1510
  * The function that will be called when the quest goes to the next stage.
1523
1511
  */
1524
1512
  get onNextStage() {
1525
- let onNext = this._onNextStage;
1526
- if (onNext === void 0) {
1527
- return void 0;
1528
- }
1529
- return (props) => onNext(this, props);
1513
+ return this._onNextStage;
1530
1514
  }
1531
1515
  /**
1532
1516
  * Start the quest.
@@ -1545,7 +1529,7 @@ var Quest = class extends pixiVn.StoredClassModel {
1545
1529
  this.currentStageIndex = 0;
1546
1530
  let currentStage = this.currentStage;
1547
1531
  if (currentStage && currentStage.start) {
1548
- this.onStart && this.onStart(props);
1532
+ this.onStart && this.onStart(this, props);
1549
1533
  return currentStage.start(props);
1550
1534
  } else {
1551
1535
  console.error(`[NQTR] Quest ${this.id} has no start stage`);
@@ -1554,11 +1538,10 @@ var Quest = class extends pixiVn.StoredClassModel {
1554
1538
  /**
1555
1539
  * Go to the next stage if the current stage is completed.
1556
1540
  * If you want to force the change of stage, use goNextStage.
1557
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
1558
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
1541
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
1559
1542
  * @returns true if the stage was changed, false otherwise.
1560
1543
  */
1561
- tryToGoNextStage(startProps, endProps) {
1544
+ tryToGoNextStage(props) {
1562
1545
  if (!this.started) {
1563
1546
  return false;
1564
1547
  }
@@ -1571,34 +1554,32 @@ var Quest = class extends pixiVn.StoredClassModel {
1571
1554
  return false;
1572
1555
  }
1573
1556
  if (currentStage.completed) {
1574
- return this.goNextStage(startProps, endProps);
1557
+ return this.goNextStage(props);
1575
1558
  }
1576
1559
  return false;
1577
1560
  }
1578
1561
  /**
1579
1562
  * Complete the current stage and go to the next stage.
1580
1563
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
1581
- * @param startProps The properties for the start stage. If you not want to pass any property, you can pass an {}.
1582
- * @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
1564
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
1583
1565
  * @returns true if the stage was changed, false otherwise.
1584
1566
  */
1585
- completeCurrentStageAndGoNext(startProps, endProps) {
1567
+ completeCurrentStageAndGoNext(props) {
1586
1568
  let currentStage = this.currentStage;
1587
1569
  if (!currentStage) {
1588
1570
  console.error(`[NQTR] Quest ${this.id} has no current stage`);
1589
1571
  return false;
1590
1572
  }
1591
1573
  currentStage.completed = true;
1592
- return this.goNextStage(startProps, endProps);
1574
+ return this.goNextStage(props);
1593
1575
  }
1594
1576
  /**
1595
1577
  * Go to the next stage without checking if the current stage is completed.
1596
1578
  * If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
1597
- * @param startProps
1598
- * @param endProps
1579
+ * @param props The properties. If you not want to pass any property, you can pass an {}.
1599
1580
  * @returns returns true if the stage was changed, false otherwise.
1600
1581
  */
1601
- goNextStage(startProps, endProps) {
1582
+ goNextStage(props) {
1602
1583
  if (!this.started) {
1603
1584
  console.warn(`[NQTR] Quest ${this.id} is not started`);
1604
1585
  return false;
@@ -1614,15 +1595,15 @@ var Quest = class extends pixiVn.StoredClassModel {
1614
1595
  return false;
1615
1596
  }
1616
1597
  this.currentStageIndex = currentStageIndex + 1;
1617
- this.onNextStage && this.onNextStage(endProps);
1598
+ this.onNextStage && this.onNextStage(this, props);
1618
1599
  if (prevStage && prevStage.onEnd) {
1619
- prevStage.onEnd(endProps);
1600
+ prevStage.onEnd(prevStage, props);
1620
1601
  }
1621
1602
  let nextCurrentStage = this.currentStage;
1622
1603
  if (nextCurrentStage) {
1623
1604
  nextCurrentStage.inizialize();
1624
1605
  if (this.currentStageMustStart) {
1625
- this.startCurrentStage(startProps);
1606
+ this.startCurrentStage(props);
1626
1607
  }
1627
1608
  }
1628
1609
  return true;