@drincs/nqtr 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{StageProps-Bok_NwL7.d.ts → StageProps-CCjGI625.d.ts} +18 -21
- package/dist/{StageProps-CFQizpZF.d.mts → StageProps-CuE_n1Wg.d.mts} +18 -21
- package/dist/classes/index.d.mts +1 -1
- package/dist/classes/index.d.ts +1 -1
- package/dist/classes/index.js +17 -36
- package/dist/classes/index.js.map +1 -1
- package/dist/classes/index.mjs +17 -36
- package/dist/classes/index.mjs.map +1 -1
- package/dist/classes/navigation/Room.js.map +1 -1
- package/dist/classes/navigation/Room.mjs.map +1 -1
- package/dist/classes/quest/Quest.d.mts +1 -1
- package/dist/classes/quest/Quest.d.ts +1 -1
- package/dist/classes/quest/Quest.js +17 -36
- package/dist/classes/quest/Quest.js.map +1 -1
- package/dist/classes/quest/Quest.mjs +17 -36
- package/dist/classes/quest/Quest.mjs.map +1 -1
- package/dist/classes/quest/Stage.d.mts +1 -1
- package/dist/classes/quest/Stage.d.ts +1 -1
- package/dist/classes/quest/Stage.js +3 -11
- package/dist/classes/quest/Stage.js.map +1 -1
- package/dist/classes/quest/Stage.mjs +3 -11
- package/dist/classes/quest/Stage.mjs.map +1 -1
- package/dist/decorators/QuestDecorator.d.mts +1 -1
- package/dist/decorators/QuestDecorator.d.ts +1 -1
- package/dist/decorators/QuestDecorator.js +17 -36
- package/dist/decorators/QuestDecorator.js.map +1 -1
- package/dist/decorators/QuestDecorator.mjs +17 -36
- package/dist/decorators/QuestDecorator.mjs.map +1 -1
- package/dist/decorators/index.d.mts +1 -1
- package/dist/decorators/index.d.ts +1 -1
- package/dist/decorators/index.js +17 -36
- package/dist/decorators/index.js.map +1 -1
- package/dist/decorators/index.mjs +17 -36
- package/dist/decorators/index.mjs.map +1 -1
- package/dist/functions/ActivityFunctions.js.map +1 -1
- package/dist/functions/ActivityFunctions.mjs.map +1 -1
- package/dist/functions/NavigationFunctions.js.map +1 -1
- package/dist/functions/NavigationFunctions.mjs.map +1 -1
- package/dist/functions/QuestFunctions.d.mts +2 -2
- package/dist/functions/QuestFunctions.d.ts +2 -2
- package/dist/functions/QuestFunctions.js.map +1 -1
- package/dist/functions/QuestFunctions.mjs.map +1 -1
- package/dist/functions/RoutineFunctions.js.map +1 -1
- package/dist/functions/RoutineFunctions.mjs.map +1 -1
- package/dist/functions/index.js.map +1 -1
- package/dist/functions/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +17 -36
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +17 -36
- package/dist/index.mjs.map +1 -1
- package/dist/interface/index.d.mts +1 -1
- package/dist/interface/index.d.ts +1 -1
- package/dist/interface/quest/QuestProps.d.mts +1 -1
- package/dist/interface/quest/QuestProps.d.ts +1 -1
- package/dist/interface/quest/StageProps.d.mts +1 -1
- package/dist/interface/quest/StageProps.d.ts +1 -1
- package/dist/types/QuestsRequired.d.mts +1 -1
- package/dist/types/QuestsRequired.d.ts +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnRenderGraphicItemProps, GraphicItemType,
|
|
1
|
+
import { OnRenderGraphicItemProps, GraphicItemType, OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
|
|
2
2
|
import { StoredClassModel } from '@drincs/pixi-vn';
|
|
3
3
|
import Goal, { GoalStage } from './classes/quest/Goal.js';
|
|
4
4
|
import StageFlags from './interface/quest/StageFlags.js';
|
|
@@ -60,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
|
|
|
60
60
|
/**
|
|
61
61
|
* The function that will be called when the stage starts.
|
|
62
62
|
*/
|
|
63
|
-
get onStart(): undefined | ((props:
|
|
63
|
+
get onStart(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
|
|
64
64
|
private _onEnd?;
|
|
65
65
|
/**
|
|
66
66
|
* The function that will be called when the stage ends.
|
|
67
67
|
*/
|
|
68
|
-
get onEnd(): undefined | ((props:
|
|
68
|
+
get onEnd(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
|
|
69
69
|
}
|
|
70
70
|
declare class StageQuest extends Stage {
|
|
71
71
|
constructor(id: string, props: StageProps);
|
|
@@ -101,7 +101,7 @@ declare class StageQuest extends Stage {
|
|
|
101
101
|
/**
|
|
102
102
|
* The function that will be called when the stage starts.
|
|
103
103
|
*/
|
|
104
|
-
start(props:
|
|
104
|
+
start(props: OnStartEndStageQuest): void;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
declare class Quest extends StoredClassModel {
|
|
@@ -157,42 +157,39 @@ declare class Quest extends StoredClassModel {
|
|
|
157
157
|
/**
|
|
158
158
|
* The function that will be called when the quest starts.
|
|
159
159
|
*/
|
|
160
|
-
get onStart(): undefined | ((props:
|
|
160
|
+
get onStart(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
|
|
161
161
|
private _onNextStage?;
|
|
162
162
|
/**
|
|
163
163
|
* The function that will be called when the quest goes to the next stage.
|
|
164
164
|
*/
|
|
165
|
-
get onNextStage(): undefined | ((props:
|
|
165
|
+
get onNextStage(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
|
|
166
166
|
/**
|
|
167
167
|
* Start the quest.
|
|
168
168
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
169
169
|
* @returns
|
|
170
170
|
*/
|
|
171
|
-
start(props:
|
|
171
|
+
start(props: OnStartEndStageQuest): void;
|
|
172
172
|
/**
|
|
173
173
|
* Go to the next stage if the current stage is completed.
|
|
174
174
|
* If you want to force the change of stage, use goNextStage.
|
|
175
|
-
* @param
|
|
176
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
175
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
177
176
|
* @returns true if the stage was changed, false otherwise.
|
|
178
177
|
*/
|
|
179
|
-
tryToGoNextStage(
|
|
178
|
+
tryToGoNextStage(props: OnStartEndStageQuest): boolean;
|
|
180
179
|
/**
|
|
181
180
|
* Complete the current stage and go to the next stage.
|
|
182
181
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
183
|
-
* @param
|
|
184
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
182
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
185
183
|
* @returns true if the stage was changed, false otherwise.
|
|
186
184
|
*/
|
|
187
|
-
completeCurrentStageAndGoNext(
|
|
185
|
+
completeCurrentStageAndGoNext(props: OnStartEndStageQuest): boolean;
|
|
188
186
|
/**
|
|
189
187
|
* Go to the next stage without checking if the current stage is completed.
|
|
190
188
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
191
|
-
* @param
|
|
192
|
-
* @param endProps
|
|
189
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
193
190
|
* @returns returns true if the stage was changed, false otherwise.
|
|
194
191
|
*/
|
|
195
|
-
goNextStage(
|
|
192
|
+
goNextStage(props: OnStartEndStageQuest): boolean;
|
|
196
193
|
/**
|
|
197
194
|
* If the current stage must start. It is true if the current stage is not started, can start and not completed.
|
|
198
195
|
*/
|
|
@@ -201,7 +198,7 @@ declare class Quest extends StoredClassModel {
|
|
|
201
198
|
* Start the current stage.
|
|
202
199
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
203
200
|
*/
|
|
204
|
-
startCurrentStage(props:
|
|
201
|
+
startCurrentStage(props: OnStartEndStageQuest): void;
|
|
205
202
|
}
|
|
206
203
|
|
|
207
204
|
type QuestsRequiredType = {
|
|
@@ -248,11 +245,11 @@ interface QuestProps {
|
|
|
248
245
|
/**
|
|
249
246
|
* The function that will be executed when the quest starts.
|
|
250
247
|
*/
|
|
251
|
-
onStart?: (quest: Quest, props:
|
|
248
|
+
onStart?: (quest: Quest, props: OnStartEndStageQuest) => void;
|
|
252
249
|
/**
|
|
253
250
|
* The function that will be executed when a stage end in the quest.
|
|
254
251
|
*/
|
|
255
|
-
onNextStage?: (quest: Quest, props:
|
|
252
|
+
onNextStage?: (quest: Quest, props: OnStartEndStageQuest) => void;
|
|
256
253
|
}
|
|
257
254
|
|
|
258
255
|
interface StageProps {
|
|
@@ -319,11 +316,11 @@ interface StageProps {
|
|
|
319
316
|
/**
|
|
320
317
|
* The function that will be executed when the stage starts.
|
|
321
318
|
*/
|
|
322
|
-
onStart?: (stage: Stage, props:
|
|
319
|
+
onStart?: (stage: Stage, props: OnStartEndStageQuest) => void;
|
|
323
320
|
/**
|
|
324
321
|
* The function that will be executed when the stage ends.
|
|
325
322
|
*/
|
|
326
|
-
onEnd?: (stage: Stage, props:
|
|
323
|
+
onEnd?: (stage: Stage, props: OnStartEndStageQuest) => void;
|
|
327
324
|
}
|
|
328
325
|
|
|
329
326
|
export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OnRenderGraphicItemProps, GraphicItemType,
|
|
1
|
+
import { OnRenderGraphicItemProps, GraphicItemType, OnStartEndStageQuest } from '@drincs/nqtr/dist/override';
|
|
2
2
|
import { StoredClassModel } from '@drincs/pixi-vn';
|
|
3
3
|
import Goal, { GoalStage } from './classes/quest/Goal.mjs';
|
|
4
4
|
import StageFlags from './interface/quest/StageFlags.mjs';
|
|
@@ -60,12 +60,12 @@ declare class Stage extends StoredClassModel implements StageProps {
|
|
|
60
60
|
/**
|
|
61
61
|
* The function that will be called when the stage starts.
|
|
62
62
|
*/
|
|
63
|
-
get onStart(): undefined | ((props:
|
|
63
|
+
get onStart(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
|
|
64
64
|
private _onEnd?;
|
|
65
65
|
/**
|
|
66
66
|
* The function that will be called when the stage ends.
|
|
67
67
|
*/
|
|
68
|
-
get onEnd(): undefined | ((props:
|
|
68
|
+
get onEnd(): undefined | ((stage: Stage, props: OnStartEndStageQuest) => void);
|
|
69
69
|
}
|
|
70
70
|
declare class StageQuest extends Stage {
|
|
71
71
|
constructor(id: string, props: StageProps);
|
|
@@ -101,7 +101,7 @@ declare class StageQuest extends Stage {
|
|
|
101
101
|
/**
|
|
102
102
|
* The function that will be called when the stage starts.
|
|
103
103
|
*/
|
|
104
|
-
start(props:
|
|
104
|
+
start(props: OnStartEndStageQuest): void;
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
declare class Quest extends StoredClassModel {
|
|
@@ -157,42 +157,39 @@ declare class Quest extends StoredClassModel {
|
|
|
157
157
|
/**
|
|
158
158
|
* The function that will be called when the quest starts.
|
|
159
159
|
*/
|
|
160
|
-
get onStart(): undefined | ((props:
|
|
160
|
+
get onStart(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
|
|
161
161
|
private _onNextStage?;
|
|
162
162
|
/**
|
|
163
163
|
* The function that will be called when the quest goes to the next stage.
|
|
164
164
|
*/
|
|
165
|
-
get onNextStage(): undefined | ((props:
|
|
165
|
+
get onNextStage(): undefined | ((stage: Quest, props: OnStartEndStageQuest) => void);
|
|
166
166
|
/**
|
|
167
167
|
* Start the quest.
|
|
168
168
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
169
169
|
* @returns
|
|
170
170
|
*/
|
|
171
|
-
start(props:
|
|
171
|
+
start(props: OnStartEndStageQuest): void;
|
|
172
172
|
/**
|
|
173
173
|
* Go to the next stage if the current stage is completed.
|
|
174
174
|
* If you want to force the change of stage, use goNextStage.
|
|
175
|
-
* @param
|
|
176
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
175
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
177
176
|
* @returns true if the stage was changed, false otherwise.
|
|
178
177
|
*/
|
|
179
|
-
tryToGoNextStage(
|
|
178
|
+
tryToGoNextStage(props: OnStartEndStageQuest): boolean;
|
|
180
179
|
/**
|
|
181
180
|
* Complete the current stage and go to the next stage.
|
|
182
181
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
183
|
-
* @param
|
|
184
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
182
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
185
183
|
* @returns true if the stage was changed, false otherwise.
|
|
186
184
|
*/
|
|
187
|
-
completeCurrentStageAndGoNext(
|
|
185
|
+
completeCurrentStageAndGoNext(props: OnStartEndStageQuest): boolean;
|
|
188
186
|
/**
|
|
189
187
|
* Go to the next stage without checking if the current stage is completed.
|
|
190
188
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
191
|
-
* @param
|
|
192
|
-
* @param endProps
|
|
189
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
193
190
|
* @returns returns true if the stage was changed, false otherwise.
|
|
194
191
|
*/
|
|
195
|
-
goNextStage(
|
|
192
|
+
goNextStage(props: OnStartEndStageQuest): boolean;
|
|
196
193
|
/**
|
|
197
194
|
* If the current stage must start. It is true if the current stage is not started, can start and not completed.
|
|
198
195
|
*/
|
|
@@ -201,7 +198,7 @@ declare class Quest extends StoredClassModel {
|
|
|
201
198
|
* Start the current stage.
|
|
202
199
|
* @param props The properties for the start stage. If you not want to pass any property, you can pass an {}.
|
|
203
200
|
*/
|
|
204
|
-
startCurrentStage(props:
|
|
201
|
+
startCurrentStage(props: OnStartEndStageQuest): void;
|
|
205
202
|
}
|
|
206
203
|
|
|
207
204
|
type QuestsRequiredType = {
|
|
@@ -248,11 +245,11 @@ interface QuestProps {
|
|
|
248
245
|
/**
|
|
249
246
|
* The function that will be executed when the quest starts.
|
|
250
247
|
*/
|
|
251
|
-
onStart?: (quest: Quest, props:
|
|
248
|
+
onStart?: (quest: Quest, props: OnStartEndStageQuest) => void;
|
|
252
249
|
/**
|
|
253
250
|
* The function that will be executed when a stage end in the quest.
|
|
254
251
|
*/
|
|
255
|
-
onNextStage?: (quest: Quest, props:
|
|
252
|
+
onNextStage?: (quest: Quest, props: OnStartEndStageQuest) => void;
|
|
256
253
|
}
|
|
257
254
|
|
|
258
255
|
interface StageProps {
|
|
@@ -319,11 +316,11 @@ interface StageProps {
|
|
|
319
316
|
/**
|
|
320
317
|
* The function that will be executed when the stage starts.
|
|
321
318
|
*/
|
|
322
|
-
onStart?: (stage: Stage, props:
|
|
319
|
+
onStart?: (stage: Stage, props: OnStartEndStageQuest) => void;
|
|
323
320
|
/**
|
|
324
321
|
* The function that will be executed when the stage ends.
|
|
325
322
|
*/
|
|
326
|
-
onEnd?: (stage: Stage, props:
|
|
323
|
+
onEnd?: (stage: Stage, props: OnStartEndStageQuest) => void;
|
|
327
324
|
}
|
|
328
325
|
|
|
329
326
|
export { Quest as Q, Stage as S, type QuestProps as a, type StageProps as b, type QuestsRequiredType as c, StageQuest as d };
|
package/dist/classes/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-BHB-jYOi.mjs';
|
|
2
2
|
export { default as Goal } from './quest/Goal.mjs';
|
|
3
|
-
export { Q as Quest, S as Stage } from '../StageProps-
|
|
3
|
+
export { Q as Quest, S as Stage } from '../StageProps-CuE_n1Wg.mjs';
|
|
4
4
|
import '@drincs/nqtr/dist/override';
|
|
5
5
|
import '@drincs/pixi-vn';
|
|
6
6
|
import '../ActivityProps-D45DQdcT.mjs';
|
package/dist/classes/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { A as ActivityRoom, C as CommitmentBaseModel, L as LocationBaseModel, M as MapBaseModel, R as RoomBaseModel } from '../Commitment-D-1lsnnU.js';
|
|
2
2
|
export { default as Goal } from './quest/Goal.js';
|
|
3
|
-
export { Q as Quest, S as Stage } from '../StageProps-
|
|
3
|
+
export { Q as Quest, S as Stage } from '../StageProps-CCjGI625.js';
|
|
4
4
|
import '@drincs/nqtr/dist/override';
|
|
5
5
|
import '@drincs/pixi-vn';
|
|
6
6
|
import '../ActivityProps-BkHX8xkA.js';
|
package/dist/classes/index.js
CHANGED
|
@@ -1064,21 +1064,13 @@ var Stage = class extends pixiVn.StoredClassModel {
|
|
|
1064
1064
|
* The function that will be called when the stage starts.
|
|
1065
1065
|
*/
|
|
1066
1066
|
get onStart() {
|
|
1067
|
-
|
|
1068
|
-
if (onStart === void 0) {
|
|
1069
|
-
return void 0;
|
|
1070
|
-
}
|
|
1071
|
-
return (props) => onStart(this, props);
|
|
1067
|
+
return this._onStart;
|
|
1072
1068
|
}
|
|
1073
1069
|
/**
|
|
1074
1070
|
* The function that will be called when the stage ends.
|
|
1075
1071
|
*/
|
|
1076
1072
|
get onEnd() {
|
|
1077
|
-
|
|
1078
|
-
if (onEnd === void 0) {
|
|
1079
|
-
return void 0;
|
|
1080
|
-
}
|
|
1081
|
-
return (props) => onEnd(this, props);
|
|
1073
|
+
return this._onEnd;
|
|
1082
1074
|
}
|
|
1083
1075
|
};
|
|
1084
1076
|
var StageQuest = class extends Stage {
|
|
@@ -1181,7 +1173,7 @@ var StageQuest = class extends Stage {
|
|
|
1181
1173
|
if (this.canStart) {
|
|
1182
1174
|
this.started = true;
|
|
1183
1175
|
if (this.onStart) {
|
|
1184
|
-
this.onStart(props);
|
|
1176
|
+
this.onStart(this, props);
|
|
1185
1177
|
}
|
|
1186
1178
|
} else {
|
|
1187
1179
|
console.warn(`[NQTR] Stage ${this.id} can't start`);
|
|
@@ -1297,21 +1289,13 @@ var Quest = class extends pixiVn.StoredClassModel {
|
|
|
1297
1289
|
* The function that will be called when the quest starts.
|
|
1298
1290
|
*/
|
|
1299
1291
|
get onStart() {
|
|
1300
|
-
|
|
1301
|
-
if (onStart === void 0) {
|
|
1302
|
-
return void 0;
|
|
1303
|
-
}
|
|
1304
|
-
return (props) => onStart(this, props);
|
|
1292
|
+
return this._onStart;
|
|
1305
1293
|
}
|
|
1306
1294
|
/**
|
|
1307
1295
|
* The function that will be called when the quest goes to the next stage.
|
|
1308
1296
|
*/
|
|
1309
1297
|
get onNextStage() {
|
|
1310
|
-
|
|
1311
|
-
if (onNext === void 0) {
|
|
1312
|
-
return void 0;
|
|
1313
|
-
}
|
|
1314
|
-
return (props) => onNext(this, props);
|
|
1298
|
+
return this._onNextStage;
|
|
1315
1299
|
}
|
|
1316
1300
|
/**
|
|
1317
1301
|
* Start the quest.
|
|
@@ -1330,7 +1314,7 @@ var Quest = class extends pixiVn.StoredClassModel {
|
|
|
1330
1314
|
this.currentStageIndex = 0;
|
|
1331
1315
|
let currentStage = this.currentStage;
|
|
1332
1316
|
if (currentStage && currentStage.start) {
|
|
1333
|
-
this.onStart && this.onStart(props);
|
|
1317
|
+
this.onStart && this.onStart(this, props);
|
|
1334
1318
|
return currentStage.start(props);
|
|
1335
1319
|
} else {
|
|
1336
1320
|
console.error(`[NQTR] Quest ${this.id} has no start stage`);
|
|
@@ -1339,11 +1323,10 @@ var Quest = class extends pixiVn.StoredClassModel {
|
|
|
1339
1323
|
/**
|
|
1340
1324
|
* Go to the next stage if the current stage is completed.
|
|
1341
1325
|
* If you want to force the change of stage, use goNextStage.
|
|
1342
|
-
* @param
|
|
1343
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
1326
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1344
1327
|
* @returns true if the stage was changed, false otherwise.
|
|
1345
1328
|
*/
|
|
1346
|
-
tryToGoNextStage(
|
|
1329
|
+
tryToGoNextStage(props) {
|
|
1347
1330
|
if (!this.started) {
|
|
1348
1331
|
return false;
|
|
1349
1332
|
}
|
|
@@ -1356,34 +1339,32 @@ var Quest = class extends pixiVn.StoredClassModel {
|
|
|
1356
1339
|
return false;
|
|
1357
1340
|
}
|
|
1358
1341
|
if (currentStage.completed) {
|
|
1359
|
-
return this.goNextStage(
|
|
1342
|
+
return this.goNextStage(props);
|
|
1360
1343
|
}
|
|
1361
1344
|
return false;
|
|
1362
1345
|
}
|
|
1363
1346
|
/**
|
|
1364
1347
|
* Complete the current stage and go to the next stage.
|
|
1365
1348
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
1366
|
-
* @param
|
|
1367
|
-
* @param endProps The properties for the end stage. If you not want to pass any property, you can pass an {}.
|
|
1349
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1368
1350
|
* @returns true if the stage was changed, false otherwise.
|
|
1369
1351
|
*/
|
|
1370
|
-
completeCurrentStageAndGoNext(
|
|
1352
|
+
completeCurrentStageAndGoNext(props) {
|
|
1371
1353
|
let currentStage = this.currentStage;
|
|
1372
1354
|
if (!currentStage) {
|
|
1373
1355
|
console.error(`[NQTR] Quest ${this.id} has no current stage`);
|
|
1374
1356
|
return false;
|
|
1375
1357
|
}
|
|
1376
1358
|
currentStage.completed = true;
|
|
1377
|
-
return this.goNextStage(
|
|
1359
|
+
return this.goNextStage(props);
|
|
1378
1360
|
}
|
|
1379
1361
|
/**
|
|
1380
1362
|
* Go to the next stage without checking if the current stage is completed.
|
|
1381
1363
|
* If you want to go to the next stage only if the current stage is completed, use tryToGoNextStage.
|
|
1382
|
-
* @param
|
|
1383
|
-
* @param endProps
|
|
1364
|
+
* @param props The properties. If you not want to pass any property, you can pass an {}.
|
|
1384
1365
|
* @returns returns true if the stage was changed, false otherwise.
|
|
1385
1366
|
*/
|
|
1386
|
-
goNextStage(
|
|
1367
|
+
goNextStage(props) {
|
|
1387
1368
|
if (!this.started) {
|
|
1388
1369
|
console.warn(`[NQTR] Quest ${this.id} is not started`);
|
|
1389
1370
|
return false;
|
|
@@ -1399,15 +1380,15 @@ var Quest = class extends pixiVn.StoredClassModel {
|
|
|
1399
1380
|
return false;
|
|
1400
1381
|
}
|
|
1401
1382
|
this.currentStageIndex = currentStageIndex + 1;
|
|
1402
|
-
this.onNextStage && this.onNextStage(
|
|
1383
|
+
this.onNextStage && this.onNextStage(this, props);
|
|
1403
1384
|
if (prevStage && prevStage.onEnd) {
|
|
1404
|
-
prevStage.onEnd(
|
|
1385
|
+
prevStage.onEnd(prevStage, props);
|
|
1405
1386
|
}
|
|
1406
1387
|
let nextCurrentStage = this.currentStage;
|
|
1407
1388
|
if (nextCurrentStage) {
|
|
1408
1389
|
nextCurrentStage.inizialize();
|
|
1409
1390
|
if (this.currentStageMustStart) {
|
|
1410
|
-
this.startCurrentStage(
|
|
1391
|
+
this.startCurrentStage(props);
|
|
1411
1392
|
}
|
|
1412
1393
|
}
|
|
1413
1394
|
return true;
|