@drincs/nqtr 0.1.19 → 0.1.20
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/Quest-BQ1pwvQ_.d.ts +197 -0
- package/dist/Quest-DaNlPBHb.d.mts +197 -0
- package/dist/classes/index.d.mts +3 -3
- package/dist/classes/index.d.ts +3 -3
- package/dist/classes/index.js +488 -298
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +486 -297
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/ActivityRoom.d.mts +1 -1
- package/dist/classes/navigation/ActivityRoom.d.ts +1 -1
- package/dist/classes/navigation/ActivityRoom.js +1 -1
- package/dist/classes/navigation/ActivityRoom.js.map +1 -1
- package/dist/classes/navigation/ActivityRoom.mjs +1 -1
- package/dist/classes/navigation/ActivityRoom.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/Goal.d.mts +21 -13
- package/dist/classes/quest/Goal.d.ts +21 -13
- package/dist/classes/quest/Goal.js +50 -15
- package/dist/classes/quest/Goal.js.map +1 -1
- package/dist/classes/quest/Goal.mjs +47 -15
- package/dist/classes/quest/Goal.mjs.map +1 -1
- package/dist/classes/quest/Quest.d.mts +3 -2
- package/dist/classes/quest/Quest.d.ts +3 -2
- package/dist/classes/quest/Quest.js +536 -9
- package/dist/classes/quest/Quest.js.map +1 -1
- package/dist/classes/quest/Quest.mjs +537 -10
- package/dist/classes/quest/Quest.mjs.map +1 -1
- package/dist/classes/quest/Stage.d.mts +3 -2
- package/dist/classes/quest/Stage.d.ts +3 -2
- package/dist/classes/quest/Stage.js +396 -51
- package/dist/classes/quest/Stage.js.map +1 -1
- package/dist/classes/quest/Stage.mjs +394 -52
- package/dist/classes/quest/Stage.mjs.map +1 -1
- package/dist/decorators/QuestDecorator.d.mts +28 -0
- package/dist/decorators/QuestDecorator.d.ts +28 -0
- package/dist/decorators/QuestDecorator.js +33 -0
- package/dist/decorators/QuestDecorator.js.map +1 -0
- package/dist/decorators/QuestDecorator.mjs +29 -0
- package/dist/decorators/QuestDecorator.mjs.map +1 -0
- package/dist/decorators/index.d.mts +5 -0
- package/dist/decorators/index.d.ts +5 -0
- package/dist/decorators/index.js +28 -0
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +27 -1
- 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/index.js.map +1 -1
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +518 -300
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +514 -299
- package/dist/index.mjs.map +1 -1
- package/dist/interface/index.d.mts +2 -2
- package/dist/interface/index.d.ts +2 -2
- package/dist/interface/quest/GoalProps.d.mts +12 -0
- package/dist/interface/quest/GoalProps.d.ts +12 -0
- package/dist/interface/quest/QuestProps.d.mts +6 -9
- package/dist/interface/quest/QuestProps.d.ts +6 -9
- package/dist/interface/quest/StageFlags.d.mts +12 -0
- package/dist/interface/quest/StageFlags.d.ts +12 -0
- package/dist/interface/quest/StageFlags.js +4 -0
- package/dist/interface/quest/StageFlags.js.map +1 -0
- package/dist/interface/quest/StageFlags.mjs +3 -0
- package/dist/interface/quest/StageFlags.mjs.map +1 -0
- package/dist/interface/quest/StageProps.d.mts +3 -2
- package/dist/interface/quest/StageProps.d.ts +3 -2
- package/dist/override/OnEndStage.d.mts +19 -0
- package/dist/override/OnEndStage.d.ts +19 -0
- package/dist/override/OnEndStage.js +4 -0
- package/dist/override/OnEndStage.js.map +1 -0
- package/dist/override/OnEndStage.mjs +3 -0
- package/dist/override/OnEndStage.mjs.map +1 -0
- package/dist/override/OnStartStage.d.mts +19 -0
- package/dist/override/OnStartStage.d.ts +19 -0
- package/dist/override/OnStartStage.js +4 -0
- package/dist/override/OnStartStage.js.map +1 -0
- package/dist/override/OnStartStage.mjs +3 -0
- package/dist/override/OnStartStage.mjs.map +1 -0
- package/dist/override/index.d.mts +2 -0
- package/dist/override/index.d.ts +2 -0
- package/dist/types/QuestsRequired.d.mts +3 -2
- package/dist/types/QuestsRequired.d.ts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.d.ts +3 -2
- package/package.json +1 -1
- package/dist/Quest-Bdm0R9LA.d.mts +0 -71
- package/dist/Quest-CxJcXETG.d.ts +0 -71
package/dist/index.js
CHANGED
|
@@ -577,6 +577,199 @@ var CommitmentBaseModel = class extends pixiVn.StoredClassModel {
|
|
|
577
577
|
return false;
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
|
+
var ActivityStoredAbstract = class {
|
|
581
|
+
/**
|
|
582
|
+
* @param onRun The function that is called when the activity is runned. Have 2 parameters: the runned activity and the yourParams object, that is an object with the parameters that you want to pass to the onRun function.
|
|
583
|
+
* @param props The activity properties.
|
|
584
|
+
*/
|
|
585
|
+
constructor(onRun, props) {
|
|
586
|
+
this.defaultName = props.name;
|
|
587
|
+
this.defaultFromHour = props.fromHour;
|
|
588
|
+
this.defaultToHour = props.toHour;
|
|
589
|
+
this.defaultFromDay = props.fromDay;
|
|
590
|
+
this.defaultToDay = props.toDay;
|
|
591
|
+
this.defaultDisabled = props.disabled || false;
|
|
592
|
+
this.defaultHidden = props.hidden || false;
|
|
593
|
+
this._renderIcon = props.renderIcon;
|
|
594
|
+
this._onRun = onRun;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* The name
|
|
598
|
+
*/
|
|
599
|
+
get name() {
|
|
600
|
+
return this.getStorageProperty("name") || this.defaultName || "";
|
|
601
|
+
}
|
|
602
|
+
set name(value) {
|
|
603
|
+
this.setStorageProperty("name", value);
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* The hour when the activity starts. If the activity is not started yet, it will be hidden.
|
|
607
|
+
*/
|
|
608
|
+
get fromHour() {
|
|
609
|
+
return this.getStorageProperty("fromHour") || this.defaultFromHour || TimeManager.minDayHours;
|
|
610
|
+
}
|
|
611
|
+
set fromHour(value) {
|
|
612
|
+
this.setStorageProperty("fromHour", value);
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* The hour when the activity ends. If the activity is ended yet, it will be hidden.
|
|
616
|
+
*/
|
|
617
|
+
get toHour() {
|
|
618
|
+
return this.getStorageProperty("toHour") || this.defaultToHour || TimeManager.maxDayHours + 1;
|
|
619
|
+
}
|
|
620
|
+
set toHour(value) {
|
|
621
|
+
this.setStorageProperty("toHour", value);
|
|
622
|
+
}
|
|
623
|
+
/**
|
|
624
|
+
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
625
|
+
*/
|
|
626
|
+
get fromDay() {
|
|
627
|
+
return this.getStorageProperty("fromDay") || this.defaultFromDay;
|
|
628
|
+
}
|
|
629
|
+
set fromDay(value) {
|
|
630
|
+
this.setStorageProperty("fromDay", value);
|
|
631
|
+
}
|
|
632
|
+
/**
|
|
633
|
+
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
634
|
+
*/
|
|
635
|
+
get toDay() {
|
|
636
|
+
return this.getStorageProperty("toDay") || this.defaultToDay;
|
|
637
|
+
}
|
|
638
|
+
set toDay(value) {
|
|
639
|
+
this.setStorageProperty("toDay", value);
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Whether is disabled.
|
|
643
|
+
*/
|
|
644
|
+
get disabled() {
|
|
645
|
+
let value = this.getStorageProperty("disabled") || this.defaultDisabled;
|
|
646
|
+
if (typeof value === "string") {
|
|
647
|
+
return pixiVn.getFlag(value);
|
|
648
|
+
}
|
|
649
|
+
return value;
|
|
650
|
+
}
|
|
651
|
+
set disabled(value) {
|
|
652
|
+
this.setStorageProperty("disabled", value);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Whether is hidden. If the activity is not started yet, it will be hidden.
|
|
656
|
+
*/
|
|
657
|
+
get hidden() {
|
|
658
|
+
if (this.fromDay && this.fromDay > TimeManager.currentDay) {
|
|
659
|
+
return true;
|
|
660
|
+
}
|
|
661
|
+
if (!TimeManager.nowIsBetween(this.fromHour, this.toHour)) {
|
|
662
|
+
return true;
|
|
663
|
+
}
|
|
664
|
+
if (!this.isExpired) {
|
|
665
|
+
return true;
|
|
666
|
+
}
|
|
667
|
+
let value = this.getStorageProperty("hidden") || this.defaultHidden;
|
|
668
|
+
if (typeof value === "string") {
|
|
669
|
+
return pixiVn.getFlag(value);
|
|
670
|
+
}
|
|
671
|
+
return value;
|
|
672
|
+
}
|
|
673
|
+
set hidden(value) {
|
|
674
|
+
this.setStorageProperty("hidden", value);
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* The function for rendering the icon of the activity.
|
|
678
|
+
*/
|
|
679
|
+
get renderIcon() {
|
|
680
|
+
let render = this._renderIcon;
|
|
681
|
+
if (render === void 0) {
|
|
682
|
+
return void 0;
|
|
683
|
+
}
|
|
684
|
+
if (typeof render === "function") {
|
|
685
|
+
return (props) => {
|
|
686
|
+
return render(this, props);
|
|
687
|
+
};
|
|
688
|
+
}
|
|
689
|
+
return (props) => render;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* The function that is called when the activity is runned.
|
|
693
|
+
*/
|
|
694
|
+
get onRun() {
|
|
695
|
+
return (props) => {
|
|
696
|
+
return this._onRun(this, props);
|
|
697
|
+
};
|
|
698
|
+
}
|
|
699
|
+
/**
|
|
700
|
+
* Whether the activity is a deadline.
|
|
701
|
+
* @returns Whether the activity is a deadline.
|
|
702
|
+
*/
|
|
703
|
+
isExpired() {
|
|
704
|
+
if (this.toDay && this.toDay <= TimeManager.currentDay) {
|
|
705
|
+
return true;
|
|
706
|
+
}
|
|
707
|
+
return false;
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Export the activity properties.
|
|
711
|
+
* @returns The activity properties.
|
|
712
|
+
*/
|
|
713
|
+
export() {
|
|
714
|
+
return {
|
|
715
|
+
name: this.getStorageProperty("name") || this.defaultName,
|
|
716
|
+
fromHour: this.getStorageProperty("fromHour") || this.defaultFromHour,
|
|
717
|
+
toHour: this.getStorageProperty("toHour") || this.defaultToHour,
|
|
718
|
+
fromDay: this.getStorageProperty("fromDay") || this.defaultFromDay,
|
|
719
|
+
toDay: this.getStorageProperty("toDay") || this.defaultToDay,
|
|
720
|
+
disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
|
|
721
|
+
hidden: this.getStorageProperty("hidden") || this.defaultHidden,
|
|
722
|
+
renderIcon: this._renderIcon
|
|
723
|
+
};
|
|
724
|
+
}
|
|
725
|
+
};
|
|
726
|
+
|
|
727
|
+
// src/classes/navigation/ActivityRoom.ts
|
|
728
|
+
var ActivityRoom = class extends ActivityStoredAbstract {
|
|
729
|
+
constructor(id, room, onRun, props) {
|
|
730
|
+
super(onRun, props);
|
|
731
|
+
this._id = id;
|
|
732
|
+
this._room = room;
|
|
733
|
+
}
|
|
734
|
+
setStorageProperty(_, __) {
|
|
735
|
+
this._room.setActivity(this);
|
|
736
|
+
}
|
|
737
|
+
getStorageProperty(propertyName) {
|
|
738
|
+
let activity = this._room.getActivityMemory(this.id);
|
|
739
|
+
if (!activity || !activity.hasOwnProperty(propertyName)) {
|
|
740
|
+
return void 0;
|
|
741
|
+
}
|
|
742
|
+
return activity[propertyName];
|
|
743
|
+
}
|
|
744
|
+
get id() {
|
|
745
|
+
return this._id;
|
|
746
|
+
}
|
|
747
|
+
get room() {
|
|
748
|
+
return this._room;
|
|
749
|
+
}
|
|
750
|
+
export() {
|
|
751
|
+
let result = {};
|
|
752
|
+
if (this.name !== void 0) {
|
|
753
|
+
result["name"] = this.name;
|
|
754
|
+
}
|
|
755
|
+
if (this.fromHour !== void 0) {
|
|
756
|
+
result["fromHour"] = this.fromHour;
|
|
757
|
+
}
|
|
758
|
+
if (this.toHour !== void 0) {
|
|
759
|
+
result["toHour"] = this.toHour;
|
|
760
|
+
}
|
|
761
|
+
if (this.fromDay !== void 0) {
|
|
762
|
+
result["fromDay"] = this.fromDay;
|
|
763
|
+
}
|
|
764
|
+
if (this.toDay !== void 0) {
|
|
765
|
+
result["toDay"] = this.toDay;
|
|
766
|
+
}
|
|
767
|
+
if (this.disabled !== void 0) {
|
|
768
|
+
result["disabled"] = this.disabled;
|
|
769
|
+
}
|
|
770
|
+
return result;
|
|
771
|
+
}
|
|
772
|
+
};
|
|
580
773
|
|
|
581
774
|
// src/decorators/RoomDecorator.ts
|
|
582
775
|
var registeredRooms = {};
|
|
@@ -905,6 +1098,32 @@ function getTemporaryCommitments() {
|
|
|
905
1098
|
return commitments;
|
|
906
1099
|
}
|
|
907
1100
|
|
|
1101
|
+
// src/decorators/QuestDecorator.ts
|
|
1102
|
+
var registeredQuests = {};
|
|
1103
|
+
function saveQuest(quest) {
|
|
1104
|
+
if (Array.isArray(quest)) {
|
|
1105
|
+
quest.forEach((c) => saveQuest(c));
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
if (registeredQuests[quest.id]) {
|
|
1109
|
+
console.warn(`[NQTR] Quest id ${quest.id} already exists, it will be overwritten`);
|
|
1110
|
+
}
|
|
1111
|
+
registeredQuests[quest.id] = quest;
|
|
1112
|
+
}
|
|
1113
|
+
function getQuestById(id) {
|
|
1114
|
+
try {
|
|
1115
|
+
let quest = registeredQuests[id];
|
|
1116
|
+
if (!quest) {
|
|
1117
|
+
console.error(`[NQTR] Quest ${id} not found`);
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
return quest;
|
|
1121
|
+
} catch (e) {
|
|
1122
|
+
console.error(`[NQTR] Error while getting Quest ${id}`, e);
|
|
1123
|
+
return;
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
|
|
908
1127
|
// src/functions/RoutineFunctions.ts
|
|
909
1128
|
function clearExpiredRoutine() {
|
|
910
1129
|
Object.entries(registeredCommitments).forEach(([_, commitment]) => {
|
|
@@ -953,244 +1172,51 @@ function getCommitmentByCharacter(character) {
|
|
|
953
1172
|
});
|
|
954
1173
|
return void 0;
|
|
955
1174
|
}
|
|
956
|
-
|
|
1175
|
+
|
|
1176
|
+
// src/classes/navigation/Room.ts
|
|
1177
|
+
var ROOM_CATEGORY = "__nqtr-room__";
|
|
1178
|
+
var RoomBaseModel = class extends pixiVn.StoredClassModel {
|
|
957
1179
|
/**
|
|
958
|
-
* @param
|
|
959
|
-
* @param
|
|
1180
|
+
* @param id The id of the room, it must be unique.
|
|
1181
|
+
* @param location The location where the room is.
|
|
1182
|
+
* @param props The properties of the room.
|
|
960
1183
|
*/
|
|
961
|
-
constructor(
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
this.
|
|
965
|
-
this.
|
|
966
|
-
this.
|
|
1184
|
+
constructor(id, location, props = {}) {
|
|
1185
|
+
var _a;
|
|
1186
|
+
super(ROOM_CATEGORY, id);
|
|
1187
|
+
this._location = location;
|
|
1188
|
+
this.defaultName = props.name || "";
|
|
1189
|
+
this._renderImage = props.renderImage;
|
|
1190
|
+
this.defaultActivityIds = ((_a = props.defaultActivities) == null ? void 0 : _a.map((activity) => activity.id)) || [];
|
|
967
1191
|
this.defaultDisabled = props.disabled || false;
|
|
968
1192
|
this.defaultHidden = props.hidden || false;
|
|
969
1193
|
this._renderIcon = props.renderIcon;
|
|
970
|
-
this.
|
|
1194
|
+
this._isEntrance = props.isEntrance;
|
|
971
1195
|
}
|
|
972
1196
|
/**
|
|
973
|
-
* The
|
|
1197
|
+
* The location where the room is.
|
|
974
1198
|
*/
|
|
975
|
-
get
|
|
976
|
-
return this.
|
|
1199
|
+
get location() {
|
|
1200
|
+
return this._location;
|
|
977
1201
|
}
|
|
978
|
-
|
|
979
|
-
|
|
1202
|
+
/**
|
|
1203
|
+
* Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
|
|
1204
|
+
*/
|
|
1205
|
+
get isEntrance() {
|
|
1206
|
+
return this._isEntrance || false;
|
|
980
1207
|
}
|
|
981
1208
|
/**
|
|
982
|
-
* The
|
|
1209
|
+
* The name.
|
|
1210
|
+
* If you set undefined, it will return the initial value of name.
|
|
983
1211
|
*/
|
|
984
|
-
get
|
|
985
|
-
return this.getStorageProperty("
|
|
1212
|
+
get name() {
|
|
1213
|
+
return this.getStorageProperty("name") || this.defaultName;
|
|
986
1214
|
}
|
|
987
|
-
set
|
|
988
|
-
this.setStorageProperty("
|
|
1215
|
+
set name(value) {
|
|
1216
|
+
this.setStorageProperty("name", value);
|
|
989
1217
|
}
|
|
990
1218
|
/**
|
|
991
|
-
* The
|
|
992
|
-
*/
|
|
993
|
-
get toHour() {
|
|
994
|
-
return this.getStorageProperty("toHour") || this.defaultToHour || TimeManager.maxDayHours + 1;
|
|
995
|
-
}
|
|
996
|
-
set toHour(value) {
|
|
997
|
-
this.setStorageProperty("toHour", value);
|
|
998
|
-
}
|
|
999
|
-
/**
|
|
1000
|
-
* The day when the activity starts. If the activity is not started yet, it will be hidden.
|
|
1001
|
-
*/
|
|
1002
|
-
get fromDay() {
|
|
1003
|
-
return this.getStorageProperty("fromDay") || this.defaultFromDay;
|
|
1004
|
-
}
|
|
1005
|
-
set fromDay(value) {
|
|
1006
|
-
this.setStorageProperty("fromDay", value);
|
|
1007
|
-
}
|
|
1008
|
-
/**
|
|
1009
|
-
* The day when the activity ends. If the activity is ended yet, it will be deleted or hidden.
|
|
1010
|
-
*/
|
|
1011
|
-
get toDay() {
|
|
1012
|
-
return this.getStorageProperty("toDay") || this.defaultToDay;
|
|
1013
|
-
}
|
|
1014
|
-
set toDay(value) {
|
|
1015
|
-
this.setStorageProperty("toDay", value);
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* Whether is disabled.
|
|
1019
|
-
*/
|
|
1020
|
-
get disabled() {
|
|
1021
|
-
let value = this.getStorageProperty("disabled") || this.defaultDisabled;
|
|
1022
|
-
if (typeof value === "string") {
|
|
1023
|
-
return pixiVn.getFlag(value);
|
|
1024
|
-
}
|
|
1025
|
-
return value;
|
|
1026
|
-
}
|
|
1027
|
-
set disabled(value) {
|
|
1028
|
-
this.setStorageProperty("disabled", value);
|
|
1029
|
-
}
|
|
1030
|
-
/**
|
|
1031
|
-
* Whether is hidden. If the activity is not started yet, it will be hidden.
|
|
1032
|
-
*/
|
|
1033
|
-
get hidden() {
|
|
1034
|
-
if (this.fromDay && this.fromDay > TimeManager.currentDay) {
|
|
1035
|
-
return true;
|
|
1036
|
-
}
|
|
1037
|
-
if (!TimeManager.nowIsBetween(this.fromHour, this.toHour)) {
|
|
1038
|
-
return true;
|
|
1039
|
-
}
|
|
1040
|
-
if (!this.isExpired) {
|
|
1041
|
-
return true;
|
|
1042
|
-
}
|
|
1043
|
-
let value = this.getStorageProperty("hidden") || this.defaultHidden;
|
|
1044
|
-
if (typeof value === "string") {
|
|
1045
|
-
return pixiVn.getFlag(value);
|
|
1046
|
-
}
|
|
1047
|
-
return value;
|
|
1048
|
-
}
|
|
1049
|
-
set hidden(value) {
|
|
1050
|
-
this.setStorageProperty("hidden", value);
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* The function for rendering the icon of the activity.
|
|
1054
|
-
*/
|
|
1055
|
-
get renderIcon() {
|
|
1056
|
-
let render = this._renderIcon;
|
|
1057
|
-
if (render === void 0) {
|
|
1058
|
-
return void 0;
|
|
1059
|
-
}
|
|
1060
|
-
if (typeof render === "function") {
|
|
1061
|
-
return (props) => {
|
|
1062
|
-
return render(this, props);
|
|
1063
|
-
};
|
|
1064
|
-
}
|
|
1065
|
-
return (props) => render;
|
|
1066
|
-
}
|
|
1067
|
-
/**
|
|
1068
|
-
* The function that is called when the activity is runned.
|
|
1069
|
-
*/
|
|
1070
|
-
get onRun() {
|
|
1071
|
-
return (props) => {
|
|
1072
|
-
return this._onRun(this, props);
|
|
1073
|
-
};
|
|
1074
|
-
}
|
|
1075
|
-
/**
|
|
1076
|
-
* Whether the activity is a deadline.
|
|
1077
|
-
* @returns Whether the activity is a deadline.
|
|
1078
|
-
*/
|
|
1079
|
-
isExpired() {
|
|
1080
|
-
if (this.toDay && this.toDay <= TimeManager.currentDay) {
|
|
1081
|
-
return true;
|
|
1082
|
-
}
|
|
1083
|
-
return false;
|
|
1084
|
-
}
|
|
1085
|
-
/**
|
|
1086
|
-
* Export the activity properties.
|
|
1087
|
-
* @returns The activity properties.
|
|
1088
|
-
*/
|
|
1089
|
-
export() {
|
|
1090
|
-
return {
|
|
1091
|
-
name: this.getStorageProperty("name") || this.defaultName,
|
|
1092
|
-
fromHour: this.getStorageProperty("fromHour") || this.defaultFromHour,
|
|
1093
|
-
toHour: this.getStorageProperty("toHour") || this.defaultToHour,
|
|
1094
|
-
fromDay: this.getStorageProperty("fromDay") || this.defaultFromDay,
|
|
1095
|
-
toDay: this.getStorageProperty("toDay") || this.defaultToDay,
|
|
1096
|
-
disabled: this.getStorageProperty("disabled") || this.defaultDisabled,
|
|
1097
|
-
hidden: this.getStorageProperty("hidden") || this.defaultHidden,
|
|
1098
|
-
renderIcon: this._renderIcon
|
|
1099
|
-
};
|
|
1100
|
-
}
|
|
1101
|
-
};
|
|
1102
|
-
|
|
1103
|
-
// src/classes/navigation/ActivityRoom.ts
|
|
1104
|
-
var ActivityRoom = class extends ActivityStoredAbstract {
|
|
1105
|
-
constructor(id, room, onRun, props) {
|
|
1106
|
-
super(onRun, props);
|
|
1107
|
-
this._id = id;
|
|
1108
|
-
this._room = room;
|
|
1109
|
-
}
|
|
1110
|
-
setStorageProperty(_, __) {
|
|
1111
|
-
this._room.setActivity(this);
|
|
1112
|
-
}
|
|
1113
|
-
getStorageProperty(propertyName) {
|
|
1114
|
-
let activity = this._room.getActivityMemory(this.id);
|
|
1115
|
-
if (!activity || !activity.hasOwnProperty(propertyName)) {
|
|
1116
|
-
return void 0;
|
|
1117
|
-
}
|
|
1118
|
-
return activity[propertyName];
|
|
1119
|
-
}
|
|
1120
|
-
get id() {
|
|
1121
|
-
return this._id;
|
|
1122
|
-
}
|
|
1123
|
-
get room() {
|
|
1124
|
-
return this._room;
|
|
1125
|
-
}
|
|
1126
|
-
export() {
|
|
1127
|
-
let result = {};
|
|
1128
|
-
if (this.name !== void 0) {
|
|
1129
|
-
result["name"] = this.name;
|
|
1130
|
-
}
|
|
1131
|
-
if (this.fromHour !== void 0) {
|
|
1132
|
-
result["fromHour"] = this.fromHour;
|
|
1133
|
-
}
|
|
1134
|
-
if (this.toHour !== void 0) {
|
|
1135
|
-
result["toHour"] = this.toHour;
|
|
1136
|
-
}
|
|
1137
|
-
if (this.fromDay !== void 0) {
|
|
1138
|
-
result["fromDay"] = this.fromDay;
|
|
1139
|
-
}
|
|
1140
|
-
if (this.toDay !== void 0) {
|
|
1141
|
-
result["toDay"] = this.toDay;
|
|
1142
|
-
}
|
|
1143
|
-
if (this.disabled !== void 0) {
|
|
1144
|
-
result["disabled"] = this.disabled;
|
|
1145
|
-
}
|
|
1146
|
-
return result;
|
|
1147
|
-
}
|
|
1148
|
-
};
|
|
1149
|
-
|
|
1150
|
-
// src/classes/navigation/Room.ts
|
|
1151
|
-
var ROOM_CATEGORY = "__nqtr-room__";
|
|
1152
|
-
var RoomBaseModel = class extends pixiVn.StoredClassModel {
|
|
1153
|
-
/**
|
|
1154
|
-
* @param id The id of the room, it must be unique.
|
|
1155
|
-
* @param location The location where the room is.
|
|
1156
|
-
* @param props The properties of the room.
|
|
1157
|
-
*/
|
|
1158
|
-
constructor(id, location, props = {}) {
|
|
1159
|
-
var _a;
|
|
1160
|
-
super(ROOM_CATEGORY, id);
|
|
1161
|
-
this._location = location;
|
|
1162
|
-
this.defaultName = props.name || "";
|
|
1163
|
-
this._renderImage = props.renderImage;
|
|
1164
|
-
this.defaultActivityIds = ((_a = props.defaultActivities) == null ? void 0 : _a.map((activity) => activity.id)) || [];
|
|
1165
|
-
this.defaultDisabled = props.disabled || false;
|
|
1166
|
-
this.defaultHidden = props.hidden || false;
|
|
1167
|
-
this._renderIcon = props.renderIcon;
|
|
1168
|
-
this._isEntrance = props.isEntrance;
|
|
1169
|
-
}
|
|
1170
|
-
/**
|
|
1171
|
-
* The location where the room is.
|
|
1172
|
-
*/
|
|
1173
|
-
get location() {
|
|
1174
|
-
return this._location;
|
|
1175
|
-
}
|
|
1176
|
-
/**
|
|
1177
|
-
* Whether is an entrance room, so when the player enters in the location, it will be the first room to be shown.
|
|
1178
|
-
*/
|
|
1179
|
-
get isEntrance() {
|
|
1180
|
-
return this._isEntrance || false;
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* The name.
|
|
1184
|
-
* If you set undefined, it will return the initial value of name.
|
|
1185
|
-
*/
|
|
1186
|
-
get name() {
|
|
1187
|
-
return this.getStorageProperty("name") || this.defaultName;
|
|
1188
|
-
}
|
|
1189
|
-
set name(value) {
|
|
1190
|
-
this.setStorageProperty("name", value);
|
|
1191
|
-
}
|
|
1192
|
-
/**
|
|
1193
|
-
* The function for rendering the image of the room.
|
|
1219
|
+
* The function for rendering the image of the room.
|
|
1194
1220
|
*/
|
|
1195
1221
|
get renderImage() {
|
|
1196
1222
|
let render = this._renderImage;
|
|
@@ -1383,47 +1409,78 @@ var RoomBaseModel = class extends pixiVn.StoredClassModel {
|
|
|
1383
1409
|
return commitments.filter((c) => c.room.id === this.id);
|
|
1384
1410
|
}
|
|
1385
1411
|
};
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1412
|
+
var GOAL_CATEGORY = "__nqtr-goal__";
|
|
1413
|
+
var Goal = class extends pixiVn.StoredClassModel {
|
|
1414
|
+
constructor(id, props) {
|
|
1415
|
+
super(GOAL_CATEGORY, id);
|
|
1390
1416
|
this._description = props.description;
|
|
1391
|
-
this.
|
|
1392
|
-
this.
|
|
1417
|
+
this._need = props.need || 1;
|
|
1418
|
+
this._defaultHave = props.have || 0;
|
|
1393
1419
|
}
|
|
1420
|
+
/**
|
|
1421
|
+
* The description of the goal.
|
|
1422
|
+
*/
|
|
1394
1423
|
get description() {
|
|
1395
1424
|
return this._description;
|
|
1396
1425
|
}
|
|
1397
|
-
get
|
|
1426
|
+
get need() {
|
|
1427
|
+
return this._need;
|
|
1428
|
+
}
|
|
1429
|
+
get defaultHave() {
|
|
1430
|
+
return this._defaultHave;
|
|
1431
|
+
}
|
|
1432
|
+
};
|
|
1433
|
+
var GoalStage = class extends Goal {
|
|
1434
|
+
constructor(id, stageId, props) {
|
|
1435
|
+
super(id, props);
|
|
1436
|
+
this._stageId = stageId;
|
|
1437
|
+
}
|
|
1438
|
+
get stageId() {
|
|
1439
|
+
return this._stageId;
|
|
1440
|
+
}
|
|
1441
|
+
set stageId(value) {
|
|
1442
|
+
this._stageId = value;
|
|
1443
|
+
}
|
|
1444
|
+
get have() {
|
|
1445
|
+
return this.getStorageProperty("have-" + this._stageId) || this.defaultHave;
|
|
1446
|
+
}
|
|
1447
|
+
set have(value) {
|
|
1448
|
+
if (!this._stageId) {
|
|
1449
|
+
console.error(`[NQTR] The stage id is not set for the goal ${this.id}, so the have value can't be set.`);
|
|
1450
|
+
return;
|
|
1451
|
+
}
|
|
1452
|
+
this.setStorageProperty("have-" + this._stageId, value);
|
|
1453
|
+
}
|
|
1454
|
+
get completed() {
|
|
1398
1455
|
return this.have >= this.need;
|
|
1399
1456
|
}
|
|
1400
|
-
|
|
1401
|
-
|
|
1457
|
+
set completed(value) {
|
|
1458
|
+
if (value) {
|
|
1459
|
+
this.have = this.need;
|
|
1460
|
+
} else {
|
|
1461
|
+
console.warn(`[NQTR] The goal can't be set as not completed. You must edit the have value manually.`);
|
|
1462
|
+
}
|
|
1402
1463
|
}
|
|
1403
1464
|
find() {
|
|
1404
1465
|
this.have++;
|
|
1405
1466
|
}
|
|
1406
|
-
get export() {
|
|
1407
|
-
return {
|
|
1408
|
-
description: this.description,
|
|
1409
|
-
need: this.need,
|
|
1410
|
-
have: this.have
|
|
1411
|
-
};
|
|
1412
|
-
}
|
|
1413
1467
|
};
|
|
1414
|
-
var
|
|
1415
|
-
var
|
|
1416
|
-
constructor(id,
|
|
1417
|
-
super(
|
|
1418
|
-
this._stages = stages;
|
|
1468
|
+
var STAGE_CATEGORY = "__nqtr-stage__";
|
|
1469
|
+
var Stage = class extends pixiVn.StoredClassModel {
|
|
1470
|
+
constructor(id, props) {
|
|
1471
|
+
super(STAGE_CATEGORY, id);
|
|
1419
1472
|
this._name = props.name || "";
|
|
1473
|
+
this._defaultGoals = props.goals || [];
|
|
1474
|
+
this._flags = props.flags || [];
|
|
1420
1475
|
this._description = props.description || "";
|
|
1421
|
-
this.
|
|
1422
|
-
this.
|
|
1423
|
-
this.
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1476
|
+
this._adviceDescription = props.adviceDescription || "";
|
|
1477
|
+
this._renderImage = props.renderImage;
|
|
1478
|
+
this._daysRequiredToStart = props.daysRequiredToStart;
|
|
1479
|
+
this._flagsRequiredToStart = props.flagsRequired || [];
|
|
1480
|
+
this._questsRequiredToStart = props.questsRequired || [];
|
|
1481
|
+
this._requestDescriptionToStart = props.requestDescription || "";
|
|
1482
|
+
this._onStart = props.onStart;
|
|
1483
|
+
this._onEnd = props.onEnd;
|
|
1427
1484
|
}
|
|
1428
1485
|
get name() {
|
|
1429
1486
|
return this._name;
|
|
@@ -1431,50 +1488,138 @@ var QuestBaseModel = class extends pixiVn.StoredClassModel {
|
|
|
1431
1488
|
get description() {
|
|
1432
1489
|
return this._description;
|
|
1433
1490
|
}
|
|
1434
|
-
get
|
|
1435
|
-
return this.
|
|
1491
|
+
get adviceDescription() {
|
|
1492
|
+
return this._adviceDescription;
|
|
1436
1493
|
}
|
|
1437
|
-
|
|
1438
|
-
|
|
1494
|
+
/**
|
|
1495
|
+
* The function for rendering the image of the stage.
|
|
1496
|
+
*/
|
|
1497
|
+
get renderImage() {
|
|
1498
|
+
let render = this._renderImage;
|
|
1499
|
+
if (render === void 0) {
|
|
1500
|
+
return void 0;
|
|
1501
|
+
}
|
|
1502
|
+
if (typeof render === "function") {
|
|
1503
|
+
return (props) => {
|
|
1504
|
+
return render(this, props);
|
|
1505
|
+
};
|
|
1506
|
+
}
|
|
1507
|
+
return (props) => render;
|
|
1439
1508
|
}
|
|
1440
|
-
get
|
|
1441
|
-
return this.
|
|
1509
|
+
get defaultGoals() {
|
|
1510
|
+
return this._defaultGoals;
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* The list of flags that the player must complete to finish the stage.
|
|
1514
|
+
*/
|
|
1515
|
+
get flags() {
|
|
1516
|
+
return this._flags;
|
|
1517
|
+
}
|
|
1518
|
+
get daysRequiredToStart() {
|
|
1519
|
+
return this._daysRequiredToStart || 0;
|
|
1520
|
+
}
|
|
1521
|
+
get flagsRequiredToStart() {
|
|
1522
|
+
return this._flagsRequiredToStart;
|
|
1523
|
+
}
|
|
1524
|
+
get questsRequiredToStart() {
|
|
1525
|
+
return this._questsRequiredToStart || [];
|
|
1526
|
+
}
|
|
1527
|
+
get requestDescriptionToStart() {
|
|
1528
|
+
return this._requestDescriptionToStart;
|
|
1529
|
+
}
|
|
1530
|
+
get onStart() {
|
|
1531
|
+
return this._onStart;
|
|
1532
|
+
}
|
|
1533
|
+
get onEnd() {
|
|
1534
|
+
return this._onEnd;
|
|
1442
1535
|
}
|
|
1443
1536
|
};
|
|
1444
|
-
var
|
|
1445
|
-
var StageBaseModel = class extends pixiVn.StoredClassModel {
|
|
1537
|
+
var StageQuest = class extends Stage {
|
|
1446
1538
|
constructor(id, props) {
|
|
1447
|
-
super(
|
|
1448
|
-
this._completed = false;
|
|
1449
|
-
this._active = false;
|
|
1450
|
-
this.defaultGoals = [];
|
|
1451
|
-
this._name = props.name || "";
|
|
1452
|
-
this._description = props.description || "";
|
|
1453
|
-
this._adviceDescription = props.adviceDescription || "";
|
|
1454
|
-
this._image = props.image || "";
|
|
1455
|
-
this._daysRequiredToStart = props.daysRequiredToStart;
|
|
1456
|
-
this._flagsRequired = props.flagsRequired;
|
|
1457
|
-
this._questsRequired = props.questsRequired;
|
|
1458
|
-
this._requestDescription = props.requestDescription || "";
|
|
1459
|
-
this._onStart = props.onStart;
|
|
1460
|
-
this._onEnd = props.onEnd;
|
|
1539
|
+
super(id, props);
|
|
1461
1540
|
}
|
|
1462
1541
|
get completed() {
|
|
1463
|
-
|
|
1542
|
+
let storedCompleted = this.getStorageProperty("completed");
|
|
1543
|
+
if (storedCompleted) {
|
|
1544
|
+
return storedCompleted;
|
|
1545
|
+
}
|
|
1546
|
+
if (!this.flags.every((flag) => pixiVn.getFlag(flag.flag))) {
|
|
1547
|
+
return false;
|
|
1548
|
+
}
|
|
1549
|
+
if (!this.goals.every((goal) => goal.completed)) {
|
|
1550
|
+
return false;
|
|
1551
|
+
}
|
|
1552
|
+
return true;
|
|
1464
1553
|
}
|
|
1465
|
-
|
|
1466
|
-
|
|
1554
|
+
set completed(value) {
|
|
1555
|
+
this.setStorageProperty("completed", value);
|
|
1467
1556
|
}
|
|
1557
|
+
/**
|
|
1558
|
+
* The list of goals that the player needs to complete to finish the stage.
|
|
1559
|
+
*/
|
|
1468
1560
|
get goals() {
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1561
|
+
return this.defaultGoals.map((goal) => {
|
|
1562
|
+
return new GoalStage(goal.id, this.id, goal);
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
get prevStageEndDay() {
|
|
1566
|
+
return this.getStorageProperty("prevStageEndDay");
|
|
1567
|
+
}
|
|
1568
|
+
set prevStageEndDay(value) {
|
|
1569
|
+
this.setStorageProperty("prevStageEndDay", value);
|
|
1570
|
+
}
|
|
1571
|
+
get startDay() {
|
|
1572
|
+
let prevStageEndDay = this.prevStageEndDay;
|
|
1573
|
+
if (prevStageEndDay === void 0) {
|
|
1574
|
+
return void 0;
|
|
1575
|
+
}
|
|
1576
|
+
return prevStageEndDay + this.daysRequiredToStart;
|
|
1577
|
+
}
|
|
1578
|
+
get canStart() {
|
|
1579
|
+
let daysRequired = this.daysRequiredToStart;
|
|
1580
|
+
if (daysRequired > 0) {
|
|
1581
|
+
let prevStageEndDay = this.prevStageEndDay;
|
|
1582
|
+
if (prevStageEndDay === void 0) {
|
|
1583
|
+
return false;
|
|
1584
|
+
}
|
|
1585
|
+
if (prevStageEndDay + daysRequired > TimeManager.currentDay) {
|
|
1586
|
+
return false;
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
if (this.flagsRequiredToStart.length > 0 && !this.flagsRequiredToStart.every((flag) => pixiVn.getFlag(flag.flag))) {
|
|
1590
|
+
return false;
|
|
1472
1591
|
}
|
|
1473
|
-
|
|
1592
|
+
if (this.questsRequiredToStart.length > 0 && !this.questsRequiredToStart.every(
|
|
1593
|
+
(q) => q.quest.currentStageIndex && q.quest.currentStageIndex >= q.stageNumber
|
|
1594
|
+
)) {
|
|
1595
|
+
return false;
|
|
1596
|
+
}
|
|
1597
|
+
return true;
|
|
1598
|
+
}
|
|
1599
|
+
get onStart() {
|
|
1600
|
+
if (this.daysRequiredToStart > 0) {
|
|
1601
|
+
this.prevStageEndDay = TimeManager.currentDay;
|
|
1602
|
+
}
|
|
1603
|
+
return super.onStart;
|
|
1604
|
+
}
|
|
1605
|
+
};
|
|
1606
|
+
|
|
1607
|
+
// src/classes/quest/Quest.ts
|
|
1608
|
+
var QUEST_CATEGORY = "__nqtr-quest__";
|
|
1609
|
+
var Quest = class extends pixiVn.StoredClassModel {
|
|
1610
|
+
constructor(id, stages, props) {
|
|
1611
|
+
super(QUEST_CATEGORY, id);
|
|
1612
|
+
this._stages = stages;
|
|
1613
|
+
this._name = props.name || "";
|
|
1614
|
+
this._description = props.description || "";
|
|
1615
|
+
this._renderIcon = props.renderIcon;
|
|
1616
|
+
this._renderImage = props.renderImage;
|
|
1617
|
+
this._isInDevelopment = props.isInDevelopment || false;
|
|
1474
1618
|
}
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1619
|
+
get stages() {
|
|
1620
|
+
return this._stages.map((stage, index) => {
|
|
1621
|
+
return new StageQuest(stage.id, stage);
|
|
1622
|
+
});
|
|
1478
1623
|
}
|
|
1479
1624
|
get name() {
|
|
1480
1625
|
return this._name;
|
|
@@ -1482,29 +1627,99 @@ var StageBaseModel = class extends pixiVn.StoredClassModel {
|
|
|
1482
1627
|
get description() {
|
|
1483
1628
|
return this._description;
|
|
1484
1629
|
}
|
|
1485
|
-
|
|
1486
|
-
|
|
1630
|
+
/**
|
|
1631
|
+
* The function for rendering the icon of the quest.
|
|
1632
|
+
*/
|
|
1633
|
+
get renderIcon() {
|
|
1634
|
+
let render = this._renderIcon;
|
|
1635
|
+
if (render === void 0) {
|
|
1636
|
+
return void 0;
|
|
1637
|
+
}
|
|
1638
|
+
if (typeof render === "function") {
|
|
1639
|
+
return (props) => {
|
|
1640
|
+
return render(this, props);
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
return (props) => render;
|
|
1487
1644
|
}
|
|
1488
|
-
|
|
1489
|
-
|
|
1645
|
+
/**
|
|
1646
|
+
* The function for rendering the image of the quest.
|
|
1647
|
+
*/
|
|
1648
|
+
get renderImage() {
|
|
1649
|
+
let render = this._renderImage;
|
|
1650
|
+
if (render === void 0) {
|
|
1651
|
+
return void 0;
|
|
1652
|
+
}
|
|
1653
|
+
if (typeof render === "function") {
|
|
1654
|
+
return (props) => {
|
|
1655
|
+
return render(this, props);
|
|
1656
|
+
};
|
|
1657
|
+
}
|
|
1658
|
+
return (props) => render;
|
|
1490
1659
|
}
|
|
1491
|
-
get
|
|
1492
|
-
return this.
|
|
1660
|
+
get isInDevelopment() {
|
|
1661
|
+
return this._isInDevelopment;
|
|
1493
1662
|
}
|
|
1494
|
-
get
|
|
1495
|
-
return this.
|
|
1663
|
+
get currentStageIndex() {
|
|
1664
|
+
return this.getStorageProperty("currentStageIndex");
|
|
1496
1665
|
}
|
|
1497
|
-
|
|
1498
|
-
|
|
1666
|
+
set currentStageIndex(value) {
|
|
1667
|
+
this.setStorageProperty("currentStageIndex", value);
|
|
1499
1668
|
}
|
|
1500
|
-
get
|
|
1501
|
-
|
|
1669
|
+
get currentStage() {
|
|
1670
|
+
let index = this.currentStageIndex;
|
|
1671
|
+
if (index === void 0 || index >= this.stages.length) {
|
|
1672
|
+
return void 0;
|
|
1673
|
+
}
|
|
1674
|
+
return this.stages[index];
|
|
1502
1675
|
}
|
|
1503
|
-
get
|
|
1504
|
-
return this.
|
|
1676
|
+
get started() {
|
|
1677
|
+
return this.currentStageIndex !== void 0;
|
|
1505
1678
|
}
|
|
1506
|
-
get
|
|
1507
|
-
return this.
|
|
1679
|
+
get completed() {
|
|
1680
|
+
return this.currentStageIndex === this.stages.length;
|
|
1681
|
+
}
|
|
1682
|
+
start() {
|
|
1683
|
+
if (this.started) {
|
|
1684
|
+
console.warn(`[NQTR] Quest ${this.id} is already started`);
|
|
1685
|
+
return;
|
|
1686
|
+
}
|
|
1687
|
+
if (this.stages.length === 0) {
|
|
1688
|
+
console.error(`[NQTR] Quest ${this.id} has no stages`);
|
|
1689
|
+
return;
|
|
1690
|
+
}
|
|
1691
|
+
this.currentStageIndex = 0;
|
|
1692
|
+
let currentStage = this.currentStage;
|
|
1693
|
+
if (currentStage && currentStage.onStart) {
|
|
1694
|
+
return currentStage.onStart();
|
|
1695
|
+
} else {
|
|
1696
|
+
console.error(`[NQTR] Quest ${this.id} has no start stage`);
|
|
1697
|
+
}
|
|
1698
|
+
}
|
|
1699
|
+
tryToGoNextStage() {
|
|
1700
|
+
if (!this.started) {
|
|
1701
|
+
return;
|
|
1702
|
+
}
|
|
1703
|
+
if (this.completed) {
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1706
|
+
let currentStage = this.currentStage;
|
|
1707
|
+
let currentStageIndex = this.currentStageIndex;
|
|
1708
|
+
if (!currentStage || currentStageIndex === void 0) {
|
|
1709
|
+
console.error(`[NQTR] Quest ${this.id} has no current stage`);
|
|
1710
|
+
return;
|
|
1711
|
+
}
|
|
1712
|
+
if (currentStage.completed) {
|
|
1713
|
+
let nextStageIndex = currentStageIndex + 1;
|
|
1714
|
+
currentStageIndex = nextStageIndex;
|
|
1715
|
+
let nextStage = this.currentStage;
|
|
1716
|
+
if (currentStage && currentStage.onEnd) {
|
|
1717
|
+
currentStage.onEnd();
|
|
1718
|
+
}
|
|
1719
|
+
if (nextStage && nextStage.onStart) {
|
|
1720
|
+
return nextStage.onStart();
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1508
1723
|
}
|
|
1509
1724
|
};
|
|
1510
1725
|
var CURRENT_ROOM_MEMORY_KEY = "___nqtr-current_room_memory___";
|
|
@@ -1568,13 +1783,14 @@ function currentActivities() {
|
|
|
1568
1783
|
}
|
|
1569
1784
|
|
|
1570
1785
|
exports.ActivityModel = ActivityModel;
|
|
1786
|
+
exports.ActivityRoom = ActivityRoom;
|
|
1571
1787
|
exports.CommitmentBaseModel = CommitmentBaseModel;
|
|
1572
1788
|
exports.Goal = Goal;
|
|
1573
1789
|
exports.LocationBaseModel = LocationBaseModel;
|
|
1574
1790
|
exports.MapBaseModel = MapBaseModel;
|
|
1575
|
-
exports.
|
|
1791
|
+
exports.Quest = Quest;
|
|
1576
1792
|
exports.RoomBaseModel = RoomBaseModel;
|
|
1577
|
-
exports.
|
|
1793
|
+
exports.Stage = Stage;
|
|
1578
1794
|
exports.TimeManager = TimeManager;
|
|
1579
1795
|
exports.addCommitment = addCommitment;
|
|
1580
1796
|
exports.clearExpiredActivities = clearExpiredActivities;
|
|
@@ -1589,9 +1805,11 @@ exports.getCueerntMap = getCueerntMap;
|
|
|
1589
1805
|
exports.getCurrenrLocation = getCurrenrLocation;
|
|
1590
1806
|
exports.getCurrentRoom = getCurrentRoom;
|
|
1591
1807
|
exports.getCurrentRoutine = getCurrentRoutine;
|
|
1808
|
+
exports.getQuestById = getQuestById;
|
|
1592
1809
|
exports.getRoomById = getRoomById;
|
|
1593
1810
|
exports.saveActivity = saveActivity;
|
|
1594
1811
|
exports.saveCommitment = saveCommitment;
|
|
1812
|
+
exports.saveQuest = saveQuest;
|
|
1595
1813
|
exports.saveRoom = saveRoom;
|
|
1596
1814
|
exports.setCurrentRoom = setCurrentRoom;
|
|
1597
1815
|
exports.setFixedRoutine = setFixedRoutine;
|