@nice2dev/game-engine 1.3.14 → 1.3.16
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 +13 -0
- package/dist/cjs/accessibility/Accessibility.js +152 -165
- package/dist/cjs/ai/AI.js +292 -294
- package/dist/cjs/ai/BehaviorTree.js +1029 -1113
- package/dist/cjs/ai/StateMachine.js +694 -756
- package/dist/cjs/animation/Animation.js +232 -241
- package/dist/cjs/audio/AudioAdvanced.js +221 -236
- package/dist/cjs/audio/AudioBridge.js +441 -435
- package/dist/cjs/audio/AudioManager.js +242 -259
- package/dist/cjs/build-cloud/BuildOrchestration.js +1059 -1098
- package/dist/cjs/build-cloud/GodotBuildCloud.js +641 -670
- package/dist/cjs/build-cloud/UnityBuildCloud.js +563 -610
- package/dist/cjs/build-cloud/UnrealBuildCloud.js +610 -635
- package/dist/cjs/core/EventBus.js +51 -56
- package/dist/cjs/core/GameClock.js +62 -66
- package/dist/cjs/core/GameConfig.js +72 -79
- package/dist/cjs/core/GameLoop.js +80 -89
- package/dist/cjs/core/ServiceLocator.js +61 -65
- package/dist/cjs/core/Validation.js +72 -82
- package/dist/cjs/core/math.js +108 -112
- package/dist/cjs/devtools/DevTools.js +542 -563
- package/dist/cjs/devtools/DeveloperExperience.js +521 -559
- package/dist/cjs/devtools/GameplayAnalytics.js +636 -646
- package/dist/cjs/dialogue/DialogueSystem.js +984 -986
- package/dist/cjs/docs/DocGenerator.js +339 -364
- package/dist/cjs/ecs/World.js +355 -371
- package/dist/cjs/editor/AchievementEditor.js +580 -636
- package/dist/cjs/editor/AdvancedEditor.js +184 -191
- package/dist/cjs/editor/AnimationRetargeting.js +696 -741
- package/dist/cjs/editor/AssetBrowser.js +1072 -1160
- package/dist/cjs/editor/AssetManager.js +187 -192
- package/dist/cjs/editor/ConsolePro.js +971 -1061
- package/dist/cjs/editor/CraftingEditor.js +680 -730
- package/dist/cjs/editor/DebugTools.js +187 -185
- package/dist/cjs/editor/DialogueSystem.js +844 -901
- package/dist/cjs/editor/LeaderboardSystem.js +429 -483
- package/dist/cjs/editor/NiceGameEditor.js +1903 -1201
- package/dist/cjs/editor/PrefabSystem.js +772 -838
- package/dist/cjs/editor/ProfilerPanel.js +649 -700
- package/dist/cjs/editor/QuestEditor.js +792 -839
- package/dist/cjs/editor/ReplaySystem.js +585 -634
- package/dist/cjs/editor/SceneEditor.js +176 -200
- package/dist/cjs/editor/ScreenshotMode.js +621 -688
- package/dist/cjs/editor/ShaderGraph.js +1556 -1582
- package/dist/cjs/editor/TimelineEditor.js +715 -778
- package/dist/cjs/editor/UndoRedoPro.js +830 -904
- package/dist/cjs/editor/VRARMode.js +582 -645
- package/dist/cjs/engine/NiceGameEngine.js +141 -164
- package/dist/cjs/engine/SaveSystem.js +441 -495
- package/dist/cjs/enterprise/Enterprise.js +254 -261
- package/dist/cjs/export/BevyExporter.js +927 -967
- package/dist/cjs/export/CocosExporter.js +644 -673
- package/dist/cjs/export/Construct3Exporter.js +783 -794
- package/dist/cjs/export/DefoldExporter.js +1028 -1069
- package/dist/cjs/export/GDevelopExporter.js +674 -708
- package/dist/cjs/export/GameMakerExporter.js +791 -805
- package/dist/cjs/export/GodotExporter.js +1003 -1045
- package/dist/cjs/export/MinecraftBedrockExporter.js +573 -578
- package/dist/cjs/export/MonoGameExporter.js +1265 -1293
- package/dist/cjs/export/Pico8Exporter.js +766 -812
- package/dist/cjs/export/PlatformExporter.js +188 -206
- package/dist/cjs/export/RPGMakerExporter.js +860 -879
- package/dist/cjs/export/RobloxExporter.js +883 -919
- package/dist/cjs/export/Solar2DExporter.js +1218 -1256
- package/dist/cjs/export/ThreeJSExporter.js +1006 -1073
- package/dist/cjs/export/Tic80Exporter.js +1210 -1267
- package/dist/cjs/export/UnityExporter.js +1116 -1131
- package/dist/cjs/export/UnrealExporter.js +889 -919
- package/dist/cjs/export/WebExporter.js +931 -970
- package/dist/cjs/export/index.js +42 -65
- package/dist/cjs/godot-integration/GodotAssetLibrary.js +659 -692
- package/dist/cjs/godot-integration/GodotImport.js +929 -1027
- package/dist/cjs/godot-integration/GodotLiveLink.js +915 -945
- package/dist/cjs/godot-integration/components/GodotProjectBrowser.js +911 -611
- package/dist/cjs/i18n/I18n.js +860 -900
- package/dist/cjs/i18n/useTranslation.js +84 -89
- package/dist/cjs/import/AsepriteImporter.js +658 -716
- package/dist/cjs/import/DragonBonesImporter.js +437 -461
- package/dist/cjs/import/GameMakerImporter.js +511 -521
- package/dist/cjs/import/GodotSceneImporter.js +788 -822
- package/dist/cjs/import/LDtkImporter.js +436 -454
- package/dist/cjs/import/Live2DImporter.js +497 -518
- package/dist/cjs/import/NdgFormat.js +424 -457
- package/dist/cjs/import/OgmoImporter.js +466 -493
- package/dist/cjs/import/RPGMakerImporter.js +451 -477
- package/dist/cjs/import/SceneImporter.js +378 -423
- package/dist/cjs/import/SpineImporter.js +511 -546
- package/dist/cjs/import/SpriterImporter.js +590 -613
- package/dist/cjs/import/TiledMapImporter.js +811 -846
- package/dist/cjs/import/UnitySceneImporter.js +687 -703
- package/dist/cjs/import/index.js +206 -251
- package/dist/cjs/index.js +275 -278
- package/dist/cjs/input/GamepadNavigation.js +185 -205
- package/dist/cjs/input/InputManager.js +397 -421
- package/dist/cjs/input/useGamepads.js +70 -81
- package/dist/cjs/integration/IconSprite.js +129 -256
- package/dist/cjs/inventory/InventorySystem.js +920 -995
- package/dist/cjs/kids/KidMode.js +997 -1022
- package/dist/cjs/kids/KidTools.js +570 -594
- package/dist/cjs/monetization/Monetization.js +170 -177
- package/dist/cjs/multiplayer/LocalMultiplayer.js +287 -287
- package/dist/cjs/multiplayer/MiniGameTypes.js +49 -59
- package/dist/cjs/native-engine/AnimationSystem.js +731 -806
- package/dist/cjs/native-engine/AssetPipeline.js +454 -515
- package/dist/cjs/native-engine/AudioEngine.js +763 -804
- package/dist/cjs/native-engine/InputSystem.js +1075 -1145
- package/dist/cjs/native-engine/NetworkingSystem.js +733 -793
- package/dist/cjs/native-engine/PhysicsEngine.js +583 -607
- package/dist/cjs/native-engine/RenderingEngine.js +302 -350
- package/dist/cjs/native-engine/SceneGraph.js +769 -808
- package/dist/cjs/network/MultiplayerTransport.js +97 -132
- package/dist/cjs/network/Networking.js +549 -564
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AbortController.js +21 -29
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +40 -48
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +35 -43
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +10 -15
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Errors.js +103 -135
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +131 -158
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +39 -53
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +5 -8
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +40 -48
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +494 -572
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +826 -953
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +125 -146
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +13 -23
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ILogger.js +11 -25
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ITransport.js +13 -24
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +108 -121
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Loggers.js +10 -14
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +150 -185
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +158 -196
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +90 -105
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Subject.js +30 -35
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +16 -21
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/Utils.js +215 -248
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +135 -157
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +76 -85
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/index.js +24 -27
- package/dist/cjs/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +3 -4
- package/dist/cjs/pathfinding/Pathfinding.js +245 -263
- package/dist/cjs/performance/AssetStreaming.js +561 -635
- package/dist/cjs/performance/BenchmarkSuite.js +283 -311
- package/dist/cjs/performance/DeltaCompression.js +467 -526
- package/dist/cjs/performance/DeterministicPhysics.js +450 -498
- package/dist/cjs/performance/ECSOptimization.js +644 -695
- package/dist/cjs/performance/GameSaveSystem.js +509 -556
- package/dist/cjs/performance/HotReload.js +447 -500
- package/dist/cjs/performance/InputRecording.js +511 -561
- package/dist/cjs/performance/InterestManagement.js +453 -500
- package/dist/cjs/performance/LocalizationRuntime.js +376 -423
- package/dist/cjs/performance/MemoryManagement.js +410 -470
- package/dist/cjs/performance/ModSupport.js +445 -496
- package/dist/cjs/performance/MultiThreadedPhysics.js +400 -443
- package/dist/cjs/performance/NetworkPrediction.js +424 -482
- package/dist/cjs/performance/ObjectPooling.js +569 -617
- package/dist/cjs/performance/Performance.js +174 -190
- package/dist/cjs/performance/PerformanceAdvanced.js +614 -637
- package/dist/cjs/performance/WebGPURenderer.js +656 -683
- package/dist/cjs/physics/PhysicsAdvanced.js +345 -379
- package/dist/cjs/physics/PhysicsEngine2D.js +391 -427
- package/dist/cjs/plugins/PluginSDK.js +432 -466
- package/dist/cjs/plugins/PluginTestKit.js +307 -330
- package/dist/cjs/procedural/Procedural.js +243 -254
- package/dist/cjs/procedural/WorldBuilding.js +297 -314
- package/dist/cjs/quest/QuestSystem.js +975 -932
- package/dist/cjs/release/MobileExport.js +157 -163
- package/dist/cjs/release/Release.js +225 -238
- package/dist/cjs/rendering/Camera2D.js +121 -124
- package/dist/cjs/rendering/Renderer2D.js +321 -335
- package/dist/cjs/rendering/WebGPURenderPipeline.js +632 -651
- package/dist/cjs/runtime3d/Runtime3D.js +359 -378
- package/dist/cjs/runtime3d/SceneEditor3D.js +252 -263
- package/dist/cjs/scene/SceneManager.js +177 -193
- package/dist/cjs/scripting/GraphToAST.js +574 -547
- package/dist/cjs/scripting/LanguageExporter.js +254 -279
- package/dist/cjs/scripting/NodeGraph.js +546 -570
- package/dist/cjs/scripting/ScriptAST.js +31 -39
- package/dist/cjs/scripting/VisualScripting2.js +1016 -1065
- package/dist/cjs/scripting/exporters/CSharpExporter.js +464 -496
- package/dist/cjs/scripting/exporters/GDScriptExporter.js +390 -442
- package/dist/cjs/scripting/exporters/LuaExporter.js +406 -447
- package/dist/cjs/scripting/exporters/PythonExporter.js +484 -549
- package/dist/cjs/scripting/exporters/RustExporter.js +459 -512
- package/dist/cjs/scripting/exporters/TypeScriptExporter.js +505 -556
- package/dist/cjs/social/Social.js +72 -80
- package/dist/cjs/systems/LightingSystem.js +844 -931
- package/dist/cjs/systems/ParticleSystem2.js +1447 -1451
- package/dist/cjs/systems/PhysicsDebugSystem.js +1070 -1141
- package/dist/cjs/systems/TerrainSystem.js +985 -1098
- package/dist/cjs/templates/ActionTemplates.js +296 -309
- package/dist/cjs/templates/FightingTemplate.js +417 -463
- package/dist/cjs/templates/MetroidvaniaTemplate.js +353 -405
- package/dist/cjs/templates/PartyTemplates.js +190 -202
- package/dist/cjs/templates/PuzzleTemplates.js +245 -261
- package/dist/cjs/templates/RPGTemplates.js +160 -178
- package/dist/cjs/templates/SportsTemplates.js +237 -250
- package/dist/cjs/templates/StrategyTemplates.js +143 -153
- package/dist/cjs/templates/SurvivalTemplate.js +336 -380
- package/dist/cjs/templates/WaveDefense.js +499 -526
- package/dist/cjs/tilemap/Tilemap.js +207 -214
- package/dist/cjs/tutorials/TutorialBranching.js +396 -417
- package/dist/cjs/tutorials/TutorialEngine.js +888 -931
- package/dist/cjs/tutorials/TutorialOverlay.js +602 -640
- package/dist/cjs/tutorials/content/Tutorials_T05_T08.js +787 -809
- package/dist/cjs/tutorials/content/Tutorials_T09_T11.js +736 -756
- package/dist/cjs/tutorials/content/Tutorials_T12_T15.js +754 -778
- package/dist/cjs/ui/GameUI.js +295 -312
- package/dist/cjs/unity-integration/UnityAssetStore.js +700 -741
- package/dist/cjs/unity-integration/UnityImport.js +1066 -1176
- package/dist/cjs/unity-integration/UnityLiveLink.js +934 -981
- package/dist/cjs/unity-integration/components/UnityAssetStoreBrowser.js +1233 -757
- package/dist/cjs/unity-integration/components/UnityProjectBrowser.js +1240 -768
- package/dist/cjs/unreal-integration/UnrealImport.js +391 -412
- package/dist/cjs/unreal-integration/UnrealLiveLink.js +1102 -1137
- package/dist/cjs/unreal-integration/UnrealMarketplace.js +436 -473
- package/dist/cjs/unreal-integration/components/UnrealProjectBrowser.js +1150 -767
- package/dist/cjs/xr/ARVR.js +167 -175
- package/dist/esm/accessibility/Accessibility.js +160 -164
- package/dist/esm/ai/AI.js +310 -293
- package/dist/esm/ai/BehaviorTree.js +1057 -1112
- package/dist/esm/ai/StateMachine.js +709 -755
- package/dist/esm/animation/Animation.js +237 -240
- package/dist/esm/audio/AudioAdvanced.js +239 -235
- package/dist/esm/audio/AudioBridge.js +448 -434
- package/dist/esm/audio/AudioManager.js +243 -258
- package/dist/esm/build-cloud/BuildOrchestration.js +1071 -1097
- package/dist/esm/build-cloud/GodotBuildCloud.js +647 -669
- package/dist/esm/build-cloud/UnityBuildCloud.js +571 -609
- package/dist/esm/build-cloud/UnrealBuildCloud.js +615 -634
- package/dist/esm/core/EventBus.js +52 -55
- package/dist/esm/core/GameClock.js +63 -65
- package/dist/esm/core/GameConfig.js +77 -78
- package/dist/esm/core/GameLoop.js +81 -88
- package/dist/esm/core/ServiceLocator.js +63 -64
- package/dist/esm/core/Validation.js +82 -81
- package/dist/esm/core/math.js +109 -111
- package/dist/esm/devtools/DevTools.js +546 -562
- package/dist/esm/devtools/DeveloperExperience.js +535 -558
- package/dist/esm/devtools/GameplayAnalytics.js +647 -645
- package/dist/esm/dialogue/DialogueSystem.js +998 -985
- package/dist/esm/docs/DocGenerator.js +342 -363
- package/dist/esm/ecs/World.js +358 -370
- package/dist/esm/editor/AchievementEditor.js +584 -635
- package/dist/esm/editor/AdvancedEditor.js +191 -190
- package/dist/esm/editor/AnimationRetargeting.js +700 -740
- package/dist/esm/editor/AssetBrowser.js +1078 -1159
- package/dist/esm/editor/AssetManager.js +188 -191
- package/dist/esm/editor/ConsolePro.js +977 -1060
- package/dist/esm/editor/CraftingEditor.js +684 -729
- package/dist/esm/editor/DebugTools.js +194 -184
- package/dist/esm/editor/DialogueSystem.js +849 -900
- package/dist/esm/editor/LeaderboardSystem.js +433 -482
- package/dist/esm/editor/NiceGameEditor.js +1908 -1200
- package/dist/esm/editor/PrefabSystem.js +777 -837
- package/dist/esm/editor/ProfilerPanel.js +654 -699
- package/dist/esm/editor/QuestEditor.js +795 -838
- package/dist/esm/editor/ReplaySystem.js +591 -633
- package/dist/esm/editor/SceneEditor.js +189 -199
- package/dist/esm/editor/ScreenshotMode.js +628 -687
- package/dist/esm/editor/ShaderGraph.js +1565 -1581
- package/dist/esm/editor/TimelineEditor.js +733 -777
- package/dist/esm/editor/UndoRedoPro.js +835 -903
- package/dist/esm/editor/VRARMode.js +586 -644
- package/dist/esm/engine/NiceGameEngine.js +142 -163
- package/dist/esm/engine/SaveSystem.js +447 -494
- package/dist/esm/enterprise/Enterprise.js +265 -260
- package/dist/esm/export/BevyExporter.js +929 -966
- package/dist/esm/export/CocosExporter.js +646 -672
- package/dist/esm/export/Construct3Exporter.js +785 -793
- package/dist/esm/export/DefoldExporter.js +1030 -1068
- package/dist/esm/export/GDevelopExporter.js +676 -707
- package/dist/esm/export/GameMakerExporter.js +793 -804
- package/dist/esm/export/GodotExporter.js +1004 -1044
- package/dist/esm/export/MinecraftBedrockExporter.js +575 -577
- package/dist/esm/export/MonoGameExporter.js +1267 -1292
- package/dist/esm/export/Pico8Exporter.js +768 -811
- package/dist/esm/export/PlatformExporter.js +193 -205
- package/dist/esm/export/RPGMakerExporter.js +862 -878
- package/dist/esm/export/RobloxExporter.js +885 -918
- package/dist/esm/export/Solar2DExporter.js +1220 -1255
- package/dist/esm/export/ThreeJSExporter.js +1007 -1072
- package/dist/esm/export/Tic80Exporter.js +1212 -1266
- package/dist/esm/export/UnityExporter.js +1117 -1130
- package/dist/esm/export/UnrealExporter.js +891 -918
- package/dist/esm/export/WebExporter.js +933 -969
- package/dist/esm/export/index.js +86 -71
- package/dist/esm/godot-integration/GodotAssetLibrary.js +663 -691
- package/dist/esm/godot-integration/GodotImport.js +935 -1026
- package/dist/esm/godot-integration/GodotLiveLink.js +918 -944
- package/dist/esm/godot-integration/components/GodotProjectBrowser.js +912 -610
- package/dist/esm/i18n/I18n.js +871 -899
- package/dist/esm/i18n/useTranslation.js +88 -88
- package/dist/esm/import/AsepriteImporter.js +637 -715
- package/dist/esm/import/DragonBonesImporter.js +417 -460
- package/dist/esm/import/GameMakerImporter.js +491 -520
- package/dist/esm/import/GodotSceneImporter.js +767 -821
- package/dist/esm/import/LDtkImporter.js +415 -453
- package/dist/esm/import/Live2DImporter.js +477 -517
- package/dist/esm/import/NdgFormat.js +410 -456
- package/dist/esm/import/OgmoImporter.js +446 -492
- package/dist/esm/import/RPGMakerImporter.js +431 -476
- package/dist/esm/import/SceneImporter.js +385 -422
- package/dist/esm/import/SpineImporter.js +491 -545
- package/dist/esm/import/SpriterImporter.js +570 -612
- package/dist/esm/import/TiledMapImporter.js +790 -845
- package/dist/esm/import/UnitySceneImporter.js +666 -702
- package/dist/esm/import/index.js +247 -258
- package/dist/esm/index.js +1332 -188
- package/dist/esm/input/GamepadNavigation.js +187 -204
- package/dist/esm/input/InputManager.js +401 -420
- package/dist/esm/input/useGamepads.js +72 -80
- package/dist/esm/integration/IconSprite.js +143 -255
- package/dist/esm/inventory/InventorySystem.js +925 -994
- package/dist/esm/kids/KidMode.js +1003 -1021
- package/dist/esm/kids/KidTools.js +573 -593
- package/dist/esm/monetization/Monetization.js +180 -176
- package/dist/esm/multiplayer/LocalMultiplayer.js +290 -286
- package/dist/esm/multiplayer/MiniGameTypes.js +58 -58
- package/dist/esm/native-engine/AnimationSystem.js +735 -805
- package/dist/esm/native-engine/AssetPipeline.js +456 -514
- package/dist/esm/native-engine/AudioEngine.js +765 -803
- package/dist/esm/native-engine/InputSystem.js +1079 -1144
- package/dist/esm/native-engine/NetworkingSystem.js +740 -792
- package/dist/esm/native-engine/PhysicsEngine.js +585 -606
- package/dist/esm/native-engine/RenderingEngine.js +304 -349
- package/dist/esm/native-engine/SceneGraph.js +773 -807
- package/dist/esm/network/MultiplayerTransport.js +99 -131
- package/dist/esm/network/Networking.js +556 -563
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AbortController.js +22 -28
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/AccessTokenHttpClient.js +41 -47
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultHttpClient.js +36 -42
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/DefaultReconnectPolicy.js +11 -14
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Errors.js +111 -134
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/FetchHttpClient.js +132 -157
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HandshakeProtocol.js +40 -52
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HeaderNames.js +6 -7
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpClient.js +42 -47
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HttpConnection.js +496 -571
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnection.js +828 -952
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/HubConnectionBuilder.js +126 -145
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/IHubProtocol.js +14 -23
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ILogger.js +12 -25
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ITransport.js +15 -24
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/JsonHubProtocol.js +109 -120
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Loggers.js +11 -13
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/LongPollingTransport.js +151 -184
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/MessageBuffer.js +159 -195
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/ServerSentEventsTransport.js +91 -104
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Subject.js +31 -34
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/TextMessageFormat.js +17 -20
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/Utils.js +230 -248
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/WebSocketTransport.js +136 -156
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/XhrHttpClient.js +77 -84
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/index.js +31 -12
- package/dist/esm/node_modules/@microsoft/signalr/dist/esm/pkg-version.js +4 -3
- package/dist/esm/pathfinding/Pathfinding.js +249 -262
- package/dist/esm/performance/AssetStreaming.js +567 -634
- package/dist/esm/performance/BenchmarkSuite.js +285 -310
- package/dist/esm/performance/DeltaCompression.js +478 -525
- package/dist/esm/performance/DeterministicPhysics.js +479 -497
- package/dist/esm/performance/ECSOptimization.js +653 -694
- package/dist/esm/performance/GameSaveSystem.js +515 -555
- package/dist/esm/performance/HotReload.js +454 -499
- package/dist/esm/performance/InputRecording.js +520 -560
- package/dist/esm/performance/InterestManagement.js +460 -499
- package/dist/esm/performance/LocalizationRuntime.js +382 -422
- package/dist/esm/performance/MemoryManagement.js +415 -469
- package/dist/esm/performance/ModSupport.js +455 -495
- package/dist/esm/performance/MultiThreadedPhysics.js +408 -442
- package/dist/esm/performance/NetworkPrediction.js +436 -481
- package/dist/esm/performance/ObjectPooling.js +582 -616
- package/dist/esm/performance/Performance.js +182 -189
- package/dist/esm/performance/PerformanceAdvanced.js +621 -636
- package/dist/esm/performance/WebGPURenderer.js +660 -682
- package/dist/esm/physics/PhysicsAdvanced.js +359 -378
- package/dist/esm/physics/PhysicsEngine2D.js +393 -426
- package/dist/esm/plugins/PluginSDK.js +435 -465
- package/dist/esm/plugins/PluginTestKit.js +315 -329
- package/dist/esm/procedural/Procedural.js +248 -253
- package/dist/esm/procedural/WorldBuilding.js +316 -313
- package/dist/esm/quest/QuestSystem.js +982 -931
- package/dist/esm/release/MobileExport.js +163 -162
- package/dist/esm/release/Release.js +234 -237
- package/dist/esm/rendering/Camera2D.js +122 -123
- package/dist/esm/rendering/Renderer2D.js +323 -334
- package/dist/esm/rendering/WebGPURenderPipeline.js +647 -650
- package/dist/esm/runtime3d/Runtime3D.js +368 -377
- package/dist/esm/runtime3d/SceneEditor3D.js +268 -262
- package/dist/esm/scene/SceneManager.js +178 -192
- package/dist/esm/scripting/GraphToAST.js +576 -546
- package/dist/esm/scripting/LanguageExporter.js +263 -278
- package/dist/esm/scripting/NodeGraph.js +550 -569
- package/dist/esm/scripting/ScriptAST.js +45 -38
- package/dist/esm/scripting/VisualScripting2.js +1025 -1064
- package/dist/esm/scripting/exporters/CSharpExporter.js +465 -495
- package/dist/esm/scripting/exporters/GDScriptExporter.js +391 -441
- package/dist/esm/scripting/exporters/LuaExporter.js +407 -446
- package/dist/esm/scripting/exporters/PythonExporter.js +485 -548
- package/dist/esm/scripting/exporters/RustExporter.js +460 -511
- package/dist/esm/scripting/exporters/TypeScriptExporter.js +506 -555
- package/dist/esm/social/Social.js +77 -79
- package/dist/esm/systems/LightingSystem.js +855 -930
- package/dist/esm/systems/ParticleSystem2.js +1453 -1450
- package/dist/esm/systems/PhysicsDebugSystem.js +1078 -1140
- package/dist/esm/systems/TerrainSystem.js +996 -1097
- package/dist/esm/templates/ActionTemplates.js +307 -308
- package/dist/esm/templates/FightingTemplate.js +439 -462
- package/dist/esm/templates/MetroidvaniaTemplate.js +391 -404
- package/dist/esm/templates/PartyTemplates.js +206 -201
- package/dist/esm/templates/PuzzleTemplates.js +260 -260
- package/dist/esm/templates/RPGTemplates.js +172 -177
- package/dist/esm/templates/SportsTemplates.js +251 -249
- package/dist/esm/templates/StrategyTemplates.js +158 -152
- package/dist/esm/templates/SurvivalTemplate.js +367 -379
- package/dist/esm/templates/WaveDefense.js +501 -525
- package/dist/esm/tilemap/Tilemap.js +209 -213
- package/dist/esm/tutorials/TutorialBranching.js +399 -416
- package/dist/esm/tutorials/TutorialEngine.js +893 -930
- package/dist/esm/tutorials/TutorialOverlay.js +603 -639
- package/dist/esm/tutorials/content/Tutorials_T05_T08.js +792 -808
- package/dist/esm/tutorials/content/Tutorials_T09_T11.js +740 -755
- package/dist/esm/tutorials/content/Tutorials_T12_T15.js +759 -777
- package/dist/esm/ui/GameUI.js +296 -311
- package/dist/esm/unity-integration/UnityAssetStore.js +704 -740
- package/dist/esm/unity-integration/UnityImport.js +1071 -1175
- package/dist/esm/unity-integration/UnityLiveLink.js +938 -980
- package/dist/esm/unity-integration/components/UnityAssetStoreBrowser.js +1234 -756
- package/dist/esm/unity-integration/components/UnityProjectBrowser.js +1241 -767
- package/dist/esm/unreal-integration/UnrealImport.js +395 -411
- package/dist/esm/unreal-integration/UnrealLiveLink.js +1105 -1136
- package/dist/esm/unreal-integration/UnrealMarketplace.js +442 -472
- package/dist/esm/unreal-integration/components/UnrealProjectBrowser.js +1151 -766
- package/dist/esm/xr/ARVR.js +181 -174
- package/package.json +7 -12
|
@@ -1,748 +1,698 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* @file CraftingEditor.ts
|
|
5
|
-
* @description Visual Crafting Recipe Editor system
|
|
6
|
-
* PRO-1.4: Professional Editor Features
|
|
7
|
-
*
|
|
8
|
-
* Features:
|
|
9
|
-
* - Recipe definition with ingredients
|
|
10
|
-
* - Crafting stations/workbenches
|
|
11
|
-
* - Recipe categories and discovery
|
|
12
|
-
* - Skill requirements
|
|
13
|
-
* - Recipe variants and tiers
|
|
14
|
-
* - Crafting time and progress
|
|
15
|
-
* - By-products and waste
|
|
16
|
-
* - Recipe chains
|
|
17
|
-
* - Salvaging/recycling
|
|
18
|
-
* - Quality system
|
|
19
|
-
*/
|
|
20
|
-
// ============================================================
|
|
21
|
-
// Crafting Editor
|
|
22
|
-
// ============================================================
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
23
3
|
class CraftingEditor {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
4
|
+
constructor() {
|
|
5
|
+
this.recipes = /* @__PURE__ */ new Map();
|
|
6
|
+
this.stations = /* @__PURE__ */ new Map();
|
|
7
|
+
this.chains = /* @__PURE__ */ new Map();
|
|
8
|
+
this.salvageRules = /* @__PURE__ */ new Map();
|
|
9
|
+
this.activeProgress = /* @__PURE__ */ new Map();
|
|
10
|
+
this.craftingQueues = /* @__PURE__ */ new Map();
|
|
11
|
+
this.playerSkills = /* @__PURE__ */ new Map();
|
|
12
|
+
this.playerInventory = /* @__PURE__ */ new Map();
|
|
13
|
+
this.discoveredRecipes = /* @__PURE__ */ new Set();
|
|
14
|
+
}
|
|
15
|
+
// ─── Recipe Management ─────────────────────────────────
|
|
16
|
+
createRecipe(name, category) {
|
|
17
|
+
const recipe = {
|
|
18
|
+
id: `recipe_${Date.now()}_${Math.random().toString(36).substr(2, 9)}`,
|
|
19
|
+
name,
|
|
20
|
+
description: "",
|
|
21
|
+
category,
|
|
22
|
+
ingredients: [],
|
|
23
|
+
outputs: [],
|
|
24
|
+
requirements: [],
|
|
25
|
+
skillRequired: 0,
|
|
26
|
+
craftingTime: 5,
|
|
27
|
+
experienceGained: 10,
|
|
28
|
+
isStackable: true,
|
|
29
|
+
maxBatch: 99,
|
|
30
|
+
discoveryMethod: "known",
|
|
31
|
+
discoveredBy: /* @__PURE__ */ new Set(),
|
|
32
|
+
tier: 1,
|
|
33
|
+
baseQuality: "normal",
|
|
34
|
+
qualityFactors: [],
|
|
35
|
+
tags: [],
|
|
36
|
+
isFavorite: false,
|
|
37
|
+
createdAt: Date.now(),
|
|
38
|
+
modifiedAt: Date.now(),
|
|
39
|
+
version: 1
|
|
40
|
+
};
|
|
41
|
+
this.recipes.set(recipe.id, recipe);
|
|
42
|
+
return recipe;
|
|
43
|
+
}
|
|
44
|
+
getRecipe(id) {
|
|
45
|
+
return this.recipes.get(id);
|
|
46
|
+
}
|
|
47
|
+
updateRecipe(id, updates) {
|
|
48
|
+
const recipe = this.recipes.get(id);
|
|
49
|
+
if (!recipe) {
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
Object.assign(recipe, updates, { modifiedAt: Date.now() });
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
deleteRecipe(id) {
|
|
56
|
+
return this.recipes.delete(id);
|
|
57
|
+
}
|
|
58
|
+
getAllRecipes() {
|
|
59
|
+
return Array.from(this.recipes.values());
|
|
60
|
+
}
|
|
61
|
+
getRecipesByCategory(category) {
|
|
62
|
+
return this.getAllRecipes().filter((r) => r.category === category);
|
|
63
|
+
}
|
|
64
|
+
// ─── Ingredient Management ─────────────────────────────
|
|
65
|
+
addIngredient(recipeId, itemId, amount, isConsumed = true) {
|
|
66
|
+
const recipe = this.recipes.get(recipeId);
|
|
67
|
+
if (!recipe) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
const ingredient = {
|
|
71
|
+
itemId,
|
|
72
|
+
amount,
|
|
73
|
+
isConsumed
|
|
74
|
+
};
|
|
75
|
+
recipe.ingredients.push(ingredient);
|
|
76
|
+
recipe.modifiedAt = Date.now();
|
|
77
|
+
return true;
|
|
78
|
+
}
|
|
79
|
+
removeIngredient(recipeId, index) {
|
|
80
|
+
const recipe = this.recipes.get(recipeId);
|
|
81
|
+
if (!recipe || index < 0 || index >= recipe.ingredients.length) {
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
recipe.ingredients.splice(index, 1);
|
|
85
|
+
recipe.modifiedAt = Date.now();
|
|
86
|
+
return true;
|
|
87
|
+
}
|
|
88
|
+
setIngredientAlternatives(recipeId, ingredientIndex, alternativeIds) {
|
|
89
|
+
const recipe = this.recipes.get(recipeId);
|
|
90
|
+
if (!recipe || !recipe.ingredients[ingredientIndex]) {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
recipe.ingredients[ingredientIndex].alternativeIds = alternativeIds;
|
|
94
|
+
recipe.modifiedAt = Date.now();
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
// ─── Output Management ─────────────────────────────────
|
|
98
|
+
addOutput(recipeId, itemId, minAmount, maxAmount = minAmount, chance = 1) {
|
|
99
|
+
const recipe = this.recipes.get(recipeId);
|
|
100
|
+
if (!recipe) {
|
|
101
|
+
return false;
|
|
102
|
+
}
|
|
103
|
+
const output = {
|
|
104
|
+
itemId,
|
|
105
|
+
minAmount,
|
|
106
|
+
maxAmount,
|
|
107
|
+
chance
|
|
108
|
+
};
|
|
109
|
+
recipe.outputs.push(output);
|
|
110
|
+
recipe.modifiedAt = Date.now();
|
|
111
|
+
return true;
|
|
112
|
+
}
|
|
113
|
+
addByproduct(recipeId, itemId, chance, amount = 1) {
|
|
114
|
+
const recipe = this.recipes.get(recipeId);
|
|
115
|
+
if (!recipe) {
|
|
116
|
+
return false;
|
|
117
|
+
}
|
|
118
|
+
if (!recipe.byproducts) {
|
|
119
|
+
recipe.byproducts = [];
|
|
120
|
+
}
|
|
121
|
+
recipe.byproducts.push({
|
|
122
|
+
itemId,
|
|
123
|
+
minAmount: amount,
|
|
124
|
+
maxAmount: amount,
|
|
125
|
+
chance
|
|
126
|
+
});
|
|
127
|
+
recipe.modifiedAt = Date.now();
|
|
128
|
+
return true;
|
|
129
|
+
}
|
|
130
|
+
// ─── Requirement Management ────────────────────────────
|
|
131
|
+
addRequirement(recipeId, type, target, value, description) {
|
|
132
|
+
const recipe = this.recipes.get(recipeId);
|
|
133
|
+
if (!recipe) {
|
|
134
|
+
return false;
|
|
135
|
+
}
|
|
136
|
+
recipe.requirements.push({ type, target, value, description });
|
|
137
|
+
recipe.modifiedAt = Date.now();
|
|
138
|
+
return true;
|
|
139
|
+
}
|
|
140
|
+
// ─── Station Management ────────────────────────────────
|
|
141
|
+
createStation(name, categories) {
|
|
142
|
+
const station = {
|
|
143
|
+
id: `station_${Date.now()}`,
|
|
144
|
+
name,
|
|
145
|
+
description: "",
|
|
146
|
+
categories,
|
|
147
|
+
tier: 1
|
|
148
|
+
};
|
|
149
|
+
this.stations.set(station.id, station);
|
|
150
|
+
return station;
|
|
151
|
+
}
|
|
152
|
+
getStation(id) {
|
|
153
|
+
return this.stations.get(id);
|
|
154
|
+
}
|
|
155
|
+
getAllStations() {
|
|
156
|
+
return Array.from(this.stations.values());
|
|
157
|
+
}
|
|
158
|
+
getStationsForCategory(category) {
|
|
159
|
+
return this.getAllStations().filter((s) => s.categories.includes(category));
|
|
160
|
+
}
|
|
161
|
+
// ─── Recipe Chains ─────────────────────────────────────
|
|
162
|
+
createChain(name) {
|
|
163
|
+
const chain = {
|
|
164
|
+
id: `chain_${Date.now()}`,
|
|
165
|
+
name,
|
|
166
|
+
description: "",
|
|
167
|
+
recipeIds: [],
|
|
168
|
+
automatable: false
|
|
169
|
+
};
|
|
170
|
+
this.chains.set(chain.id, chain);
|
|
171
|
+
return chain;
|
|
172
|
+
}
|
|
173
|
+
addRecipeToChain(chainId, recipeId) {
|
|
174
|
+
const chain = this.chains.get(chainId);
|
|
175
|
+
if (!chain) {
|
|
176
|
+
return false;
|
|
177
|
+
}
|
|
178
|
+
chain.recipeIds.push(recipeId);
|
|
179
|
+
return true;
|
|
180
|
+
}
|
|
181
|
+
// ─── Salvage Rules ─────────────────────────────────────
|
|
182
|
+
createSalvageRule(sourceItemId) {
|
|
183
|
+
const rule = {
|
|
184
|
+
sourceItemId,
|
|
185
|
+
outputs: [],
|
|
186
|
+
preserveEnchantments: false
|
|
187
|
+
};
|
|
188
|
+
this.salvageRules.set(sourceItemId, rule);
|
|
189
|
+
return rule;
|
|
190
|
+
}
|
|
191
|
+
addSalvageOutput(sourceItemId, outputItemId, chance, amount = 1) {
|
|
192
|
+
const rule = this.salvageRules.get(sourceItemId);
|
|
193
|
+
if (!rule) {
|
|
194
|
+
return false;
|
|
195
|
+
}
|
|
196
|
+
rule.outputs.push({
|
|
197
|
+
itemId: outputItemId,
|
|
198
|
+
minAmount: amount,
|
|
199
|
+
maxAmount: amount,
|
|
200
|
+
chance
|
|
201
|
+
});
|
|
202
|
+
return true;
|
|
203
|
+
}
|
|
204
|
+
// ─── Runtime: Availability ─────────────────────────────
|
|
205
|
+
getAvailableRecipes(playerId, stationId) {
|
|
206
|
+
return this.getAllRecipes().filter((recipe) => {
|
|
207
|
+
if (recipe.discoveryMethod !== "known" && !this.discoveredRecipes.has(recipe.id)) {
|
|
208
|
+
return false;
|
|
209
|
+
}
|
|
210
|
+
if (stationId && recipe.stationId && recipe.stationId !== stationId) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
for (const req of recipe.requirements) {
|
|
214
|
+
if (!this.checkRequirement(req, playerId)) {
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
return true;
|
|
219
|
+
});
|
|
220
|
+
}
|
|
221
|
+
canCraft(recipeId, playerId, quantity = 1) {
|
|
222
|
+
const recipe = this.recipes.get(recipeId);
|
|
223
|
+
if (!recipe) {
|
|
224
|
+
return { canCraft: false, reason: "Recipe not found" };
|
|
225
|
+
}
|
|
226
|
+
if (recipe.discoveryMethod !== "known" && !this.discoveredRecipes.has(recipeId)) {
|
|
227
|
+
return { canCraft: false, reason: "Recipe not discovered" };
|
|
228
|
+
}
|
|
229
|
+
if (recipe.skillId) {
|
|
230
|
+
const skill = this.playerSkills.get(recipe.skillId) ?? 0;
|
|
231
|
+
if (skill < recipe.skillRequired) {
|
|
232
|
+
return {
|
|
233
|
+
canCraft: false,
|
|
234
|
+
reason: `Requires ${recipe.skillId} skill ${recipe.skillRequired}`
|
|
62
235
|
};
|
|
63
|
-
|
|
64
|
-
return recipe;
|
|
236
|
+
}
|
|
65
237
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
isConsumed,
|
|
96
|
-
};
|
|
97
|
-
recipe.ingredients.push(ingredient);
|
|
98
|
-
recipe.modifiedAt = Date.now();
|
|
99
|
-
return true;
|
|
100
|
-
}
|
|
101
|
-
removeIngredient(recipeId, index) {
|
|
102
|
-
const recipe = this.recipes.get(recipeId);
|
|
103
|
-
if (!recipe || index < 0 || index >= recipe.ingredients.length) {
|
|
104
|
-
return false;
|
|
105
|
-
}
|
|
106
|
-
recipe.ingredients.splice(index, 1);
|
|
107
|
-
recipe.modifiedAt = Date.now();
|
|
108
|
-
return true;
|
|
109
|
-
}
|
|
110
|
-
setIngredientAlternatives(recipeId, ingredientIndex, alternativeIds) {
|
|
111
|
-
const recipe = this.recipes.get(recipeId);
|
|
112
|
-
if (!recipe || !recipe.ingredients[ingredientIndex]) {
|
|
113
|
-
return false;
|
|
114
|
-
}
|
|
115
|
-
recipe.ingredients[ingredientIndex].alternativeIds = alternativeIds;
|
|
116
|
-
recipe.modifiedAt = Date.now();
|
|
117
|
-
return true;
|
|
118
|
-
}
|
|
119
|
-
// ─── Output Management ─────────────────────────────────
|
|
120
|
-
addOutput(recipeId, itemId, minAmount, maxAmount = minAmount, chance = 1) {
|
|
121
|
-
const recipe = this.recipes.get(recipeId);
|
|
122
|
-
if (!recipe) {
|
|
123
|
-
return false;
|
|
124
|
-
}
|
|
125
|
-
const output = {
|
|
126
|
-
itemId,
|
|
127
|
-
minAmount,
|
|
128
|
-
maxAmount,
|
|
129
|
-
chance,
|
|
130
|
-
};
|
|
131
|
-
recipe.outputs.push(output);
|
|
132
|
-
recipe.modifiedAt = Date.now();
|
|
133
|
-
return true;
|
|
134
|
-
}
|
|
135
|
-
addByproduct(recipeId, itemId, chance, amount = 1) {
|
|
136
|
-
const recipe = this.recipes.get(recipeId);
|
|
137
|
-
if (!recipe) {
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
if (!recipe.byproducts) {
|
|
141
|
-
recipe.byproducts = [];
|
|
142
|
-
}
|
|
143
|
-
recipe.byproducts.push({
|
|
144
|
-
itemId,
|
|
145
|
-
minAmount: amount,
|
|
146
|
-
maxAmount: amount,
|
|
147
|
-
chance,
|
|
148
|
-
});
|
|
149
|
-
recipe.modifiedAt = Date.now();
|
|
150
|
-
return true;
|
|
151
|
-
}
|
|
152
|
-
// ─── Requirement Management ────────────────────────────
|
|
153
|
-
addRequirement(recipeId, type, target, value, description) {
|
|
154
|
-
const recipe = this.recipes.get(recipeId);
|
|
155
|
-
if (!recipe) {
|
|
156
|
-
return false;
|
|
157
|
-
}
|
|
158
|
-
recipe.requirements.push({ type, target, value, description });
|
|
159
|
-
recipe.modifiedAt = Date.now();
|
|
160
|
-
return true;
|
|
161
|
-
}
|
|
162
|
-
// ─── Station Management ────────────────────────────────
|
|
163
|
-
createStation(name, categories) {
|
|
164
|
-
const station = {
|
|
165
|
-
id: `station_${Date.now()}`,
|
|
166
|
-
name,
|
|
167
|
-
description: '',
|
|
168
|
-
categories,
|
|
169
|
-
tier: 1,
|
|
170
|
-
};
|
|
171
|
-
this.stations.set(station.id, station);
|
|
172
|
-
return station;
|
|
173
|
-
}
|
|
174
|
-
getStation(id) {
|
|
175
|
-
return this.stations.get(id);
|
|
176
|
-
}
|
|
177
|
-
getAllStations() {
|
|
178
|
-
return Array.from(this.stations.values());
|
|
179
|
-
}
|
|
180
|
-
getStationsForCategory(category) {
|
|
181
|
-
return this.getAllStations().filter((s) => s.categories.includes(category));
|
|
182
|
-
}
|
|
183
|
-
// ─── Recipe Chains ─────────────────────────────────────
|
|
184
|
-
createChain(name) {
|
|
185
|
-
const chain = {
|
|
186
|
-
id: `chain_${Date.now()}`,
|
|
187
|
-
name,
|
|
188
|
-
description: '',
|
|
189
|
-
recipeIds: [],
|
|
190
|
-
automatable: false,
|
|
191
|
-
};
|
|
192
|
-
this.chains.set(chain.id, chain);
|
|
193
|
-
return chain;
|
|
194
|
-
}
|
|
195
|
-
addRecipeToChain(chainId, recipeId) {
|
|
196
|
-
const chain = this.chains.get(chainId);
|
|
197
|
-
if (!chain) {
|
|
198
|
-
return false;
|
|
199
|
-
}
|
|
200
|
-
chain.recipeIds.push(recipeId);
|
|
201
|
-
return true;
|
|
202
|
-
}
|
|
203
|
-
// ─── Salvage Rules ─────────────────────────────────────
|
|
204
|
-
createSalvageRule(sourceItemId) {
|
|
205
|
-
const rule = {
|
|
206
|
-
sourceItemId,
|
|
207
|
-
outputs: [],
|
|
208
|
-
preserveEnchantments: false,
|
|
209
|
-
};
|
|
210
|
-
this.salvageRules.set(sourceItemId, rule);
|
|
211
|
-
return rule;
|
|
212
|
-
}
|
|
213
|
-
addSalvageOutput(sourceItemId, outputItemId, chance, amount = 1) {
|
|
214
|
-
const rule = this.salvageRules.get(sourceItemId);
|
|
215
|
-
if (!rule) {
|
|
216
|
-
return false;
|
|
217
|
-
}
|
|
218
|
-
rule.outputs.push({
|
|
219
|
-
itemId: outputItemId,
|
|
220
|
-
minAmount: amount,
|
|
221
|
-
maxAmount: amount,
|
|
222
|
-
chance,
|
|
223
|
-
});
|
|
224
|
-
return true;
|
|
225
|
-
}
|
|
226
|
-
// ─── Runtime: Availability ─────────────────────────────
|
|
227
|
-
getAvailableRecipes(playerId, stationId) {
|
|
228
|
-
return this.getAllRecipes().filter((recipe) => {
|
|
229
|
-
// Check discovery
|
|
230
|
-
if (recipe.discoveryMethod !== 'known' && !this.discoveredRecipes.has(recipe.id)) {
|
|
231
|
-
return false;
|
|
232
|
-
}
|
|
233
|
-
// Check station
|
|
234
|
-
if (stationId && recipe.stationId && recipe.stationId !== stationId) {
|
|
235
|
-
return false;
|
|
236
|
-
}
|
|
237
|
-
// Check requirements
|
|
238
|
-
for (const req of recipe.requirements) {
|
|
239
|
-
if (!this.checkRequirement(req, playerId)) {
|
|
240
|
-
return false;
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
return true;
|
|
244
|
-
});
|
|
245
|
-
}
|
|
246
|
-
canCraft(recipeId, playerId, quantity = 1) {
|
|
247
|
-
const recipe = this.recipes.get(recipeId);
|
|
248
|
-
if (!recipe) {
|
|
249
|
-
return { canCraft: false, reason: 'Recipe not found' };
|
|
250
|
-
}
|
|
251
|
-
// Check discovery
|
|
252
|
-
if (recipe.discoveryMethod !== 'known' && !this.discoveredRecipes.has(recipeId)) {
|
|
253
|
-
return { canCraft: false, reason: 'Recipe not discovered' };
|
|
254
|
-
}
|
|
255
|
-
// Check skill requirement
|
|
256
|
-
if (recipe.skillId) {
|
|
257
|
-
const skill = this.playerSkills.get(recipe.skillId) ?? 0;
|
|
258
|
-
if (skill < recipe.skillRequired) {
|
|
259
|
-
return {
|
|
260
|
-
canCraft: false,
|
|
261
|
-
reason: `Requires ${recipe.skillId} skill ${recipe.skillRequired}`,
|
|
262
|
-
};
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
// Check ingredients
|
|
266
|
-
for (const ingredient of recipe.ingredients) {
|
|
267
|
-
const required = ingredient.amount * quantity;
|
|
268
|
-
let hasIngredient = false;
|
|
269
|
-
// Check main item or alternatives
|
|
270
|
-
const itemIds = [ingredient.itemId, ...(ingredient.alternativeIds ?? [])];
|
|
271
|
-
for (const itemId of itemIds) {
|
|
272
|
-
const available = this.playerInventory.get(itemId) ?? 0;
|
|
273
|
-
if (available >= required) {
|
|
274
|
-
hasIngredient = true;
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
if (!hasIngredient) {
|
|
279
|
-
return { canCraft: false, reason: `Insufficient ${ingredient.itemId}` };
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
// Check requirements
|
|
283
|
-
for (const req of recipe.requirements) {
|
|
284
|
-
if (!this.checkRequirement(req, playerId)) {
|
|
285
|
-
return { canCraft: false, reason: req.description ?? `Requirement not met: ${req.type}` };
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
return { canCraft: true };
|
|
289
|
-
}
|
|
290
|
-
checkRequirement(req, _playerId) {
|
|
291
|
-
switch (req.type) {
|
|
292
|
-
case 'skill': {
|
|
293
|
-
const skill = this.playerSkills.get(req.target) ?? 0;
|
|
294
|
-
return skill >= req.value;
|
|
295
|
-
}
|
|
296
|
-
case 'level':
|
|
297
|
-
// Would integrate with player level system
|
|
298
|
-
return true;
|
|
299
|
-
default:
|
|
300
|
-
return true;
|
|
301
|
-
}
|
|
302
|
-
}
|
|
303
|
-
// ─── Runtime: Crafting ─────────────────────────────────
|
|
304
|
-
startCrafting(recipeId, playerId, quantity = 1) {
|
|
305
|
-
const recipe = this.recipes.get(recipeId);
|
|
306
|
-
if (!recipe) {
|
|
307
|
-
return null;
|
|
308
|
-
}
|
|
309
|
-
const check = this.canCraft(recipeId, playerId, quantity);
|
|
310
|
-
if (!check.canCraft) {
|
|
311
|
-
return null;
|
|
312
|
-
}
|
|
313
|
-
// Consume ingredients
|
|
314
|
-
for (const ingredient of recipe.ingredients) {
|
|
315
|
-
if (!ingredient.isConsumed) {
|
|
316
|
-
continue;
|
|
317
|
-
}
|
|
318
|
-
const required = ingredient.amount * quantity;
|
|
319
|
-
const itemIds = [ingredient.itemId, ...(ingredient.alternativeIds ?? [])];
|
|
320
|
-
for (const itemId of itemIds) {
|
|
321
|
-
const available = this.playerInventory.get(itemId) ?? 0;
|
|
322
|
-
if (available >= required) {
|
|
323
|
-
this.playerInventory.set(itemId, available - required);
|
|
324
|
-
break;
|
|
325
|
-
}
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
const now = Date.now();
|
|
329
|
-
const craftingTime = recipe.craftingTime * 1000 * quantity;
|
|
330
|
-
const progress = {
|
|
331
|
-
id: `progress_${Date.now()}`,
|
|
332
|
-
recipeId,
|
|
333
|
-
playerId,
|
|
334
|
-
startedAt: now,
|
|
335
|
-
completesAt: now + craftingTime,
|
|
336
|
-
quantity,
|
|
337
|
-
isPaused: false,
|
|
338
|
-
accumulatedTime: 0,
|
|
339
|
-
cancelled: false,
|
|
340
|
-
};
|
|
341
|
-
this.activeProgress.set(progress.id, progress);
|
|
342
|
-
this.onCraftingStarted?.(progress);
|
|
343
|
-
// Instant crafting
|
|
344
|
-
if (recipe.craftingTime === 0) {
|
|
345
|
-
this.completeCrafting(progress.id);
|
|
346
|
-
}
|
|
347
|
-
return progress;
|
|
348
|
-
}
|
|
349
|
-
updateCraftingProgress(_deltaTime) {
|
|
350
|
-
const now = Date.now();
|
|
351
|
-
for (const [progressId, progress] of this.activeProgress) {
|
|
352
|
-
if (progress.isPaused || progress.cancelled) {
|
|
353
|
-
continue;
|
|
354
|
-
}
|
|
355
|
-
const recipe = this.recipes.get(progress.recipeId);
|
|
356
|
-
if (!recipe) {
|
|
357
|
-
continue;
|
|
358
|
-
}
|
|
359
|
-
// Check if complete
|
|
360
|
-
if (now >= progress.completesAt) {
|
|
361
|
-
this.completeCrafting(progressId);
|
|
362
|
-
}
|
|
363
|
-
else {
|
|
364
|
-
// Report progress
|
|
365
|
-
const totalTime = progress.completesAt - progress.startedAt;
|
|
366
|
-
const elapsed = now - progress.startedAt + progress.accumulatedTime;
|
|
367
|
-
const percent = Math.min(1, elapsed / totalTime);
|
|
368
|
-
this.onCraftingProgress?.(progress, percent);
|
|
369
|
-
}
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
completeCrafting(progressId) {
|
|
373
|
-
const progress = this.activeProgress.get(progressId);
|
|
374
|
-
if (!progress) {
|
|
375
|
-
return;
|
|
376
|
-
}
|
|
377
|
-
const recipe = this.recipes.get(progress.recipeId);
|
|
378
|
-
if (!recipe) {
|
|
379
|
-
return;
|
|
380
|
-
}
|
|
381
|
-
// Determine quality
|
|
382
|
-
const quality = this.determineQuality(recipe, progress.playerId);
|
|
383
|
-
this.onQualityDetermined?.(recipe, quality, []);
|
|
384
|
-
// Generate outputs
|
|
385
|
-
const outputs = [];
|
|
386
|
-
for (const output of recipe.outputs) {
|
|
387
|
-
if (Math.random() <= output.chance) {
|
|
388
|
-
const baseAmount = Math.floor(Math.random() * (output.maxAmount - output.minAmount + 1) + output.minAmount) *
|
|
389
|
-
progress.quantity;
|
|
390
|
-
// Apply skill bonus
|
|
391
|
-
let finalAmount = baseAmount;
|
|
392
|
-
if (output.bonusFromSkill && recipe.skillId) {
|
|
393
|
-
const skill = this.playerSkills.get(recipe.skillId) ?? 0;
|
|
394
|
-
finalAmount += Math.floor(skill * output.bonusFromSkill);
|
|
395
|
-
}
|
|
396
|
-
// Add to inventory
|
|
397
|
-
const current = this.playerInventory.get(output.itemId) ?? 0;
|
|
398
|
-
this.playerInventory.set(output.itemId, current + finalAmount);
|
|
399
|
-
outputs.push({ ...output, minAmount: finalAmount, maxAmount: finalAmount });
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
// Generate byproducts
|
|
403
|
-
if (recipe.byproducts) {
|
|
404
|
-
for (const byproduct of recipe.byproducts) {
|
|
405
|
-
if (Math.random() <= byproduct.chance) {
|
|
406
|
-
const amount = Math.floor(Math.random() * (byproduct.maxAmount - byproduct.minAmount + 1) + byproduct.minAmount) * progress.quantity;
|
|
407
|
-
const current = this.playerInventory.get(byproduct.itemId) ?? 0;
|
|
408
|
-
this.playerInventory.set(byproduct.itemId, current + amount);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
|
-
// Award experience
|
|
413
|
-
if (recipe.skillId && recipe.experienceGained > 0) {
|
|
414
|
-
const totalXp = recipe.experienceGained * progress.quantity;
|
|
415
|
-
this.onExperienceGained?.(recipe.skillId, totalXp);
|
|
416
|
-
}
|
|
417
|
-
this.activeProgress.delete(progressId);
|
|
418
|
-
this.onCraftingCompleted?.(recipe, outputs, quality);
|
|
419
|
-
}
|
|
420
|
-
determineQuality(recipe, _playerId) {
|
|
421
|
-
const qualities = [
|
|
422
|
-
'poor',
|
|
423
|
-
'normal',
|
|
424
|
-
'fine',
|
|
425
|
-
'superior',
|
|
426
|
-
'masterwork',
|
|
427
|
-
'legendary',
|
|
428
|
-
];
|
|
429
|
-
const baseIndex = qualities.indexOf(recipe.baseQuality);
|
|
430
|
-
let qualityScore = baseIndex;
|
|
431
|
-
for (const factor of recipe.qualityFactors) {
|
|
432
|
-
switch (factor.type) {
|
|
433
|
-
case 'skill':
|
|
434
|
-
if (recipe.skillId) {
|
|
435
|
-
const skill = this.playerSkills.get(recipe.skillId) ?? 0;
|
|
436
|
-
qualityScore += (skill / 100) * factor.weight;
|
|
437
|
-
}
|
|
438
|
-
break;
|
|
439
|
-
case 'random':
|
|
440
|
-
qualityScore += (Math.random() - 0.5) * factor.weight;
|
|
441
|
-
break;
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
const finalIndex = Math.max(0, Math.min(qualities.length - 1, Math.round(qualityScore)));
|
|
445
|
-
return qualities[finalIndex];
|
|
446
|
-
}
|
|
447
|
-
pauseCrafting(progressId) {
|
|
448
|
-
const progress = this.activeProgress.get(progressId);
|
|
449
|
-
if (!progress || progress.isPaused) {
|
|
450
|
-
return false;
|
|
451
|
-
}
|
|
452
|
-
progress.isPaused = true;
|
|
453
|
-
progress.pausedAt = Date.now();
|
|
454
|
-
progress.accumulatedTime += progress.pausedAt - progress.startedAt;
|
|
455
|
-
return true;
|
|
456
|
-
}
|
|
457
|
-
resumeCrafting(progressId) {
|
|
458
|
-
const progress = this.activeProgress.get(progressId);
|
|
459
|
-
if (!progress || !progress.isPaused) {
|
|
460
|
-
return false;
|
|
461
|
-
}
|
|
462
|
-
const now = Date.now();
|
|
463
|
-
const remainingTime = progress.completesAt - progress.startedAt - progress.accumulatedTime;
|
|
464
|
-
progress.isPaused = false;
|
|
465
|
-
progress.startedAt = now;
|
|
466
|
-
progress.completesAt = now + remainingTime;
|
|
467
|
-
progress.pausedAt = undefined;
|
|
468
|
-
return true;
|
|
469
|
-
}
|
|
470
|
-
cancelCrafting(progressId, refundIngredients = false) {
|
|
471
|
-
const progress = this.activeProgress.get(progressId);
|
|
472
|
-
if (!progress) {
|
|
473
|
-
return false;
|
|
474
|
-
}
|
|
475
|
-
progress.cancelled = true;
|
|
476
|
-
if (refundIngredients) {
|
|
477
|
-
const recipe = this.recipes.get(progress.recipeId);
|
|
478
|
-
if (recipe) {
|
|
479
|
-
for (const ingredient of recipe.ingredients) {
|
|
480
|
-
if (!ingredient.isConsumed) {
|
|
481
|
-
continue;
|
|
482
|
-
}
|
|
483
|
-
const amount = ingredient.amount * progress.quantity;
|
|
484
|
-
const current = this.playerInventory.get(ingredient.itemId) ?? 0;
|
|
485
|
-
this.playerInventory.set(ingredient.itemId, current + amount);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
this.activeProgress.delete(progressId);
|
|
490
|
-
return true;
|
|
491
|
-
}
|
|
492
|
-
// ─── Crafting Queue ────────────────────────────────────
|
|
493
|
-
addToQueue(playerId, recipeId, quantity, priority = 0) {
|
|
494
|
-
if (!this.craftingQueues.has(playerId)) {
|
|
495
|
-
this.craftingQueues.set(playerId, []);
|
|
496
|
-
}
|
|
497
|
-
const queue = this.craftingQueues.get(playerId);
|
|
498
|
-
queue.push({ recipeId, quantity, priority });
|
|
499
|
-
queue.sort((a, b) => b.priority - a.priority);
|
|
238
|
+
for (const ingredient of recipe.ingredients) {
|
|
239
|
+
const required = ingredient.amount * quantity;
|
|
240
|
+
let hasIngredient = false;
|
|
241
|
+
const itemIds = [ingredient.itemId, ...ingredient.alternativeIds ?? []];
|
|
242
|
+
for (const itemId of itemIds) {
|
|
243
|
+
const available = this.playerInventory.get(itemId) ?? 0;
|
|
244
|
+
if (available >= required) {
|
|
245
|
+
hasIngredient = true;
|
|
246
|
+
break;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
if (!hasIngredient) {
|
|
250
|
+
return { canCraft: false, reason: `Insufficient ${ingredient.itemId}` };
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
for (const req of recipe.requirements) {
|
|
254
|
+
if (!this.checkRequirement(req, playerId)) {
|
|
255
|
+
return { canCraft: false, reason: req.description ?? `Requirement not met: ${req.type}` };
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
return { canCraft: true };
|
|
259
|
+
}
|
|
260
|
+
checkRequirement(req, _playerId) {
|
|
261
|
+
switch (req.type) {
|
|
262
|
+
case "skill": {
|
|
263
|
+
const skill = this.playerSkills.get(req.target) ?? 0;
|
|
264
|
+
return skill >= req.value;
|
|
265
|
+
}
|
|
266
|
+
case "level":
|
|
500
267
|
return true;
|
|
501
|
-
|
|
502
|
-
getQueue(playerId) {
|
|
503
|
-
return this.craftingQueues.get(playerId) ?? [];
|
|
504
|
-
}
|
|
505
|
-
processQueueItem(playerId) {
|
|
506
|
-
const queue = this.craftingQueues.get(playerId);
|
|
507
|
-
if (!queue || queue.length === 0) {
|
|
508
|
-
return null;
|
|
509
|
-
}
|
|
510
|
-
const item = queue.shift();
|
|
511
|
-
return this.startCrafting(item.recipeId, playerId, item.quantity);
|
|
512
|
-
}
|
|
513
|
-
// ─── Discovery ─────────────────────────────────────────
|
|
514
|
-
discoverRecipe(recipeId, playerId) {
|
|
515
|
-
const recipe = this.recipes.get(recipeId);
|
|
516
|
-
if (!recipe) {
|
|
517
|
-
return false;
|
|
518
|
-
}
|
|
519
|
-
if (this.discoveredRecipes.has(recipeId)) {
|
|
520
|
-
return false;
|
|
521
|
-
}
|
|
522
|
-
this.discoveredRecipes.add(recipeId);
|
|
523
|
-
recipe.discoveredBy.add(playerId);
|
|
524
|
-
this.onRecipeDiscovered?.(recipe, playerId);
|
|
268
|
+
default:
|
|
525
269
|
return true;
|
|
526
270
|
}
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
if (skill < rule.skillRequired) {
|
|
546
|
-
return false;
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
return true;
|
|
550
|
-
}
|
|
551
|
-
salvageItem(itemId, _playerId, quantity = 1) {
|
|
552
|
-
const rule = this.salvageRules.get(itemId);
|
|
553
|
-
if (!rule) {
|
|
554
|
-
return null;
|
|
555
|
-
}
|
|
556
|
-
// Consume items
|
|
271
|
+
}
|
|
272
|
+
// ─── Runtime: Crafting ─────────────────────────────────
|
|
273
|
+
startCrafting(recipeId, playerId, quantity = 1) {
|
|
274
|
+
const recipe = this.recipes.get(recipeId);
|
|
275
|
+
if (!recipe) {
|
|
276
|
+
return null;
|
|
277
|
+
}
|
|
278
|
+
const check = this.canCraft(recipeId, playerId, quantity);
|
|
279
|
+
if (!check.canCraft) {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
for (const ingredient of recipe.ingredients) {
|
|
283
|
+
if (!ingredient.isConsumed) {
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
const required = ingredient.amount * quantity;
|
|
287
|
+
const itemIds = [ingredient.itemId, ...ingredient.alternativeIds ?? []];
|
|
288
|
+
for (const itemId of itemIds) {
|
|
557
289
|
const available = this.playerInventory.get(itemId) ?? 0;
|
|
558
|
-
if (available
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
this.
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
290
|
+
if (available >= required) {
|
|
291
|
+
this.playerInventory.set(itemId, available - required);
|
|
292
|
+
break;
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
const now = Date.now();
|
|
297
|
+
const craftingTime = recipe.craftingTime * 1e3 * quantity;
|
|
298
|
+
const progress = {
|
|
299
|
+
id: `progress_${Date.now()}`,
|
|
300
|
+
recipeId,
|
|
301
|
+
playerId,
|
|
302
|
+
startedAt: now,
|
|
303
|
+
completesAt: now + craftingTime,
|
|
304
|
+
quantity,
|
|
305
|
+
isPaused: false,
|
|
306
|
+
accumulatedTime: 0,
|
|
307
|
+
cancelled: false
|
|
308
|
+
};
|
|
309
|
+
this.activeProgress.set(progress.id, progress);
|
|
310
|
+
this.onCraftingStarted?.(progress);
|
|
311
|
+
if (recipe.craftingTime === 0) {
|
|
312
|
+
this.completeCrafting(progress.id);
|
|
313
|
+
}
|
|
314
|
+
return progress;
|
|
315
|
+
}
|
|
316
|
+
updateCraftingProgress(_deltaTime) {
|
|
317
|
+
const now = Date.now();
|
|
318
|
+
for (const [progressId, progress] of this.activeProgress) {
|
|
319
|
+
if (progress.isPaused || progress.cancelled) {
|
|
320
|
+
continue;
|
|
321
|
+
}
|
|
322
|
+
const recipe = this.recipes.get(progress.recipeId);
|
|
323
|
+
if (!recipe) {
|
|
324
|
+
continue;
|
|
325
|
+
}
|
|
326
|
+
if (now >= progress.completesAt) {
|
|
327
|
+
this.completeCrafting(progressId);
|
|
328
|
+
} else {
|
|
329
|
+
const totalTime = progress.completesAt - progress.startedAt;
|
|
330
|
+
const elapsed = now - progress.startedAt + progress.accumulatedTime;
|
|
331
|
+
const percent = Math.min(1, elapsed / totalTime);
|
|
332
|
+
this.onCraftingProgress?.(progress, percent);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
completeCrafting(progressId) {
|
|
337
|
+
const progress = this.activeProgress.get(progressId);
|
|
338
|
+
if (!progress) {
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
341
|
+
const recipe = this.recipes.get(progress.recipeId);
|
|
342
|
+
if (!recipe) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
const quality = this.determineQuality(recipe, progress.playerId);
|
|
346
|
+
this.onQualityDetermined?.(recipe, quality, []);
|
|
347
|
+
const outputs = [];
|
|
348
|
+
for (const output of recipe.outputs) {
|
|
349
|
+
if (Math.random() <= output.chance) {
|
|
350
|
+
const baseAmount = Math.floor(Math.random() * (output.maxAmount - output.minAmount + 1) + output.minAmount) * progress.quantity;
|
|
351
|
+
let finalAmount = baseAmount;
|
|
352
|
+
if (output.bonusFromSkill && recipe.skillId) {
|
|
353
|
+
const skill = this.playerSkills.get(recipe.skillId) ?? 0;
|
|
354
|
+
finalAmount += Math.floor(skill * output.bonusFromSkill);
|
|
355
|
+
}
|
|
356
|
+
const current = this.playerInventory.get(output.itemId) ?? 0;
|
|
357
|
+
this.playerInventory.set(output.itemId, current + finalAmount);
|
|
358
|
+
outputs.push({ ...output, minAmount: finalAmount, maxAmount: finalAmount });
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (recipe.byproducts) {
|
|
362
|
+
for (const byproduct of recipe.byproducts) {
|
|
363
|
+
if (Math.random() <= byproduct.chance) {
|
|
364
|
+
const amount = Math.floor(
|
|
365
|
+
Math.random() * (byproduct.maxAmount - byproduct.minAmount + 1) + byproduct.minAmount
|
|
366
|
+
) * progress.quantity;
|
|
367
|
+
const current = this.playerInventory.get(byproduct.itemId) ?? 0;
|
|
368
|
+
this.playerInventory.set(byproduct.itemId, current + amount);
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
if (recipe.skillId && recipe.experienceGained > 0) {
|
|
373
|
+
const totalXp = recipe.experienceGained * progress.quantity;
|
|
374
|
+
this.onExperienceGained?.(recipe.skillId, totalXp);
|
|
375
|
+
}
|
|
376
|
+
this.activeProgress.delete(progressId);
|
|
377
|
+
this.onCraftingCompleted?.(recipe, outputs, quality);
|
|
378
|
+
}
|
|
379
|
+
determineQuality(recipe, _playerId) {
|
|
380
|
+
const qualities = [
|
|
381
|
+
"poor",
|
|
382
|
+
"normal",
|
|
383
|
+
"fine",
|
|
384
|
+
"superior",
|
|
385
|
+
"masterwork",
|
|
386
|
+
"legendary"
|
|
387
|
+
];
|
|
388
|
+
const baseIndex = qualities.indexOf(recipe.baseQuality);
|
|
389
|
+
let qualityScore = baseIndex;
|
|
390
|
+
for (const factor of recipe.qualityFactors) {
|
|
391
|
+
switch (factor.type) {
|
|
392
|
+
case "skill":
|
|
393
|
+
if (recipe.skillId) {
|
|
394
|
+
const skill = this.playerSkills.get(recipe.skillId) ?? 0;
|
|
395
|
+
qualityScore += skill / 100 * factor.weight;
|
|
396
|
+
}
|
|
397
|
+
break;
|
|
398
|
+
case "random":
|
|
399
|
+
qualityScore += (Math.random() - 0.5) * factor.weight;
|
|
400
|
+
break;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
const finalIndex = Math.max(0, Math.min(qualities.length - 1, Math.round(qualityScore)));
|
|
404
|
+
return qualities[finalIndex];
|
|
405
|
+
}
|
|
406
|
+
pauseCrafting(progressId) {
|
|
407
|
+
const progress = this.activeProgress.get(progressId);
|
|
408
|
+
if (!progress || progress.isPaused) {
|
|
409
|
+
return false;
|
|
410
|
+
}
|
|
411
|
+
progress.isPaused = true;
|
|
412
|
+
progress.pausedAt = Date.now();
|
|
413
|
+
progress.accumulatedTime += progress.pausedAt - progress.startedAt;
|
|
414
|
+
return true;
|
|
415
|
+
}
|
|
416
|
+
resumeCrafting(progressId) {
|
|
417
|
+
const progress = this.activeProgress.get(progressId);
|
|
418
|
+
if (!progress || !progress.isPaused) {
|
|
419
|
+
return false;
|
|
420
|
+
}
|
|
421
|
+
const now = Date.now();
|
|
422
|
+
const remainingTime = progress.completesAt - progress.startedAt - progress.accumulatedTime;
|
|
423
|
+
progress.isPaused = false;
|
|
424
|
+
progress.startedAt = now;
|
|
425
|
+
progress.completesAt = now + remainingTime;
|
|
426
|
+
progress.pausedAt = void 0;
|
|
427
|
+
return true;
|
|
428
|
+
}
|
|
429
|
+
cancelCrafting(progressId, refundIngredients = false) {
|
|
430
|
+
const progress = this.activeProgress.get(progressId);
|
|
431
|
+
if (!progress) {
|
|
432
|
+
return false;
|
|
433
|
+
}
|
|
434
|
+
progress.cancelled = true;
|
|
435
|
+
if (refundIngredients) {
|
|
436
|
+
const recipe = this.recipes.get(progress.recipeId);
|
|
437
|
+
if (recipe) {
|
|
691
438
|
for (const ingredient of recipe.ingredients) {
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
439
|
+
if (!ingredient.isConsumed) {
|
|
440
|
+
continue;
|
|
441
|
+
}
|
|
442
|
+
const amount = ingredient.amount * progress.quantity;
|
|
443
|
+
const current = this.playerInventory.get(ingredient.itemId) ?? 0;
|
|
444
|
+
this.playerInventory.set(ingredient.itemId, current + amount);
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
this.activeProgress.delete(progressId);
|
|
449
|
+
return true;
|
|
450
|
+
}
|
|
451
|
+
// ─── Crafting Queue ────────────────────────────────────
|
|
452
|
+
addToQueue(playerId, recipeId, quantity, priority = 0) {
|
|
453
|
+
if (!this.craftingQueues.has(playerId)) {
|
|
454
|
+
this.craftingQueues.set(playerId, []);
|
|
455
|
+
}
|
|
456
|
+
const queue = this.craftingQueues.get(playerId);
|
|
457
|
+
queue.push({ recipeId, quantity, priority });
|
|
458
|
+
queue.sort((a, b) => b.priority - a.priority);
|
|
459
|
+
return true;
|
|
460
|
+
}
|
|
461
|
+
getQueue(playerId) {
|
|
462
|
+
return this.craftingQueues.get(playerId) ?? [];
|
|
463
|
+
}
|
|
464
|
+
processQueueItem(playerId) {
|
|
465
|
+
const queue = this.craftingQueues.get(playerId);
|
|
466
|
+
if (!queue || queue.length === 0) {
|
|
467
|
+
return null;
|
|
468
|
+
}
|
|
469
|
+
const item = queue.shift();
|
|
470
|
+
return this.startCrafting(item.recipeId, playerId, item.quantity);
|
|
471
|
+
}
|
|
472
|
+
// ─── Discovery ─────────────────────────────────────────
|
|
473
|
+
discoverRecipe(recipeId, playerId) {
|
|
474
|
+
const recipe = this.recipes.get(recipeId);
|
|
475
|
+
if (!recipe) {
|
|
476
|
+
return false;
|
|
477
|
+
}
|
|
478
|
+
if (this.discoveredRecipes.has(recipeId)) {
|
|
479
|
+
return false;
|
|
480
|
+
}
|
|
481
|
+
this.discoveredRecipes.add(recipeId);
|
|
482
|
+
recipe.discoveredBy.add(playerId);
|
|
483
|
+
this.onRecipeDiscovered?.(recipe, playerId);
|
|
484
|
+
return true;
|
|
485
|
+
}
|
|
486
|
+
isRecipeDiscovered(recipeId) {
|
|
487
|
+
const recipe = this.recipes.get(recipeId);
|
|
488
|
+
if (!recipe) {
|
|
489
|
+
return false;
|
|
490
|
+
}
|
|
491
|
+
if (recipe.discoveryMethod === "known") {
|
|
492
|
+
return true;
|
|
493
|
+
}
|
|
494
|
+
return this.discoveredRecipes.has(recipeId);
|
|
495
|
+
}
|
|
496
|
+
// ─── Salvage ───────────────────────────────────────────
|
|
497
|
+
canSalvage(itemId, _playerId) {
|
|
498
|
+
const rule = this.salvageRules.get(itemId);
|
|
499
|
+
if (!rule) {
|
|
500
|
+
return false;
|
|
501
|
+
}
|
|
502
|
+
if (rule.skillRequired) {
|
|
503
|
+
const skill = this.playerSkills.get("salvaging") ?? 0;
|
|
504
|
+
if (skill < rule.skillRequired) {
|
|
505
|
+
return false;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
return true;
|
|
509
|
+
}
|
|
510
|
+
salvageItem(itemId, _playerId, quantity = 1) {
|
|
511
|
+
const rule = this.salvageRules.get(itemId);
|
|
512
|
+
if (!rule) {
|
|
513
|
+
return null;
|
|
514
|
+
}
|
|
515
|
+
const available = this.playerInventory.get(itemId) ?? 0;
|
|
516
|
+
if (available < quantity) {
|
|
517
|
+
return null;
|
|
518
|
+
}
|
|
519
|
+
this.playerInventory.set(itemId, available - quantity);
|
|
520
|
+
const outputs = [];
|
|
521
|
+
for (const output of rule.outputs) {
|
|
522
|
+
for (let i = 0; i < quantity; i++) {
|
|
523
|
+
if (Math.random() <= output.chance) {
|
|
524
|
+
const amount = Math.floor(
|
|
525
|
+
Math.random() * (output.maxAmount - output.minAmount + 1) + output.minAmount
|
|
526
|
+
);
|
|
527
|
+
const current = this.playerInventory.get(output.itemId) ?? 0;
|
|
528
|
+
this.playerInventory.set(output.itemId, current + amount);
|
|
529
|
+
outputs.push({ ...output, minAmount: amount, maxAmount: amount });
|
|
530
|
+
}
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
return outputs;
|
|
534
|
+
}
|
|
535
|
+
// ─── Player State ──────────────────────────────────────
|
|
536
|
+
setPlayerSkill(skillId, level) {
|
|
537
|
+
this.playerSkills.set(skillId, level);
|
|
538
|
+
}
|
|
539
|
+
setPlayerItem(itemId, count) {
|
|
540
|
+
this.playerInventory.set(itemId, count);
|
|
541
|
+
}
|
|
542
|
+
getPlayerInventory() {
|
|
543
|
+
return new Map(this.playerInventory);
|
|
544
|
+
}
|
|
545
|
+
// ─── Callbacks ─────────────────────────────────────────
|
|
546
|
+
setOnRecipeDiscovered(callback) {
|
|
547
|
+
this.onRecipeDiscovered = callback;
|
|
548
|
+
}
|
|
549
|
+
setOnCraftingStarted(callback) {
|
|
550
|
+
this.onCraftingStarted = callback;
|
|
551
|
+
}
|
|
552
|
+
setOnCraftingProgress(callback) {
|
|
553
|
+
this.onCraftingProgress = callback;
|
|
554
|
+
}
|
|
555
|
+
setOnCraftingCompleted(callback) {
|
|
556
|
+
this.onCraftingCompleted = callback;
|
|
557
|
+
}
|
|
558
|
+
setOnCraftingFailed(callback) {
|
|
559
|
+
this.onCraftingFailed = callback;
|
|
560
|
+
}
|
|
561
|
+
setOnQualityDetermined(callback) {
|
|
562
|
+
this.onQualityDetermined = callback;
|
|
563
|
+
}
|
|
564
|
+
setOnExperienceGained(callback) {
|
|
565
|
+
this.onExperienceGained = callback;
|
|
566
|
+
}
|
|
567
|
+
// ─── Queries ───────────────────────────────────────────
|
|
568
|
+
getActiveProgress() {
|
|
569
|
+
return Array.from(this.activeProgress.values());
|
|
570
|
+
}
|
|
571
|
+
getProgressForPlayer(playerId) {
|
|
572
|
+
return this.getActiveProgress().filter((p) => p.playerId === playerId);
|
|
573
|
+
}
|
|
574
|
+
searchRecipes(query) {
|
|
575
|
+
const lowerQuery = query.toLowerCase();
|
|
576
|
+
return this.getAllRecipes().filter(
|
|
577
|
+
(r) => r.name.toLowerCase().includes(lowerQuery) || r.description.toLowerCase().includes(lowerQuery) || r.tags.some((t) => t.toLowerCase().includes(lowerQuery))
|
|
578
|
+
);
|
|
579
|
+
}
|
|
580
|
+
getRecipesByTags(tags) {
|
|
581
|
+
return this.getAllRecipes().filter((r) => tags.some((t) => r.tags.includes(t)));
|
|
582
|
+
}
|
|
583
|
+
// ─── Serialization ─────────────────────────────────────
|
|
584
|
+
exportRecipes() {
|
|
585
|
+
const data = {
|
|
586
|
+
recipes: Array.from(this.recipes.entries()).map(([_id, recipe]) => ({
|
|
587
|
+
...recipe,
|
|
588
|
+
discoveredBy: Array.from(recipe.discoveredBy)
|
|
589
|
+
})),
|
|
590
|
+
stations: Array.from(this.stations.entries()),
|
|
591
|
+
chains: Array.from(this.chains.entries()),
|
|
592
|
+
salvageRules: Array.from(this.salvageRules.entries())
|
|
593
|
+
};
|
|
594
|
+
return JSON.stringify(data, null, 2);
|
|
595
|
+
}
|
|
596
|
+
importRecipes(json) {
|
|
597
|
+
try {
|
|
598
|
+
const data = JSON.parse(json);
|
|
599
|
+
this.recipes = new Map(
|
|
600
|
+
data.recipes.map((r) => [
|
|
601
|
+
r.id,
|
|
602
|
+
{ ...r, discoveredBy: new Set(r.discoveredBy) }
|
|
603
|
+
])
|
|
604
|
+
);
|
|
605
|
+
this.stations = new Map(data.stations);
|
|
606
|
+
this.chains = new Map(data.chains);
|
|
607
|
+
this.salvageRules = new Map(data.salvageRules);
|
|
608
|
+
return true;
|
|
609
|
+
} catch {
|
|
610
|
+
return false;
|
|
611
|
+
}
|
|
612
|
+
}
|
|
613
|
+
exportProgress() {
|
|
614
|
+
const data = {
|
|
615
|
+
activeProgress: Array.from(this.activeProgress.entries()),
|
|
616
|
+
craftingQueues: Array.from(this.craftingQueues.entries()),
|
|
617
|
+
discoveredRecipes: Array.from(this.discoveredRecipes)
|
|
618
|
+
};
|
|
619
|
+
return JSON.stringify(data);
|
|
620
|
+
}
|
|
621
|
+
importProgress(json) {
|
|
622
|
+
try {
|
|
623
|
+
const data = JSON.parse(json);
|
|
624
|
+
this.activeProgress = new Map(data.activeProgress);
|
|
625
|
+
this.craftingQueues = new Map(data.craftingQueues);
|
|
626
|
+
this.discoveredRecipes = new Set(data.discoveredRecipes);
|
|
627
|
+
return true;
|
|
628
|
+
} catch {
|
|
629
|
+
return false;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
// ─── Graph Visualization ───────────────────────────────
|
|
633
|
+
getRecipeGraph(recipeId) {
|
|
634
|
+
const recipe = this.recipes.get(recipeId);
|
|
635
|
+
if (!recipe) {
|
|
636
|
+
return null;
|
|
637
|
+
}
|
|
638
|
+
const nodes = [];
|
|
639
|
+
const edges = [];
|
|
640
|
+
nodes.push({
|
|
641
|
+
id: recipe.id,
|
|
642
|
+
type: "recipe",
|
|
643
|
+
name: recipe.name,
|
|
644
|
+
x: 300,
|
|
645
|
+
y: 150
|
|
646
|
+
});
|
|
647
|
+
let y = 50;
|
|
648
|
+
for (const ingredient of recipe.ingredients) {
|
|
649
|
+
nodes.push({
|
|
650
|
+
id: `ing_${ingredient.itemId}`,
|
|
651
|
+
type: "ingredient",
|
|
652
|
+
name: ingredient.itemId,
|
|
653
|
+
amount: ingredient.amount,
|
|
654
|
+
x: 100,
|
|
655
|
+
y
|
|
656
|
+
});
|
|
657
|
+
edges.push({
|
|
658
|
+
id: `edge_${ingredient.itemId}_${recipe.id}`,
|
|
659
|
+
from: `ing_${ingredient.itemId}`,
|
|
660
|
+
to: recipe.id,
|
|
661
|
+
type: ingredient.isConsumed ? "consumed" : "catalyst"
|
|
662
|
+
});
|
|
663
|
+
y += 60;
|
|
664
|
+
}
|
|
665
|
+
y = 50;
|
|
666
|
+
for (const output of recipe.outputs) {
|
|
667
|
+
nodes.push({
|
|
668
|
+
id: `out_${output.itemId}`,
|
|
669
|
+
type: "output",
|
|
670
|
+
name: output.itemId,
|
|
671
|
+
amount: output.minAmount === output.maxAmount ? output.minAmount : `${output.minAmount}-${output.maxAmount}`,
|
|
672
|
+
x: 500,
|
|
673
|
+
y
|
|
674
|
+
});
|
|
675
|
+
edges.push({
|
|
676
|
+
id: `edge_${recipe.id}_${output.itemId}`,
|
|
677
|
+
from: recipe.id,
|
|
678
|
+
to: `out_${output.itemId}`,
|
|
679
|
+
type: "produces",
|
|
680
|
+
chance: output.chance
|
|
681
|
+
});
|
|
682
|
+
y += 60;
|
|
683
|
+
}
|
|
684
|
+
return { nodes, edges };
|
|
685
|
+
}
|
|
732
686
|
}
|
|
733
|
-
// ============================================================
|
|
734
|
-
// Factory Functions
|
|
735
|
-
// ============================================================
|
|
736
687
|
function createCraftingEditor() {
|
|
737
|
-
|
|
688
|
+
return new CraftingEditor();
|
|
738
689
|
}
|
|
739
690
|
function createIngredient(itemId, amount, isConsumed = true) {
|
|
740
|
-
|
|
691
|
+
return { itemId, amount, isConsumed };
|
|
741
692
|
}
|
|
742
693
|
function createOutput(itemId, amount, chance = 1) {
|
|
743
|
-
|
|
694
|
+
return { itemId, minAmount: amount, maxAmount: amount, chance };
|
|
744
695
|
}
|
|
745
|
-
|
|
746
696
|
exports.CraftingEditor = CraftingEditor;
|
|
747
697
|
exports.createCraftingEditor = createCraftingEditor;
|
|
748
698
|
exports.createIngredient = createIngredient;
|