@drincs/nqtr 0.1.18 → 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/{Commitment-DNn_TEgV.d.mts → Commitment-C3Nc2RJH.d.mts} +17 -4
- package/dist/{Commitment-GIA4EK_q.d.ts → Commitment-Cc2kZEy0.d.ts} +17 -4
- package/dist/Quest-BQ1pwvQ_.d.ts +197 -0
- package/dist/Quest-DaNlPBHb.d.mts +197 -0
- package/dist/classes/Commitment.d.mts +2 -2
- package/dist/classes/Commitment.d.ts +2 -2
- package/dist/classes/Commitment.js +12 -1
- package/dist/classes/Commitment.js.map +1 -1
- package/dist/classes/Commitment.mjs +12 -1
- package/dist/classes/Commitment.mjs.map +1 -1
- package/dist/classes/index.d.mts +4 -4
- package/dist/classes/index.d.ts +4 -4
- package/dist/classes/index.js +514 -313
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +512 -312
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/ActivityRoom.d.mts +2 -2
- package/dist/classes/navigation/ActivityRoom.d.ts +2 -2
- 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/Location.d.mts +2 -2
- package/dist/classes/navigation/Location.d.ts +2 -2
- package/dist/classes/navigation/Location.js.map +1 -1
- package/dist/classes/navigation/Location.mjs.map +1 -1
- package/dist/classes/navigation/Map.d.mts +2 -2
- package/dist/classes/navigation/Map.d.ts +2 -2
- package/dist/classes/navigation/Map.js.map +1 -1
- package/dist/classes/navigation/Map.mjs.map +1 -1
- package/dist/classes/navigation/Room.d.mts +2 -2
- package/dist/classes/navigation/Room.d.ts +2 -2
- package/dist/classes/navigation/Room.js +15 -15
- package/dist/classes/navigation/Room.js.map +1 -1
- package/dist/classes/navigation/Room.mjs +15 -15
- 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/ActivityDecorator.d.mts +1 -1
- package/dist/decorators/ActivityDecorator.d.ts +1 -1
- package/dist/decorators/ActivityDecorator.js.map +1 -1
- package/dist/decorators/ActivityDecorator.mjs.map +1 -1
- package/dist/decorators/CommitmentDecorator.d.mts +32 -6
- package/dist/decorators/CommitmentDecorator.d.ts +32 -6
- package/dist/decorators/CommitmentDecorator.js +7 -7
- package/dist/decorators/CommitmentDecorator.js.map +1 -1
- package/dist/decorators/CommitmentDecorator.mjs +5 -5
- package/dist/decorators/CommitmentDecorator.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/RoomDecorator.d.mts +3 -3
- package/dist/decorators/RoomDecorator.d.ts +3 -3
- package/dist/decorators/RoomDecorator.js.map +1 -1
- package/dist/decorators/RoomDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +8 -3
- package/dist/decorators/index.d.ts +8 -3
- package/dist/decorators/index.js +30 -15
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +27 -12
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/ActivityFunctions.d.mts +2 -2
- package/dist/functions/ActivityFunctions.d.ts +2 -2
- package/dist/functions/ActivityFunctions.js.map +1 -1
- package/dist/functions/ActivityFunctions.mjs.map +1 -1
- package/dist/functions/NavigationFunctions.d.mts +2 -2
- package/dist/functions/NavigationFunctions.d.ts +2 -2
- package/dist/functions/NavigationFunctions.js.map +1 -1
- package/dist/functions/NavigationFunctions.mjs.map +1 -1
- package/dist/functions/RoutineFunctions.d.mts +21 -4
- package/dist/functions/RoutineFunctions.d.ts +21 -4
- package/dist/functions/RoutineFunctions.js +16 -16
- package/dist/functions/RoutineFunctions.js.map +1 -1
- package/dist/functions/RoutineFunctions.mjs +16 -16
- package/dist/functions/RoutineFunctions.mjs.map +1 -1
- package/dist/functions/index.d.mts +3 -3
- package/dist/functions/index.d.ts +3 -3
- package/dist/functions/index.js +16 -16
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs +16 -16
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +7 -6
- package/dist/index.d.ts +7 -6
- package/dist/index.js +543 -326
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +536 -319
- package/dist/index.mjs.map +1 -1
- package/dist/interface/CommitmentProps.d.mts +2 -2
- package/dist/interface/CommitmentProps.d.ts +2 -2
- package/dist/interface/RoomProps.d.mts +2 -2
- package/dist/interface/RoomProps.d.ts +2 -2
- package/dist/interface/index.d.mts +4 -4
- package/dist/interface/index.d.ts +4 -4
- package/dist/interface/navigation/LocationProps.d.mts +2 -2
- package/dist/interface/navigation/LocationProps.d.ts +2 -2
- package/dist/interface/navigation/MapProps.d.mts +2 -2
- package/dist/interface/navigation/MapProps.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/ExecutionType.d.mts +3 -0
- package/dist/types/ExecutionType.d.ts +3 -0
- package/dist/types/ExecutionType.js +4 -0
- package/dist/types/ExecutionType.js.map +1 -0
- package/dist/types/ExecutionType.mjs +3 -0
- package/dist/types/ExecutionType.mjs.map +1 -0
- package/dist/types/QuestsRequired.d.mts +3 -2
- package/dist/types/QuestsRequired.d.ts +3 -2
- package/dist/types/index.d.mts +4 -2
- package/dist/types/index.d.ts +4 -2
- package/package.json +1 -1
- package/dist/Quest-Bdm0R9LA.d.mts +0 -71
- package/dist/Quest-CxJcXETG.d.ts +0 -71
- package/dist/enums/ExecutionTypeEnum.d.mts +0 -6
- package/dist/enums/ExecutionTypeEnum.d.ts +0 -6
- package/dist/enums/ExecutionTypeEnum.js +0 -12
- package/dist/enums/ExecutionTypeEnum.js.map +0 -1
- package/dist/enums/ExecutionTypeEnum.mjs +0 -10
- package/dist/enums/ExecutionTypeEnum.mjs.map +0 -1
- package/dist/enums/index.d.mts +0 -1
- package/dist/enums/index.d.ts +0 -1
- package/dist/enums/index.js +0 -12
- package/dist/enums/index.js.map +0 -1
- package/dist/enums/index.mjs +0 -10
- package/dist/enums/index.mjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GraphicItemType, OnRenderGraphicItemProps, OnRunProps } from '@drincs/nqtr/dist/override';
|
|
2
2
|
import { CharacterBaseModel, StoredClassModel } from '@drincs/pixi-vn';
|
|
3
|
-
import
|
|
3
|
+
import ExecutionType from './types/ExecutionType.mjs';
|
|
4
4
|
import ActivityModel from './classes/Activity.mjs';
|
|
5
5
|
import { a as ActivityStoredAbstract, A as ActivityProps } from './ActivityProps-BoJeWa2B.mjs';
|
|
6
6
|
import { OnRunActivityEvent } from './types/OnRunActivityEvent.mjs';
|
|
@@ -53,9 +53,9 @@ interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseM
|
|
|
53
53
|
renderImage?: GraphicItemType | ((commitment: CommitmentBaseModel<TCharacter, TRoom>, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
54
54
|
/**
|
|
55
55
|
* 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.
|
|
56
|
-
* @default
|
|
56
|
+
* @default "interaction"
|
|
57
57
|
*/
|
|
58
|
-
executionType?:
|
|
58
|
+
executionType?: ExecutionType;
|
|
59
59
|
/**
|
|
60
60
|
* Is a function that is called when the player interacts with the character.
|
|
61
61
|
* @param commitment
|
|
@@ -79,6 +79,12 @@ interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseM
|
|
|
79
79
|
* @default undefined
|
|
80
80
|
*/
|
|
81
81
|
renderIcon?: GraphicItemType | ((commitment: CommitmentBaseModel, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
82
|
+
/**
|
|
83
|
+
* The priority. The higher the number, the higher the priority.
|
|
84
|
+
* 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.
|
|
85
|
+
* @default 0
|
|
86
|
+
*/
|
|
87
|
+
priority?: number;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
interface LocationProps<TMap extends MapBaseModel = MapBaseModel> {
|
|
@@ -544,7 +550,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
544
550
|
/**
|
|
545
551
|
* 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.
|
|
546
552
|
*/
|
|
547
|
-
get executionType():
|
|
553
|
+
get executionType(): ExecutionType;
|
|
548
554
|
private _renderIcon?;
|
|
549
555
|
/**
|
|
550
556
|
* The function for rendering the icon of the commitment.
|
|
@@ -567,6 +573,13 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
567
573
|
*/
|
|
568
574
|
get hidden(): boolean;
|
|
569
575
|
set hidden(value: boolean | string);
|
|
576
|
+
private defaultPriority;
|
|
577
|
+
/**
|
|
578
|
+
* The priority. The higher the number, the higher the priority.
|
|
579
|
+
* 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.
|
|
580
|
+
*/
|
|
581
|
+
get priority(): number;
|
|
582
|
+
set priority(value: number);
|
|
570
583
|
/**
|
|
571
584
|
* Whether the commitment is expired.
|
|
572
585
|
* @returns Whether the commitment is expired.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GraphicItemType, OnRenderGraphicItemProps, OnRunProps } from '@drincs/nqtr/dist/override';
|
|
2
2
|
import { CharacterBaseModel, StoredClassModel } from '@drincs/pixi-vn';
|
|
3
|
-
import
|
|
3
|
+
import ExecutionType from './types/ExecutionType.js';
|
|
4
4
|
import ActivityModel from './classes/Activity.js';
|
|
5
5
|
import { a as ActivityStoredAbstract, A as ActivityProps } from './ActivityProps-_79x9-BX.js';
|
|
6
6
|
import { OnRunActivityEvent } from './types/OnRunActivityEvent.js';
|
|
@@ -53,9 +53,9 @@ interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseM
|
|
|
53
53
|
renderImage?: GraphicItemType | ((commitment: CommitmentBaseModel<TCharacter, TRoom>, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
54
54
|
/**
|
|
55
55
|
* 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.
|
|
56
|
-
* @default
|
|
56
|
+
* @default "interaction"
|
|
57
57
|
*/
|
|
58
|
-
executionType?:
|
|
58
|
+
executionType?: ExecutionType;
|
|
59
59
|
/**
|
|
60
60
|
* Is a function that is called when the player interacts with the character.
|
|
61
61
|
* @param commitment
|
|
@@ -79,6 +79,12 @@ interface CommitmentProps<TCharacter extends CharacterBaseModel = CharacterBaseM
|
|
|
79
79
|
* @default undefined
|
|
80
80
|
*/
|
|
81
81
|
renderIcon?: GraphicItemType | ((commitment: CommitmentBaseModel, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
82
|
+
/**
|
|
83
|
+
* The priority. The higher the number, the higher the priority.
|
|
84
|
+
* 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.
|
|
85
|
+
* @default 0
|
|
86
|
+
*/
|
|
87
|
+
priority?: number;
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
interface LocationProps<TMap extends MapBaseModel = MapBaseModel> {
|
|
@@ -544,7 +550,7 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
544
550
|
/**
|
|
545
551
|
* 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.
|
|
546
552
|
*/
|
|
547
|
-
get executionType():
|
|
553
|
+
get executionType(): ExecutionType;
|
|
548
554
|
private _renderIcon?;
|
|
549
555
|
/**
|
|
550
556
|
* The function for rendering the icon of the commitment.
|
|
@@ -567,6 +573,13 @@ declare class CommitmentBaseModel<TCharacter extends CharacterBaseModel = Charac
|
|
|
567
573
|
*/
|
|
568
574
|
get hidden(): boolean;
|
|
569
575
|
set hidden(value: boolean | string);
|
|
576
|
+
private defaultPriority;
|
|
577
|
+
/**
|
|
578
|
+
* The priority. The higher the number, the higher the priority.
|
|
579
|
+
* 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.
|
|
580
|
+
*/
|
|
581
|
+
get priority(): number;
|
|
582
|
+
set priority(value: number);
|
|
570
583
|
/**
|
|
571
584
|
* Whether the commitment is expired.
|
|
572
585
|
* @returns Whether the commitment is expired.
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { GraphicItemType, OnRenderGraphicItemProps } from '@drincs/nqtr/dist/override';
|
|
2
|
+
import { StoredClassModel } from '@drincs/pixi-vn';
|
|
3
|
+
import Goal, { GoalStage } from './classes/quest/Goal.js';
|
|
4
|
+
import StageFlags from './interface/quest/StageFlags.js';
|
|
5
|
+
|
|
6
|
+
type QuestsRequiredType = {
|
|
7
|
+
quest: Quest;
|
|
8
|
+
stageNumber: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
interface QuestProps {
|
|
12
|
+
/**
|
|
13
|
+
* The name of the quest.
|
|
14
|
+
* @default ""
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The description of the quest.
|
|
19
|
+
* @default ""
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
renderIcon?: GraphicItemType | ((room: Quest, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
27
|
+
/**
|
|
28
|
+
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
29
|
+
* Or an object to manage multiple image types. For example to have a image based on time.
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* {
|
|
33
|
+
* "morning": "morning-background.jpg",
|
|
34
|
+
* "afternoon": "afternoon-background.jpg",
|
|
35
|
+
* "evening": "evening-background.jpg",
|
|
36
|
+
* "night": "night-background.jpg"
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
* @default undefined
|
|
40
|
+
*/
|
|
41
|
+
renderImage?: GraphicItemType | ((room: Quest, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
42
|
+
/**
|
|
43
|
+
* If the quest is in development.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
isInDevelopment?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface StageProps {
|
|
50
|
+
/**
|
|
51
|
+
* The goals of the stage.
|
|
52
|
+
* @default []
|
|
53
|
+
*/
|
|
54
|
+
goals?: Goal[];
|
|
55
|
+
/**
|
|
56
|
+
* The flags of the stage.
|
|
57
|
+
* @default []
|
|
58
|
+
*/
|
|
59
|
+
flags?: StageFlags[];
|
|
60
|
+
/**
|
|
61
|
+
* The name of the stage.
|
|
62
|
+
* @default ""
|
|
63
|
+
*/
|
|
64
|
+
name?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The description of the stage.
|
|
67
|
+
* @default ""
|
|
68
|
+
*/
|
|
69
|
+
description?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The advice description of the stage.
|
|
72
|
+
* @default ""
|
|
73
|
+
*/
|
|
74
|
+
adviceDescription?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
77
|
+
* Or an object to manage multiple image types. For example to have a image based on time.
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* {
|
|
81
|
+
* "morning": "morning-background.jpg",
|
|
82
|
+
* "afternoon": "afternoon-background.jpg",
|
|
83
|
+
* "evening": "evening-background.jpg",
|
|
84
|
+
* "night": "night-background.jpg"
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
* @default undefined
|
|
88
|
+
*/
|
|
89
|
+
renderImage?: GraphicItemType | ((room: Stage, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
90
|
+
/**
|
|
91
|
+
* The day required to start the stage.
|
|
92
|
+
* @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.
|
|
93
|
+
*/
|
|
94
|
+
daysRequiredToStart?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The flags required to start the stage.
|
|
97
|
+
* @default []
|
|
98
|
+
*/
|
|
99
|
+
flagsRequired?: StageFlags[];
|
|
100
|
+
/**
|
|
101
|
+
* The quests required to start the stage.
|
|
102
|
+
* @default []
|
|
103
|
+
*/
|
|
104
|
+
questsRequired?: QuestsRequiredType[];
|
|
105
|
+
/**
|
|
106
|
+
* The description to request to start the stage.
|
|
107
|
+
* @default ""
|
|
108
|
+
*/
|
|
109
|
+
requestDescription?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The function that will be executed when the stage starts.
|
|
112
|
+
*/
|
|
113
|
+
onStart?: () => void;
|
|
114
|
+
/**
|
|
115
|
+
* The function that will be executed when the stage ends.
|
|
116
|
+
*/
|
|
117
|
+
onEnd?: () => void;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare class Stage extends StoredClassModel implements StageProps {
|
|
121
|
+
constructor(id: string, props: StageProps);
|
|
122
|
+
private _name;
|
|
123
|
+
get name(): string;
|
|
124
|
+
private _description;
|
|
125
|
+
get description(): string;
|
|
126
|
+
private _adviceDescription;
|
|
127
|
+
get adviceDescription(): string;
|
|
128
|
+
private _renderImage?;
|
|
129
|
+
/**
|
|
130
|
+
* The function for rendering the image of the stage.
|
|
131
|
+
*/
|
|
132
|
+
get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
133
|
+
private _defaultGoals;
|
|
134
|
+
get defaultGoals(): Goal[];
|
|
135
|
+
private _flags;
|
|
136
|
+
/**
|
|
137
|
+
* The list of flags that the player must complete to finish the stage.
|
|
138
|
+
*/
|
|
139
|
+
get flags(): StageFlags[];
|
|
140
|
+
private _daysRequiredToStart?;
|
|
141
|
+
get daysRequiredToStart(): number;
|
|
142
|
+
private _flagsRequiredToStart;
|
|
143
|
+
get flagsRequiredToStart(): StageFlags[];
|
|
144
|
+
private _questsRequiredToStart;
|
|
145
|
+
get questsRequiredToStart(): QuestsRequiredType[];
|
|
146
|
+
private _requestDescriptionToStart;
|
|
147
|
+
get requestDescriptionToStart(): string;
|
|
148
|
+
private _onStart?;
|
|
149
|
+
get onStart(): undefined | (() => void);
|
|
150
|
+
private _onEnd?;
|
|
151
|
+
get onEnd(): undefined | (() => void);
|
|
152
|
+
}
|
|
153
|
+
declare class StageQuest extends Stage {
|
|
154
|
+
constructor(id: string, props: StageProps);
|
|
155
|
+
get completed(): boolean;
|
|
156
|
+
set completed(value: boolean);
|
|
157
|
+
/**
|
|
158
|
+
* The list of goals that the player needs to complete to finish the stage.
|
|
159
|
+
*/
|
|
160
|
+
get goals(): GoalStage[];
|
|
161
|
+
private get prevStageEndDay();
|
|
162
|
+
private set prevStageEndDay(value);
|
|
163
|
+
get startDay(): number | undefined;
|
|
164
|
+
get canStart(): boolean;
|
|
165
|
+
get onStart(): undefined | (() => void);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare class Quest extends StoredClassModel {
|
|
169
|
+
constructor(id: string, stages: Stage[], props: QuestProps);
|
|
170
|
+
private _stages;
|
|
171
|
+
get stages(): StageQuest[];
|
|
172
|
+
private _name;
|
|
173
|
+
get name(): string;
|
|
174
|
+
private _description;
|
|
175
|
+
get description(): string;
|
|
176
|
+
private _renderIcon?;
|
|
177
|
+
/**
|
|
178
|
+
* The function for rendering the icon of the quest.
|
|
179
|
+
*/
|
|
180
|
+
get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
181
|
+
private _renderImage?;
|
|
182
|
+
/**
|
|
183
|
+
* The function for rendering the image of the quest.
|
|
184
|
+
*/
|
|
185
|
+
get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
186
|
+
private _isInDevelopment;
|
|
187
|
+
get isInDevelopment(): boolean;
|
|
188
|
+
get currentStageIndex(): number | undefined;
|
|
189
|
+
private set currentStageIndex(value);
|
|
190
|
+
get currentStage(): StageQuest | undefined;
|
|
191
|
+
get started(): boolean;
|
|
192
|
+
get completed(): boolean;
|
|
193
|
+
start(): void;
|
|
194
|
+
tryToGoNextStage(): void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { GraphicItemType, OnRenderGraphicItemProps } from '@drincs/nqtr/dist/override';
|
|
2
|
+
import { StoredClassModel } from '@drincs/pixi-vn';
|
|
3
|
+
import Goal, { GoalStage } from './classes/quest/Goal.mjs';
|
|
4
|
+
import StageFlags from './interface/quest/StageFlags.mjs';
|
|
5
|
+
|
|
6
|
+
type QuestsRequiredType = {
|
|
7
|
+
quest: Quest;
|
|
8
|
+
stageNumber: number;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
interface QuestProps {
|
|
12
|
+
/**
|
|
13
|
+
* The name of the quest.
|
|
14
|
+
* @default ""
|
|
15
|
+
*/
|
|
16
|
+
name?: string;
|
|
17
|
+
/**
|
|
18
|
+
* The description of the quest.
|
|
19
|
+
* @default ""
|
|
20
|
+
*/
|
|
21
|
+
description?: string;
|
|
22
|
+
/**
|
|
23
|
+
* The icon element. Can be a string or an Element or a Pixi'VN CanvasItem
|
|
24
|
+
* @default undefined
|
|
25
|
+
*/
|
|
26
|
+
renderIcon?: GraphicItemType | ((room: Quest, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
27
|
+
/**
|
|
28
|
+
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
29
|
+
* Or an object to manage multiple image types. For example to have a image based on time.
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* {
|
|
33
|
+
* "morning": "morning-background.jpg",
|
|
34
|
+
* "afternoon": "afternoon-background.jpg",
|
|
35
|
+
* "evening": "evening-background.jpg",
|
|
36
|
+
* "night": "night-background.jpg"
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
* @default undefined
|
|
40
|
+
*/
|
|
41
|
+
renderImage?: GraphicItemType | ((room: Quest, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
42
|
+
/**
|
|
43
|
+
* If the quest is in development.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
isInDevelopment?: boolean;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
interface StageProps {
|
|
50
|
+
/**
|
|
51
|
+
* The goals of the stage.
|
|
52
|
+
* @default []
|
|
53
|
+
*/
|
|
54
|
+
goals?: Goal[];
|
|
55
|
+
/**
|
|
56
|
+
* The flags of the stage.
|
|
57
|
+
* @default []
|
|
58
|
+
*/
|
|
59
|
+
flags?: StageFlags[];
|
|
60
|
+
/**
|
|
61
|
+
* The name of the stage.
|
|
62
|
+
* @default ""
|
|
63
|
+
*/
|
|
64
|
+
name?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The description of the stage.
|
|
67
|
+
* @default ""
|
|
68
|
+
*/
|
|
69
|
+
description?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The advice description of the stage.
|
|
72
|
+
* @default ""
|
|
73
|
+
*/
|
|
74
|
+
adviceDescription?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The image. It can be a string, an Element or a Pixi'VN Canvas Item.
|
|
77
|
+
* Or an object to manage multiple image types. For example to have a image based on time.
|
|
78
|
+
* @example
|
|
79
|
+
* ```ts
|
|
80
|
+
* {
|
|
81
|
+
* "morning": "morning-background.jpg",
|
|
82
|
+
* "afternoon": "afternoon-background.jpg",
|
|
83
|
+
* "evening": "evening-background.jpg",
|
|
84
|
+
* "night": "night-background.jpg"
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
* @default undefined
|
|
88
|
+
*/
|
|
89
|
+
renderImage?: GraphicItemType | ((room: Stage, props: OnRenderGraphicItemProps) => GraphicItemType);
|
|
90
|
+
/**
|
|
91
|
+
* The day required to start the stage.
|
|
92
|
+
* @example If the value is 3, and the previous stage ends on day 1, the stage will start on day 4.
|
|
93
|
+
*/
|
|
94
|
+
daysRequiredToStart?: number;
|
|
95
|
+
/**
|
|
96
|
+
* The flags required to start the stage.
|
|
97
|
+
* @default []
|
|
98
|
+
*/
|
|
99
|
+
flagsRequired?: StageFlags[];
|
|
100
|
+
/**
|
|
101
|
+
* The quests required to start the stage.
|
|
102
|
+
* @default []
|
|
103
|
+
*/
|
|
104
|
+
questsRequired?: QuestsRequiredType[];
|
|
105
|
+
/**
|
|
106
|
+
* The description to request to start the stage.
|
|
107
|
+
* @default ""
|
|
108
|
+
*/
|
|
109
|
+
requestDescription?: string;
|
|
110
|
+
/**
|
|
111
|
+
* The function that will be executed when the stage starts.
|
|
112
|
+
*/
|
|
113
|
+
onStart?: () => void;
|
|
114
|
+
/**
|
|
115
|
+
* The function that will be executed when the stage ends.
|
|
116
|
+
*/
|
|
117
|
+
onEnd?: () => void;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
declare class Stage extends StoredClassModel implements StageProps {
|
|
121
|
+
constructor(id: string, props: StageProps);
|
|
122
|
+
private _name;
|
|
123
|
+
get name(): string;
|
|
124
|
+
private _description;
|
|
125
|
+
get description(): string;
|
|
126
|
+
private _adviceDescription;
|
|
127
|
+
get adviceDescription(): string;
|
|
128
|
+
private _renderImage?;
|
|
129
|
+
/**
|
|
130
|
+
* The function for rendering the image of the stage.
|
|
131
|
+
*/
|
|
132
|
+
get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
133
|
+
private _defaultGoals;
|
|
134
|
+
get defaultGoals(): Goal[];
|
|
135
|
+
private _flags;
|
|
136
|
+
/**
|
|
137
|
+
* The list of flags that the player must complete to finish the stage.
|
|
138
|
+
*/
|
|
139
|
+
get flags(): StageFlags[];
|
|
140
|
+
private _daysRequiredToStart?;
|
|
141
|
+
get daysRequiredToStart(): number;
|
|
142
|
+
private _flagsRequiredToStart;
|
|
143
|
+
get flagsRequiredToStart(): StageFlags[];
|
|
144
|
+
private _questsRequiredToStart;
|
|
145
|
+
get questsRequiredToStart(): QuestsRequiredType[];
|
|
146
|
+
private _requestDescriptionToStart;
|
|
147
|
+
get requestDescriptionToStart(): string;
|
|
148
|
+
private _onStart?;
|
|
149
|
+
get onStart(): undefined | (() => void);
|
|
150
|
+
private _onEnd?;
|
|
151
|
+
get onEnd(): undefined | (() => void);
|
|
152
|
+
}
|
|
153
|
+
declare class StageQuest extends Stage {
|
|
154
|
+
constructor(id: string, props: StageProps);
|
|
155
|
+
get completed(): boolean;
|
|
156
|
+
set completed(value: boolean);
|
|
157
|
+
/**
|
|
158
|
+
* The list of goals that the player needs to complete to finish the stage.
|
|
159
|
+
*/
|
|
160
|
+
get goals(): GoalStage[];
|
|
161
|
+
private get prevStageEndDay();
|
|
162
|
+
private set prevStageEndDay(value);
|
|
163
|
+
get startDay(): number | undefined;
|
|
164
|
+
get canStart(): boolean;
|
|
165
|
+
get onStart(): undefined | (() => void);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
declare class Quest extends StoredClassModel {
|
|
169
|
+
constructor(id: string, stages: Stage[], props: QuestProps);
|
|
170
|
+
private _stages;
|
|
171
|
+
get stages(): StageQuest[];
|
|
172
|
+
private _name;
|
|
173
|
+
get name(): string;
|
|
174
|
+
private _description;
|
|
175
|
+
get description(): string;
|
|
176
|
+
private _renderIcon?;
|
|
177
|
+
/**
|
|
178
|
+
* The function for rendering the icon of the quest.
|
|
179
|
+
*/
|
|
180
|
+
get renderIcon(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
181
|
+
private _renderImage?;
|
|
182
|
+
/**
|
|
183
|
+
* The function for rendering the image of the quest.
|
|
184
|
+
*/
|
|
185
|
+
get renderImage(): ((props: OnRenderGraphicItemProps) => GraphicItemType) | undefined;
|
|
186
|
+
private _isInDevelopment;
|
|
187
|
+
get isInDevelopment(): boolean;
|
|
188
|
+
get currentStageIndex(): number | undefined;
|
|
189
|
+
private set currentStageIndex(value);
|
|
190
|
+
get currentStage(): StageQuest | undefined;
|
|
191
|
+
get started(): boolean;
|
|
192
|
+
get completed(): boolean;
|
|
193
|
+
start(): void;
|
|
194
|
+
tryToGoNextStage(): void;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@drincs/nqtr/dist/override';
|
|
2
2
|
import '@drincs/pixi-vn';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export { C as default } from '../Commitment-C3Nc2RJH.mjs';
|
|
4
|
+
import '../types/ExecutionType.mjs';
|
|
5
5
|
import './Activity.mjs';
|
|
6
6
|
import '../ActivityProps-BoJeWa2B.mjs';
|
|
7
7
|
import '../types/OnRunActivityEvent.mjs';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@drincs/nqtr/dist/override';
|
|
2
2
|
import '@drincs/pixi-vn';
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
export { C as default } from '../Commitment-Cc2kZEy0.js';
|
|
4
|
+
import '../types/ExecutionType.js';
|
|
5
5
|
import './Activity.js';
|
|
6
6
|
import '../ActivityProps-_79x9-BX.js';
|
|
7
7
|
import '../types/OnRunActivityEvent.js';
|
|
@@ -265,11 +265,12 @@ var CommitmentBaseModel = class extends pixiVn.StoredClassModel {
|
|
|
265
265
|
this.defaultFromDay = props.fromDay;
|
|
266
266
|
this.defaultToDay = props.toDay;
|
|
267
267
|
this._renderImage = props.renderImage;
|
|
268
|
-
this._executionType = props.executionType || "interaction"
|
|
268
|
+
this._executionType = props.executionType || "interaction";
|
|
269
269
|
this._onRun = props.onRun;
|
|
270
270
|
this.defaultDisabled = props.disabled || false;
|
|
271
271
|
this.defaultHidden = props.hidden || false;
|
|
272
272
|
this._renderIcon = props.renderIcon;
|
|
273
|
+
this.defaultPriority = props.priority || 0;
|
|
273
274
|
}
|
|
274
275
|
/**
|
|
275
276
|
* The character or characters that are in the commitment and so in the room.
|
|
@@ -411,6 +412,16 @@ var CommitmentBaseModel = class extends pixiVn.StoredClassModel {
|
|
|
411
412
|
set hidden(value) {
|
|
412
413
|
this.setStorageProperty("hidden", value);
|
|
413
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* The priority. The higher the number, the higher the priority.
|
|
417
|
+
* 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.
|
|
418
|
+
*/
|
|
419
|
+
get priority() {
|
|
420
|
+
return this.getStorageProperty("priority") || this.defaultPriority || 0;
|
|
421
|
+
}
|
|
422
|
+
set priority(value) {
|
|
423
|
+
this.setStorageProperty("priority", value);
|
|
424
|
+
}
|
|
414
425
|
/**
|
|
415
426
|
* Whether the commitment is expired.
|
|
416
427
|
* @returns Whether the commitment is expired.
|