@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.
- package/dist/{StageProps-Bok_NwL7.d.ts → StageProps-CCjGI625.d.ts} +18 -21
- package/dist/{StageProps-CFQizpZF.d.mts → StageProps-CuE_n1Wg.d.mts} +18 -21
- package/dist/classes/index.d.mts +1 -1
- package/dist/classes/index.d.ts +1 -1
- package/dist/classes/index.js +17 -36
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +17 -36
- 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 -1
- package/dist/classes/quest/Quest.d.ts +1 -1
- package/dist/classes/quest/Quest.js +17 -36
- package/dist/classes/quest/Quest.js.map +1 -1
- package/dist/classes/quest/Quest.mjs +17 -36
- package/dist/classes/quest/Quest.mjs.map +1 -1
- package/dist/classes/quest/Stage.d.mts +1 -1
- package/dist/classes/quest/Stage.d.ts +1 -1
- package/dist/classes/quest/Stage.js +3 -11
- package/dist/classes/quest/Stage.js.map +1 -1
- package/dist/classes/quest/Stage.mjs +3 -11
- package/dist/classes/quest/Stage.mjs.map +1 -1
- package/dist/decorators/QuestDecorator.d.mts +1 -1
- package/dist/decorators/QuestDecorator.d.ts +1 -1
- package/dist/decorators/QuestDecorator.js +17 -36
- package/dist/decorators/QuestDecorator.js.map +1 -1
- package/dist/decorators/QuestDecorator.mjs +17 -36
- package/dist/decorators/QuestDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +17 -36
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +17 -36
- 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 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -36
- package/dist/index.mjs.map +1 -1
- package/dist/interface/index.d.mts +1 -1
- package/dist/interface/index.d.ts +1 -1
- package/dist/interface/quest/QuestProps.d.mts +1 -1
- package/dist/interface/quest/QuestProps.d.ts +1 -1
- package/dist/interface/quest/StageProps.d.mts +1 -1
- package/dist/interface/quest/StageProps.d.ts +1 -1
- package/dist/types/QuestsRequired.d.mts +1 -1
- package/dist/types/QuestsRequired.d.ts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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(
|
|
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
|
|
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(
|
|
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(
|
|
1598
|
+
this.onNextStage && this.onNextStage(this, props);
|
|
1618
1599
|
if (prevStage && prevStage.onEnd) {
|
|
1619
|
-
prevStage.onEnd(
|
|
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(
|
|
1606
|
+
this.startCurrentStage(props);
|
|
1626
1607
|
}
|
|
1627
1608
|
}
|
|
1628
1609
|
return true;
|