@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/classes/index.mjs
CHANGED
|
@@ -1337,11 +1337,10 @@ var Quest = class extends StoredClassModel {
|
|
|
1337
1337
|
/**
|
|
1338
1338
|
* Go to the next stage if the current stage is completed.
|
|
1339
1339
|
* If you want to force the change of stage, use goNextStage.
|
|
1340
|
-
* @param
|
|
1341
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
1340
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1342
1341
|
* @returns true if the stage was changed, false otherwise.
|
|
1343
1342
|
*/
|
|
1344
|
-
tryToGoNextStage(
|
|
1343
|
+
tryToGoNextStage(props) {
|
|
1345
1344
|
if (!this.started) {
|
|
1346
1345
|
return false;
|
|
1347
1346
|
}
|
|
@@ -1354,34 +1353,32 @@ var Quest = class extends StoredClassModel {
|
|
|
1354
1353
|
return false;
|
|
1355
1354
|
}
|
|
1356
1355
|
if (currentStage.completed) {
|
|
1357
|
-
return this.goNextStage(
|
|
1356
|
+
return this.goNextStage(props);
|
|
1358
1357
|
}
|
|
1359
1358
|
return false;
|
|
1360
1359
|
}
|
|
1361
1360
|
/**
|
|
1362
1361
|
* Complete the current stage and go to the next stage.
|
|
1363
1362
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
1364
|
-
* @param
|
|
1365
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
1363
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1366
1364
|
* @returns true if the stage was changed, false otherwise.
|
|
1367
1365
|
*/
|
|
1368
|
-
completeCurrentStageAndGoNext(
|
|
1366
|
+
completeCurrentStageAndGoNext(props) {
|
|
1369
1367
|
let currentStage = this.currentStage;
|
|
1370
1368
|
if (!currentStage) {
|
|
1371
1369
|
console.error(`[NQTR] Quest ${this.id} has no current stage`);
|
|
1372
1370
|
return false;
|
|
1373
1371
|
}
|
|
1374
1372
|
currentStage.completed = true;
|
|
1375
|
-
return this.goNextStage(
|
|
1373
|
+
return this.goNextStage(props);
|
|
1376
1374
|
}
|
|
1377
1375
|
/**
|
|
1378
1376
|
* Go to the next stage without checking if the current stage is completed.
|
|
1379
1377
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
1380
|
-
* @param
|
|
1381
|
-
* @param endProps
|
|
1378
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1382
1379
|
* @returns returns true if the stage was changed, false otherwise.
|
|
1383
1380
|
*/
|
|
1384
|
-
goNextStage(
|
|
1381
|
+
goNextStage(props) {
|
|
1385
1382
|
if (!this.started) {
|
|
1386
1383
|
console.warn(`[NQTR] Quest ${this.id} is not started`);
|
|
1387
1384
|
return false;
|
|
@@ -1397,15 +1394,15 @@ var Quest = class extends StoredClassModel {
|
|
|
1397
1394
|
return false;
|
|
1398
1395
|
}
|
|
1399
1396
|
this.currentStageIndex = currentStageIndex + 1;
|
|
1400
|
-
this.onNextStage && this.onNextStage(
|
|
1397
|
+
this.onNextStage && this.onNextStage(props);
|
|
1401
1398
|
if (prevStage && prevStage.onEnd) {
|
|
1402
|
-
prevStage.onEnd(
|
|
1399
|
+
prevStage.onEnd(props);
|
|
1403
1400
|
}
|
|
1404
1401
|
let nextCurrentStage = this.currentStage;
|
|
1405
1402
|
if (nextCurrentStage) {
|
|
1406
1403
|
nextCurrentStage.inizialize();
|
|
1407
1404
|
if (this.currentStageMustStart) {
|
|
1408
|
-
this.startCurrentStage(
|
|
1405
|
+
this.startCurrentStage(props);
|
|
1409
1406
|
}
|
|
1410
1407
|
}
|
|
1411
1408
|
return true;
|