@jgengine/core 0.10.0 → 0.12.0
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 +39 -2
- package/LICENSE +203 -661
- package/README.md +1 -1
- package/dist/ai/crowd.d.ts +55 -0
- package/dist/ai/crowd.js +114 -0
- package/dist/ai/flock.d.ts +5 -2
- package/dist/ai/flock.js +5 -2
- package/dist/ai/groupAssist.d.ts +1 -0
- package/dist/ai/groupAssist.js +1 -0
- package/dist/ai/heatSystem.d.ts +76 -0
- package/dist/ai/heatSystem.js +97 -0
- package/dist/ai/interestScheduler.d.ts +107 -0
- package/dist/ai/interestScheduler.js +118 -0
- package/dist/ai/jobBoard.d.ts +1 -0
- package/dist/ai/jobBoard.js +1 -0
- package/dist/ai/laneSelect.d.ts +5 -2
- package/dist/ai/laneSelect.js +5 -2
- package/dist/ai/mobBrain.d.ts +1 -0
- package/dist/ai/mobBrain.js +1 -0
- package/dist/ai/populationDirector.d.ts +103 -0
- package/dist/ai/populationDirector.js +190 -0
- package/dist/ai/pursuit.d.ts +56 -0
- package/dist/ai/pursuit.js +53 -0
- package/dist/ai/spawnDirector.d.ts +7 -2
- package/dist/ai/spawnDirector.js +18 -15
- package/dist/ai/spawnPoint.d.ts +3 -1
- package/dist/ai/spawnPoint.js +3 -1
- package/dist/ai/targetAcquisition.d.ts +84 -0
- package/dist/ai/targetAcquisition.js +92 -0
- package/dist/anim/easing.d.ts +19 -0
- package/dist/anim/easing.js +19 -0
- package/dist/anim/oscillator.d.ts +12 -0
- package/dist/anim/oscillator.js +25 -0
- package/dist/area/areaEffectField.d.ts +127 -0
- package/dist/area/areaEffectField.js +175 -0
- package/dist/area/stackPolicy.d.ts +47 -0
- package/dist/area/stackPolicy.js +99 -0
- package/dist/authoring.d.ts +2 -1
- package/dist/authoring.js +2 -1
- package/dist/board/laneBoard.d.ts +13 -0
- package/dist/board/laneBoard.js +13 -0
- package/dist/board/timelineBoard.d.ts +10 -0
- package/dist/board/timelineBoard.js +10 -0
- package/dist/combat/abilityKit.d.ts +18 -0
- package/dist/combat/abilityKit.js +24 -9
- package/dist/combat/animationState.d.ts +5 -0
- package/dist/combat/animationState.js +5 -0
- package/dist/combat/breakMeters.d.ts +10 -0
- package/dist/combat/breakMeters.js +10 -0
- package/dist/combat/castRunner.d.ts +5 -0
- package/dist/combat/castRunner.js +5 -0
- package/dist/combat/comboPoints.d.ts +5 -0
- package/dist/combat/comboPoints.js +5 -0
- package/dist/combat/comboString.d.ts +5 -0
- package/dist/combat/comboString.js +5 -0
- package/dist/combat/damageInterceptors.d.ts +192 -0
- package/dist/combat/damageInterceptors.js +251 -0
- package/dist/combat/damageMatchup.d.ts +68 -0
- package/dist/combat/damageMatchup.js +42 -0
- package/dist/combat/damageResolution.d.ts +63 -0
- package/dist/combat/damageResolution.js +50 -0
- package/dist/combat/death.d.ts +7 -1
- package/dist/combat/death.js +5 -0
- package/dist/combat/deathReason.d.ts +14 -0
- package/dist/combat/deathReason.js +1 -0
- package/dist/combat/defensiveWindow.d.ts +5 -0
- package/dist/combat/defensiveWindow.js +5 -0
- package/dist/combat/dotField.d.ts +5 -1
- package/dist/combat/dotField.js +5 -1
- package/dist/combat/downed.d.ts +5 -0
- package/dist/combat/downed.js +5 -0
- package/dist/combat/effects.d.ts +5 -0
- package/dist/combat/effects.js +5 -0
- package/dist/combat/encounterSequence.d.ts +258 -0
- package/dist/combat/encounterSequence.js +426 -0
- package/dist/combat/hitReaction.d.ts +57 -1
- package/dist/combat/hitReaction.js +45 -5
- package/dist/combat/magazine.d.ts +54 -0
- package/dist/combat/magazine.js +96 -0
- package/dist/combat/projectiles.d.ts +5 -0
- package/dist/combat/projectiles.js +32 -14
- package/dist/combat/receivedDamage.d.ts +117 -0
- package/dist/combat/receivedDamage.js +92 -0
- package/dist/combat/regenShield.d.ts +5 -1
- package/dist/combat/regenShield.js +5 -1
- package/dist/combat/renderCues.d.ts +51 -0
- package/dist/combat/renderCues.js +44 -0
- package/dist/combat/resourcePool.d.ts +5 -0
- package/dist/combat/resourcePool.js +5 -0
- package/dist/combat/rewardAllocation.d.ts +121 -0
- package/dist/combat/rewardAllocation.js +251 -0
- package/dist/combat/shotOrigin.d.ts +18 -1
- package/dist/combat/shotOrigin.js +39 -0
- package/dist/combat/statusApplication.d.ts +96 -0
- package/dist/combat/statusApplication.js +81 -0
- package/dist/combat/telegraph.d.ts +11 -2
- package/dist/combat/telegraph.js +11 -2
- package/dist/combat/thresholdCrossings.d.ts +85 -0
- package/dist/combat/thresholdCrossings.js +116 -0
- package/dist/combat.d.ts +35 -0
- package/dist/combat.js +35 -0
- package/dist/commands/commandRegistry.d.ts +11 -0
- package/dist/commands/commandRegistry.js +9 -2
- package/dist/crafting/crop.d.ts +18 -0
- package/dist/crafting/crop.js +18 -0
- package/dist/crafting/production.d.ts +5 -0
- package/dist/crafting/production.js +5 -0
- package/dist/devtools/controls.d.ts +38 -0
- package/dist/devtools/controls.js +181 -0
- package/dist/devtools/devtools.d.ts +5 -197
- package/dist/devtools/devtools.js +38 -774
- package/dist/devtools/discover.d.ts +32 -0
- package/dist/devtools/discover.js +240 -0
- package/dist/devtools/fallbackSeams.d.ts +50 -0
- package/dist/devtools/fallbackSeams.js +111 -0
- package/dist/devtools/frame.d.ts +15 -0
- package/dist/devtools/frame.js +247 -0
- package/dist/devtools/logs.d.ts +15 -0
- package/dist/devtools/logs.js +86 -0
- package/dist/devtools/overrides.d.ts +16 -0
- package/dist/devtools/overrides.js +66 -0
- package/dist/devtools/rewriteTunables.d.ts +17 -0
- package/dist/devtools/rewriteTunables.js +276 -0
- package/dist/devtools/saveEndpoint.d.ts +46 -0
- package/dist/devtools/saveEndpoint.js +48 -0
- package/dist/devtools/transformTunables.d.ts +3 -0
- package/dist/devtools/transformTunables.js +3 -0
- package/dist/devtools/tunableSchema.d.ts +31 -0
- package/dist/devtools/tunableSchema.js +31 -0
- package/dist/devtools/types.d.ts +212 -0
- package/dist/devtools/types.js +1 -0
- package/dist/economy/auctionBook.d.ts +122 -0
- package/dist/economy/auctionBook.js +213 -0
- package/dist/economy/currency.d.ts +12 -1
- package/dist/economy/currency.js +12 -1
- package/dist/economy/listingBook.d.ts +91 -0
- package/dist/economy/listingBook.js +144 -0
- package/dist/economy/priceHistory.d.ts +44 -0
- package/dist/economy/priceHistory.js +89 -0
- package/dist/economy/resourceLedger.d.ts +222 -0
- package/dist/economy/resourceLedger.js +353 -0
- package/dist/economy/sharedWallet.d.ts +14 -0
- package/dist/economy/sharedWallet.js +14 -0
- package/dist/economy/techTree.d.ts +12 -0
- package/dist/economy/techTree.js +12 -0
- package/dist/economy/unlockPoints.d.ts +92 -0
- package/dist/economy/unlockPoints.js +103 -0
- package/dist/economy/wallet.d.ts +26 -2
- package/dist/economy/wallet.js +35 -6
- package/dist/editor/commandApply.d.ts +5 -0
- package/dist/editor/commandApply.js +755 -0
- package/dist/editor/commands.d.ts +235 -7
- package/dist/editor/commands.js +82 -124
- package/dist/editor/directives.d.ts +94 -0
- package/dist/editor/directives.js +206 -0
- package/dist/editor/document.d.ts +194 -13
- package/dist/editor/document.js +1166 -19
- package/dist/editor/entityCatalog.d.ts +42 -0
- package/dist/editor/entityCatalog.js +101 -0
- package/dist/editor/environment.d.ts +74 -0
- package/dist/editor/environment.js +169 -0
- package/dist/editor/grid.d.ts +229 -0
- package/dist/editor/grid.js +366 -0
- package/dist/editor/gridAdapters.d.ts +80 -0
- package/dist/editor/gridAdapters.js +134 -0
- package/dist/editor/index.d.ts +98 -6
- package/dist/editor/index.js +13 -2
- package/dist/editor/liveSync.d.ts +127 -0
- package/dist/editor/liveSync.js +249 -0
- package/dist/editor/minimap.d.ts +31 -0
- package/dist/editor/minimap.js +73 -0
- package/dist/editor/runtimeInspector.d.ts +88 -0
- package/dist/editor/runtimeInspector.js +239 -0
- package/dist/editor/streamer.d.ts +66 -0
- package/dist/editor/streamer.js +68 -0
- package/dist/editor/types.d.ts +250 -1
- package/dist/editor/world.d.ts +136 -0
- package/dist/editor/world.js +303 -0
- package/dist/faction/reputation.d.ts +5 -0
- package/dist/faction/reputation.js +5 -0
- package/dist/format/distance.d.ts +17 -0
- package/dist/format/distance.js +18 -0
- package/dist/format/duration.d.ts +27 -0
- package/dist/format/duration.js +45 -0
- package/dist/format/speed.d.ts +17 -0
- package/dist/format/speed.js +25 -0
- package/dist/game/breeding.d.ts +161 -0
- package/dist/game/breeding.js +181 -0
- package/dist/game/cameraConfig.d.ts +451 -0
- package/dist/game/cameraConfig.js +1 -0
- package/dist/game/connectedPlayers.d.ts +6 -4
- package/dist/game/connectedPlayers.js +2 -2
- package/dist/game/cosmetics.d.ts +9 -0
- package/dist/game/cosmetics.js +16 -0
- package/dist/game/defineGame.d.ts +110 -5
- package/dist/game/defineGame.js +49 -4
- package/dist/game/defineSystem.d.ts +90 -0
- package/dist/game/defineSystem.js +47 -0
- package/dist/game/dialogue.d.ts +33 -0
- package/dist/game/dialogue.js +21 -0
- package/dist/game/events.d.ts +63 -13
- package/dist/game/events.js +5 -0
- package/dist/game/feed.d.ts +33 -0
- package/dist/game/feed.js +35 -2
- package/dist/game/gamePhase.d.ts +11 -0
- package/dist/game/gamePhase.js +16 -0
- package/dist/game/leaderboard.d.ts +5 -0
- package/dist/game/leaderboard.js +5 -0
- package/dist/game/loadout.d.ts +5 -0
- package/dist/game/loadout.js +5 -0
- package/dist/game/lootFilter.d.ts +2 -0
- package/dist/game/lootFilter.js +2 -0
- package/dist/game/lootPipeline.d.ts +164 -0
- package/dist/game/lootPipeline.js +216 -0
- package/dist/game/lootTable.d.ts +19 -2
- package/dist/game/lootTable.js +15 -5
- package/dist/game/objectives.d.ts +43 -0
- package/dist/game/objectives.js +36 -0
- package/dist/game/paramLayers.d.ts +148 -0
- package/dist/game/paramLayers.js +185 -0
- package/dist/game/ping.d.ts +5 -0
- package/dist/game/ping.js +5 -0
- package/dist/game/playableGame.d.ts +116 -432
- package/dist/game/playableGame.js +1 -1
- package/dist/game/progression.d.ts +35 -0
- package/dist/game/progression.js +19 -0
- package/dist/game/quest.d.ts +8 -0
- package/dist/game/quest.js +30 -3
- package/dist/game/race.d.ts +141 -0
- package/dist/game/race.js +169 -0
- package/dist/game/recordBook.d.ts +3 -1
- package/dist/game/recordBook.js +4 -1
- package/dist/game/ruleSelection.d.ts +75 -0
- package/dist/game/ruleSelection.js +127 -0
- package/dist/game/runDraft.d.ts +5 -0
- package/dist/game/runDraft.js +5 -0
- package/dist/game/saveStore.d.ts +111 -0
- package/dist/game/saveStore.js +312 -0
- package/dist/game/snapshotHistory.d.ts +67 -0
- package/dist/game/snapshotHistory.js +95 -0
- package/dist/game/social.d.ts +38 -1
- package/dist/game/social.js +71 -0
- package/dist/game/spawnPoints.d.ts +5 -0
- package/dist/game/spawnPoints.js +5 -0
- package/dist/game/systemRuntime.d.ts +50 -0
- package/dist/game/systemRuntime.js +157 -0
- package/dist/game/systemSchedule.d.ts +72 -0
- package/dist/game/systemSchedule.js +242 -0
- package/dist/game/toasts.d.ts +43 -0
- package/dist/game/toasts.js +44 -0
- package/dist/game/trade.d.ts +10 -0
- package/dist/game/trade.js +10 -0
- package/dist/game/tribe.d.ts +184 -0
- package/dist/game/tribe.js +432 -0
- package/dist/game/unlocks.d.ts +8 -0
- package/dist/game/unlocks.js +16 -0
- package/dist/game/vfxInstance.d.ts +138 -0
- package/dist/game/vfxInstance.js +96 -0
- package/dist/game/worldItem.d.ts +17 -4
- package/dist/game/worldItem.js +17 -4
- package/dist/gameplay.d.ts +93 -0
- package/dist/gameplay.js +93 -0
- package/dist/index.d.ts +5 -14
- package/dist/index.js +5 -14
- package/dist/input/actionBindings.d.ts +23 -6
- package/dist/input/actionBindings.js +23 -6
- package/dist/input/axisInput.d.ts +7 -2
- package/dist/input/axisInput.js +7 -2
- package/dist/input/controlGroups.d.ts +67 -0
- package/dist/input/controlGroups.js +41 -0
- package/dist/input/touchScheme.d.ts +82 -6
- package/dist/input/touchScheme.js +123 -10
- package/dist/interaction/lockpick.d.ts +61 -0
- package/dist/interaction/lockpick.js +168 -0
- package/dist/interaction/proximityPrompt.d.ts +2 -0
- package/dist/interaction/proximityPrompt.js +2 -0
- package/dist/interaction/qte.d.ts +5 -0
- package/dist/interaction/qte.js +5 -0
- package/dist/interaction/skillCheck.d.ts +5 -0
- package/dist/interaction/skillCheck.js +5 -0
- package/dist/inventory/encumbrance.d.ts +69 -0
- package/dist/inventory/encumbrance.js +68 -0
- package/dist/inventory/inventoryModel.d.ts +12 -0
- package/dist/inventory/inventoryModel.js +12 -0
- package/dist/inventory/shapedGrid.d.ts +16 -0
- package/dist/inventory/shapedGrid.js +16 -0
- package/dist/inventory/slotModel.d.ts +10 -0
- package/dist/inventory/slotModel.js +10 -0
- package/dist/item/durability.d.ts +5 -0
- package/dist/item/durability.js +6 -3
- package/dist/item/itemIdentity.d.ts +171 -0
- package/dist/item/itemIdentity.js +138 -0
- package/dist/item/itemInstanceRegistry.d.ts +32 -0
- package/dist/item/itemInstanceRegistry.js +34 -0
- package/dist/item/itemgen.d.ts +163 -0
- package/dist/item/itemgen.js +151 -0
- package/dist/item/modularItem.d.ts +5 -0
- package/dist/item/modularItem.js +5 -0
- package/dist/item/use.d.ts +5 -0
- package/dist/item/use.js +5 -0
- package/dist/item/useBehavior.d.ts +142 -0
- package/dist/item/useBehavior.js +105 -0
- package/dist/item/weapon.d.ts +5 -0
- package/dist/item/weapon.js +5 -0
- package/dist/math/scalar.d.ts +25 -0
- package/dist/math/scalar.js +47 -0
- package/dist/meta/changelog.d.ts +4 -1
- package/dist/meta/changelog.js +39 -2
- package/dist/movement/avoidance.d.ts +45 -0
- package/dist/movement/avoidance.js +123 -0
- package/dist/movement/cameraRig.d.ts +8 -0
- package/dist/movement/cameraRig.js +8 -0
- package/dist/movement/dash.d.ts +11 -0
- package/dist/movement/dash.js +11 -0
- package/dist/movement/formation.d.ts +135 -0
- package/dist/movement/formation.js +194 -0
- package/dist/movement/glideModel.d.ts +5 -0
- package/dist/movement/glideModel.js +5 -0
- package/dist/movement/grappleSwing.d.ts +5 -0
- package/dist/movement/grappleSwing.js +5 -0
- package/dist/movement/leaderTrail.d.ts +5 -0
- package/dist/movement/leaderTrail.js +5 -0
- package/dist/movement/movementModel.d.ts +50 -9
- package/dist/movement/movementModel.js +75 -29
- package/dist/movement/playerMovement.js +167 -12
- package/dist/movement/poseState.d.ts +13 -0
- package/dist/movement/poseState.js +16 -0
- package/dist/movement/steering.d.ts +8 -0
- package/dist/movement/steering.js +18 -0
- package/dist/multiplayer/combatSnapshot.d.ts +3 -0
- package/dist/multiplayer/combatSnapshot.js +16 -8
- package/dist/multiplayer/lagCompensation.d.ts +5 -0
- package/dist/multiplayer/lagCompensation.js +5 -0
- package/dist/multiplayer/presenceModel.d.ts +11 -1
- package/dist/multiplayer/presenceModel.js +17 -1
- package/dist/multiplayer/simultaneousCommit.d.ts +3 -0
- package/dist/multiplayer/simultaneousCommit.js +3 -0
- package/dist/multiplayer.d.ts +11 -0
- package/dist/multiplayer.js +11 -0
- package/dist/nav/pathFollow.d.ts +57 -0
- package/dist/nav/pathFollow.js +109 -0
- package/dist/orders/orderKinds.d.ts +156 -0
- package/dist/orders/orderKinds.js +197 -0
- package/dist/orders/orderQueue.d.ts +208 -0
- package/dist/orders/orderQueue.js +211 -0
- package/dist/physics/drivableVehicle.d.ts +31 -0
- package/dist/physics/drivableVehicle.js +16 -0
- package/dist/physics/flightDynamics.d.ts +82 -0
- package/dist/physics/flightDynamics.js +165 -0
- package/dist/physics/gravityField.d.ts +25 -0
- package/dist/physics/gravityField.js +41 -0
- package/dist/physics/kinematicVehicle.d.ts +108 -1
- package/dist/physics/kinematicVehicle.js +212 -15
- package/dist/physics/physicsWorld.d.ts +50 -12
- package/dist/physics/physicsWorld.js +120 -122
- package/dist/physics/radialImpulse.d.ts +25 -0
- package/dist/physics/radialImpulse.js +27 -0
- package/dist/physics/vehicleObstacles.d.ts +44 -0
- package/dist/physics/vehicleObstacles.js +115 -0
- package/dist/procedural.d.ts +3 -0
- package/dist/procedural.js +3 -0
- package/dist/progression/statGraph.d.ts +116 -0
- package/dist/progression/statGraph.js +318 -0
- package/dist/puzzle/cellGrid.d.ts +9 -0
- package/dist/puzzle/cellGrid.js +9 -0
- package/dist/puzzle/fallingPiece.d.ts +9 -0
- package/dist/puzzle/fallingPiece.js +9 -0
- package/dist/puzzle/nonogram.d.ts +39 -0
- package/dist/puzzle/nonogram.js +136 -0
- package/dist/random/nameGen.d.ts +5 -0
- package/dist/random/nameGen.js +5 -0
- package/dist/random/pick.d.ts +8 -0
- package/dist/random/pick.js +31 -0
- package/dist/random/rng.d.ts +26 -1
- package/dist/random/rng.js +32 -9
- package/dist/random/seedLink.d.ts +4 -0
- package/dist/random/seedLink.js +4 -0
- package/dist/relation/keyedValues.d.ts +54 -0
- package/dist/relation/keyedValues.js +115 -0
- package/dist/relation/thresholds.d.ts +62 -0
- package/dist/relation/thresholds.js +62 -0
- package/dist/render/color.d.ts +12 -0
- package/dist/render/color.js +26 -0
- package/dist/render/lookPreset.d.ts +41 -0
- package/dist/render/lookPreset.js +29 -0
- package/dist/render/postProcessing.d.ts +20 -0
- package/dist/render/postProcessing.js +21 -1
- package/dist/rules/predicate.d.ts +53 -0
- package/dist/rules/predicate.js +64 -0
- package/dist/rules/ruleEffects.d.ts +38 -0
- package/dist/rules/ruleEffects.js +37 -0
- package/dist/rules/triggeredRules.d.ts +160 -0
- package/dist/rules/triggeredRules.js +241 -0
- package/dist/runtime/adapter.d.ts +55 -3
- package/dist/runtime/adapter.js +57 -1
- package/dist/runtime/cameraDirector.d.ts +1 -0
- package/dist/runtime/cameraDirector.js +1 -0
- package/dist/runtime/commandRunner.d.ts +1 -0
- package/dist/runtime/commandRunner.js +1 -0
- package/dist/runtime/context/combat.d.ts +51 -0
- package/dist/runtime/context/combat.js +130 -0
- package/dist/runtime/context/combatFx.d.ts +23 -0
- package/dist/runtime/context/combatFx.js +161 -0
- package/dist/runtime/context/deathLoot.d.ts +30 -0
- package/dist/runtime/context/deathLoot.js +39 -0
- package/dist/runtime/context/player.d.ts +48 -0
- package/dist/runtime/context/player.js +125 -0
- package/dist/runtime/context/registries.d.ts +13 -0
- package/dist/runtime/context/registries.js +84 -0
- package/dist/runtime/context/scene.d.ts +59 -0
- package/dist/runtime/context/scene.js +291 -0
- package/dist/runtime/context/snapshotCodecs.d.ts +12 -0
- package/dist/runtime/context/snapshotCodecs.js +26 -0
- package/dist/runtime/context/worldItems.d.ts +21 -0
- package/dist/runtime/context/worldItems.js +37 -0
- package/dist/runtime/descriptors/baseline.d.ts +48 -0
- package/dist/runtime/descriptors/baseline.js +157 -0
- package/dist/runtime/descriptors/features.d.ts +79 -0
- package/dist/runtime/descriptors/features.js +299 -0
- package/dist/runtime/gameContext.d.ts +2 -327
- package/dist/runtime/gameContext.js +273 -778
- package/dist/runtime/gameContextTypes.d.ts +467 -0
- package/dist/runtime/gameContextTypes.js +1 -0
- package/dist/runtime/gameRuntime.d.ts +1 -0
- package/dist/runtime/gameRuntime.js +1 -0
- package/dist/runtime/headlessRunner.d.ts +62 -0
- package/dist/runtime/headlessRunner.js +45 -0
- package/dist/runtime/hostPersistence.d.ts +12 -0
- package/dist/runtime/hostPersistence.js +12 -0
- package/dist/runtime/hostPolicy.d.ts +51 -0
- package/dist/runtime/hostPolicy.js +68 -0
- package/dist/runtime/hostedGameRunner.d.ts +11 -4
- package/dist/runtime/hostedGameRunner.js +27 -3
- package/dist/runtime/hostedWorldSession.d.ts +15 -5
- package/dist/runtime/hostedWorldSession.js +12 -4
- package/dist/runtime/inputSnapshot.d.ts +8 -3
- package/dist/runtime/inputSnapshot.js +6 -2
- package/dist/runtime/motionIntents.d.ts +11 -2
- package/dist/runtime/motionIntents.js +16 -2
- package/dist/runtime/perContext.d.ts +15 -0
- package/dist/runtime/perContext.js +21 -0
- package/dist/runtime/runtimeSave.d.ts +79 -0
- package/dist/runtime/runtimeSave.js +105 -0
- package/dist/runtime/save.d.ts +4 -0
- package/dist/runtime/save.js +4 -0
- package/dist/runtime/snapshot.d.ts +7 -0
- package/dist/runtime/snapshot.js +7 -0
- package/dist/runtime/visibility.d.ts +2 -1
- package/dist/runtime/visibility.js +2 -1
- package/dist/runtime/worldChannel.d.ts +7 -3
- package/dist/runtime/worldChannel.js +51 -6
- package/dist/runtime/worldMirror.d.ts +14 -2
- package/dist/runtime/worldMirror.js +15 -2
- package/dist/runtime/worldProjection.d.ts +47 -0
- package/dist/runtime/worldProjection.js +52 -0
- package/dist/runtime/worldReplication.d.ts +30 -7
- package/dist/runtime/worldReplication.js +41 -9
- package/dist/runtime/worldSnapshot.d.ts +42 -3
- package/dist/runtime/worldSnapshot.js +34 -7
- package/dist/scene/assetCatalog.d.ts +26 -0
- package/dist/scene/assetCatalog.js +4 -0
- package/dist/scene/assetDiagnostics.d.ts +69 -0
- package/dist/scene/assetDiagnostics.js +110 -0
- package/dist/scene/assetGenerator.d.ts +65 -0
- package/dist/scene/assetGenerator.js +64 -0
- package/dist/scene/assetSpace.d.ts +137 -0
- package/dist/scene/assetSpace.js +257 -0
- package/dist/scene/authoredTriggers.d.ts +219 -0
- package/dist/scene/authoredTriggers.js +454 -0
- package/dist/scene/behaviorRuntime.d.ts +75 -0
- package/dist/scene/behaviorRuntime.js +217 -0
- package/dist/scene/behaviors.d.ts +14 -2
- package/dist/scene/behaviors.js +7 -2
- package/dist/scene/bodyBind.d.ts +60 -0
- package/dist/scene/bodyBind.js +51 -0
- package/dist/scene/builtinSceneKinds.d.ts +5 -0
- package/dist/scene/builtinSceneKinds.js +67 -0
- package/dist/scene/colliders.d.ts +71 -1
- package/dist/scene/colliders.js +145 -1
- package/dist/scene/collisionMesh.d.ts +94 -0
- package/dist/scene/collisionMesh.js +699 -0
- package/dist/scene/companion.d.ts +147 -0
- package/dist/scene/companion.js +193 -0
- package/dist/scene/entityStats.d.ts +18 -11
- package/dist/scene/entityStats.js +21 -16
- package/dist/scene/entityStore.d.ts +12 -1
- package/dist/scene/entityStore.js +15 -0
- package/dist/scene/facing.d.ts +18 -0
- package/dist/scene/facing.js +26 -0
- package/dist/scene/modelSockets.d.ts +33 -0
- package/dist/scene/modelSockets.js +29 -0
- package/dist/scene/objectQuery.d.ts +2 -0
- package/dist/scene/objectQuery.js +2 -0
- package/dist/scene/objectStore.d.ts +4 -0
- package/dist/scene/objectStore.js +6 -0
- package/dist/scene/possession.d.ts +8 -0
- package/dist/scene/possession.js +14 -0
- package/dist/scene/roster.d.ts +3 -0
- package/dist/scene/roster.js +12 -0
- package/dist/scene/sceneKinds.d.ts +256 -0
- package/dist/scene/sceneKinds.js +218 -0
- package/dist/scene/sceneOwnership.d.ts +169 -0
- package/dist/scene/sceneOwnership.js +179 -0
- package/dist/scene/sceneRaycast.js +15 -0
- package/dist/scene/selectionBookmarks.d.ts +93 -0
- package/dist/scene/selectionBookmarks.js +122 -0
- package/dist/scene/vehicleSeat.d.ts +68 -0
- package/dist/scene/vehicleSeat.js +59 -0
- package/dist/sensor/concealment.d.ts +3 -0
- package/dist/sensor/concealment.js +3 -0
- package/dist/sensor/freezeMonitor.d.ts +1 -0
- package/dist/sensor/freezeMonitor.js +1 -0
- package/dist/sensor/frustumSensor.d.ts +7 -3
- package/dist/sensor/frustumSensor.js +7 -3
- package/dist/sensor/hiddenStateProbe.d.ts +5 -2
- package/dist/sensor/hiddenStateProbe.js +5 -2
- package/dist/sensor/recordingBuffer.d.ts +2 -1
- package/dist/sensor/recordingBuffer.js +2 -1
- package/dist/sensor/replayLoop.d.ts +6 -2
- package/dist/sensor/replayLoop.js +6 -2
- package/dist/sensor/revealQuery.d.ts +2 -1
- package/dist/sensor/revealQuery.js +2 -1
- package/dist/sensor/visionCone.d.ts +10 -3
- package/dist/sensor/visionCone.js +10 -3
- package/dist/session/contestedChannel.d.ts +1 -0
- package/dist/session/contestedChannel.js +1 -0
- package/dist/session/extraction.d.ts +1 -0
- package/dist/session/extraction.js +1 -0
- package/dist/session/roles.d.ts +6 -0
- package/dist/session/roles.js +6 -0
- package/dist/session/roundState.d.ts +8 -0
- package/dist/session/roundState.js +2 -0
- package/dist/settings/settingsModel.d.ts +1 -0
- package/dist/settings/settingsModel.js +1 -0
- package/dist/stats/accumulatorMeter.d.ts +6 -0
- package/dist/stats/accumulatorMeter.js +6 -0
- package/dist/stats/eventMeter.d.ts +5 -0
- package/dist/stats/eventMeter.js +5 -0
- package/dist/stats/rollCheck.d.ts +5 -0
- package/dist/stats/rollCheck.js +5 -0
- package/dist/stats/spawnLevelStats.d.ts +110 -0
- package/dist/stats/spawnLevelStats.js +140 -0
- package/dist/stats/statModifiers.d.ts +5 -0
- package/dist/stats/statModifiers.js +5 -0
- package/dist/stats/statPool.d.ts +70 -0
- package/dist/stats/statPool.js +59 -0
- package/dist/store/changeSignal.d.ts +3 -0
- package/dist/store/changeSignal.js +2 -0
- package/dist/store/defineKeyedStore.d.ts +38 -0
- package/dist/store/defineKeyedStore.js +42 -0
- package/dist/store/defineStore.d.ts +33 -0
- package/dist/store/defineStore.js +35 -0
- package/dist/store/observableKeyedStore.d.ts +7 -0
- package/dist/store/observableKeyedStore.js +35 -2
- package/dist/survival/decayMeter.d.ts +55 -0
- package/dist/survival/decayMeter.js +130 -57
- package/dist/survival/moodle.d.ts +2 -0
- package/dist/survival/regionHealth.d.ts +6 -0
- package/dist/survival/regionHealth.js +6 -3
- package/dist/tactics/fallingGrid.d.ts +4 -2
- package/dist/tactics/fallingGrid.js +4 -2
- package/dist/tactics/predictiveQuery.d.ts +3 -0
- package/dist/tactics/predictiveQuery.js +3 -0
- package/dist/tactics/snapshot.d.ts +2 -0
- package/dist/tactics/snapshot.js +2 -0
- package/dist/tactics/surface.d.ts +1 -0
- package/dist/tactics/surface.js +1 -0
- package/dist/tactics/tacticalGrid.d.ts +1 -0
- package/dist/tactics/tacticalGrid.js +1 -0
- package/dist/time/beatClock.d.ts +14 -4
- package/dist/time/beatClock.js +14 -4
- package/dist/time/calendarClock.d.ts +3 -0
- package/dist/time/calendarClock.js +3 -0
- package/dist/time/idleProgress.d.ts +4 -0
- package/dist/time/idleProgress.js +4 -0
- package/dist/time/simClock.d.ts +2 -0
- package/dist/time/simClock.js +20 -5
- package/dist/ui/actionModel.d.ts +110 -0
- package/dist/ui/actionModel.js +159 -0
- package/dist/ui/gameLayout.d.ts +30 -11
- package/dist/ui/gameLayout.js +30 -11
- package/dist/ui/hudDocument.d.ts +114 -0
- package/dist/ui/hudDocument.js +220 -0
- package/dist/ui/hudLayout.d.ts +38 -1
- package/dist/ui/hudLayout.js +220 -17
- package/dist/ui/selectionModel.d.ts +92 -0
- package/dist/ui/selectionModel.js +88 -0
- package/dist/ui/tooltipModel.d.ts +63 -0
- package/dist/ui/tooltipModel.js +82 -0
- package/dist/ui.d.ts +15 -0
- package/dist/ui.js +15 -0
- package/dist/visibility/bounds.d.ts +8 -1
- package/dist/visibility/bounds.js +8 -1
- package/dist/visibility/frustum.d.ts +12 -3
- package/dist/visibility/frustum.js +12 -3
- package/dist/work/jobQueue.d.ts +201 -0
- package/dist/work/jobQueue.js +253 -0
- package/dist/work/unitTraining.d.ts +58 -0
- package/dist/work/unitTraining.js +52 -0
- package/dist/world/authoredEntities.d.ts +29 -0
- package/dist/world/authoredEntities.js +29 -0
- package/dist/world/authoredObjects.d.ts +72 -0
- package/dist/world/authoredObjects.js +81 -0
- package/dist/world/authoredSpawn.d.ts +39 -0
- package/dist/world/authoredSpawn.js +37 -0
- package/dist/world/buildSockets.d.ts +152 -0
- package/dist/world/buildSockets.js +188 -0
- package/dist/world/buildingGenerator.d.ts +18 -0
- package/dist/world/buildingGenerator.js +62 -0
- package/dist/world/buildings.d.ts +5 -0
- package/dist/world/buildings.js +5 -0
- package/dist/world/catenary.d.ts +22 -0
- package/dist/world/catenary.js +69 -0
- package/dist/world/cityBlocks.d.ts +152 -0
- package/dist/world/cityBlocks.js +670 -0
- package/dist/world/cityContent.d.ts +77 -0
- package/dist/world/cityContent.js +261 -0
- package/dist/world/cityGeometry.d.ts +114 -0
- package/dist/world/cityGeometry.js +573 -0
- package/dist/world/cityKind.d.ts +314 -0
- package/dist/world/cityKind.js +1578 -0
- package/dist/world/features.d.ts +133 -10
- package/dist/world/features.js +66 -6
- package/dist/world/footprintGrid.d.ts +59 -0
- package/dist/world/footprintGrid.js +141 -0
- package/dist/world/geometry.d.ts +64 -0
- package/dist/world/geometry.js +94 -0
- package/dist/world/grassKind.d.ts +51 -0
- package/dist/world/grassKind.js +101 -0
- package/dist/world/markers.d.ts +50 -4
- package/dist/world/markers.js +49 -0
- package/dist/world/massing.js +1 -1
- package/dist/world/minimapBake.d.ts +78 -0
- package/dist/world/minimapBake.js +208 -0
- package/dist/world/minimapTrack.d.ts +17 -0
- package/dist/world/minimapTrack.js +22 -0
- package/dist/world/pathInstances.d.ts +27 -0
- package/dist/world/pathInstances.js +27 -0
- package/dist/world/pathNetwork.d.ts +159 -0
- package/dist/world/pathNetwork.js +684 -0
- package/dist/world/pathTerrain.d.ts +80 -0
- package/dist/world/pathTerrain.js +142 -0
- package/dist/world/place.d.ts +166 -0
- package/dist/world/place.js +96 -0
- package/dist/world/placeAsset.d.ts +81 -0
- package/dist/world/placeAsset.js +79 -0
- package/dist/world/placement.d.ts +4 -0
- package/dist/world/placement.js +4 -0
- package/dist/world/placementController.d.ts +6 -0
- package/dist/world/placementController.js +6 -0
- package/dist/world/poleLineKind.d.ts +40 -0
- package/dist/world/poleLineKind.js +97 -0
- package/dist/world/polyline.d.ts +34 -0
- package/dist/world/polyline.js +88 -0
- package/dist/world/resourceNode.d.ts +109 -0
- package/dist/world/resourceNode.js +140 -0
- package/dist/world/roads.d.ts +8 -0
- package/dist/world/roads.js +38 -0
- package/dist/world/scatter.js +2 -20
- package/dist/world/scatterRegion.d.ts +164 -0
- package/dist/world/scatterRegion.js +409 -0
- package/dist/world/sceneShapes.d.ts +43 -0
- package/dist/world/sceneShapes.js +1 -0
- package/dist/world/segment.d.ts +27 -0
- package/dist/world/segment.js +43 -0
- package/dist/world/soilKind.d.ts +48 -0
- package/dist/world/soilKind.js +92 -0
- package/dist/world/spatialSample.d.ts +241 -0
- package/dist/world/spatialSample.js +465 -0
- package/dist/world/streets.d.ts +29 -0
- package/dist/world/streets.js +55 -0
- package/dist/world/terraform.d.ts +213 -1
- package/dist/world/terraform.js +627 -22
- package/dist/world/terrain.d.ts +164 -20
- package/dist/world/terrain.js +325 -41
- package/dist/world/terrainGuides.d.ts +182 -0
- package/dist/world/terrainGuides.js +343 -0
- package/dist/world/vec2.d.ts +81 -0
- package/dist/world/vec2.js +128 -0
- package/dist/world/vec3.d.ts +49 -0
- package/dist/world/vec3.js +76 -0
- package/dist/world/vegetation.d.ts +71 -0
- package/dist/world/vegetation.js +151 -0
- package/dist/world/visibilityField.d.ts +154 -0
- package/dist/world/visibilityField.js +271 -0
- package/dist/world/volumetricClouds.d.ts +52 -0
- package/dist/world/volumetricClouds.js +43 -0
- package/dist/world/walls.d.ts +9 -0
- package/dist/world/walls.js +9 -0
- package/dist/world/waterKind.d.ts +55 -0
- package/dist/world/waterKind.js +99 -0
- package/dist/world.d.ts +141 -0
- package/dist/world.js +141 -0
- package/package.json +32 -8
- package/skills/game-design/SKILL.md +28 -0
- package/skills/game-design/agents/openai.yaml +4 -0
- package/skills/game-design/references/application-playbook.md +170 -0
- package/skills/game-design/references/field-guide.md +288 -0
- package/skills/jgengine/SKILL.md +54 -0
- package/skills/jgengine/api.md +527 -0
- package/skills/jgengine/capabilities.md +131 -0
- package/skills/jgengine/recipes/minimal-game.md +88 -0
- package/skills/jgengine-combat/SKILL.md +38 -0
- package/skills/jgengine-combat/api.md +585 -0
- package/skills/jgengine-combat/capabilities.md +213 -0
- package/skills/jgengine-combat/recipes/portable-stat-pools.md +122 -0
- package/skills/jgengine-combat/reference.md +108 -0
- package/skills/jgengine-gameplay/SKILL.md +39 -0
- package/skills/jgengine-gameplay/api.md +1920 -0
- package/skills/jgengine-gameplay/capabilities.md +454 -0
- package/skills/jgengine-gameplay/reference-systems.md +56 -0
- package/skills/jgengine-world/SKILL.md +51 -0
- package/skills/jgengine-world/api.md +3056 -0
- package/skills/jgengine-world/capabilities.md +476 -0
- package/skills/jgengine-world/recipes/commanding-entities.md +128 -0
- package/skills/jgengine-world/reference.md +261 -0
- package/dist/cartridge/runtime.d.ts +0 -15
- package/dist/cartridge/runtime.js +0 -556
- package/dist/cartridge/spec.d.ts +0 -188
- package/dist/cartridge/spec.js +0 -19
- package/dist/cartridge/validate.d.ts +0 -2
- package/dist/cartridge/validate.js +0 -78
- package/dist/store/engineStore.d.ts +0 -22
- package/dist/store/engineStore.js +0 -50
- package/dist/store/features.d.ts +0 -10
- package/dist/store/features.js +0 -23
- package/llms.txt +0 -5389
|
@@ -0,0 +1,299 @@
|
|
|
1
|
+
import { canAfford as walletCanAfford, chargeAll as walletChargeAll, } from "../../economy/wallet.js";
|
|
2
|
+
import { createCosmetics } from "../../game/cosmetics.js";
|
|
3
|
+
import { createLeaderboard } from "../../game/leaderboard.js";
|
|
4
|
+
import { createGameDialogue } from "../../game/dialogue.js";
|
|
5
|
+
import { createQuestJournal } from "../../game/quest.js";
|
|
6
|
+
import { createChat } from "../../game/chat.js";
|
|
7
|
+
import {} from "../../game/social.js";
|
|
8
|
+
import { createTradeSystem } from "../../game/trade.js";
|
|
9
|
+
import { createUnlocks } from "../../game/unlocks.js";
|
|
10
|
+
import { createRoster } from "../../scene/roster.js";
|
|
11
|
+
import { createConnectedPlayers } from "../../game/connectedPlayers.js";
|
|
12
|
+
import { notifyAfter } from "../../store/changeSignal.js";
|
|
13
|
+
import { decodeArray, decodeRecord } from "../context/snapshotCodecs.js";
|
|
14
|
+
/** @internal */
|
|
15
|
+
export const featureDescriptors = [
|
|
16
|
+
{
|
|
17
|
+
key: "unlocks",
|
|
18
|
+
enabled: (f) => f.unlocks === true,
|
|
19
|
+
create(d) {
|
|
20
|
+
const unlocks = notifyAfter(createUnlocks(), ["grant", "hydrate"], d.signalNotify);
|
|
21
|
+
return {
|
|
22
|
+
value: unlocks,
|
|
23
|
+
save: {
|
|
24
|
+
key: "unlocks",
|
|
25
|
+
snapshot: () => unlocks.snapshotAll(),
|
|
26
|
+
decode: (raw) => decodeRecord(raw),
|
|
27
|
+
hydrate: (data) => unlocks.hydrateAll(data),
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
key: "social",
|
|
34
|
+
enabled: (f) => f.social === true,
|
|
35
|
+
create(d) {
|
|
36
|
+
const raw = d.sharedSocial();
|
|
37
|
+
const social = {
|
|
38
|
+
friends: notifyAfter(raw.friends, ["request", "accept", "decline", "remove", "block", "hydrate"], d.signalNotify),
|
|
39
|
+
party: notifyAfter(raw.party, ["invite", "accept", "decline", "kick", "leave", "promote"], d.signalNotify),
|
|
40
|
+
presence: raw.presence,
|
|
41
|
+
emotes: raw.emotes,
|
|
42
|
+
worldInvites: notifyAfter(raw.worldInvites, ["invite", "accept", "decline"], d.signalNotify),
|
|
43
|
+
snapshot: raw.snapshot,
|
|
44
|
+
hydrate: (data) => {
|
|
45
|
+
raw.hydrate(data);
|
|
46
|
+
d.signalNotify();
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
value: social,
|
|
51
|
+
replicate: {
|
|
52
|
+
key: "social",
|
|
53
|
+
snapshot: () => social.snapshot(),
|
|
54
|
+
decode: (rawVal) => {
|
|
55
|
+
const rec = decodeRecord(rawVal);
|
|
56
|
+
return rec === null ? null : rec;
|
|
57
|
+
},
|
|
58
|
+
hydrate: (data) => social.hydrate(data),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
key: "chat",
|
|
65
|
+
enabled: (f) => f.chat === true,
|
|
66
|
+
create(d) {
|
|
67
|
+
const raw = d.sharedSocial();
|
|
68
|
+
const chat = notifyAfter(createChat({
|
|
69
|
+
events: d.events,
|
|
70
|
+
now: d.now,
|
|
71
|
+
party: raw.party,
|
|
72
|
+
proximity: {
|
|
73
|
+
entities: { get: (id) => d.entities.get(id) },
|
|
74
|
+
spatial: { inRadius: (center, radius, filter) => d.spatial.inRadius(center, radius, filter) },
|
|
75
|
+
},
|
|
76
|
+
blockedBy: (userId) => raw.friends.snapshot(userId).blocked,
|
|
77
|
+
}), ["register", "send", "whisper", "hydrate"], d.signalNotify);
|
|
78
|
+
return {
|
|
79
|
+
value: chat,
|
|
80
|
+
replicate: {
|
|
81
|
+
key: "chat",
|
|
82
|
+
snapshot: () => chat.snapshot(),
|
|
83
|
+
decode: (rawVal) => {
|
|
84
|
+
const rec = decodeRecord(rawVal);
|
|
85
|
+
return rec === null ? null : rec;
|
|
86
|
+
},
|
|
87
|
+
hydrate: (data) => chat.hydrate(data),
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
key: "leaderboard",
|
|
94
|
+
enabled: (f) => f.leaderboard === true,
|
|
95
|
+
create(d) {
|
|
96
|
+
const leaderboard = notifyAfter(createLeaderboard(), ["increment", "hydrate"], d.signalNotify);
|
|
97
|
+
return {
|
|
98
|
+
value: leaderboard,
|
|
99
|
+
replicate: {
|
|
100
|
+
key: "leaderboard",
|
|
101
|
+
snapshot: () => leaderboard.snapshot(),
|
|
102
|
+
decode: (raw) => decodeArray(raw),
|
|
103
|
+
hydrate: (data) => leaderboard.hydrate(data),
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
key: "roster",
|
|
110
|
+
enabled: (f) => f.roster === true,
|
|
111
|
+
create(d) {
|
|
112
|
+
const roster = notifyAfter(createRoster({ now: d.now }), ["capture", "release", "setEquipped", "hydrate"], d.signalNotify);
|
|
113
|
+
return {
|
|
114
|
+
value: roster,
|
|
115
|
+
save: {
|
|
116
|
+
key: "roster",
|
|
117
|
+
snapshot: () => roster.snapshotAll(),
|
|
118
|
+
decode: (raw) => decodeRecord(raw),
|
|
119
|
+
hydrate: (data) => roster.hydrateAll(data),
|
|
120
|
+
},
|
|
121
|
+
};
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
key: "cosmetics",
|
|
126
|
+
enabled: (f) => f.cosmetics === true,
|
|
127
|
+
create(d) {
|
|
128
|
+
const cosmetics = notifyAfter(createCosmetics({ events: d.events }), ["apply", "equip", "hydrate"], d.signalNotify);
|
|
129
|
+
return {
|
|
130
|
+
value: cosmetics,
|
|
131
|
+
save: {
|
|
132
|
+
key: "cosmetics",
|
|
133
|
+
snapshot: () => cosmetics.snapshotAll(),
|
|
134
|
+
decode: (raw) => decodeRecord(raw),
|
|
135
|
+
hydrate: (data) => cosmetics.hydrateAll(data),
|
|
136
|
+
},
|
|
137
|
+
};
|
|
138
|
+
},
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
key: "trade",
|
|
142
|
+
enabled: (f) => f.trade === true,
|
|
143
|
+
create(d) {
|
|
144
|
+
return {
|
|
145
|
+
value: createTradeSystem({
|
|
146
|
+
resolveTrade: (itemId) => d.content.itemById?.(itemId)?.trade,
|
|
147
|
+
wallet: {
|
|
148
|
+
canAfford: (costs) => walletCanAfford(d.walletOf(d.activeUserId()), costs) ? null : "insufficient-funds",
|
|
149
|
+
charge(costs) {
|
|
150
|
+
const result = walletChargeAll(d.walletOf(d.activeUserId()), costs);
|
|
151
|
+
if (result.status === "ok") {
|
|
152
|
+
d.setWallet(d.activeUserId(), result.state);
|
|
153
|
+
d.signalNotify();
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
grant(gains) {
|
|
157
|
+
for (const [currencyId, amount] of Object.entries(gains)) {
|
|
158
|
+
d.economy.grant(d.activeUserId(), currencyId, amount);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
},
|
|
162
|
+
inventory: {
|
|
163
|
+
put(inventoryId, itemId, count) {
|
|
164
|
+
if (d.layouts[inventoryId] === undefined)
|
|
165
|
+
return { reason: `unknown inventory "${inventoryId}"` };
|
|
166
|
+
const result = d.inventoryFor(d.activeUserId()).put(inventoryId, itemId, count);
|
|
167
|
+
return result.status === "ok" ? null : { reason: result.reason };
|
|
168
|
+
},
|
|
169
|
+
take(inventoryId, itemId, count) {
|
|
170
|
+
if (d.layouts[inventoryId] === undefined)
|
|
171
|
+
return { reason: `unknown inventory "${inventoryId}"` };
|
|
172
|
+
const result = d.inventoryFor(d.activeUserId()).take(inventoryId, itemId, count);
|
|
173
|
+
return result.status === "ok" ? null : { reason: result.reason };
|
|
174
|
+
},
|
|
175
|
+
count: (inventoryId, itemId) => d.inventoryFor(d.activeUserId()).count(inventoryId, itemId),
|
|
176
|
+
},
|
|
177
|
+
}),
|
|
178
|
+
};
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
key: "quest",
|
|
183
|
+
enabled: (f) => f.quest === true,
|
|
184
|
+
create(d) {
|
|
185
|
+
const quest = notifyAfter(createQuestJournal({
|
|
186
|
+
events: d.events,
|
|
187
|
+
rewards: {
|
|
188
|
+
grantXp(userId, amount) {
|
|
189
|
+
const existing = d.ensureInstanceStats(userId)["xp"];
|
|
190
|
+
const current = (existing?.current ?? 0) + amount;
|
|
191
|
+
d.seedUserPool(userId, "xp", { current, max: Math.max(existing?.max ?? 0, current) });
|
|
192
|
+
},
|
|
193
|
+
grantEconomy: (userId, currencyId, amount) => d.economy.grant(userId, currencyId, amount),
|
|
194
|
+
grantItem(userId, inventoryId, itemId, count) {
|
|
195
|
+
if (d.layouts[inventoryId] === undefined)
|
|
196
|
+
return { reason: `unknown inventory "${inventoryId}"` };
|
|
197
|
+
const result = d.inventoryFor(userId).put(inventoryId, itemId, count);
|
|
198
|
+
return result.status === "ok" ? null : { reason: result.reason };
|
|
199
|
+
},
|
|
200
|
+
grantUnlock: (userId, unlockId) => d.feature("unlocks")?.grant(userId, unlockId),
|
|
201
|
+
},
|
|
202
|
+
hasUnlock: (userId, id) => d.feature("unlocks")?.has(userId, id) ?? false,
|
|
203
|
+
}), ["accept", "abandon", "progress", "turnIn", "grant", "revoke", "hydrate"], d.signalNotify);
|
|
204
|
+
return {
|
|
205
|
+
value: quest,
|
|
206
|
+
save: {
|
|
207
|
+
key: "quest",
|
|
208
|
+
snapshot: () => quest.snapshotAll(),
|
|
209
|
+
decode: (raw) => decodeRecord(raw),
|
|
210
|
+
hydrate: (data) => quest.hydrateAll(data),
|
|
211
|
+
},
|
|
212
|
+
};
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
key: "dialogue",
|
|
217
|
+
enabled: (f) => f.dialogue === true,
|
|
218
|
+
create(d) {
|
|
219
|
+
const dialogue = createGameDialogue(d.store);
|
|
220
|
+
d.commandRegistry.define("dialogue.open", {
|
|
221
|
+
apply(state, input) {
|
|
222
|
+
const id = input.id;
|
|
223
|
+
if (id !== undefined)
|
|
224
|
+
state.game.dialogue?.open(id);
|
|
225
|
+
},
|
|
226
|
+
});
|
|
227
|
+
d.commandRegistry.define("dialogue.close", {
|
|
228
|
+
apply(state) {
|
|
229
|
+
state.game.dialogue?.close();
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
return { value: dialogue };
|
|
233
|
+
},
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
key: "players",
|
|
237
|
+
enabled: (f) => f.players === true,
|
|
238
|
+
create(d) {
|
|
239
|
+
return { value: notifyAfter(createConnectedPlayers(), ["join", "leave"], d.signalNotify) };
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
key: "cards",
|
|
244
|
+
enabled: (f) => f.cards === true,
|
|
245
|
+
create(d) {
|
|
246
|
+
return {
|
|
247
|
+
value: { pile: d.pile },
|
|
248
|
+
save: {
|
|
249
|
+
key: "cards",
|
|
250
|
+
snapshot: () => {
|
|
251
|
+
const out = {};
|
|
252
|
+
for (const [id, cardPile] of d.cardPiles)
|
|
253
|
+
out[id] = cardPile.state();
|
|
254
|
+
return out;
|
|
255
|
+
},
|
|
256
|
+
decode: (raw) => decodeRecord(raw),
|
|
257
|
+
hydrate: (data) => {
|
|
258
|
+
const piles = data;
|
|
259
|
+
for (const [id, state] of Object.entries(piles)) {
|
|
260
|
+
d.cardPiles.get(id)?.reset(state);
|
|
261
|
+
}
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
};
|
|
265
|
+
},
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
key: "turn",
|
|
269
|
+
enabled: (f) => f.turn === true,
|
|
270
|
+
create(d) {
|
|
271
|
+
return {
|
|
272
|
+
value: { loop: d.loop },
|
|
273
|
+
save: {
|
|
274
|
+
key: "turn",
|
|
275
|
+
snapshot: () => {
|
|
276
|
+
const out = {};
|
|
277
|
+
for (const [id, turnLoop] of d.turnLoops)
|
|
278
|
+
out[id] = turnLoop.capture();
|
|
279
|
+
return out;
|
|
280
|
+
},
|
|
281
|
+
decode: (raw) => decodeRecord(raw),
|
|
282
|
+
hydrate: (data) => {
|
|
283
|
+
const loops = data;
|
|
284
|
+
for (const [id, state] of Object.entries(loops)) {
|
|
285
|
+
d.turnLoops.get(id)?.restore(state);
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
},
|
|
289
|
+
};
|
|
290
|
+
},
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
key: "race",
|
|
294
|
+
enabled: (f) => f.race === true,
|
|
295
|
+
create(d) {
|
|
296
|
+
return { value: { state: d.raceState } };
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
];
|
|
@@ -1,329 +1,4 @@
|
|
|
1
|
-
import { type CardPile, type CardPileConfig } from "../cards/cardPile.js";
|
|
2
|
-
import { type OnDeathSpec } from "../combat/death.js";
|
|
3
|
-
import { type EffectInput, type EffectResult, type EffectVia, type ReceiveMap, type SingleTargetEffectInput } from "../combat/effects.js";
|
|
4
|
-
import { type ProjectileSystem } from "../combat/projectiles.js";
|
|
5
|
-
import { type HitReaction, type HitReactionConfig } from "../combat/hitReaction.js";
|
|
6
|
-
import { type TelegraphShape } from "../combat/telegraph.js";
|
|
7
|
-
import { type CommandDefinition, type CommandResult } from "../commands/commandRegistry.js";
|
|
8
|
-
import { type Cosmetics } from "../game/cosmetics.js";
|
|
9
|
-
import type { GameDefinition } from "../game/defineGame.js";
|
|
10
|
-
import { type TerrainField } from "../world/terrain.js";
|
|
11
|
-
import { type GameEventMap, type GameEvents } from "../game/events.js";
|
|
12
|
-
import { type GameFeed } from "../game/feed.js";
|
|
13
|
-
import { type Leaderboard } from "../game/leaderboard.js";
|
|
14
|
-
import { type Loadouts } from "../game/loadout.js";
|
|
15
|
-
import { type Drop, type LootTableDef } from "../game/lootTable.js";
|
|
16
|
-
import { type QuestJournal } from "../game/quest.js";
|
|
17
|
-
import { type WorldItemRecord, type WorldItemSpawnInput } from "../game/worldItem.js";
|
|
18
|
-
import { type Chat } from "../game/chat.js";
|
|
19
|
-
import { type Social } from "../game/social.js";
|
|
20
|
-
import { type TradeField, type TradeSystem } from "../game/trade.js";
|
|
21
|
-
import { type Unlocks } from "../game/unlocks.js";
|
|
22
|
-
import { type InventoryLayout, type InventorySet } from "../inventory/inventoryModel.js";
|
|
23
|
-
import type { ContextVerb } from "../interaction/contextMenu.js";
|
|
24
|
-
import type { ProximityPrompt } from "../interaction/proximityPrompt.js";
|
|
25
|
-
import { type ItemUseHandler, type ItemUseInput, type ItemUseRejection, type ItemUseResult } from "../item/use.js";
|
|
26
|
-
import { type WeaponStats } from "../item/weapon.js";
|
|
27
|
-
import { type PoseAllowedStates, type PoseState } from "../movement/poseState.js";
|
|
28
1
|
import type { ModelAssetRef } from "../scene/assetCatalog.js";
|
|
29
|
-
import {
|
|
30
|
-
|
|
31
|
-
import type { EntityBlackboard, EntityPose, EntityPosition, EntityStore, SceneEntity, SpawnOptions, SpawnPose } from "../scene/entityStore.js";
|
|
32
|
-
import { type Forms } from "../scene/form.js";
|
|
33
|
-
import { type EntityColliderSet } from "../scene/colliders.js";
|
|
34
|
-
import { type ObjectRaycastHit, type ObjectRaycastInput } from "../scene/objectQuery.js";
|
|
35
|
-
import { type ObjectStore } from "../scene/objectStore.js";
|
|
36
|
-
import { type Roster } from "../scene/roster.js";
|
|
37
|
-
import { type ConnectedPlayers } from "../game/connectedPlayers.js";
|
|
38
|
-
import { type Possession } from "../scene/possession.js";
|
|
39
|
-
import { type SceneRaycastHit, type SceneRaycastInput } from "../scene/sceneRaycast.js";
|
|
40
|
-
import { type SpatialApi } from "../scene/spatial.js";
|
|
41
|
-
import { type CycleTargetOptions } from "../scene/targeting.js";
|
|
42
|
-
import { type Stats } from "../stats/statModifiers.js";
|
|
43
|
-
import { type ObservableKeyedStore } from "../store/observableKeyedStore.js";
|
|
44
|
-
import { type WorldSnapshot } from "./worldSnapshot.js";
|
|
45
|
-
import { type SimClock } from "../time/simClock.js";
|
|
46
|
-
import { type TurnLoop, type TurnLoopConfig } from "../turn/turnLoop.js";
|
|
47
|
-
import { RaceState, type RaceStateConfig } from "../game/race.js";
|
|
48
|
-
import { type CameraDirector } from "./cameraDirector.js";
|
|
49
|
-
import { type InputSnapshot } from "./inputSnapshot.js";
|
|
50
|
-
import { type MotionIntents } from "./motionIntents.js";
|
|
51
|
-
export interface GameContextItemEntry {
|
|
52
|
-
use?: string;
|
|
53
|
-
weapon?: Record<string, unknown>;
|
|
54
|
-
trade?: TradeField;
|
|
55
|
-
/** Rarity id read by the `worldItem` loot-filter/render binding when this item drops to the ground (#32/#33). */
|
|
56
|
-
rarity?: string;
|
|
57
|
-
/** Base item type read by the loot-filter rule evaluator (#33); defaults to the item id when absent. */
|
|
58
|
-
baseType?: string;
|
|
59
|
-
}
|
|
60
|
-
export type CatalogEntityRole = "player" | "enemy" | "hostile" | "npc" | "vehicle";
|
|
61
|
-
export interface GameContextEntityEntry {
|
|
62
|
-
stats?: StatCatalog;
|
|
63
|
-
receive?: ReceiveMap;
|
|
64
|
-
onDeath?: OnDeathSpec;
|
|
65
|
-
movement?: PoseAllowedStates & {
|
|
66
|
-
walkSpeed?: number;
|
|
67
|
-
};
|
|
68
|
-
role?: CatalogEntityRole;
|
|
69
|
-
/** Right-click context-menu verbs for this entity (#31). */
|
|
70
|
-
verbs?: readonly ContextVerb[];
|
|
71
|
-
/** Purpose-specific colliders (physical body + named damage hitboxes). */
|
|
72
|
-
colliders?: EntityColliderSet;
|
|
73
|
-
}
|
|
74
|
-
export interface GameContextObjectEntry {
|
|
75
|
-
proximityPrompt?: ProximityPrompt;
|
|
76
|
-
breakable?: false | {
|
|
77
|
-
baseBreakTime: number;
|
|
78
|
-
};
|
|
79
|
-
slotInventory?: InventoryLayout;
|
|
80
|
-
/** Right-click context-menu verbs for this object (#31). */
|
|
81
|
-
verbs?: readonly ContextVerb[];
|
|
82
|
-
colliders?: EntityColliderSet;
|
|
83
|
-
halfExtents?: readonly [number, number, number];
|
|
84
|
-
}
|
|
85
|
-
export interface GameContextContent {
|
|
86
|
-
itemById?(itemId: string): GameContextItemEntry | null | undefined;
|
|
87
|
-
entityById?(catalogId: string): GameContextEntityEntry | null | undefined;
|
|
88
|
-
objectById?(catalogId: string): GameContextObjectEntry | null | undefined;
|
|
89
|
-
}
|
|
90
|
-
export interface GameContextOptions<TAssetRef extends ModelAssetRef = ModelAssetRef, TMultiplayer = unknown> {
|
|
91
|
-
definition: GameDefinition<TAssetRef, TMultiplayer>;
|
|
92
|
-
content: GameContextContent;
|
|
93
|
-
player: {
|
|
94
|
-
userId: string;
|
|
95
|
-
isNew: boolean;
|
|
96
|
-
};
|
|
97
|
-
now?: () => number;
|
|
98
|
-
occluder?: (from: EntityPosition, to: EntityPosition) => boolean;
|
|
99
|
-
}
|
|
100
|
-
export interface SceneObjectContext extends ObjectStore {
|
|
101
|
-
catalog(instanceId: string): GameContextObjectEntry | null;
|
|
102
|
-
raycast(input: ObjectRaycastInput): ObjectRaycastHit | null;
|
|
103
|
-
raycastAll(input: ObjectRaycastInput): readonly ObjectRaycastHit[];
|
|
104
|
-
setColliders(instanceId: string, colliders: EntityColliderSet | null): void;
|
|
105
|
-
collidersOf(instanceId: string): EntityColliderSet | null;
|
|
106
|
-
}
|
|
107
|
-
export interface FloatTextInput {
|
|
108
|
-
instanceId?: string;
|
|
109
|
-
position?: [number, number, number];
|
|
110
|
-
text?: string;
|
|
111
|
-
kind?: string;
|
|
112
|
-
amount?: number;
|
|
113
|
-
hitType?: string;
|
|
114
|
-
element?: string;
|
|
115
|
-
crit?: boolean;
|
|
116
|
-
scale?: number;
|
|
117
|
-
}
|
|
118
|
-
export interface TelegraphInput {
|
|
119
|
-
from: string;
|
|
120
|
-
shape: TelegraphShape;
|
|
121
|
-
at: [number, number, number];
|
|
122
|
-
dir?: number;
|
|
123
|
-
windupMs: number;
|
|
124
|
-
kind?: string;
|
|
125
|
-
effect?: {
|
|
126
|
-
effect: string;
|
|
127
|
-
via?: EffectVia;
|
|
128
|
-
radius?: number;
|
|
129
|
-
falloff?: "linear" | "none";
|
|
130
|
-
los?: boolean;
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
export interface HitReactionInput {
|
|
134
|
-
from: string;
|
|
135
|
-
to: string;
|
|
136
|
-
config: HitReactionConfig;
|
|
137
|
-
power?: number;
|
|
138
|
-
}
|
|
139
|
-
export interface SceneEntityContext {
|
|
140
|
-
spawn(name: string, options?: SpawnOptions): string;
|
|
141
|
-
despawn(instanceId: string): boolean;
|
|
142
|
-
update: EntityStore["update"];
|
|
143
|
-
setPose(instanceId: string, pose: EntityPose): boolean;
|
|
144
|
-
setPoseConstraint: EntityStore["setPoseConstraint"];
|
|
145
|
-
get(instanceId: string): SceneEntity | null;
|
|
146
|
-
list(): readonly SceneEntity[];
|
|
147
|
-
spawnPoseOf(instanceId: string): SpawnPose | null;
|
|
148
|
-
resetToSpawn(instanceId: string): boolean;
|
|
149
|
-
resetAllToSpawn(filter?: (entity: SceneEntity) => boolean): number;
|
|
150
|
-
blackboard: EntityBlackboard;
|
|
151
|
-
stats: EntityStatsApi;
|
|
152
|
-
floatText(input: FloatTextInput): void;
|
|
153
|
-
telegraph(input: TelegraphInput): () => void;
|
|
154
|
-
hitReaction(input: HitReactionInput): HitReaction | null;
|
|
155
|
-
setTarget(fromId: string, toId: string | null): void;
|
|
156
|
-
getTarget(fromId: string): string | null;
|
|
157
|
-
cycleTarget(fromId: string, options?: CycleTargetOptions): string | null;
|
|
158
|
-
canReceive(instanceId: string, effect: string, magnitude?: number): string | null;
|
|
159
|
-
preview(input: SingleTargetEffectInput): number;
|
|
160
|
-
effect(input: EffectInput): EffectResult[];
|
|
161
|
-
willHitProjectile: ProjectileSystem["willHitProjectile"];
|
|
162
|
-
fireProjectile: ProjectileSystem["fireProjectile"];
|
|
163
|
-
settleProjectile: ProjectileSystem["settleProjectile"];
|
|
164
|
-
distance: SpatialApi["distance"];
|
|
165
|
-
inRadius: SpatialApi["inRadius"];
|
|
166
|
-
hasLineOfSight: SpatialApi["hasLineOfSight"];
|
|
167
|
-
queryArc: SpatialApi["queryArc"];
|
|
168
|
-
moveToward: SpatialApi["moveToward"];
|
|
169
|
-
invalidateSpatial: SpatialApi["invalidate"];
|
|
170
|
-
setColliders(instanceId: string, colliders: EntityColliderSet | null): void;
|
|
171
|
-
collidersOf(instanceId: string): EntityColliderSet | null;
|
|
172
|
-
form: Forms;
|
|
173
|
-
paint: PaintLayer;
|
|
174
|
-
}
|
|
175
|
-
export type WorldItemPickupResult = {
|
|
176
|
-
status: "ok";
|
|
177
|
-
record: WorldItemRecord;
|
|
178
|
-
} | {
|
|
179
|
-
status: "rejected";
|
|
180
|
-
reason: string;
|
|
181
|
-
};
|
|
182
|
-
export interface SceneWorldItemContext {
|
|
183
|
-
spawn(input: WorldItemSpawnInput): WorldItemRecord;
|
|
184
|
-
get(instanceId: string): WorldItemRecord | null;
|
|
185
|
-
list(): readonly WorldItemRecord[];
|
|
186
|
-
nearestInRadius(from: EntityPosition, radius: number, filter?: (record: WorldItemRecord) => boolean): string | null;
|
|
187
|
-
pickup(instanceId: string, userId: string): WorldItemPickupResult;
|
|
188
|
-
consume(instanceId: string): WorldItemRecord | null;
|
|
189
|
-
}
|
|
190
|
-
export interface GameContextCommands {
|
|
191
|
-
define<TInput>(name: string, definition: CommandDefinition<GameContext, TInput>): void;
|
|
192
|
-
has(name: string): boolean;
|
|
193
|
-
names(): string[];
|
|
194
|
-
run(name: string, input: unknown): CommandResult<GameContext>;
|
|
195
|
-
/** Run a command attributed to `actorUserId` — a shared-world host routes each client's command through this so the handler can read {@link actor}. */
|
|
196
|
-
runAs(actorUserId: string, name: string, input: unknown): CommandResult<GameContext>;
|
|
197
|
-
/** The user a command is running on behalf of, or `null` outside a {@link runAs} call — commands default to `ctx.player.userId` when this is `null`. */
|
|
198
|
-
actor(): string | null;
|
|
199
|
-
}
|
|
200
|
-
export interface GameContextFeed extends Omit<GameFeed, "bind"> {
|
|
201
|
-
bind(action: keyof GameEventMap): () => void;
|
|
202
|
-
}
|
|
203
|
-
export interface GameContextLoot {
|
|
204
|
-
register(def: LootTableDef): void;
|
|
205
|
-
has(id: string): boolean;
|
|
206
|
-
roll(id: string, rng?: () => number): Drop[];
|
|
207
|
-
grantToPlayer(userId: string, drops: Drop[], source?: string): void;
|
|
208
|
-
}
|
|
209
|
-
export interface GameContextEconomy {
|
|
210
|
-
balance(userId: string, currencyId: string): number;
|
|
211
|
-
grant(userId: string, currencyId: string, amount: number): void;
|
|
212
|
-
charge(userId: string, currencyId: string, amount: number): {
|
|
213
|
-
reason: string;
|
|
214
|
-
} | null;
|
|
215
|
-
}
|
|
216
|
-
export interface GameContextItemUse {
|
|
217
|
-
register(handlers: Record<string, ItemUseHandler<GameContext>>): void;
|
|
218
|
-
registered(): string[];
|
|
219
|
-
can(input: ItemUseInput): ItemUseRejection | null;
|
|
220
|
-
use(input: ItemUseInput): ItemUseResult<GameContext>;
|
|
221
|
-
}
|
|
222
|
-
export interface GameContextWorld {
|
|
223
|
-
ground: TerrainField;
|
|
224
|
-
groundHeightAt(x: number, z: number): number;
|
|
225
|
-
}
|
|
226
|
-
export interface GameContextCards {
|
|
227
|
-
/** Lazily creates (on first call, `config` required) or returns the existing notify-wrapped pile for `id`. */
|
|
228
|
-
pile(id: string, config?: CardPileConfig): CardPile;
|
|
229
|
-
}
|
|
230
|
-
export interface GameContextTurn {
|
|
231
|
-
/** Lazily creates (on first call, `config` required) or returns the existing notify-wrapped turn loop for `id`. */
|
|
232
|
-
loop(id: string, config?: TurnLoopConfig): TurnLoop;
|
|
233
|
-
}
|
|
234
|
-
export interface GameContextRace {
|
|
235
|
-
/** Lazily creates (on first call, `config` required) or returns the existing reactive race for `id` — discrete mutations and eventful `update` calls bump `ctx.version()`, so HUDs stop hand-managing `store.set` (#286.2). */
|
|
236
|
-
state(id: string, config?: RaceStateConfig): RaceState;
|
|
237
|
-
}
|
|
238
|
-
/** Reachable audio seam on `ctx.game`: `play`, `music`, and `resume` route through the `audio.play`/`audio.music`/`audio.resume` events the shell's audio engine listens on, so game code triggers sound without importing the shell. */
|
|
239
|
-
export interface GameAudio {
|
|
240
|
-
play(sound: string, at?: readonly [number, number, number]): void;
|
|
241
|
-
/** Crossfade the procedural soundtrack to `theme` (null fades out); `transpose` shifts the incoming theme's key in semitones. */
|
|
242
|
-
music(theme: string | null, transpose?: number): void;
|
|
243
|
-
resume(): void;
|
|
244
|
-
}
|
|
245
|
-
export interface GameContext {
|
|
246
|
-
scene: {
|
|
247
|
-
object: SceneObjectContext;
|
|
248
|
-
entity: SceneEntityContext;
|
|
249
|
-
worldItem: SceneWorldItemContext;
|
|
250
|
-
raycast(input: SceneRaycastInput): SceneRaycastHit | null;
|
|
251
|
-
raycastAll(input: SceneRaycastInput): readonly SceneRaycastHit[];
|
|
252
|
-
};
|
|
253
|
-
world: GameContextWorld;
|
|
254
|
-
game: {
|
|
255
|
-
commands: GameContextCommands;
|
|
256
|
-
events: GameEvents;
|
|
257
|
-
audio: GameAudio;
|
|
258
|
-
/** Play a model's one-shot animation clip bound to `event` in its `animation.oneShots` (e.g. an attack swing) — emits `entity.animation` for the shell to pick up. */
|
|
259
|
-
playEntityAnimation(instanceId: string, event: string): void;
|
|
260
|
-
feed: GameContextFeed;
|
|
261
|
-
loot: GameContextLoot;
|
|
262
|
-
trade: TradeSystem;
|
|
263
|
-
quest: QuestJournal;
|
|
264
|
-
/** Friends/party/presence/emotes/world-invites — present only when `features.social` is set. */
|
|
265
|
-
social?: Social;
|
|
266
|
-
/** Channels + messages — present only when `features.chat` is set (implies `social`). */
|
|
267
|
-
chat?: Chat;
|
|
268
|
-
unlocks: Unlocks;
|
|
269
|
-
economy: GameContextEconomy;
|
|
270
|
-
/** Competitive score tracking — present only when `features.leaderboard` is set. */
|
|
271
|
-
leaderboard?: Leaderboard;
|
|
272
|
-
/** Owned-entity roster — present only when `features.roster` is set. */
|
|
273
|
-
roster?: Roster;
|
|
274
|
-
/** Game-defined keyed reactive store slot (#163.1); mutations bump `ctx.version()`/notify `ctx.subscribe`. */
|
|
275
|
-
store: ObservableKeyedStore<unknown>;
|
|
276
|
-
/** Card pile zones — present only when `features.cards` is set. */
|
|
277
|
-
cards?: GameContextCards;
|
|
278
|
-
/** Turn/phase loop — present only when `features.turn` is set. */
|
|
279
|
-
turn?: GameContextTurn;
|
|
280
|
-
/** Lap/checkpoint race state — present only when `features.race` is set. */
|
|
281
|
-
race?: GameContextRace;
|
|
282
|
-
/** Connected-player set for a shared world — present only when `features.players` is set. */
|
|
283
|
-
players?: ConnectedPlayers;
|
|
284
|
-
};
|
|
285
|
-
player: {
|
|
286
|
-
/** The acting player's id — the command actor inside `runAs`, the local player everywhere else. */
|
|
287
|
-
userId: string;
|
|
288
|
-
isNew: boolean;
|
|
289
|
-
/** The acting player's inventory set — the command actor's bags inside `runAs`, the local player's everywhere else. */
|
|
290
|
-
inventory: InventorySet<string>;
|
|
291
|
-
/** A specific player's inventory set — how a host reads or grants into any connected player's bags. */
|
|
292
|
-
inventoryFor(userId: string): InventorySet<string>;
|
|
293
|
-
/** The acting player's stat modifiers — the command actor's inside `runAs`, the local player's everywhere else. */
|
|
294
|
-
stats: Stats<string>;
|
|
295
|
-
/** A specific player's stat modifiers — how a host reads or buffs any connected player's stats. */
|
|
296
|
-
statsFor(userId: string): Stats<string>;
|
|
297
|
-
loadout: Loadouts;
|
|
298
|
-
applyLoadout(userId: string, loadoutId: string): {
|
|
299
|
-
reason: string;
|
|
300
|
-
} | null;
|
|
301
|
-
movement: PoseState;
|
|
302
|
-
possession: Possession;
|
|
303
|
-
cosmetics: Cosmetics;
|
|
304
|
-
/** Motion seam into the movement integrator (#162.4); routes to the command actor's queue (or the local player outside a command), so a command's impulse lands on whoever ran it. See `MotionIntents`. */
|
|
305
|
-
motion: MotionIntents;
|
|
306
|
-
/** A specific player's motion queue — how the host-side per-player movement integrator drains each connected player's impulses. */
|
|
307
|
-
motionFor(userId: string): MotionIntents;
|
|
308
|
-
};
|
|
309
|
-
item: {
|
|
310
|
-
use: GameContextItemUse;
|
|
311
|
-
weapon: WeaponStats;
|
|
312
|
-
};
|
|
313
|
-
time: SimClock;
|
|
314
|
-
/** Runtime camera-follow/cinematic override (#196.2); the shell reads `followedEntityId()` each frame. */
|
|
315
|
-
camera: CameraDirector;
|
|
316
|
-
/** Held-input snapshot published by the shell each frame before `onTick` (#164.1). */
|
|
317
|
-
input: InputSnapshot;
|
|
318
|
-
subscribe(listener: () => void): () => void;
|
|
319
|
-
version(): number;
|
|
320
|
-
/**
|
|
321
|
-
* Gather every opted-in live subsystem into one {@link WorldSnapshot} — entities, entity stats, the
|
|
322
|
-
* keyed store, the action feed, plus leaderboard/chat when those features are on. The full-world
|
|
323
|
-
* baseline a host sends a joining client; {@link hydrate} is its inverse.
|
|
324
|
-
*/
|
|
325
|
-
snapshot(): WorldSnapshot;
|
|
326
|
-
/** Apply a {@link WorldSnapshot} from an authoritative host, hydrating each subsystem key present in it. */
|
|
327
|
-
hydrate(snapshot: WorldSnapshot): void;
|
|
328
|
-
}
|
|
2
|
+
import type { GameContext, GameContextOptions } from "./gameContextTypes.js";
|
|
3
|
+
export type { CatalogEntityRole, FloatTextInput, GameAudio, GameContext, GameContextCards, GameContextCommands, GameContextContent, GameContextEconomy, GameContextEntityEntry, GameContextFeed, GameContextItemEntry, GameContextItemUse, GameContextLoot, GameContextModels, GameContextObjectEntry, GameContextOptions, GameContextRace, GameContextTurn, GameContextWorld, HitReactionInput, MoveTowardCommitOptions, SceneEntityContext, SceneObjectContext, SceneWorldItemContext, TelegraphInput, VfxInput, WorldItemPickupResult, } from "./gameContextTypes.js";
|
|
329
4
|
export declare function createGameContext<TAssetRef extends ModelAssetRef, TMultiplayer>(options: GameContextOptions<TAssetRef, TMultiplayer>): GameContext;
|