@drincs/nqtr 0.2.6 → 0.2.8
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.
- package/dist/{StageProps-DVGvhQgr.d.ts → StageProps-ssZax5Ip.d.ts} +18 -22
- package/dist/{StageProps-BP4soUUZ.d.mts → StageProps-vuObH5D2.d.mts} +18 -22
- package/dist/classes/index.d.mts +1 -2
- package/dist/classes/index.d.ts +1 -2
- package/dist/classes/index.js +11 -14
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +11 -14
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/Room.js.map +1 -1
- package/dist/classes/navigation/Room.mjs.map +1 -1
- package/dist/classes/quest/Quest.d.mts +1 -2
- package/dist/classes/quest/Quest.d.ts +1 -2
- package/dist/classes/quest/Quest.js +11 -14
- package/dist/classes/quest/Quest.js.map +1 -1
- package/dist/classes/quest/Quest.mjs +11 -14
- package/dist/classes/quest/Quest.mjs.map +1 -1
- package/dist/classes/quest/Stage.d.mts +1 -2
- package/dist/classes/quest/Stage.d.ts +1 -2
- package/dist/classes/quest/Stage.js.map +1 -1
- package/dist/classes/quest/Stage.mjs.map +1 -1
- package/dist/decorators/QuestDecorator.d.mts +1 -2
- package/dist/decorators/QuestDecorator.d.ts +1 -2
- package/dist/decorators/QuestDecorator.js +11 -14
- package/dist/decorators/QuestDecorator.js.map +1 -1
- package/dist/decorators/QuestDecorator.mjs +11 -14
- package/dist/decorators/QuestDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +1 -2
- package/dist/decorators/index.d.ts +1 -2
- package/dist/decorators/index.js +11 -14
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +11 -14
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/ActivityFunctions.js.map +1 -1
- package/dist/functions/ActivityFunctions.mjs.map +1 -1
- package/dist/functions/NavigationFunctions.js.map +1 -1
- package/dist/functions/NavigationFunctions.mjs.map +1 -1
- package/dist/functions/QuestFunctions.d.mts +2 -2
- package/dist/functions/QuestFunctions.d.ts +2 -2
- package/dist/functions/QuestFunctions.js.map +1 -1
- package/dist/functions/QuestFunctions.mjs.map +1 -1
- package/dist/functions/RoutineFunctions.js.map +1 -1
- package/dist/functions/RoutineFunctions.mjs.map +1 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -2
- package/dist/index.d.ts +1 -2
- package/dist/index.js +11 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -14
- package/dist/index.mjs.map +1 -1
- package/dist/interface/index.d.mts +1 -2
- package/dist/interface/index.d.ts +1 -2
- package/dist/interface/quest/QuestProps.d.mts +1 -2
- package/dist/interface/quest/QuestProps.d.ts +1 -2
- package/dist/interface/quest/StageProps.d.mts +1 -2
- package/dist/interface/quest/StageProps.d.ts +1 -2
- package/dist/override/{OnStartStageQuest.d.mts → OnStartEndStageQuest.d.mts} +3 -3
- package/dist/override/{OnStartStageQuest.d.ts → OnStartEndStageQuest.d.ts} +3 -3
- package/dist/override/OnStartEndStageQuest.js +4 -0
- package/dist/override/OnStartEndStageQuest.mjs +3 -0
- package/dist/override/index.d.mts +1 -2
- package/dist/override/index.d.ts +1 -2
- package/dist/types/QuestsRequired.d.mts +1 -2
- package/dist/types/QuestsRequired.d.ts +1 -2
- package/dist/types/index.d.mts +1 -2
- package/dist/types/index.d.ts +1 -2
- package/package.json +2 -2
- package/dist/override/OnEndStageQuest.d.mts +0 -19
- package/dist/override/OnEndStageQuest.d.ts +0 -19
- package/dist/override/OnEndStageQuest.js +0 -4
- package/dist/override/OnEndStageQuest.mjs +0 -3
- package/dist/override/OnStartStageQuest.js +0 -4
- package/dist/override/OnStartStageQuest.js.map +0 -1
- package/dist/override/OnStartStageQuest.mjs +0 -3
- package/dist/override/OnStartStageQuest.mjs.map +0 -1
- /package/dist/override/{OnEndStageQuest.js.map → OnStartEndStageQuest.js.map} +0 -0
- /package/dist/override/{OnEndStageQuest.mjs.map → OnStartEndStageQuest.mjs.map} +0 -0
package/dist/index.mjs
CHANGED
|
@@ -1552,11 +1552,10 @@ var Quest = class extends StoredClassModel {
|
|
|
1552
1552
|
/**
|
|
1553
1553
|
* Go to the next stage if the current stage is completed.
|
|
1554
1554
|
* If you want to force the change of stage, use goNextStage.
|
|
1555
|
-
* @param
|
|
1556
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
1555
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1557
1556
|
* @returns true if the stage was changed, false otherwise.
|
|
1558
1557
|
*/
|
|
1559
|
-
tryToGoNextStage(
|
|
1558
|
+
tryToGoNextStage(props) {
|
|
1560
1559
|
if (!this.started) {
|
|
1561
1560
|
return false;
|
|
1562
1561
|
}
|
|
@@ -1569,34 +1568,32 @@ var Quest = class extends StoredClassModel {
|
|
|
1569
1568
|
return false;
|
|
1570
1569
|
}
|
|
1571
1570
|
if (currentStage.completed) {
|
|
1572
|
-
return this.goNextStage(
|
|
1571
|
+
return this.goNextStage(props);
|
|
1573
1572
|
}
|
|
1574
1573
|
return false;
|
|
1575
1574
|
}
|
|
1576
1575
|
/**
|
|
1577
1576
|
* Complete the current stage and go to the next stage.
|
|
1578
1577
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
1579
|
-
* @param
|
|
1580
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
1578
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1581
1579
|
* @returns true if the stage was changed, false otherwise.
|
|
1582
1580
|
*/
|
|
1583
|
-
completeCurrentStageAndGoNext(
|
|
1581
|
+
completeCurrentStageAndGoNext(props) {
|
|
1584
1582
|
let currentStage = this.currentStage;
|
|
1585
1583
|
if (!currentStage) {
|
|
1586
1584
|
console.error(`[NQTR] Quest ${this.id} has no current stage`);
|
|
1587
1585
|
return false;
|
|
1588
1586
|
}
|
|
1589
1587
|
currentStage.completed = true;
|
|
1590
|
-
return this.goNextStage(
|
|
1588
|
+
return this.goNextStage(props);
|
|
1591
1589
|
}
|
|
1592
1590
|
/**
|
|
1593
1591
|
* Go to the next stage without checking if the current stage is completed.
|
|
1594
1592
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
1595
|
-
* @param
|
|
1596
|
-
* @param endProps
|
|
1593
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1597
1594
|
* @returns returns true if the stage was changed, false otherwise.
|
|
1598
1595
|
*/
|
|
1599
|
-
goNextStage(
|
|
1596
|
+
goNextStage(props) {
|
|
1600
1597
|
if (!this.started) {
|
|
1601
1598
|
console.warn(`[NQTR] Quest ${this.id} is not started`);
|
|
1602
1599
|
return false;
|
|
@@ -1612,15 +1609,15 @@ var Quest = class extends StoredClassModel {
|
|
|
1612
1609
|
return false;
|
|
1613
1610
|
}
|
|
1614
1611
|
this.currentStageIndex = currentStageIndex + 1;
|
|
1615
|
-
this.onNextStage && this.onNextStage(
|
|
1612
|
+
this.onNextStage && this.onNextStage(props);
|
|
1616
1613
|
if (prevStage && prevStage.onEnd) {
|
|
1617
|
-
prevStage.onEnd(
|
|
1614
|
+
prevStage.onEnd(props);
|
|
1618
1615
|
}
|
|
1619
1616
|
let nextCurrentStage = this.currentStage;
|
|
1620
1617
|
if (nextCurrentStage) {
|
|
1621
1618
|
nextCurrentStage.inizialize();
|
|
1622
1619
|
if (this.currentStageMustStart) {
|
|
1623
|
-
this.startCurrentStage(
|
|
1620
|
+
this.startCurrentStage(props);
|
|
1624
1621
|
}
|
|
1625
1622
|
}
|
|
1626
1623
|
return true;
|