@drincs/nqtr 0.3.7 → 0.4.1
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/RoomInterface-BRA386zn.d.mts +171 -0
- package/dist/RoomInterface-Cwm08AzD.d.ts +171 -0
- package/dist/{StageInterface-DX74DUxG.d.mts → StageInterface-LDgQToad.d.mts} +28 -14
- package/dist/{StageInterface-DX74DUxG.d.ts → StageInterface-LDgQToad.d.ts} +28 -14
- package/dist/classes/index.cjs +2 -0
- package/dist/classes/index.cjs.map +1 -0
- package/dist/classes/index.d.mts +508 -31
- package/dist/classes/index.d.ts +508 -31
- package/dist/classes/index.mjs +1 -1
- package/dist/classes/index.mjs.map +1 -1
- package/dist/decorators/index.cjs +2 -0
- package/dist/decorators/index.cjs.map +1 -0
- package/dist/decorators/index.d.mts +161 -9
- package/dist/decorators/index.d.ts +161 -9
- package/dist/decorators/index.mjs +1 -1
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/index-B-x-OmU2.d.ts +186 -0
- package/dist/index-CJubtUni.d.mts +301 -0
- package/dist/index-Cq_kqDbo.d.ts +301 -0
- package/dist/index-k8ho_YWr.d.mts +186 -0
- package/dist/index.cjs +2 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +16 -46
- package/dist/index.d.ts +16 -46
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/dist/interface/index.cjs +2 -0
- package/dist/{functions/index.js.map → interface/index.cjs.map} +1 -1
- package/dist/interface/index.d.mts +3 -14
- package/dist/interface/index.d.ts +3 -14
- package/dist/managers/index.cjs +2 -0
- package/dist/managers/index.cjs.map +1 -0
- package/dist/managers/index.d.mts +4 -17
- package/dist/managers/index.d.ts +4 -17
- package/dist/managers/index.mjs +1 -1
- package/dist/managers/index.mjs.map +1 -1
- package/dist/types/index.cjs +2 -0
- package/dist/{functions/index.mjs.map → types/index.cjs.map} +1 -1
- package/dist/types/index.d.mts +60 -4
- package/dist/types/index.d.ts +60 -4
- package/package.json +13 -5
- package/dist/RoomInterface-CdAM_q7P.d.ts +0 -83
- package/dist/RoomInterface-DURfkQ7u.d.mts +0 -83
- package/dist/classes/ActivityBaseModel.d.mts +0 -63
- package/dist/classes/ActivityBaseModel.d.ts +0 -63
- package/dist/classes/ActivityBaseModel.js +0 -2
- package/dist/classes/ActivityBaseModel.js.map +0 -1
- package/dist/classes/ActivityBaseModel.mjs +0 -2
- package/dist/classes/ActivityBaseModel.mjs.map +0 -1
- package/dist/classes/ActivityStoredClass.d.mts +0 -27
- package/dist/classes/ActivityStoredClass.d.ts +0 -27
- package/dist/classes/ActivityStoredClass.js +0 -2
- package/dist/classes/ActivityStoredClass.js.map +0 -1
- package/dist/classes/ActivityStoredClass.mjs +0 -2
- package/dist/classes/ActivityStoredClass.mjs.map +0 -1
- package/dist/classes/CommitmentBaseModel.d.mts +0 -65
- package/dist/classes/CommitmentBaseModel.d.ts +0 -65
- package/dist/classes/CommitmentBaseModel.js +0 -2
- package/dist/classes/CommitmentBaseModel.js.map +0 -1
- package/dist/classes/CommitmentBaseModel.mjs +0 -2
- package/dist/classes/CommitmentBaseModel.mjs.map +0 -1
- package/dist/classes/CommitmentStoredClass.d.mts +0 -31
- package/dist/classes/CommitmentStoredClass.d.ts +0 -31
- package/dist/classes/CommitmentStoredClass.js +0 -2
- package/dist/classes/CommitmentStoredClass.js.map +0 -1
- package/dist/classes/CommitmentStoredClass.mjs +0 -2
- package/dist/classes/CommitmentStoredClass.mjs.map +0 -1
- package/dist/classes/index.js +0 -2
- package/dist/classes/index.js.map +0 -1
- package/dist/classes/navigation/LocationBaseModel.d.mts +0 -54
- package/dist/classes/navigation/LocationBaseModel.d.ts +0 -54
- package/dist/classes/navigation/LocationBaseModel.js +0 -2
- package/dist/classes/navigation/LocationBaseModel.js.map +0 -1
- package/dist/classes/navigation/LocationBaseModel.mjs +0 -2
- package/dist/classes/navigation/LocationBaseModel.mjs.map +0 -1
- package/dist/classes/navigation/LocationStoredClass.d.mts +0 -23
- package/dist/classes/navigation/LocationStoredClass.d.ts +0 -23
- package/dist/classes/navigation/LocationStoredClass.js +0 -2
- package/dist/classes/navigation/LocationStoredClass.js.map +0 -1
- package/dist/classes/navigation/LocationStoredClass.mjs +0 -2
- package/dist/classes/navigation/LocationStoredClass.mjs.map +0 -1
- package/dist/classes/navigation/MapBaseModel.d.mts +0 -41
- package/dist/classes/navigation/MapBaseModel.d.ts +0 -41
- package/dist/classes/navigation/MapBaseModel.js +0 -2
- package/dist/classes/navigation/MapBaseModel.js.map +0 -1
- package/dist/classes/navigation/MapBaseModel.mjs +0 -2
- package/dist/classes/navigation/MapBaseModel.mjs.map +0 -1
- package/dist/classes/navigation/MapStoredClass.d.mts +0 -14
- package/dist/classes/navigation/MapStoredClass.d.ts +0 -14
- package/dist/classes/navigation/MapStoredClass.js +0 -2
- package/dist/classes/navigation/MapStoredClass.js.map +0 -1
- package/dist/classes/navigation/MapStoredClass.mjs +0 -2
- package/dist/classes/navigation/MapStoredClass.mjs.map +0 -1
- package/dist/classes/navigation/NavigationAbstractClass.d.mts +0 -48
- package/dist/classes/navigation/NavigationAbstractClass.d.ts +0 -48
- package/dist/classes/navigation/NavigationAbstractClass.js +0 -2
- package/dist/classes/navigation/NavigationAbstractClass.js.map +0 -1
- package/dist/classes/navigation/NavigationAbstractClass.mjs +0 -2
- package/dist/classes/navigation/NavigationAbstractClass.mjs.map +0 -1
- package/dist/classes/navigation/RoomBaseModel.d.mts +0 -67
- package/dist/classes/navigation/RoomBaseModel.d.ts +0 -67
- package/dist/classes/navigation/RoomBaseModel.js +0 -2
- package/dist/classes/navigation/RoomBaseModel.js.map +0 -1
- package/dist/classes/navigation/RoomBaseModel.mjs +0 -2
- package/dist/classes/navigation/RoomBaseModel.mjs.map +0 -1
- package/dist/classes/navigation/RoomStoredClass.d.mts +0 -24
- package/dist/classes/navigation/RoomStoredClass.d.ts +0 -24
- package/dist/classes/navigation/RoomStoredClass.js +0 -2
- package/dist/classes/navigation/RoomStoredClass.js.map +0 -1
- package/dist/classes/navigation/RoomStoredClass.mjs +0 -2
- package/dist/classes/navigation/RoomStoredClass.mjs.map +0 -1
- package/dist/classes/quest/QuestBaseModel.d.mts +0 -36
- package/dist/classes/quest/QuestBaseModel.d.ts +0 -36
- package/dist/classes/quest/QuestBaseModel.js +0 -2
- package/dist/classes/quest/QuestBaseModel.js.map +0 -1
- package/dist/classes/quest/QuestBaseModel.mjs +0 -2
- package/dist/classes/quest/QuestBaseModel.mjs.map +0 -1
- package/dist/classes/quest/QuestStoredClass.d.mts +0 -37
- package/dist/classes/quest/QuestStoredClass.d.ts +0 -37
- package/dist/classes/quest/QuestStoredClass.js +0 -2
- package/dist/classes/quest/QuestStoredClass.js.map +0 -1
- package/dist/classes/quest/QuestStoredClass.mjs +0 -2
- package/dist/classes/quest/QuestStoredClass.mjs.map +0 -1
- package/dist/classes/quest/StageBaseModel.d.mts +0 -50
- package/dist/classes/quest/StageBaseModel.d.ts +0 -50
- package/dist/classes/quest/StageBaseModel.js +0 -2
- package/dist/classes/quest/StageBaseModel.js.map +0 -1
- package/dist/classes/quest/StageBaseModel.mjs +0 -2
- package/dist/classes/quest/StageBaseModel.mjs.map +0 -1
- package/dist/classes/quest/StageStoredClass.d.mts +0 -46
- package/dist/classes/quest/StageStoredClass.d.ts +0 -46
- package/dist/classes/quest/StageStoredClass.js +0 -2
- package/dist/classes/quest/StageStoredClass.js.map +0 -1
- package/dist/classes/quest/StageStoredClass.mjs +0 -2
- package/dist/classes/quest/StageStoredClass.mjs.map +0 -1
- package/dist/constants.d.mts +0 -4
- package/dist/constants.d.ts +0 -4
- package/dist/constants.js +0 -2
- package/dist/constants.js.map +0 -1
- package/dist/constants.mjs +0 -2
- package/dist/constants.mjs.map +0 -1
- package/dist/decorators/ActivityDecorator.d.mts +0 -15
- package/dist/decorators/ActivityDecorator.d.ts +0 -15
- package/dist/decorators/ActivityDecorator.js +0 -2
- package/dist/decorators/ActivityDecorator.js.map +0 -1
- package/dist/decorators/ActivityDecorator.mjs +0 -2
- package/dist/decorators/ActivityDecorator.mjs.map +0 -1
- package/dist/decorators/CommitmentDecorator.d.mts +0 -27
- package/dist/decorators/CommitmentDecorator.d.ts +0 -27
- package/dist/decorators/CommitmentDecorator.js +0 -2
- package/dist/decorators/CommitmentDecorator.js.map +0 -1
- package/dist/decorators/CommitmentDecorator.mjs +0 -2
- package/dist/decorators/CommitmentDecorator.mjs.map +0 -1
- package/dist/decorators/QuestDecorator.d.mts +0 -22
- package/dist/decorators/QuestDecorator.d.ts +0 -22
- package/dist/decorators/QuestDecorator.js +0 -2
- package/dist/decorators/QuestDecorator.js.map +0 -1
- package/dist/decorators/QuestDecorator.mjs +0 -2
- package/dist/decorators/QuestDecorator.mjs.map +0 -1
- package/dist/decorators/RoomDecorator.d.mts +0 -28
- package/dist/decorators/RoomDecorator.d.ts +0 -28
- package/dist/decorators/RoomDecorator.js +0 -2
- package/dist/decorators/RoomDecorator.js.map +0 -1
- package/dist/decorators/RoomDecorator.mjs +0 -2
- package/dist/decorators/RoomDecorator.mjs.map +0 -1
- package/dist/decorators/index.js +0 -2
- package/dist/decorators/index.js.map +0 -1
- package/dist/functions/index.d.mts +0 -2
- package/dist/functions/index.d.ts +0 -2
- package/dist/functions/index.js +0 -2
- package/dist/functions/index.mjs +0 -2
- package/dist/index.js +0 -2
- package/dist/index.js.map +0 -1
- package/dist/interface/ActivityInterface.d.mts +0 -40
- package/dist/interface/ActivityInterface.d.ts +0 -40
- package/dist/interface/ActivityInterface.js +0 -2
- package/dist/interface/ActivityInterface.js.map +0 -1
- package/dist/interface/ActivityInterface.mjs +0 -2
- package/dist/interface/ActivityInterface.mjs.map +0 -1
- package/dist/interface/ActivityProps.d.mts +0 -48
- package/dist/interface/ActivityProps.d.ts +0 -48
- package/dist/interface/ActivityProps.js +0 -2
- package/dist/interface/ActivityProps.js.map +0 -1
- package/dist/interface/ActivityProps.mjs +0 -2
- package/dist/interface/ActivityProps.mjs.map +0 -1
- package/dist/interface/CommitmentInterface.d.mts +0 -6
- package/dist/interface/CommitmentInterface.d.ts +0 -6
- package/dist/interface/CommitmentInterface.js +0 -2
- package/dist/interface/CommitmentInterface.js.map +0 -1
- package/dist/interface/CommitmentInterface.mjs +0 -2
- package/dist/interface/CommitmentInterface.mjs.map +0 -1
- package/dist/interface/CommitmentProps.d.mts +0 -79
- package/dist/interface/CommitmentProps.d.ts +0 -79
- package/dist/interface/CommitmentProps.js +0 -2
- package/dist/interface/CommitmentProps.js.map +0 -1
- package/dist/interface/CommitmentProps.mjs +0 -2
- package/dist/interface/CommitmentProps.mjs.map +0 -1
- package/dist/interface/index.js +0 -2
- package/dist/interface/index.js.map +0 -1
- package/dist/interface/navigation/LocationBaseModelProps.d.mts +0 -32
- package/dist/interface/navigation/LocationBaseModelProps.d.ts +0 -32
- package/dist/interface/navigation/LocationBaseModelProps.js +0 -2
- package/dist/interface/navigation/LocationBaseModelProps.js.map +0 -1
- package/dist/interface/navigation/LocationBaseModelProps.mjs +0 -2
- package/dist/interface/navigation/LocationBaseModelProps.mjs.map +0 -1
- package/dist/interface/navigation/LocationInterface.d.mts +0 -6
- package/dist/interface/navigation/LocationInterface.d.ts +0 -6
- package/dist/interface/navigation/LocationInterface.js +0 -2
- package/dist/interface/navigation/LocationInterface.js.map +0 -1
- package/dist/interface/navigation/LocationInterface.mjs +0 -2
- package/dist/interface/navigation/LocationInterface.mjs.map +0 -1
- package/dist/interface/navigation/MapBaseModelProps.d.mts +0 -22
- package/dist/interface/navigation/MapBaseModelProps.d.ts +0 -22
- package/dist/interface/navigation/MapBaseModelProps.js +0 -2
- package/dist/interface/navigation/MapBaseModelProps.js.map +0 -1
- package/dist/interface/navigation/MapBaseModelProps.mjs +0 -2
- package/dist/interface/navigation/MapBaseModelProps.mjs.map +0 -1
- package/dist/interface/navigation/MapInterface.d.mts +0 -6
- package/dist/interface/navigation/MapInterface.d.ts +0 -6
- package/dist/interface/navigation/MapInterface.js +0 -2
- package/dist/interface/navigation/MapInterface.js.map +0 -1
- package/dist/interface/navigation/MapInterface.mjs +0 -2
- package/dist/interface/navigation/MapInterface.mjs.map +0 -1
- package/dist/interface/navigation/NavigationAbstractClass.d.mts +0 -54
- package/dist/interface/navigation/NavigationAbstractClass.d.ts +0 -54
- package/dist/interface/navigation/NavigationAbstractClass.js +0 -2
- package/dist/interface/navigation/NavigationAbstractClass.js.map +0 -1
- package/dist/interface/navigation/NavigationAbstractClass.mjs +0 -2
- package/dist/interface/navigation/NavigationAbstractClass.mjs.map +0 -1
- package/dist/interface/navigation/RoomBaseModelProps.d.mts +0 -37
- package/dist/interface/navigation/RoomBaseModelProps.d.ts +0 -37
- package/dist/interface/navigation/RoomBaseModelProps.js +0 -2
- package/dist/interface/navigation/RoomBaseModelProps.js.map +0 -1
- package/dist/interface/navigation/RoomBaseModelProps.mjs +0 -2
- package/dist/interface/navigation/RoomBaseModelProps.mjs.map +0 -1
- package/dist/interface/navigation/RoomInterface.d.mts +0 -6
- package/dist/interface/navigation/RoomInterface.d.ts +0 -6
- package/dist/interface/navigation/RoomInterface.js +0 -2
- package/dist/interface/navigation/RoomInterface.js.map +0 -1
- package/dist/interface/navigation/RoomInterface.mjs +0 -2
- package/dist/interface/navigation/RoomInterface.mjs.map +0 -1
- package/dist/interface/quest/QuestInterface.d.mts +0 -2
- package/dist/interface/quest/QuestInterface.d.ts +0 -2
- package/dist/interface/quest/QuestInterface.js +0 -2
- package/dist/interface/quest/QuestInterface.js.map +0 -1
- package/dist/interface/quest/QuestInterface.mjs +0 -2
- package/dist/interface/quest/QuestInterface.mjs.map +0 -1
- package/dist/interface/quest/QuestProps.d.mts +0 -39
- package/dist/interface/quest/QuestProps.d.ts +0 -39
- package/dist/interface/quest/QuestProps.js +0 -2
- package/dist/interface/quest/QuestProps.js.map +0 -1
- package/dist/interface/quest/QuestProps.mjs +0 -2
- package/dist/interface/quest/QuestProps.mjs.map +0 -1
- package/dist/interface/quest/StageFlags.d.mts +0 -12
- package/dist/interface/quest/StageFlags.d.ts +0 -12
- package/dist/interface/quest/StageFlags.js +0 -2
- package/dist/interface/quest/StageFlags.js.map +0 -1
- package/dist/interface/quest/StageFlags.mjs +0 -2
- package/dist/interface/quest/StageFlags.mjs.map +0 -1
- package/dist/interface/quest/StageInterface.d.mts +0 -2
- package/dist/interface/quest/StageInterface.d.ts +0 -2
- package/dist/interface/quest/StageInterface.js +0 -2
- package/dist/interface/quest/StageInterface.js.map +0 -1
- package/dist/interface/quest/StageInterface.mjs +0 -2
- package/dist/interface/quest/StageInterface.mjs.map +0 -1
- package/dist/interface/quest/StageProps.d.mts +0 -60
- package/dist/interface/quest/StageProps.d.ts +0 -60
- package/dist/interface/quest/StageProps.js +0 -2
- package/dist/interface/quest/StageProps.js.map +0 -1
- package/dist/interface/quest/StageProps.mjs +0 -2
- package/dist/interface/quest/StageProps.mjs.map +0 -1
- package/dist/managers/NavigatorManager.d.mts +0 -22
- package/dist/managers/NavigatorManager.d.ts +0 -22
- package/dist/managers/NavigatorManager.js +0 -2
- package/dist/managers/NavigatorManager.js.map +0 -1
- package/dist/managers/NavigatorManager.mjs +0 -2
- package/dist/managers/NavigatorManager.mjs.map +0 -1
- package/dist/managers/QuestManager.d.mts +0 -17
- package/dist/managers/QuestManager.d.ts +0 -17
- package/dist/managers/QuestManager.js +0 -2
- package/dist/managers/QuestManager.js.map +0 -1
- package/dist/managers/QuestManager.mjs +0 -2
- package/dist/managers/QuestManager.mjs.map +0 -1
- package/dist/managers/RoutineManager.d.mts +0 -59
- package/dist/managers/RoutineManager.d.ts +0 -59
- package/dist/managers/RoutineManager.js +0 -2
- package/dist/managers/RoutineManager.js.map +0 -1
- package/dist/managers/RoutineManager.mjs +0 -2
- package/dist/managers/RoutineManager.mjs.map +0 -1
- package/dist/managers/TimeManager.d.mts +0 -74
- package/dist/managers/TimeManager.d.ts +0 -74
- package/dist/managers/TimeManager.js +0 -2
- package/dist/managers/TimeManager.js.map +0 -1
- package/dist/managers/TimeManager.mjs +0 -2
- package/dist/managers/TimeManager.mjs.map +0 -1
- package/dist/managers/TimeManagerSettings.d.mts +0 -13
- package/dist/managers/TimeManagerSettings.d.ts +0 -13
- package/dist/managers/TimeManagerSettings.js +0 -2
- package/dist/managers/TimeManagerSettings.js.map +0 -1
- package/dist/managers/TimeManagerSettings.mjs +0 -2
- package/dist/managers/TimeManagerSettings.mjs.map +0 -1
- package/dist/managers/index.js +0 -2
- package/dist/managers/index.js.map +0 -1
- package/dist/nqtr.d.d.mts +0 -195
- package/dist/nqtr.d.d.ts +0 -195
- package/dist/nqtr.d.js +0 -2
- package/dist/nqtr.d.js.map +0 -1
- package/dist/nqtr.d.mjs +0 -2
- package/dist/nqtr.d.mjs.map +0 -1
- package/dist/types/ExecutionType.d.mts +0 -3
- package/dist/types/ExecutionType.d.ts +0 -3
- package/dist/types/ExecutionType.js +0 -2
- package/dist/types/ExecutionType.js.map +0 -1
- package/dist/types/ExecutionType.mjs +0 -2
- package/dist/types/ExecutionType.mjs.map +0 -1
- package/dist/types/OnRunEvent.d.mts +0 -9
- package/dist/types/OnRunEvent.d.ts +0 -9
- package/dist/types/OnRunEvent.js +0 -2
- package/dist/types/OnRunEvent.js.map +0 -1
- package/dist/types/OnRunEvent.mjs +0 -2
- package/dist/types/OnRunEvent.mjs.map +0 -1
- package/dist/types/QuestsRequired.d.mts +0 -2
- package/dist/types/QuestsRequired.d.ts +0 -2
- package/dist/types/QuestsRequired.js +0 -2
- package/dist/types/QuestsRequired.js.map +0 -1
- package/dist/types/QuestsRequired.mjs +0 -2
- package/dist/types/QuestsRequired.mjs.map +0 -1
- package/dist/types/TimeDataType.d.mts +0 -6
- package/dist/types/TimeDataType.d.ts +0 -6
- package/dist/types/TimeDataType.js +0 -2
- package/dist/types/TimeDataType.js.map +0 -1
- package/dist/types/TimeDataType.mjs +0 -2
- package/dist/types/TimeDataType.mjs.map +0 -1
- package/dist/types/TimeSettings.d.mts +0 -58
- package/dist/types/TimeSettings.d.ts +0 -58
- package/dist/types/TimeSettings.js +0 -2
- package/dist/types/TimeSettings.js.map +0 -1
- package/dist/types/TimeSettings.mjs +0 -2
- package/dist/types/TimeSettings.mjs.map +0 -1
- package/dist/types/index.js +0 -2
- package/dist/types/index.js.map +0 -1
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { ActivityInterface as ActivityInterface$1, CommitmentInterface as CommitmentInterface$1, LocationInterface as LocationInterface$1, MapInterface as MapInterface$1, RoomInterface as RoomInterface$1 } from '@drincs/nqtr';
|
|
2
|
+
import { CharacterInterface, StoredClassModel } from '@drincs/pixi-vn';
|
|
3
|
+
import { O as OnRunAsyncFunction, E as ExecutionType } from './StageInterface-LDgQToad.mjs';
|
|
4
|
+
|
|
5
|
+
interface ActivityInterface extends ActivityBaseInternalInterface, ActivityInterface$1 {
|
|
6
|
+
}
|
|
7
|
+
interface ActivityBaseInternalInterface {
|
|
8
|
+
/**
|
|
9
|
+
* The id of the activity/commitment.
|
|
10
|
+
*/
|
|
11
|
+
readonly id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The hour when the activity/commitment starts. If the activity/commitment is not started yet, it will be hidden.
|
|
14
|
+
*/
|
|
15
|
+
readonly fromHour: number | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The hour when the activity/commitment ends. If the activity/commitment is ended yet, it will be hidden.
|
|
18
|
+
*/
|
|
19
|
+
readonly toHour: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The day when the activity/commitment starts. If the activity/commitment is not started yet, it will be hidden.
|
|
22
|
+
*/
|
|
23
|
+
readonly fromDay: number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The day when the activity/commitment ends. If the activity/commitment is ended yet, it will be deleted or hidden.
|
|
26
|
+
*/
|
|
27
|
+
readonly toDay: number | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The function that is called when the activity/commitment is runned.
|
|
30
|
+
*/
|
|
31
|
+
readonly run: OnRunAsyncFunction;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the activity/commitment is a deadline.
|
|
34
|
+
*/
|
|
35
|
+
readonly expired: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the activity/commitment is active.
|
|
38
|
+
*/
|
|
39
|
+
readonly isActive: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface CommitmentInterface extends CommitmentBaseInternalInterface, CommitmentInterface$1 {
|
|
43
|
+
}
|
|
44
|
+
interface CommitmentBaseInternalInterface extends ActivityBaseInternalInterface {
|
|
45
|
+
/**
|
|
46
|
+
* The character or characters that are in the commitment and so in the room.
|
|
47
|
+
*/
|
|
48
|
+
readonly characters: CharacterInterface[];
|
|
49
|
+
/**
|
|
50
|
+
* The room where the commitment is.
|
|
51
|
+
*/
|
|
52
|
+
readonly room: RoomInterface;
|
|
53
|
+
/**
|
|
54
|
+
* Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
|
|
55
|
+
* If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.
|
|
56
|
+
*/
|
|
57
|
+
executionType: ExecutionType;
|
|
58
|
+
/**
|
|
59
|
+
* The priority. The higher the number, the higher the priority.
|
|
60
|
+
* To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen.
|
|
61
|
+
*/
|
|
62
|
+
priority: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface NavigationAbstractInterface extends StoredClassModel {
|
|
66
|
+
/**
|
|
67
|
+
* Connects the activity to the class.
|
|
68
|
+
* @param activity The activity to connect to the class.
|
|
69
|
+
* @param options
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
addActivity(activity: ActivityInterface, options?: {
|
|
73
|
+
/**
|
|
74
|
+
* the activity will be associated with this class only for the specified hours.
|
|
75
|
+
* If you set from 3 and to 5, the activity will be associated with this class only for hours 3, 4 and 5. soSo at 2 or 6 it will not be associated with this class.
|
|
76
|
+
*/
|
|
77
|
+
hours?: {
|
|
78
|
+
from: number;
|
|
79
|
+
to: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* the activity will be associated with this class from the specified day.
|
|
83
|
+
* If you set 3, the activity will be associated with this class from day 3. So at day 2 it will not be associated with this class.
|
|
84
|
+
*/
|
|
85
|
+
fromDay?: number;
|
|
86
|
+
/**
|
|
87
|
+
* the activity will be associated with this class to the specified day.
|
|
88
|
+
* If you set 3, the activity will be associated with this class until day 3. So at day 4 it will not be associated with this class.
|
|
89
|
+
*/
|
|
90
|
+
toDay?: number;
|
|
91
|
+
}): void;
|
|
92
|
+
/**
|
|
93
|
+
* Disconnects the activity from the class.
|
|
94
|
+
* @param activity The activity to disconnect from the class.
|
|
95
|
+
* @param options
|
|
96
|
+
*/
|
|
97
|
+
removeActivity(activity: ActivityInterface, options?: {
|
|
98
|
+
/**
|
|
99
|
+
* The activity will be excluded from this class only for the specified days.
|
|
100
|
+
* If to 3, the activity will be excluded from this class only for days 1, 2 and 3. So at day 4 it will be associated with this class.
|
|
101
|
+
*/
|
|
102
|
+
toDay?: number;
|
|
103
|
+
}): void;
|
|
104
|
+
/**
|
|
105
|
+
* Removes the useless activities.
|
|
106
|
+
*/
|
|
107
|
+
clearExpiredActivities(): void;
|
|
108
|
+
/**
|
|
109
|
+
* The activities associated with this class.
|
|
110
|
+
*/
|
|
111
|
+
activities: ActivityInterface[];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface LocationInterface extends LocationInternalInterface, LocationInterface$1 {
|
|
115
|
+
}
|
|
116
|
+
interface LocationInternalInterface extends NavigationAbstractInterface {
|
|
117
|
+
/**
|
|
118
|
+
* The id of the location.
|
|
119
|
+
*/
|
|
120
|
+
readonly id: string;
|
|
121
|
+
/**
|
|
122
|
+
* The map where the location is.
|
|
123
|
+
*/
|
|
124
|
+
readonly map: MapInterface;
|
|
125
|
+
/**
|
|
126
|
+
* Get all rooms in the location.
|
|
127
|
+
* @returns The rooms in the location.
|
|
128
|
+
*/
|
|
129
|
+
readonly rooms: RoomInterface[];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface MapInterface extends MapBaseInternalInterface, MapInterface$1 {
|
|
133
|
+
}
|
|
134
|
+
interface MapBaseInternalInterface extends NavigationAbstractInterface {
|
|
135
|
+
/**
|
|
136
|
+
* The id of the map.
|
|
137
|
+
*/
|
|
138
|
+
readonly id: string;
|
|
139
|
+
/**
|
|
140
|
+
* Get all locations in the map.
|
|
141
|
+
* @returns The locations in the map.
|
|
142
|
+
*/
|
|
143
|
+
readonly locations: LocationInterface[];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface RoomInterface extends RoomBaseInternalInterface, RoomInterface$1 {
|
|
147
|
+
}
|
|
148
|
+
interface RoomBaseInternalInterface extends NavigationAbstractInterface {
|
|
149
|
+
/**
|
|
150
|
+
* The id of the room.
|
|
151
|
+
*/
|
|
152
|
+
readonly id: string;
|
|
153
|
+
/**
|
|
154
|
+
* The location where the room is.
|
|
155
|
+
*/
|
|
156
|
+
readonly location: LocationInterface;
|
|
157
|
+
/**
|
|
158
|
+
* Get the character commitments of the room.
|
|
159
|
+
*/
|
|
160
|
+
readonly routine: CommitmentInterface[];
|
|
161
|
+
/**
|
|
162
|
+
* Get the characters in the room.
|
|
163
|
+
*/
|
|
164
|
+
readonly characters: CharacterInterface[];
|
|
165
|
+
/**
|
|
166
|
+
* Get the function that will be executed when the room is visited.
|
|
167
|
+
*/
|
|
168
|
+
readonly automaticFunction: OnRunAsyncFunction | undefined;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type { ActivityInterface as A, CommitmentInterface as C, LocationInterface as L, MapInterface as M, NavigationAbstractInterface as N, RoomInterface as R, ActivityBaseInternalInterface as a, CommitmentBaseInternalInterface as b, LocationInternalInterface as c, MapBaseInternalInterface as d, RoomBaseInternalInterface as e };
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { ActivityInterface as ActivityInterface$1, CommitmentInterface as CommitmentInterface$1, LocationInterface as LocationInterface$1, MapInterface as MapInterface$1, RoomInterface as RoomInterface$1 } from '@drincs/nqtr';
|
|
2
|
+
import { CharacterInterface, StoredClassModel } from '@drincs/pixi-vn';
|
|
3
|
+
import { O as OnRunAsyncFunction, E as ExecutionType } from './StageInterface-LDgQToad.js';
|
|
4
|
+
|
|
5
|
+
interface ActivityInterface extends ActivityBaseInternalInterface, ActivityInterface$1 {
|
|
6
|
+
}
|
|
7
|
+
interface ActivityBaseInternalInterface {
|
|
8
|
+
/**
|
|
9
|
+
* The id of the activity/commitment.
|
|
10
|
+
*/
|
|
11
|
+
readonly id: string;
|
|
12
|
+
/**
|
|
13
|
+
* The hour when the activity/commitment starts. If the activity/commitment is not started yet, it will be hidden.
|
|
14
|
+
*/
|
|
15
|
+
readonly fromHour: number | undefined;
|
|
16
|
+
/**
|
|
17
|
+
* The hour when the activity/commitment ends. If the activity/commitment is ended yet, it will be hidden.
|
|
18
|
+
*/
|
|
19
|
+
readonly toHour: number | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* The day when the activity/commitment starts. If the activity/commitment is not started yet, it will be hidden.
|
|
22
|
+
*/
|
|
23
|
+
readonly fromDay: number | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* The day when the activity/commitment ends. If the activity/commitment is ended yet, it will be deleted or hidden.
|
|
26
|
+
*/
|
|
27
|
+
readonly toDay: number | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* The function that is called when the activity/commitment is runned.
|
|
30
|
+
*/
|
|
31
|
+
readonly run: OnRunAsyncFunction;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the activity/commitment is a deadline.
|
|
34
|
+
*/
|
|
35
|
+
readonly expired: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Whether the activity/commitment is active.
|
|
38
|
+
*/
|
|
39
|
+
readonly isActive: boolean;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface CommitmentInterface extends CommitmentBaseInternalInterface, CommitmentInterface$1 {
|
|
43
|
+
}
|
|
44
|
+
interface CommitmentBaseInternalInterface extends ActivityBaseInternalInterface {
|
|
45
|
+
/**
|
|
46
|
+
* The character or characters that are in the commitment and so in the room.
|
|
47
|
+
*/
|
|
48
|
+
readonly characters: CharacterInterface[];
|
|
49
|
+
/**
|
|
50
|
+
* The room where the commitment is.
|
|
51
|
+
*/
|
|
52
|
+
readonly room: RoomInterface;
|
|
53
|
+
/**
|
|
54
|
+
* Execution type. If is "automatic" the onRun() runned automatically when the palayer is in the room. If is "interaction" the player must interact with the character to run the onRun() function.
|
|
55
|
+
* If you set "automatic" remember to remove the commitment when it is no longer needed, because otherwise it repeats itself every time.
|
|
56
|
+
*/
|
|
57
|
+
executionType: ExecutionType;
|
|
58
|
+
/**
|
|
59
|
+
* The priority. The higher the number, the higher the priority.
|
|
60
|
+
* To ensure that a character is not in 2 places at the same time, if there are 2 or more valid commits at the same time and with the same character, the one with the highest priority will be chosen.
|
|
61
|
+
*/
|
|
62
|
+
priority: number;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
interface NavigationAbstractInterface extends StoredClassModel {
|
|
66
|
+
/**
|
|
67
|
+
* Connects the activity to the class.
|
|
68
|
+
* @param activity The activity to connect to the class.
|
|
69
|
+
* @param options
|
|
70
|
+
* @returns
|
|
71
|
+
*/
|
|
72
|
+
addActivity(activity: ActivityInterface, options?: {
|
|
73
|
+
/**
|
|
74
|
+
* the activity will be associated with this class only for the specified hours.
|
|
75
|
+
* If you set from 3 and to 5, the activity will be associated with this class only for hours 3, 4 and 5. soSo at 2 or 6 it will not be associated with this class.
|
|
76
|
+
*/
|
|
77
|
+
hours?: {
|
|
78
|
+
from: number;
|
|
79
|
+
to: number;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* the activity will be associated with this class from the specified day.
|
|
83
|
+
* If you set 3, the activity will be associated with this class from day 3. So at day 2 it will not be associated with this class.
|
|
84
|
+
*/
|
|
85
|
+
fromDay?: number;
|
|
86
|
+
/**
|
|
87
|
+
* the activity will be associated with this class to the specified day.
|
|
88
|
+
* If you set 3, the activity will be associated with this class until day 3. So at day 4 it will not be associated with this class.
|
|
89
|
+
*/
|
|
90
|
+
toDay?: number;
|
|
91
|
+
}): void;
|
|
92
|
+
/**
|
|
93
|
+
* Disconnects the activity from the class.
|
|
94
|
+
* @param activity The activity to disconnect from the class.
|
|
95
|
+
* @param options
|
|
96
|
+
*/
|
|
97
|
+
removeActivity(activity: ActivityInterface, options?: {
|
|
98
|
+
/**
|
|
99
|
+
* The activity will be excluded from this class only for the specified days.
|
|
100
|
+
* If to 3, the activity will be excluded from this class only for days 1, 2 and 3. So at day 4 it will be associated with this class.
|
|
101
|
+
*/
|
|
102
|
+
toDay?: number;
|
|
103
|
+
}): void;
|
|
104
|
+
/**
|
|
105
|
+
* Removes the useless activities.
|
|
106
|
+
*/
|
|
107
|
+
clearExpiredActivities(): void;
|
|
108
|
+
/**
|
|
109
|
+
* The activities associated with this class.
|
|
110
|
+
*/
|
|
111
|
+
activities: ActivityInterface[];
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
interface LocationInterface extends LocationInternalInterface, LocationInterface$1 {
|
|
115
|
+
}
|
|
116
|
+
interface LocationInternalInterface extends NavigationAbstractInterface {
|
|
117
|
+
/**
|
|
118
|
+
* The id of the location.
|
|
119
|
+
*/
|
|
120
|
+
readonly id: string;
|
|
121
|
+
/**
|
|
122
|
+
* The map where the location is.
|
|
123
|
+
*/
|
|
124
|
+
readonly map: MapInterface;
|
|
125
|
+
/**
|
|
126
|
+
* Get all rooms in the location.
|
|
127
|
+
* @returns The rooms in the location.
|
|
128
|
+
*/
|
|
129
|
+
readonly rooms: RoomInterface[];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface MapInterface extends MapBaseInternalInterface, MapInterface$1 {
|
|
133
|
+
}
|
|
134
|
+
interface MapBaseInternalInterface extends NavigationAbstractInterface {
|
|
135
|
+
/**
|
|
136
|
+
* The id of the map.
|
|
137
|
+
*/
|
|
138
|
+
readonly id: string;
|
|
139
|
+
/**
|
|
140
|
+
* Get all locations in the map.
|
|
141
|
+
* @returns The locations in the map.
|
|
142
|
+
*/
|
|
143
|
+
readonly locations: LocationInterface[];
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
interface RoomInterface extends RoomBaseInternalInterface, RoomInterface$1 {
|
|
147
|
+
}
|
|
148
|
+
interface RoomBaseInternalInterface extends NavigationAbstractInterface {
|
|
149
|
+
/**
|
|
150
|
+
* The id of the room.
|
|
151
|
+
*/
|
|
152
|
+
readonly id: string;
|
|
153
|
+
/**
|
|
154
|
+
* The location where the room is.
|
|
155
|
+
*/
|
|
156
|
+
readonly location: LocationInterface;
|
|
157
|
+
/**
|
|
158
|
+
* Get the character commitments of the room.
|
|
159
|
+
*/
|
|
160
|
+
readonly routine: CommitmentInterface[];
|
|
161
|
+
/**
|
|
162
|
+
* Get the characters in the room.
|
|
163
|
+
*/
|
|
164
|
+
readonly characters: CharacterInterface[];
|
|
165
|
+
/**
|
|
166
|
+
* Get the function that will be executed when the room is visited.
|
|
167
|
+
*/
|
|
168
|
+
readonly automaticFunction: OnRunAsyncFunction | undefined;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export type { ActivityInterface as A, CommitmentInterface as C, LocationInterface as L, MapInterface as M, NavigationAbstractInterface as N, RoomInterface as R, ActivityBaseInternalInterface as a, CommitmentBaseInternalInterface as b, LocationInternalInterface as c, MapBaseInternalInterface as d, RoomBaseInternalInterface as e };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { OnRunProps, QuestInterface as QuestInterface$1, StageInterface as StageInterface$1 } from '@drincs/nqtr';
|
|
1
|
+
import { OnRunProps as OnRunProps$1, QuestInterface as QuestInterface$1, StageInterface as StageInterface$1 } from '@drincs/nqtr';
|
|
2
|
+
|
|
3
|
+
type ExecutionType = "automatic" | "interaction";
|
|
4
|
+
|
|
5
|
+
type OnRunProps = OnRunProps$1;
|
|
6
|
+
/**
|
|
7
|
+
* The function that is called when the class is runned.
|
|
8
|
+
*/
|
|
9
|
+
type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
|
|
10
|
+
type OnRunFunction = (props: OnRunProps) => any | Promise<any>;
|
|
11
|
+
type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
|
|
2
12
|
|
|
3
13
|
type QuestsRequiredType = {
|
|
4
14
|
quest: QuestInterface;
|
|
@@ -28,6 +38,10 @@ interface QuestBaseInternalInterface {
|
|
|
28
38
|
* If the quest is started.
|
|
29
39
|
*/
|
|
30
40
|
readonly started: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* If the quest is started and not completed and not failed.
|
|
43
|
+
*/
|
|
44
|
+
readonly inProgress: boolean;
|
|
31
45
|
/**
|
|
32
46
|
* If the quest is completed.
|
|
33
47
|
*/
|
|
@@ -39,38 +53,38 @@ interface QuestBaseInternalInterface {
|
|
|
39
53
|
/**
|
|
40
54
|
* The function that will be called when the quest starts.
|
|
41
55
|
*/
|
|
42
|
-
readonly onStart?:
|
|
56
|
+
readonly onStart?: OnRunEvent<QuestInterface>;
|
|
43
57
|
/**
|
|
44
58
|
* The function that will be called when the quest goes to the next stage.
|
|
45
59
|
*/
|
|
46
|
-
readonly onNextStage?:
|
|
60
|
+
readonly onNextStage?: OnRunEvent<QuestInterface>;
|
|
47
61
|
/**
|
|
48
62
|
* Start the quest.
|
|
49
63
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
50
64
|
* @returns
|
|
51
65
|
*/
|
|
52
|
-
start(props: OnRunProps): void
|
|
66
|
+
start(props: OnRunProps$1): Promise<void>;
|
|
53
67
|
/**
|
|
54
68
|
* Go to the next stage if the current stage is completed.
|
|
55
69
|
* If you want to force the change of stage, use goNextStage.
|
|
56
70
|
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
57
71
|
* @returns true if the stage was changed, false otherwise.
|
|
58
72
|
*/
|
|
59
|
-
tryToGoNextStage(props: OnRunProps): boolean
|
|
73
|
+
tryToGoNextStage(props: OnRunProps$1): Promise<boolean>;
|
|
60
74
|
/**
|
|
61
75
|
* Complete the current stage and go to the next stage.
|
|
62
76
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
63
77
|
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
64
78
|
* @returns true if the stage was changed, false otherwise.
|
|
65
79
|
*/
|
|
66
|
-
completeCurrentStageAndGoNext(props: OnRunProps): boolean
|
|
80
|
+
completeCurrentStageAndGoNext(props: OnRunProps$1): Promise<boolean>;
|
|
67
81
|
/**
|
|
68
82
|
* Go to the next stage without checking if the current stage is completed.
|
|
69
83
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
70
84
|
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
71
85
|
* @returns returns true if the stage was changed, false otherwise.
|
|
72
86
|
*/
|
|
73
|
-
goNextStage(props: OnRunProps): boolean
|
|
87
|
+
goNextStage(props: OnRunProps$1): Promise<boolean>;
|
|
74
88
|
/**
|
|
75
89
|
* If the current stage must start. It is true if the current stage is not started, can start and not completed.
|
|
76
90
|
*/
|
|
@@ -79,7 +93,7 @@ interface QuestBaseInternalInterface {
|
|
|
79
93
|
* Start the current stage.
|
|
80
94
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
81
95
|
*/
|
|
82
|
-
startCurrentStage(props: OnRunProps): void
|
|
96
|
+
startCurrentStage(props: OnRunProps$1): Promise<void>;
|
|
83
97
|
}
|
|
84
98
|
|
|
85
99
|
interface StageInterface extends StageBaseInternalInterface, StageInterface$1 {
|
|
@@ -92,11 +106,11 @@ interface StageBaseInternalInterface {
|
|
|
92
106
|
/**
|
|
93
107
|
* The function that will be called when the stage starts.
|
|
94
108
|
*/
|
|
95
|
-
readonly onStart?:
|
|
109
|
+
readonly onStart?: OnRunEvent<StageInterface>;
|
|
96
110
|
/**
|
|
97
111
|
* The function that will be called when the stage ends.
|
|
98
112
|
*/
|
|
99
|
-
readonly onEnd?:
|
|
113
|
+
readonly onEnd?: OnRunEvent<StageInterface>;
|
|
100
114
|
/**
|
|
101
115
|
* Check if the flag and goals are completed.
|
|
102
116
|
* You can force the completion of the stage by setting the completed property to true.
|
|
@@ -108,7 +122,7 @@ interface StageBaseInternalInterface {
|
|
|
108
122
|
* return true;
|
|
109
123
|
* }
|
|
110
124
|
* if (this.flags.length > 0) {
|
|
111
|
-
* if (!this.flags.every((flag) => getFlag(flag.flag))) {
|
|
125
|
+
* if (!this.flags.every((flag) => storage.getFlag(flag.flag))) {
|
|
112
126
|
* return false;
|
|
113
127
|
* }
|
|
114
128
|
* return true;
|
|
@@ -136,7 +150,7 @@ interface StageBaseInternalInterface {
|
|
|
136
150
|
* ```ts
|
|
137
151
|
* export default class Stage extends StageStoredClass {
|
|
138
152
|
* override get canStart(): boolean {
|
|
139
|
-
* if (this.flagsRequiredToStart.length > 0 && !this.flagsRequiredToStart.every((flag) => getFlag(flag.flag))) {
|
|
153
|
+
* if (this.flagsRequiredToStart.length > 0 && !this.flagsRequiredToStart.every((flag) => storage.getFlag(flag.flag))) {
|
|
140
154
|
* return false;
|
|
141
155
|
* }
|
|
142
156
|
* return super.canStart;
|
|
@@ -148,7 +162,7 @@ interface StageBaseInternalInterface {
|
|
|
148
162
|
/**
|
|
149
163
|
* The function that will be called when the stage starts.
|
|
150
164
|
*/
|
|
151
|
-
start(props: OnRunProps): void
|
|
165
|
+
start(props: OnRunProps$1): Promise<void>;
|
|
152
166
|
/**
|
|
153
167
|
* The number of days required to start the stage.
|
|
154
168
|
*/
|
|
@@ -159,4 +173,4 @@ interface StageBaseInternalInterface {
|
|
|
159
173
|
readonly questsRequiredToStart: QuestsRequiredType[];
|
|
160
174
|
}
|
|
161
175
|
|
|
162
|
-
export type { QuestInterface as Q, StageInterface as S,
|
|
176
|
+
export type { ExecutionType as E, OnRunAsyncFunction as O, QuestInterface as Q, StageInterface as S, OnRunEvent as a, OnRunFunction as b, OnRunProps as c, QuestsRequiredType as d, QuestBaseInternalInterface as e, StageBaseInternalInterface as f };
|
|
@@ -1,4 +1,14 @@
|
|
|
1
|
-
import { OnRunProps, QuestInterface as QuestInterface$1, StageInterface as StageInterface$1 } from '@drincs/nqtr';
|
|
1
|
+
import { OnRunProps as OnRunProps$1, QuestInterface as QuestInterface$1, StageInterface as StageInterface$1 } from '@drincs/nqtr';
|
|
2
|
+
|
|
3
|
+
type ExecutionType = "automatic" | "interaction";
|
|
4
|
+
|
|
5
|
+
type OnRunProps = OnRunProps$1;
|
|
6
|
+
/**
|
|
7
|
+
* The function that is called when the class is runned.
|
|
8
|
+
*/
|
|
9
|
+
type OnRunEvent<T> = (item: T, props: OnRunProps) => any | Promise<any>;
|
|
10
|
+
type OnRunFunction = (props: OnRunProps) => any | Promise<any>;
|
|
11
|
+
type OnRunAsyncFunction = (props: OnRunProps) => Promise<any>;
|
|
2
12
|
|
|
3
13
|
type QuestsRequiredType = {
|
|
4
14
|
quest: QuestInterface;
|
|
@@ -28,6 +38,10 @@ interface QuestBaseInternalInterface {
|
|
|
28
38
|
* If the quest is started.
|
|
29
39
|
*/
|
|
30
40
|
readonly started: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* If the quest is started and not completed and not failed.
|
|
43
|
+
*/
|
|
44
|
+
readonly inProgress: boolean;
|
|
31
45
|
/**
|
|
32
46
|
* If the quest is completed.
|
|
33
47
|
*/
|
|
@@ -39,38 +53,38 @@ interface QuestBaseInternalInterface {
|
|
|
39
53
|
/**
|
|
40
54
|
* The function that will be called when the quest starts.
|
|
41
55
|
*/
|
|
42
|
-
readonly onStart?:
|
|
56
|
+
readonly onStart?: OnRunEvent<QuestInterface>;
|
|
43
57
|
/**
|
|
44
58
|
* The function that will be called when the quest goes to the next stage.
|
|
45
59
|
*/
|
|
46
|
-
readonly onNextStage?:
|
|
60
|
+
readonly onNextStage?: OnRunEvent<QuestInterface>;
|
|
47
61
|
/**
|
|
48
62
|
* Start the quest.
|
|
49
63
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
50
64
|
* @returns
|
|
51
65
|
*/
|
|
52
|
-
start(props: OnRunProps): void
|
|
66
|
+
start(props: OnRunProps$1): Promise<void>;
|
|
53
67
|
/**
|
|
54
68
|
* Go to the next stage if the current stage is completed.
|
|
55
69
|
* If you want to force the change of stage, use goNextStage.
|
|
56
70
|
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
57
71
|
* @returns true if the stage was changed, false otherwise.
|
|
58
72
|
*/
|
|
59
|
-
tryToGoNextStage(props: OnRunProps): boolean
|
|
73
|
+
tryToGoNextStage(props: OnRunProps$1): Promise<boolean>;
|
|
60
74
|
/**
|
|
61
75
|
* Complete the current stage and go to the next stage.
|
|
62
76
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
63
77
|
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
64
78
|
* @returns true if the stage was changed, false otherwise.
|
|
65
79
|
*/
|
|
66
|
-
completeCurrentStageAndGoNext(props: OnRunProps): boolean
|
|
80
|
+
completeCurrentStageAndGoNext(props: OnRunProps$1): Promise<boolean>;
|
|
67
81
|
/**
|
|
68
82
|
* Go to the next stage without checking if the current stage is completed.
|
|
69
83
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
70
84
|
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
71
85
|
* @returns returns true if the stage was changed, false otherwise.
|
|
72
86
|
*/
|
|
73
|
-
goNextStage(props: OnRunProps): boolean
|
|
87
|
+
goNextStage(props: OnRunProps$1): Promise<boolean>;
|
|
74
88
|
/**
|
|
75
89
|
* If the current stage must start. It is true if the current stage is not started, can start and not completed.
|
|
76
90
|
*/
|
|
@@ -79,7 +93,7 @@ interface QuestBaseInternalInterface {
|
|
|
79
93
|
* Start the current stage.
|
|
80
94
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
81
95
|
*/
|
|
82
|
-
startCurrentStage(props: OnRunProps): void
|
|
96
|
+
startCurrentStage(props: OnRunProps$1): Promise<void>;
|
|
83
97
|
}
|
|
84
98
|
|
|
85
99
|
interface StageInterface extends StageBaseInternalInterface, StageInterface$1 {
|
|
@@ -92,11 +106,11 @@ interface StageBaseInternalInterface {
|
|
|
92
106
|
/**
|
|
93
107
|
* The function that will be called when the stage starts.
|
|
94
108
|
*/
|
|
95
|
-
readonly onStart?:
|
|
109
|
+
readonly onStart?: OnRunEvent<StageInterface>;
|
|
96
110
|
/**
|
|
97
111
|
* The function that will be called when the stage ends.
|
|
98
112
|
*/
|
|
99
|
-
readonly onEnd?:
|
|
113
|
+
readonly onEnd?: OnRunEvent<StageInterface>;
|
|
100
114
|
/**
|
|
101
115
|
* Check if the flag and goals are completed.
|
|
102
116
|
* You can force the completion of the stage by setting the completed property to true.
|
|
@@ -108,7 +122,7 @@ interface StageBaseInternalInterface {
|
|
|
108
122
|
* return true;
|
|
109
123
|
* }
|
|
110
124
|
* if (this.flags.length > 0) {
|
|
111
|
-
* if (!this.flags.every((flag) => getFlag(flag.flag))) {
|
|
125
|
+
* if (!this.flags.every((flag) => storage.getFlag(flag.flag))) {
|
|
112
126
|
* return false;
|
|
113
127
|
* }
|
|
114
128
|
* return true;
|
|
@@ -136,7 +150,7 @@ interface StageBaseInternalInterface {
|
|
|
136
150
|
* ```ts
|
|
137
151
|
* export default class Stage extends StageStoredClass {
|
|
138
152
|
* override get canStart(): boolean {
|
|
139
|
-
* if (this.flagsRequiredToStart.length > 0 && !this.flagsRequiredToStart.every((flag) => getFlag(flag.flag))) {
|
|
153
|
+
* if (this.flagsRequiredToStart.length > 0 && !this.flagsRequiredToStart.every((flag) => storage.getFlag(flag.flag))) {
|
|
140
154
|
* return false;
|
|
141
155
|
* }
|
|
142
156
|
* return super.canStart;
|
|
@@ -148,7 +162,7 @@ interface StageBaseInternalInterface {
|
|
|
148
162
|
/**
|
|
149
163
|
* The function that will be called when the stage starts.
|
|
150
164
|
*/
|
|
151
|
-
start(props: OnRunProps): void
|
|
165
|
+
start(props: OnRunProps$1): Promise<void>;
|
|
152
166
|
/**
|
|
153
167
|
* The number of days required to start the stage.
|
|
154
168
|
*/
|
|
@@ -159,4 +173,4 @@ interface StageBaseInternalInterface {
|
|
|
159
173
|
readonly questsRequiredToStart: QuestsRequiredType[];
|
|
160
174
|
}
|
|
161
175
|
|
|
162
|
-
export type { QuestInterface as Q, StageInterface as S,
|
|
176
|
+
export type { ExecutionType as E, OnRunAsyncFunction as O, QuestInterface as Q, StageInterface as S, OnRunEvent as a, OnRunFunction as b, OnRunProps as c, QuestsRequiredType as d, QuestBaseInternalInterface as e, StageBaseInternalInterface as f };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
'use strict';var pixiVn=require('@drincs/pixi-vn');var f="___nqtr-time_manager_data___",p="___nqtr-current_room_memory___",Z="___nqtr-last_event_memory___";var u;(n=>(n.log=(i,...a)=>console.log(`[NQTR] ${i}`,...a),n.warn=(i,...a)=>console.warn(`[NQTR] ${i}`,...a),n.error=(i,...a)=>console.error(`[NQTR] ${i}`,...a),n.info=(i,...a)=>console.info(`[NQTR] ${i}`,...a)))(u||={});var q=new pixiVn.CachedMap({cacheSize:20}),re;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}q.set(i.id,i);}n.add=o;function e(i){try{let a=q.get(i);if(!a){console.warn(`[NQTR] Activity ${i} not found, you should register it first`);return}return a}catch(a){u.error(`Error while getting Activity ${i}`,a);return}}n.get=e;function t(){return Array.from(q.values())}n.values=t;function r(i){return q.has(i)}n.has=r;})(re||={});var L=re;var S=new pixiVn.CachedMap({cacheSize:20}),k=new pixiVn.CachedMap({cacheSize:20}),ne;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}console.warn(`[NQTR] Registering commitment ${i.id}`,i),S.set(i.id,i);}n.add=o;function e(i){try{let a=S.get(i);if(!a){console.warn(`[NQTR] Commitment ${i} not found, you should register it first`);return}return a}catch(a){u.error(`Error while getting Commitment ${i}`,a);return}}n.get=e;function t(){return Array.from(S.values())}n.values=t;function r(i){return S.has(i)}n.has=r;})(ne||={});var v=ne;var E=new pixiVn.CachedMap({cacheSize:20}),ae;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>o(a));return}E.has(i.id)&&console.warn(`[NQTR] Location id ${i.id} already exists, it will be overwritten`),E.set(i.id,i);}n.add=o;function e(i){try{let a=E.get(i);if(!a){console.warn(`[NQTR] Location ${i} not found, you should register it first`);return}return a}catch(a){u.error(`Error while getting Location ${i}`,a);return}}n.get=e;function t(){return Array.from(E.values())}n.values=t;function r(i){return E.has(i)}n.has=r;})(ae||={});var w=ae;var C=new pixiVn.CachedMap({cacheSize:20}),oe;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>o(a));return}C.has(i.id)&&console.warn(`[NQTR] Map id ${i.id} already exists, it will be overwritten`),C.set(i.id,i);}n.add=o;function e(i){try{let a=C.get(i);if(!a){console.warn(`[NQTR] Map ${i} not found, you should register it first`);return}return a}catch(a){u.error(`Error while getting Map ${i}`,a);return}}n.get=e;function t(){return Array.from(C.values())}n.values=t;function r(i){return C.has(i)}n.has=r;})(oe||={});var P=oe;var $=new pixiVn.CachedMap({cacheSize:5}),se;(n=>{function o(i){if(Array.isArray(i)){i.forEach(a=>n.add(a));return}$.set(i.id,i);}n.add=o;function e(i){try{let a=$.get(i);if(!a){console.warn(`[NQTR] Quest ${i} not found, you should register it first`);return}return a}catch(a){u.error(`Error while getting Quest ${i}`,a);return}}n.get=e;function t(){return Array.from($.values())}n.values=t;function r(i){return $.has(i)}n.has=r;})(se||={});var Y=new pixiVn.CachedMap({cacheSize:20}),ue;(n=>{function o(i){if(Array.isArray(i)){i.forEach(m=>o(m));return}Y.set(i.id,i);let a=i.location;w.add(a);let s=a?.map;s&&P.add(s);}n.add=o;function e(i){try{let a=Y.get(i);if(!a){console.warn(`[NQTR] Room ${i} not found, you should register it first`);return}return a}catch(a){u.error(`Error while getting Room ${i}`,a);return}}n.get=e;function t(){return Array.from(Y.values())}n.values=t;function r(i){return Y.has(i)}n.has=r;})(ue||={});var I=ue;var N=class{get rooms(){return I.values()}get locations(){return w.values()}get maps(){return P.values()}get currentRoomId(){return pixiVn.storage.getVariable(p)}get currentRoom(){let e=this.currentRoomId;if(!e){u.error("The current room has not yet been set");return}let t=I.get(e);if(!t){u.error(`Current room ${e} not found`);return}return t}set currentRoom(e){if(typeof e!="string"&&(e=e.id),!I.get(e)){u.error(`The room ${e} is not registered, so it can't be set as current room`);return}let r=pixiVn.storage.getVariable(p);r!==e&&(Q({type:"editroom",prev:r,value:e}),pixiVn.storage.setVariable(p,e));}get currentLocation(){return this.currentRoom?.location}get currentMap(){return this.currentRoom?.location.map}clearExpiredActivities(){I.values().forEach(e=>{e.clearExpiredActivities();});}};var F="___nqtr-temporary_commitment___",H=class{get fixedRoutine(){return [...k.values()]}set fixedRoutine(e){e.forEach(t=>{k.has(t.id)&&console.warn(`[NQTR] Commitment id ${t.id} already exists, it will be overwritten`),k.set(t.id,t);});}get temporaryRoutine(){let e=pixiVn.storage.getVariable(F);return e?e.map(r=>v.get(r)).filter(r=>r!==void 0):[]}get allRoutine(){return [...this.fixedRoutine,...this.temporaryRoutine]}add(e){Array.isArray(e)||(e=[e]);let t=e.map(r=>{if(!v.get(r.id)){console.warn(`[NQTR] Commitment ${r.id} not found, it will be ignored`);return}return r.id}).filter(r=>r!==void 0);pixiVn.storage.setVariable(F,t);}find(e){return v.get(e)}remove(e){Array.isArray(e)||(e=[e]);let t=e.map(n=>n.id),r=pixiVn.storage.getVariable(F);r&&(r=r.filter(n=>!t.includes(n)),pixiVn.storage.setVariable(F,r));}clearExpiredRoutine(){v.values().forEach(e=>{e.expired&&S.delete(e.id);});}get currentRoutine(){let e={};return [...this.fixedRoutine,...this.temporaryRoutine].forEach(t=>{t.isActive&&(t.characters.length>0?t.characters.every(n=>!e[n.id]||t.priority>e[n.id].priority)&&t.characters.forEach(n=>{e[n.id]=t;}):u.error(`The commitment ${t.id} has no characters assigned`));}),Object.values(e)}get currentRoomRoutine(){return g.currentRoom?.routine||[]}getCommitmentByCharacter(e){this.currentRoutine.forEach(t=>{if(t.characters.map(r=>r.id).includes(e.id))return t});}};var d=class{static minDayHours=0;static maxDayHours=24;static defaultTimeSpent=1;static timeSlots=[];static weekLength=7;static weekendStartDay=this.weekLength-1;static weekDaysNames=[]};var O=class{initialize(e){let{minDayHours:t=0,maxDayHours:r=24,defaultTimeSpent:n=1,timeSlots:i=[],weekLength:a=7,weekendStartDay:s=a-1,weekDaysNames:m=[]}=e;d.minDayHours=t,d.maxDayHours=r,d.defaultTimeSpent=n,d.timeSlots=i,d.weekLength=a,s>=d.weekLength?console.warn(`[NQTR] Weekend start day should be less than week length ${a}, so will be ignored`):d.weekendStartDay=s,m.length!==a?console.warn(`[NQTR] Week days names should be equal to week length ${a}, so will be ignored`):d.weekDaysNames=m;}get minDayHours(){return d.minDayHours}get maxDayHours(){return d.maxDayHours}get defaultTimeSpent(){return d.defaultTimeSpent}get timeSlots(){return d.timeSlots}get weekLength(){return d.weekLength}get weekendStartDay(){return d.weekendStartDay}get weekDaysNames(){return d.weekDaysNames}get currentHour(){let e=pixiVn.storage.getVariable(f)||{};return e.hasOwnProperty("currentHour")&&typeof e.currentHour=="number"?e.currentHour:this.minDayHours}set currentHour(e){let t=pixiVn.storage.getVariable(f)||{},r={...t};typeof e=="number"?r.currentHour=e:delete r.currentHour,Q({type:"edittime",prev:t,value:r}),pixiVn.storage.setVariable(f,r);}get currentDay(){let e=pixiVn.storage.getVariable(f)||{};return e.hasOwnProperty("currentDay")&&typeof e.currentDay=="number"?e.currentDay:0}set currentDay(e){let t=pixiVn.storage.getVariable(f)||{},r={...t};typeof e=="number"?r.currentDay=e:delete r.currentDay,Q({type:"edittime",prev:t,value:r}),pixiVn.storage.setVariable(f,r);}get isWeekend(){return this.currentWeekDayNumber>=this.weekendStartDay}get currentWeekDayNumber(){return this.currentDay%this.weekLength+1}get currentDayName(){let e=this.currentWeekDayNumber-1;return e>=this.weekDaysNames.length?(console.warn(`[NQTR] Week day name is not defined for day ${e}`,this.weekDaysNames),""):this.weekDaysNames[e]}get currentTimeSlot(){if(this.timeSlots.length===0)return console.warn("[NQTR] Time slots are not defined"),0;for(let e=0;e<this.timeSlots.length;e++){let t=this.timeSlots[e];if(this.timeSlots.length>e+1&&this.nowIsBetween(t.startHour,this.timeSlots[e+1].startHour))return e}return this.timeSlots.length-1}increaseHour(e=this.defaultTimeSpent){let t=this.currentHour+e;return t>=this.maxDayHours&&(this.increaseDay(),t=this.minDayHours+(t-this.maxDayHours)),this.currentHour=t,this.currentHour}increaseDay(e=this.minDayHours,t=1){let r=this.currentDay+t;return this.currentDay=r,this.currentHour=e,this.currentDay}nowIsBetween(e,t){e===void 0&&(e=this.minDayHours-1),t===void 0&&(t=this.maxDayHours+1);let r=this.currentHour;return e<t?r>=e&&r<t:r>=e||r<t}};var c=new O,g=new N,z=new H;function Q(o){pixiVn.storage.setVariable(Z,o);}function be(){return pixiVn.storage.getVariable(Z)}function de(){let o=be(),e=g.currentRoom;if(!e||!e.automaticFunction){pixiVn.narration.addCurrentStepToHistory();return}switch(o?.type){case "editroom":pixiVn.storage.setVariable(p,o.prev),pixiVn.narration.addCurrentStepToHistory(),pixiVn.storage.setVariable(p,e.id);break;case "edittime":let t=pixiVn.storage.getVariable(f)||{};pixiVn.storage.setVariable(f,o.prev),pixiVn.narration.addCurrentStepToHistory(),pixiVn.storage.setVariable(f,t);break}}var _e="__nqtr-activity__",h=class extends pixiVn.StoredClassModel{constructor(t,r,n,i=_e){super(i,t);this._onRun=r;this._fromHour=n.fromHour,this._toHour=n.toHour,this._fromDay=n.fromDay,this._toDay=n.toDay;}_fromHour;get fromHour(){return this._fromHour}_toHour;get toHour(){return this._toHour}_fromDay;get fromDay(){return this._fromDay}_toDay;get toDay(){return this._toDay}get run(){return async t=>(de(),await this._onRun(this,t))}get expired(){return !!(this.toDay&&this.toDay<=c.currentDay)}get isActive(){return !(this.fromDay&&this.fromDay>c.currentDay||this.toDay&&this.toDay<c.currentDay||!c.nowIsBetween(this.fromHour,this.toHour))}};var G=class extends h{constructor(e,t,r){super(e,t,{fromHour:r.fromHour,toHour:r.toHour,fromDay:r.fromDay,toDay:r.toDay}),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.renderIcon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var Re="__nqtr-commitment__",x=class extends h{constructor(t,r,n,i,a){i=i||(()=>{});super(t,i,a,Re);this._characters=r;this._room=n;this.defaultExecutionType=a.executionType||"interaction",this.defaultPriority=a.priority;}defaultExecutionType;defaultPriority;get characters(){return this._characters}get room(){return this._room}get executionType(){return this.getStorageProperty("executionType")||this.defaultExecutionType}set executionType(t){this.setStorageProperty("executionType",t);}get priority(){return this.getStorageProperty("priority")||this.defaultPriority||0}set priority(t){this.setStorageProperty("priority",t);}};var K=class extends x{constructor(e,t,r,n){super(e,t?Array.isArray(t)?t:[t]:[],r,n.onRun,{executionType:n.executionType,priority:n.priority,fromHour:n.fromHour,toHour:n.toHour,fromDay:n.fromDay,toDay:n.toDay}),this._name=n.name||"",this._image=n.image,this.defaultDisabled=n.disabled||false,this.defaultHidden=n.hidden||false,this._icon=n.icon;}_name;get name(){return this._name}_image;get image(){return this._image}_icon;get icon(){return this._icon}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){if(this.fromDay&&this.fromDay>c.currentDay||!c.nowIsBetween(this.fromHour,this.toHour)||!this.expired)return true;let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}};var l=class extends pixiVn.StoredClassModel{constructor(t,r,n=[]){super(t,r);this.defaultActivities=n;}get defaultActivitiesIds(){return this.defaultActivities.map(t=>t.id)}get activeActivityScheduling(){return this.getStorageProperty("activeActivityScheduling")||{}}get excludedActivitiesScheduling(){return this.getStorageProperty("excludedActivitiesScheduling")||{}}removeActivityScheduling(t){let r=this.activeActivityScheduling;delete r[t],this.setStorageProperty("activeActivityScheduling",r);let n=this.excludedActivitiesScheduling;delete n[t],this.setStorageProperty("excludedActivitiesScheduling",n);}editActivityScheduling(t,r){this.removeActivityScheduling(t);let n=this.activeActivityScheduling;n[t]=r,this.setStorageProperty("activeActivityScheduling",n);}editExcludedActivityScheduling(t,r){this.removeActivityScheduling(t);let n=this.excludedActivitiesScheduling;n[t]=r,this.setStorageProperty("excludedActivitiesScheduling",n);}get additionalActivitiesIds(){return this.getStorageProperty("additionalActivitiesIds")||[]}get excludedActivitiesIds(){return this.getStorageProperty("excludedActivitiesIds")||[]}addActivity(t,r={}){let{hours:n,fromDay:i,toDay:a}=r,s={};if(n){if(n.from>=n.to)throw new Error("[NQTR] The from hour must be less than the to hour.");s.fromHour=n.from;}if(i===0&&console.warn("[NQTR] The from day must be greater than 0, so it will be ignored."),a===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),i&&a&&i>=a)throw new Error("[NQTR] The from day must be less than the to day.");if(i&&(s.fromDay=i),a&&(s.toDay=a),this.defaultActivitiesIds.includes(t.id)){console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}let m=this.additionalActivitiesIds;if(m.includes(t.id)){if(Object.keys(s).length){this.editActivityScheduling(t.id,s);return}else if(this.excludedActivitiesIds.includes(t.id)){this.removeActivityScheduling(t.id),console.log(`[NQTR] Activity with id ${t.id} was excluded, so it will be associated with this class again.`);return}console.warn(`[NQTR] Activity with id ${t.id} already exists, so it will be ignored.`);return}m.push(t.id),this.setStorageProperty("additionalActivitiesIds",m),Object.keys(s).length&&this.editActivityScheduling(t.id,s);}removeActivity(t,r={}){let{toDay:n}=r,i={};n===0&&console.warn("[NQTR] The to day must be greater than 0, so it will be ignored."),n&&(i.toDay=n);let a=this.additionalActivitiesIds;if(a.includes(t.id)){if(Object.keys(i).length){this.editExcludedActivityScheduling(t.id,i);return}a=a.filter(s=>s!==t.id),this.setStorageProperty("additionalActivitiesIds",a);}else if(this.defaultActivitiesIds.includes(t.id)){if(Object.keys(i).length){this.editExcludedActivityScheduling(t.id,i);return}let s=this.excludedActivitiesIds;s.push(t.id),this.setStorageProperty("excludedActivitiesIds",s);}else console.warn(`[NQTR] Activity with id ${t.id} not found, so it will be ignored.`);}clearExpiredActivities(){let t=this.activeActivityScheduling,r=this.excludedActivitiesScheduling,n=this.additionalActivitiesIds,i=this.excludedActivitiesIds;n.forEach(a=>{if(a in t){let{toDay:s}=t[a];s&&s<c.currentDay&&(this.removeActivityScheduling(a),n=n.filter(m=>m!==a));}}),i.forEach(a=>{if(a in r){let{toDay:s}=r[a];s&&s<c.currentDay&&(this.removeActivityScheduling(a),i=i.filter(m=>m!==a));}});}get activities(){let t=[];return Object.entries(this.activeActivityScheduling).forEach(([r,n])=>{let i=L.get(r),{fromDay:a=i?.fromDay,fromHour:s=i?.fromHour,toDay:m=i?.toDay,toHour:he=i?.toHour}=n;i&&c.nowIsBetween(s,he)&&!(a&&a>c.currentDay)&&!(m&&m<c.currentDay)&&t.push(i);}),Object.entries(this.excludedActivitiesScheduling).forEach(([r,n])=>{let i=L.get(r);i&&i.isActive&&!(n.toDay&&n.toDay>=c.currentDay)&&t.push(i);}),this.defaultActivities.forEach(r=>{r.isActive&&!t.find(n=>n.id===r.id)&&t.push(r);}),t}};var Ae="__nqtr-location__",_=class extends l{constructor(t,r,n=[]){super(Ae,t,n);this._map=r;}get map(){return this._map}get rooms(){return g.rooms.filter(t=>t.location.id===this.id)}};var j=class extends _{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}};var De="__nqtr-map__",R=class extends l{constructor(e,t=[]){super(De,e,t);}get locations(){return g.locations.filter(e=>e.map.id===this.id)}};var W=class extends R{constructor(e,t={}){super(e,t.activities||[]),this.defaultName=t.name||"",this._image=t.image;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}};var Ee="__nqtr-room__",T=class extends l{constructor(t,r,n=[]){super(Ee,t,n);this._location=r;}get routine(){return z.currentRoutine.filter(t=>t.room.id===this.id)}get location(){return this._location}get characters(){let t=[];return this.routine.forEach(r=>{t.push(...r.characters);}),t}get automaticFunction(){let t=this.routine.find(r=>r.executionType==="automatic")?.run;if(t)return async r=>{await t(r);}}};var U=class extends T{constructor(e,t,r={}){super(e,t,r.activities||[]),this.defaultName=r.name||"",this._image=r.image,this.defaultDisabled=r.disabled||false,this.defaultHidden=r.hidden||false,this._icon=r.icon;}defaultName;get name(){return this.getStorageProperty("name")||this.defaultName}set name(e){this.setStorageProperty("name",e);}_image;get image(){return this._image}defaultDisabled;get disabled(){let e=this.getStorageProperty("disabled")||this.defaultDisabled;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set disabled(e){this.setStorageProperty("disabled",e);}defaultHidden;get hidden(){let e=this.getStorageProperty("hidden")||this.defaultHidden;return typeof e=="string"?pixiVn.storage.getFlag(e):e}set hidden(e){this.setStorageProperty("hidden",e);}_icon;get icon(){return this._icon}get routine(){return z.currentRoutine.filter(e=>e.room.id===this.id)}};var Ce="__nqtr-quest__",A=class extends pixiVn.StoredClassModel{constructor(t,r,n={}){super(Ce,t);this._stages=r;this._onStart=n.onStart,this._onNextStage=n.onNextStage;}get stages(){return this._stages}get currentStageIndex(){return this.getStorageProperty("currentStageIndex")}set currentStageIndex(t){this.setStorageProperty("currentStageIndex",t);}get currentStage(){let t=this.currentStageIndex;if(!(t===void 0||t>=this.stages.length))return this.stages[t]}get started(){return this.currentStageIndex!==void 0}get completed(){return this.currentStageIndex===void 0?false:this.currentStageIndex>this.stages.length-1}get inProgress(){return this.completed||this.failed?false:this.started}get failed(){return this.getStorageProperty("failed")||false}set failed(t){this.setStorageProperty("failed",t);}_onStart;get onStart(){return this._onStart}_onNextStage;get onNextStage(){return this._onNextStage}async start(t){if(this.started){console.warn(`[NQTR] Quest ${this.id} is already started`);return}if(this.stages.length===0){u.error(`Quest ${this.id} has no stages`);return}this.currentStageIndex=0;let r=this.currentStage;if(r&&r.start)return this.onStart&&await this.onStart(this,t),await r.start(t);u.error(`Quest ${this.id} has no start stage`);}async tryToGoNextStage(t){if(!this.inProgress)return false;let r=this.currentStage;return r?r.completed?await this.goNextStage(t):false:(u.error(`Quest ${this.id} has no current stage`),false)}async completeCurrentStageAndGoNext(t){let r=this.currentStage;return r?(r.completed=true,await this.goNextStage(t)):(u.error(`Quest ${this.id} has no current stage`),false)}async goNextStage(t){if(!this.inProgress)return console.warn(`[NQTR] Quest ${this.id} is not in progress`),false;let r=this.currentStage,n=this.currentStageIndex;if(!r||n===void 0)return u.error(`Quest ${this.id} has no current stage`),false;this.currentStageIndex=n+1,this.onNextStage&&await this.onNextStage(this,t),r&&r.onEnd&&await r.onEnd(r,t);let i=this.currentStage;return i&&(i.inizialize(),this.currentStageMustStart&&await this.startCurrentStage(t)),true}get currentStageMustStart(){let t=this.currentStage;return t?!t.started&&t.canStart&&!t.completed:false}async startCurrentStage(t){let r=this.currentStage;r&&this.currentStageMustStart?await r.start(t):console.warn(`[NQTR] Quest ${this.id} can't start the current stage`);}};var J=class extends A{constructor(e,t,r){super(e,t,{onStart:r.onStart,onNextStage:r.onNextStage}),this._name=r.name||"",this._description=r.description||"",this._icon=r.icon,this._image=r.image,this._inDevelopment=r.inDevelopment||false;}_name;get name(){return this._name}_description;get description(){return this._description}_icon;get icon(){return this._icon}_image;get image(){return this._image}_inDevelopment;get inDevelopment(){return this._inDevelopment}};var Ne="__nqtr-stage__",D=class extends pixiVn.StoredClassModel{constructor(e,t={}){super(Ne,e),this._onStart=t.onStart,this._onEnd=t.onEnd,this._daysRequiredToStart=t.daysRequiredToStart,this._questsRequiredToStart=t.questsRequiredToStart||[];}_onStart;get onStart(){return this._onStart}_onEnd;get onEnd(){return this._onEnd}get completed(){return this.getStorageProperty("completed")||false}set completed(e){this.setStorageProperty("completed",e);}get started(){return this.getStorageProperty("started")||false}set started(e){this.setStorageProperty("started",e);}get prevStageEndDay(){return this.getStorageProperty("prevStageEndDay")}set prevStageEndDay(e){this.setStorageProperty("prevStageEndDay",e);}get startDay(){let e=this.prevStageEndDay;if(e!==void 0)return e+this.daysRequiredToStart}get canStart(){let e=this.daysRequiredToStart;if(e>0){let t=this.prevStageEndDay;if(t===void 0||t+e>c.currentDay)return false}return !(this.questsRequiredToStart.length>0&&!this.questsRequiredToStart.every(t=>t.quest.currentStageIndex&&t.quest.currentStageIndex>=t.stageNumber))}inizialize(){this.daysRequiredToStart>0&&(this.prevStageEndDay=c.currentDay,console.log(`[NQTR] Stage ${this.id} will start on day ${this.startDay}`));}async start(e){this.canStart?(this.started=true,this.onStart&&await this.onStart(this,e)):console.warn(`[NQTR] Stage ${this.id} can't start`);}_daysRequiredToStart;get daysRequiredToStart(){return this._daysRequiredToStart||0}_questsRequiredToStart;get questsRequiredToStart(){return this._questsRequiredToStart||[]}};var X=class extends D{constructor(e,t){super(e,{onStart:t.onStart,onEnd:t.onEnd,daysRequiredToStart:t.daysRequiredToStart,questsRequiredToStart:t.questsRequiredToStart}),this._name=t.name||"",this._flags=t.flags||[],this._description=t.description||"",this._adviceDescription=t.adviceDescription||"",this._image=t.image,this._flagsRequiredToStart=t.flagsRequiredToStart||[],this._requestDescriptionToStart=t.requestDescriptionToStart||"";}_name;get name(){return this._name}_description;get description(){return this._description}_adviceDescription;get adviceDescription(){return this._adviceDescription}_image;get image(){return this._image}_flags;get flags(){return this._flags}_flagsRequiredToStart;get flagsRequiredToStart(){return this._flagsRequiredToStart}_requestDescriptionToStart;get requestDescriptionToStart(){return this._requestDescriptionToStart}get completed(){return super.completed?true:this.flags.length>0?!!this.flags.every(e=>pixiVn.storage.getFlag(e.flag)):false}set completed(e){super.completed=e;}get canStart(){return this.flagsRequiredToStart.length>0&&!this.flagsRequiredToStart.every(e=>pixiVn.storage.getFlag(e.flag))?false:super.canStart}};exports.ActivityBaseModel=G;exports.ActivityStoredClass=h;exports.CommitmentBaseModel=K;exports.CommitmentStoredClass=x;exports.LocationBaseModel=j;exports.LocationStoredClass=_;exports.MapBaseModel=W;exports.MapStoredClass=R;exports.QuestBaseModel=J;exports.QuestStoredClass=A;exports.RoomBaseModel=U;exports.RoomStoredClass=T;exports.StageBaseModel=X;exports.StageStoredClass=D;//# sourceMappingURL=index.cjs.map
|
|
2
|
+
//# sourceMappingURL=index.cjs.map
|