@nice2dev/game-engine 1.3.12 → 1.3.14
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/CHANGELOG.md +8 -0
- package/package.json +2 -2
- package/dist/types/accessibility/index.d.ts +0 -1
- package/dist/types/ai/index.d.ts +0 -1
- package/dist/types/animation/index.d.ts +0 -1
- package/dist/types/audio/HRTFAudio.d.ts +0 -180
- package/dist/types/audio/index.d.ts +0 -2
- package/dist/types/community/Community.d.ts +0 -112
- package/dist/types/community/index.d.ts +0 -1
- package/dist/types/core/TypeSafety.d.ts +0 -190
- package/dist/types/core/index.d.ts +0 -7
- package/dist/types/devtools/AssetStore.d.ts +0 -133
- package/dist/types/devtools/index.d.ts +0 -3
- package/dist/types/dialogue/index.d.ts +0 -2
- package/dist/types/docs/APIPlayground.d.ts +0 -26
- package/dist/types/docs/Cookbook.d.ts +0 -18
- package/dist/types/docs/Guides.d.ts +0 -18
- package/dist/types/docs/index.d.ts +0 -4
- package/dist/types/ecs/ECSOptimized.d.ts +0 -131
- package/dist/types/ecs/index.d.ts +0 -2
- package/dist/types/editor/NiceAnimationTimeline.d.ts +0 -114
- package/dist/types/editor/NiceLevelEditor.d.ts +0 -232
- package/dist/types/editor/NiceMaterialEditor.d.ts +0 -105
- package/dist/types/editor/NiceNodeGraph.d.ts +0 -87
- package/dist/types/editor/NiceParticleEditor.d.ts +0 -127
- package/dist/types/editor/behavior-tree/BTDebugPanel.d.ts +0 -102
- package/dist/types/editor/behavior-tree/BTEditorCanvas.d.ts +0 -79
- package/dist/types/editor/behavior-tree/BTEditorNode.d.ts +0 -58
- package/dist/types/editor/behavior-tree/BTEditorToolbar.d.ts +0 -75
- package/dist/types/editor/behavior-tree/BTNodePalette.d.ts +0 -72
- package/dist/types/editor/behavior-tree/BTPropertyPanel.d.ts +0 -66
- package/dist/types/editor/behavior-tree/BehaviorTreeEditor.d.ts +0 -186
- package/dist/types/editor/behavior-tree/index.d.ts +0 -14
- package/dist/types/editor/behavior-tree/serialization.d.ts +0 -30
- package/dist/types/editor/behavior-tree/types.d.ts +0 -299
- package/dist/types/editor/index.d.ts +0 -20
- package/dist/types/editor/state-machine/SMEditorCanvas.d.ts +0 -61
- package/dist/types/editor/state-machine/StateMachineEditor.d.ts +0 -139
- package/dist/types/editor/state-machine/index.d.ts +0 -11
- package/dist/types/editor/state-machine/serialization.d.ts +0 -23
- package/dist/types/editor/state-machine/types.d.ts +0 -241
- package/dist/types/engine/index.d.ts +0 -2
- package/dist/types/enterprise/index.d.ts +0 -1
- package/dist/types/epic/index.d.ts +0 -10
- package/dist/types/i18n/index.d.ts +0 -2
- package/dist/types/input/index.d.ts +0 -3
- package/dist/types/kids/index.d.ts +0 -2
- package/dist/types/legendary/index.d.ts +0 -57
- package/dist/types/monetization/index.d.ts +0 -1
- package/dist/types/multiplayer/NiceNetcode.d.ts +0 -434
- package/dist/types/multiplayer/index.d.ts +0 -5
- package/dist/types/network/index.d.ts +0 -2
- package/dist/types/pathfinding/index.d.ts +0 -1
- package/dist/types/performance/AssetCompression.d.ts +0 -137
- package/dist/types/performance/WASMModules.d.ts +0 -65
- package/dist/types/performance/WebGPUCompute.d.ts +0 -71
- package/dist/types/performance/index.d.ts +0 -1
- package/dist/types/physics/RapierIntegration.d.ts +0 -404
- package/dist/types/physics/index.d.ts +0 -2
- package/dist/types/plugins/index.d.ts +0 -2
- package/dist/types/procedural/index.d.ts +0 -2
- package/dist/types/release/index.d.ts +0 -1
- package/dist/types/rendering/WebGPUv2.d.ts +0 -173
- package/dist/types/rendering/index.d.ts +0 -3
- package/dist/types/runtime3d/index.d.ts +0 -2
- package/dist/types/scene/index.d.ts +0 -2
- package/dist/types/scripting/WasmCompiler.d.ts +0 -182
- package/dist/types/scripting/index.d.ts +0 -19
- package/dist/types/social/index.d.ts +0 -1
- package/dist/types/systems/NiceAI.d.ts +0 -637
- package/dist/types/systems/NiceAbility.d.ts +0 -225
- package/dist/types/systems/NiceAccessibility.d.ts +0 -230
- package/dist/types/systems/NiceAchievement.d.ts +0 -153
- package/dist/types/systems/NiceAchievementUI.d.ts +0 -196
- package/dist/types/systems/NiceAchievements.d.ts +0 -230
- package/dist/types/systems/NiceAction.d.ts +0 -81
- package/dist/types/systems/NiceAlchemy.d.ts +0 -195
- package/dist/types/systems/NiceAnalytics.d.ts +0 -493
- package/dist/types/systems/NiceAnimation.d.ts +0 -350
- package/dist/types/systems/NiceArena.d.ts +0 -215
- package/dist/types/systems/NiceAssetLoader.d.ts +0 -136
- package/dist/types/systems/NiceAuction.d.ts +0 -157
- package/dist/types/systems/NiceAudio.d.ts +0 -224
- package/dist/types/systems/NiceAugment.d.ts +0 -187
- package/dist/types/systems/NiceAura.d.ts +0 -193
- package/dist/types/systems/NiceBank.d.ts +0 -158
- package/dist/types/systems/NiceBattlePass.d.ts +0 -150
- package/dist/types/systems/NiceBehavior.d.ts +0 -160
- package/dist/types/systems/NiceBinding.d.ts +0 -96
- package/dist/types/systems/NiceBlacksmith.d.ts +0 -221
- package/dist/types/systems/NiceBuff.d.ts +0 -177
- package/dist/types/systems/NiceBuilding.d.ts +0 -207
- package/dist/types/systems/NiceBullet.d.ts +0 -167
- package/dist/types/systems/NiceCamera.d.ts +0 -252
- package/dist/types/systems/NiceCard.d.ts +0 -171
- package/dist/types/systems/NiceChat.d.ts +0 -148
- package/dist/types/systems/NiceCheat.d.ts +0 -375
- package/dist/types/systems/NiceClimbing.d.ts +0 -186
- package/dist/types/systems/NiceCloud.d.ts +0 -422
- package/dist/types/systems/NiceCollision.d.ts +0 -238
- package/dist/types/systems/NiceCombo.d.ts +0 -131
- package/dist/types/systems/NiceCommand.d.ts +0 -112
- package/dist/types/systems/NiceCompanion.d.ts +0 -182
- package/dist/types/systems/NiceController.d.ts +0 -144
- package/dist/types/systems/NiceCooking.d.ts +0 -193
- package/dist/types/systems/NiceCoroutine.d.ts +0 -101
- package/dist/types/systems/NiceCrafting.d.ts +0 -228
- package/dist/types/systems/NiceCutscene.d.ts +0 -437
- package/dist/types/systems/NiceDaily.d.ts +0 -133
- package/dist/types/systems/NiceDamage.d.ts +0 -271
- package/dist/types/systems/NiceDayNight.d.ts +0 -126
- package/dist/types/systems/NiceDebug.d.ts +0 -255
- package/dist/types/systems/NiceDestructible.d.ts +0 -150
- package/dist/types/systems/NiceDialogue.d.ts +0 -629
- package/dist/types/systems/NiceDungeon.d.ts +0 -202
- package/dist/types/systems/NiceECS.d.ts +0 -151
- package/dist/types/systems/NiceEnchant.d.ts +0 -148
- package/dist/types/systems/NiceEntityPool.d.ts +0 -127
- package/dist/types/systems/NiceEquipment.d.ts +0 -137
- package/dist/types/systems/NiceEvent.d.ts +0 -202
- package/dist/types/systems/NiceEventBus.d.ts +0 -164
- package/dist/types/systems/NiceFaction.d.ts +0 -173
- package/dist/types/systems/NiceFarming.d.ts +0 -163
- package/dist/types/systems/NiceFishing.d.ts +0 -196
- package/dist/types/systems/NiceFlocking.d.ts +0 -156
- package/dist/types/systems/NiceFog.d.ts +0 -137
- package/dist/types/systems/NiceFormation.d.ts +0 -140
- package/dist/types/systems/NiceGacha.d.ts +0 -134
- package/dist/types/systems/NiceGambling.d.ts +0 -175
- package/dist/types/systems/NiceGem.d.ts +0 -165
- package/dist/types/systems/NiceGesture.d.ts +0 -502
- package/dist/types/systems/NiceGrappling.d.ts +0 -154
- package/dist/types/systems/NiceGrid.d.ts +0 -142
- package/dist/types/systems/NiceGuild.d.ts +0 -162
- package/dist/types/systems/NiceHaptics.d.ts +0 -112
- package/dist/types/systems/NiceHousing.d.ts +0 -197
- package/dist/types/systems/NiceInput.d.ts +0 -280
- package/dist/types/systems/NiceInventory.d.ts +0 -534
- package/dist/types/systems/NiceLOD.d.ts +0 -144
- package/dist/types/systems/NiceLeaderboard.d.ts +0 -191
- package/dist/types/systems/NiceLevel.d.ts +0 -304
- package/dist/types/systems/NiceLighting.d.ts +0 -214
- package/dist/types/systems/NiceLocalization.d.ts +0 -148
- package/dist/types/systems/NiceLocomotion.d.ts +0 -398
- package/dist/types/systems/NiceLogger.d.ts +0 -117
- package/dist/types/systems/NiceLoot.d.ts +0 -176
- package/dist/types/systems/NiceMail.d.ts +0 -164
- package/dist/types/systems/NiceMap.d.ts +0 -234
- package/dist/types/systems/NiceMarriage.d.ts +0 -150
- package/dist/types/systems/NiceMastery.d.ts +0 -171
- package/dist/types/systems/NiceMatch.d.ts +0 -196
- package/dist/types/systems/NiceMatch3.d.ts +0 -118
- package/dist/types/systems/NiceMessageBus.d.ts +0 -115
- package/dist/types/systems/NiceMinimap.d.ts +0 -258
- package/dist/types/systems/NiceMining.d.ts +0 -175
- package/dist/types/systems/NiceModding.d.ts +0 -452
- package/dist/types/systems/NiceMount.d.ts +0 -152
- package/dist/types/systems/NiceNavigation.d.ts +0 -307
- package/dist/types/systems/NiceNetwork.d.ts +0 -568
- package/dist/types/systems/NiceNotification.d.ts +0 -438
- package/dist/types/systems/NiceObjective.d.ts +0 -395
- package/dist/types/systems/NiceParticle.d.ts +0 -639
- package/dist/types/systems/NiceParty.d.ts +0 -168
- package/dist/types/systems/NicePerformance.d.ts +0 -144
- package/dist/types/systems/NicePet.d.ts +0 -167
- package/dist/types/systems/NicePhotoMode.d.ts +0 -270
- package/dist/types/systems/NicePhysics.d.ts +0 -326
- package/dist/types/systems/NicePlatformer.d.ts +0 -158
- package/dist/types/systems/NicePool.d.ts +0 -128
- package/dist/types/systems/NicePortal.d.ts +0 -178
- package/dist/types/systems/NicePostProcess.d.ts +0 -254
- package/dist/types/systems/NiceProcedural.d.ts +0 -202
- package/dist/types/systems/NiceProfile.d.ts +0 -223
- package/dist/types/systems/NiceProjectile.d.ts +0 -157
- package/dist/types/systems/NicePvP.d.ts +0 -199
- package/dist/types/systems/NiceQTE.d.ts +0 -160
- package/dist/types/systems/NiceQuest.d.ts +0 -620
- package/dist/types/systems/NiceRaid.d.ts +0 -215
- package/dist/types/systems/NiceRanking.d.ts +0 -399
- package/dist/types/systems/NiceReplay.d.ts +0 -180
- package/dist/types/systems/NiceReputation.d.ts +0 -151
- package/dist/types/systems/NiceResource.d.ts +0 -200
- package/dist/types/systems/NiceRhythm.d.ts +0 -148
- package/dist/types/systems/NiceRoguelike.d.ts +0 -276
- package/dist/types/systems/NiceRune.d.ts +0 -202
- package/dist/types/systems/NiceSaveSystem.d.ts +0 -194
- package/dist/types/systems/NiceSceneManager.d.ts +0 -112
- package/dist/types/systems/NiceScore.d.ts +0 -186
- package/dist/types/systems/NiceScreenFX.d.ts +0 -235
- package/dist/types/systems/NiceScreenshot.d.ts +0 -443
- package/dist/types/systems/NiceScribe.d.ts +0 -239
- package/dist/types/systems/NiceSeason.d.ts +0 -176
- package/dist/types/systems/NiceSerialization.d.ts +0 -89
- package/dist/types/systems/NiceServiceLocator.d.ts +0 -94
- package/dist/types/systems/NiceShop.d.ts +0 -528
- package/dist/types/systems/NiceSignal.d.ts +0 -112
- package/dist/types/systems/NiceSkillTree.d.ts +0 -237
- package/dist/types/systems/NiceSocial.d.ts +0 -580
- package/dist/types/systems/NiceSpawner.d.ts +0 -237
- package/dist/types/systems/NiceSpell.d.ts +0 -216
- package/dist/types/systems/NiceState.d.ts +0 -224
- package/dist/types/systems/NiceStateMachine.d.ts +0 -108
- package/dist/types/systems/NiceStatus.d.ts +0 -116
- package/dist/types/systems/NiceStealth.d.ts +0 -204
- package/dist/types/systems/NiceSteam.d.ts +0 -255
- package/dist/types/systems/NiceStreaming.d.ts +0 -173
- package/dist/types/systems/NiceSwimming.d.ts +0 -166
- package/dist/types/systems/NiceTalent.d.ts +0 -154
- package/dist/types/systems/NiceTarget.d.ts +0 -121
- package/dist/types/systems/NiceTerrain.d.ts +0 -143
- package/dist/types/systems/NiceTilemap.d.ts +0 -218
- package/dist/types/systems/NiceTimer.d.ts +0 -153
- package/dist/types/systems/NiceTournament.d.ts +0 -190
- package/dist/types/systems/NiceTrading.d.ts +0 -238
- package/dist/types/systems/NiceTransmog.d.ts +0 -142
- package/dist/types/systems/NiceTutorial.d.ts +0 -248
- package/dist/types/systems/NiceTween.d.ts +0 -164
- package/dist/types/systems/NiceUI.d.ts +0 -364
- package/dist/types/systems/NiceVFX.d.ts +0 -333
- package/dist/types/systems/NiceVehicle.d.ts +0 -176
- package/dist/types/systems/NiceVoice.d.ts +0 -502
- package/dist/types/systems/NiceWater.d.ts +0 -162
- package/dist/types/systems/NiceWave.d.ts +0 -174
- package/dist/types/systems/NiceWaypoint.d.ts +0 -165
- package/dist/types/systems/NiceWeather.d.ts +0 -225
- package/dist/types/systems/NiceXR.d.ts +0 -187
- package/dist/types/systems/index.d.ts +0 -182
- package/dist/types/templates/index.d.ts +0 -2
- package/dist/types/tilemap/index.d.ts +0 -1
- package/dist/types/tutorials/TutorialEditor.d.ts +0 -43
- package/dist/types/tutorials/VoiceNarration.d.ts +0 -75
- package/dist/types/tutorials/content/Tutorials_T04.d.ts +0 -3
- package/dist/types/tutorials/content/UITutorials.d.ts +0 -14
- package/dist/types/tutorials/content/index.d.ts +0 -5
- package/dist/types/tutorials/index.d.ts +0 -6
- package/dist/types/ui/index.d.ts +0 -2
- package/dist/types/visual-scripting/VisualScriptDebugger.d.ts +0 -145
- package/dist/types/visual-scripting/VisualScriptExecutor.d.ts +0 -100
- package/dist/types/visual-scripting/VisualScriptGraph.d.ts +0 -173
- package/dist/types/visual-scripting/VisualScriptNode.d.ts +0 -157
- package/dist/types/visual-scripting/index.d.ts +0 -6
- package/dist/types/visual-scripting/nodes/ActionNodes.d.ts +0 -152
- package/dist/types/visual-scripting/nodes/EventNodes.d.ts +0 -95
- package/dist/types/visual-scripting/nodes/FlowControlNodes.d.ts +0 -134
- package/dist/types/visual-scripting/nodes/LogicNodes.d.ts +0 -122
- package/dist/types/visual-scripting/nodes/MathNodes.d.ts +0 -170
- package/dist/types/visual-scripting/nodes/UtilityNodes.d.ts +0 -131
- package/dist/types/visual-scripting/nodes/VariableNodes.d.ts +0 -107
- package/dist/types/visual-scripting/nodes/index.d.ts +0 -21
- package/dist/types/visual-scripting/nodes/registerNodes.d.ts +0 -29
- package/dist/types/visual-scripting/types.d.ts +0 -402
- package/dist/types/xr/WebXRLayers.d.ts +0 -319
- package/dist/types/xr/index.d.ts +0 -2
|
@@ -1,395 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* NiceObjective - Mission Objective System
|
|
3
|
-
*
|
|
4
|
-
* Comprehensive system for managing game objectives, missions,
|
|
5
|
-
* and goals with tracking and completion handling.
|
|
6
|
-
*
|
|
7
|
-
* Features:
|
|
8
|
-
* - Multiple objective types
|
|
9
|
-
* - Objective chains
|
|
10
|
-
* - Progress tracking
|
|
11
|
-
* - Time limits
|
|
12
|
-
* - Optional objectives
|
|
13
|
-
* - Failure conditions
|
|
14
|
-
* - Objective markers
|
|
15
|
-
* - Checkpoints
|
|
16
|
-
* - Branching objectives
|
|
17
|
-
* - Rewards system
|
|
18
|
-
* - Objective categories
|
|
19
|
-
* - Statistics tracking
|
|
20
|
-
*
|
|
21
|
-
* @packageDocumentation
|
|
22
|
-
*/
|
|
23
|
-
import { EventEmitter } from 'events';
|
|
24
|
-
/** Unique objective ID */
|
|
25
|
-
export type ObjectiveId = string;
|
|
26
|
-
/** Unique mission ID */
|
|
27
|
-
export type MissionId = string;
|
|
28
|
-
/** Objective type */
|
|
29
|
-
export type ObjectiveType = 'reach' | 'collect' | 'kill' | 'protect' | 'escort' | 'survive' | 'interact' | 'use' | 'talk' | 'investigate' | 'destroy' | 'capture' | 'defend' | 'stealth' | 'race' | 'custom';
|
|
30
|
-
/** Objective state */
|
|
31
|
-
export type ObjectiveState = 'locked' | 'available' | 'active' | 'completed' | 'failed' | 'expired';
|
|
32
|
-
/** Mission state */
|
|
33
|
-
export type MissionState = 'locked' | 'available' | 'active' | 'completed' | 'failed';
|
|
34
|
-
/** Objective priority */
|
|
35
|
-
export type ObjectivePriority = 'primary' | 'secondary' | 'bonus' | 'hidden';
|
|
36
|
-
/** 3D Position */
|
|
37
|
-
export interface Position3D {
|
|
38
|
-
x: number;
|
|
39
|
-
y: number;
|
|
40
|
-
z: number;
|
|
41
|
-
}
|
|
42
|
-
/** Objective marker */
|
|
43
|
-
export interface ObjectiveMarker {
|
|
44
|
-
id: string;
|
|
45
|
-
position: Position3D;
|
|
46
|
-
icon?: string;
|
|
47
|
-
color?: string;
|
|
48
|
-
label?: string;
|
|
49
|
-
visible: boolean;
|
|
50
|
-
trackable: boolean;
|
|
51
|
-
distanceVisible: boolean;
|
|
52
|
-
pulseEffect?: boolean;
|
|
53
|
-
}
|
|
54
|
-
/** Progress requirement */
|
|
55
|
-
export interface ProgressRequirement {
|
|
56
|
-
current: number;
|
|
57
|
-
target: number;
|
|
58
|
-
unit?: string;
|
|
59
|
-
}
|
|
60
|
-
/** Time constraint */
|
|
61
|
-
export interface TimeConstraint {
|
|
62
|
-
enabled: boolean;
|
|
63
|
-
duration: number;
|
|
64
|
-
remaining: number;
|
|
65
|
-
started?: number;
|
|
66
|
-
paused?: boolean;
|
|
67
|
-
showTimer?: boolean;
|
|
68
|
-
warningThreshold?: number;
|
|
69
|
-
}
|
|
70
|
-
/** Objective reward */
|
|
71
|
-
export interface ObjectiveReward {
|
|
72
|
-
experience?: number;
|
|
73
|
-
currency?: Record<string, number>;
|
|
74
|
-
items?: Array<{
|
|
75
|
-
itemId: string;
|
|
76
|
-
quantity: number;
|
|
77
|
-
}>;
|
|
78
|
-
reputation?: Record<string, number>;
|
|
79
|
-
unlocks?: string[];
|
|
80
|
-
custom?: Record<string, unknown>;
|
|
81
|
-
}
|
|
82
|
-
/** Failure condition */
|
|
83
|
-
export interface FailureCondition {
|
|
84
|
-
id: string;
|
|
85
|
-
type: 'death' | 'timeout' | 'detected' | 'target_lost' | 'damage' | 'custom';
|
|
86
|
-
threshold?: number;
|
|
87
|
-
current?: number;
|
|
88
|
-
message?: string;
|
|
89
|
-
}
|
|
90
|
-
/** Objective definition */
|
|
91
|
-
export interface ObjectiveDefinition {
|
|
92
|
-
id: ObjectiveId;
|
|
93
|
-
missionId: MissionId;
|
|
94
|
-
name: string;
|
|
95
|
-
description: string;
|
|
96
|
-
type: ObjectiveType;
|
|
97
|
-
priority: ObjectivePriority;
|
|
98
|
-
state: ObjectiveState;
|
|
99
|
-
progress: ProgressRequirement;
|
|
100
|
-
timeConstraint?: TimeConstraint;
|
|
101
|
-
markers?: ObjectiveMarker[];
|
|
102
|
-
rewards?: ObjectiveReward;
|
|
103
|
-
failureConditions?: FailureCondition[];
|
|
104
|
-
prerequisiteIds?: ObjectiveId[];
|
|
105
|
-
unlockObjectiveIds?: ObjectiveId[];
|
|
106
|
-
optional: boolean;
|
|
107
|
-
hidden: boolean;
|
|
108
|
-
trackable: boolean;
|
|
109
|
-
autoComplete: boolean;
|
|
110
|
-
hints?: string[];
|
|
111
|
-
currentHint?: number;
|
|
112
|
-
customData?: Record<string, unknown>;
|
|
113
|
-
completedAt?: number;
|
|
114
|
-
failedAt?: number;
|
|
115
|
-
}
|
|
116
|
-
/** Mission definition */
|
|
117
|
-
export interface MissionDefinition {
|
|
118
|
-
id: MissionId;
|
|
119
|
-
name: string;
|
|
120
|
-
description: string;
|
|
121
|
-
briefing?: string;
|
|
122
|
-
category: string;
|
|
123
|
-
state: MissionState;
|
|
124
|
-
objectives: ObjectiveId[];
|
|
125
|
-
primaryObjectives: ObjectiveId[];
|
|
126
|
-
secondaryObjectives: ObjectiveId[];
|
|
127
|
-
bonusObjectives: ObjectiveId[];
|
|
128
|
-
prerequisiteMissionIds?: MissionId[];
|
|
129
|
-
rewards?: ObjectiveReward;
|
|
130
|
-
failureConditions?: FailureCondition[];
|
|
131
|
-
timeConstraint?: TimeConstraint;
|
|
132
|
-
difficulty?: number;
|
|
133
|
-
recommendedLevel?: number;
|
|
134
|
-
location?: string;
|
|
135
|
-
giver?: string;
|
|
136
|
-
checkpoints?: Checkpoint[];
|
|
137
|
-
currentCheckpoint?: number;
|
|
138
|
-
startedAt?: number;
|
|
139
|
-
completedAt?: number;
|
|
140
|
-
failedAt?: number;
|
|
141
|
-
customData?: Record<string, unknown>;
|
|
142
|
-
}
|
|
143
|
-
/** Checkpoint */
|
|
144
|
-
export interface Checkpoint {
|
|
145
|
-
id: string;
|
|
146
|
-
name: string;
|
|
147
|
-
objectiveId: ObjectiveId;
|
|
148
|
-
position?: Position3D;
|
|
149
|
-
savedAt?: number;
|
|
150
|
-
}
|
|
151
|
-
/** Tracked objective display info */
|
|
152
|
-
export interface TrackedObjective {
|
|
153
|
-
objectiveId: ObjectiveId;
|
|
154
|
-
missionId: MissionId;
|
|
155
|
-
missionName: string;
|
|
156
|
-
name: string;
|
|
157
|
-
description: string;
|
|
158
|
-
progress: ProgressRequirement;
|
|
159
|
-
priority: ObjectivePriority;
|
|
160
|
-
markers: ObjectiveMarker[];
|
|
161
|
-
timeRemaining?: number;
|
|
162
|
-
hints?: string[];
|
|
163
|
-
}
|
|
164
|
-
/** Objective update */
|
|
165
|
-
export interface ObjectiveUpdate {
|
|
166
|
-
objectiveId: ObjectiveId;
|
|
167
|
-
type: 'progress' | 'state' | 'marker' | 'time';
|
|
168
|
-
oldValue?: unknown;
|
|
169
|
-
newValue: unknown;
|
|
170
|
-
}
|
|
171
|
-
/** Mission statistics */
|
|
172
|
-
export interface MissionStatistics {
|
|
173
|
-
missionsCompleted: number;
|
|
174
|
-
missionsFailed: number;
|
|
175
|
-
objectivesCompleted: number;
|
|
176
|
-
objectivesFailed: number;
|
|
177
|
-
optionalCompleted: number;
|
|
178
|
-
totalPlayTime: number;
|
|
179
|
-
fastestCompletion?: Record<MissionId, number>;
|
|
180
|
-
attemptsPerMission: Record<MissionId, number>;
|
|
181
|
-
}
|
|
182
|
-
/** Objective event types */
|
|
183
|
-
export type ObjectiveEventType = 'mission_started' | 'mission_completed' | 'mission_failed' | 'mission_updated' | 'objective_started' | 'objective_progress' | 'objective_completed' | 'objective_failed' | 'objective_expired' | 'checkpoint_reached' | 'checkpoint_loaded' | 'time_warning' | 'hint_revealed' | 'marker_updated';
|
|
184
|
-
/** Objective event data */
|
|
185
|
-
export interface ObjectiveEvent {
|
|
186
|
-
type: ObjectiveEventType;
|
|
187
|
-
timestamp: number;
|
|
188
|
-
missionId?: MissionId;
|
|
189
|
-
objectiveId?: ObjectiveId;
|
|
190
|
-
data?: unknown;
|
|
191
|
-
}
|
|
192
|
-
/** Objective event callback */
|
|
193
|
-
export type ObjectiveEventCallback = (event: ObjectiveEvent) => void;
|
|
194
|
-
/** Objective system configuration */
|
|
195
|
-
export interface ObjectiveConfig {
|
|
196
|
-
maxTrackedObjectives: number;
|
|
197
|
-
autoTrackPrimary: boolean;
|
|
198
|
-
showCompletionPopup: boolean;
|
|
199
|
-
showFailurePopup: boolean;
|
|
200
|
-
timeWarningThreshold: number;
|
|
201
|
-
enableCheckpoints: boolean;
|
|
202
|
-
maxCheckpoints: number;
|
|
203
|
-
hintDelay: number;
|
|
204
|
-
markerUpdateInterval: number;
|
|
205
|
-
}
|
|
206
|
-
/** Default configuration */
|
|
207
|
-
export declare const DEFAULT_OBJECTIVE_CONFIG: ObjectiveConfig;
|
|
208
|
-
/**
|
|
209
|
-
* Mission objective management system
|
|
210
|
-
*/
|
|
211
|
-
export declare class NiceObjective extends EventEmitter {
|
|
212
|
-
private config;
|
|
213
|
-
private missions;
|
|
214
|
-
private objectives;
|
|
215
|
-
private activeMission?;
|
|
216
|
-
private trackedObjectives;
|
|
217
|
-
private statistics;
|
|
218
|
-
private timerInterval?;
|
|
219
|
-
private hintTimers;
|
|
220
|
-
private sessionStartTime;
|
|
221
|
-
constructor(config?: Partial<ObjectiveConfig>);
|
|
222
|
-
/**
|
|
223
|
-
* Emit objective event
|
|
224
|
-
*/
|
|
225
|
-
private emitEvent;
|
|
226
|
-
/**
|
|
227
|
-
* Start timer loop
|
|
228
|
-
*/
|
|
229
|
-
private startTimerLoop;
|
|
230
|
-
/**
|
|
231
|
-
* Update timers
|
|
232
|
-
*/
|
|
233
|
-
private updateTimers;
|
|
234
|
-
/**
|
|
235
|
-
* Update time constraint
|
|
236
|
-
*/
|
|
237
|
-
private updateTimeConstraint;
|
|
238
|
-
/**
|
|
239
|
-
* Create mission
|
|
240
|
-
*/
|
|
241
|
-
createMission(definition: Omit<MissionDefinition, 'objectives' | 'primaryObjectives' | 'secondaryObjectives' | 'bonusObjectives'>): MissionDefinition;
|
|
242
|
-
/**
|
|
243
|
-
* Get mission
|
|
244
|
-
*/
|
|
245
|
-
getMission(missionId: MissionId): MissionDefinition | undefined;
|
|
246
|
-
/**
|
|
247
|
-
* Get all missions
|
|
248
|
-
*/
|
|
249
|
-
getAllMissions(state?: MissionState): MissionDefinition[];
|
|
250
|
-
/**
|
|
251
|
-
* Start mission
|
|
252
|
-
*/
|
|
253
|
-
startMission(missionId: MissionId): boolean;
|
|
254
|
-
/**
|
|
255
|
-
* Complete mission
|
|
256
|
-
*/
|
|
257
|
-
completeMission(missionId: MissionId): boolean;
|
|
258
|
-
/**
|
|
259
|
-
* Fail mission
|
|
260
|
-
*/
|
|
261
|
-
failMission(missionId: MissionId, reason?: string): boolean;
|
|
262
|
-
/**
|
|
263
|
-
* Get active mission
|
|
264
|
-
*/
|
|
265
|
-
getActiveMission(): MissionDefinition | undefined;
|
|
266
|
-
/**
|
|
267
|
-
* Create objective
|
|
268
|
-
*/
|
|
269
|
-
createObjective(definition: ObjectiveDefinition): ObjectiveDefinition;
|
|
270
|
-
/**
|
|
271
|
-
* Get objective
|
|
272
|
-
*/
|
|
273
|
-
getObjective(objectiveId: ObjectiveId): ObjectiveDefinition | undefined;
|
|
274
|
-
/**
|
|
275
|
-
* Start objective
|
|
276
|
-
*/
|
|
277
|
-
startObjective(objectiveId: ObjectiveId): boolean;
|
|
278
|
-
/**
|
|
279
|
-
* Update objective progress
|
|
280
|
-
*/
|
|
281
|
-
updateProgress(objectiveId: ObjectiveId, amount?: number): ObjectiveUpdate | undefined;
|
|
282
|
-
/**
|
|
283
|
-
* Set objective progress directly
|
|
284
|
-
*/
|
|
285
|
-
setProgress(objectiveId: ObjectiveId, value: number): boolean;
|
|
286
|
-
/**
|
|
287
|
-
* Complete objective
|
|
288
|
-
*/
|
|
289
|
-
completeObjective(objectiveId: ObjectiveId): boolean;
|
|
290
|
-
/**
|
|
291
|
-
* Fail objective
|
|
292
|
-
*/
|
|
293
|
-
failObjective(objectiveId: ObjectiveId, reason?: string): boolean;
|
|
294
|
-
/**
|
|
295
|
-
* Expire objective
|
|
296
|
-
*/
|
|
297
|
-
expireObjective(objectiveId: ObjectiveId): boolean;
|
|
298
|
-
/**
|
|
299
|
-
* Check failure condition
|
|
300
|
-
*/
|
|
301
|
-
checkFailureCondition(objectiveId: ObjectiveId, conditionId: string, value: number): boolean;
|
|
302
|
-
/**
|
|
303
|
-
* Track objective
|
|
304
|
-
*/
|
|
305
|
-
trackObjective(objectiveId: ObjectiveId): boolean;
|
|
306
|
-
/**
|
|
307
|
-
* Untrack objective
|
|
308
|
-
*/
|
|
309
|
-
untrackObjective(objectiveId: ObjectiveId): boolean;
|
|
310
|
-
/**
|
|
311
|
-
* Get tracked objectives
|
|
312
|
-
*/
|
|
313
|
-
getTrackedObjectives(): TrackedObjective[];
|
|
314
|
-
/**
|
|
315
|
-
* Is objective tracked
|
|
316
|
-
*/
|
|
317
|
-
isTracked(objectiveId: ObjectiveId): boolean;
|
|
318
|
-
/**
|
|
319
|
-
* Add marker to objective
|
|
320
|
-
*/
|
|
321
|
-
addMarker(objectiveId: ObjectiveId, marker: ObjectiveMarker): boolean;
|
|
322
|
-
/**
|
|
323
|
-
* Remove marker
|
|
324
|
-
*/
|
|
325
|
-
removeMarker(objectiveId: ObjectiveId, markerId: string): boolean;
|
|
326
|
-
/**
|
|
327
|
-
* Update marker position
|
|
328
|
-
*/
|
|
329
|
-
updateMarkerPosition(objectiveId: ObjectiveId, markerId: string, position: Position3D): boolean;
|
|
330
|
-
/**
|
|
331
|
-
* Get all active markers
|
|
332
|
-
*/
|
|
333
|
-
getAllMarkers(): Array<ObjectiveMarker & {
|
|
334
|
-
objectiveId: ObjectiveId;
|
|
335
|
-
}>;
|
|
336
|
-
/**
|
|
337
|
-
* Save checkpoint
|
|
338
|
-
*/
|
|
339
|
-
saveCheckpoint(missionId: MissionId, checkpointId: string): boolean;
|
|
340
|
-
/**
|
|
341
|
-
* Load checkpoint
|
|
342
|
-
*/
|
|
343
|
-
loadCheckpoint(missionId: MissionId, checkpointId?: string): boolean;
|
|
344
|
-
/**
|
|
345
|
-
* Setup hint timer
|
|
346
|
-
*/
|
|
347
|
-
private setupHintTimer;
|
|
348
|
-
/**
|
|
349
|
-
* Schedule next hint
|
|
350
|
-
*/
|
|
351
|
-
private scheduleNextHint;
|
|
352
|
-
/**
|
|
353
|
-
* Reveal hint
|
|
354
|
-
*/
|
|
355
|
-
revealHint(objectiveId: ObjectiveId): boolean;
|
|
356
|
-
/**
|
|
357
|
-
* Get current hints for objective
|
|
358
|
-
*/
|
|
359
|
-
getHints(objectiveId: ObjectiveId): string[];
|
|
360
|
-
/**
|
|
361
|
-
* Get statistics
|
|
362
|
-
*/
|
|
363
|
-
getStatistics(): MissionStatistics;
|
|
364
|
-
/**
|
|
365
|
-
* Get mission completion percentage
|
|
366
|
-
*/
|
|
367
|
-
getMissionCompletionPercentage(missionId: MissionId): number;
|
|
368
|
-
/**
|
|
369
|
-
* Export state
|
|
370
|
-
*/
|
|
371
|
-
exportState(): object;
|
|
372
|
-
/**
|
|
373
|
-
* Import state
|
|
374
|
-
*/
|
|
375
|
-
importState(data: {
|
|
376
|
-
missions: Array<[MissionId, MissionDefinition]>;
|
|
377
|
-
objectives: Array<[ObjectiveId, ObjectiveDefinition]>;
|
|
378
|
-
activeMission?: MissionId;
|
|
379
|
-
trackedObjectives: ObjectiveId[];
|
|
380
|
-
statistics: MissionStatistics;
|
|
381
|
-
}): void;
|
|
382
|
-
/**
|
|
383
|
-
* Reset all missions
|
|
384
|
-
*/
|
|
385
|
-
resetAll(): void;
|
|
386
|
-
/**
|
|
387
|
-
* Destroy objective system
|
|
388
|
-
*/
|
|
389
|
-
destroy(): void;
|
|
390
|
-
}
|
|
391
|
-
/**
|
|
392
|
-
* Create objective system instance
|
|
393
|
-
*/
|
|
394
|
-
export declare function createObjectiveSystem(config?: Partial<ObjectiveConfig>): NiceObjective;
|
|
395
|
-
export default NiceObjective;
|