@wildshard/engine 0.0.0 → 0.1.15
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 +128 -0
- package/budgets/calibration/m5-2026-10-01T08-07-18-573Z.json +3985 -0
- package/budgets/calibration/m5-2026-10-01T22-02-53-510Z.json +4473 -0
- package/budgets/calibration-reports/README.md +25 -0
- package/budgets/calibration-reports/_template.desktop.json +1994 -0
- package/budgets/calibration-reports/_template.phone.json +2069 -0
- package/budgets/calibration-reports/assessment.json +571 -0
- package/budgets/calibration-reports/driftwood-isle.phone.json +72 -0
- package/budgets/calibration-reports/far-reach.desktop.json +73158 -0
- package/budgets/calibration-reports/far-reach.phone.json +73086 -0
- package/budgets/calibration-reports/nalati-grasslands-x22.desktop.json +19525 -0
- package/budgets/calibration-reports/nalati-grasslands.phone.json +72 -0
- package/budgets/calibration-reports/nine-dragon-stack-g224.desktop.json +146 -0
- package/budgets/calibration-reports/nine-dragon-stack.phone.json +89 -0
- package/budgets/calibration-reports/pine-hollow.desktop.json +54949 -0
- package/budgets/calibration-reports/pine-hollow.phone.json +72 -0
- package/budgets/calibration-reports/sunscar-dunes.desktop.json +7788 -0
- package/budgets/calibration-reports/sunscar-dunes.phone.json +9378 -0
- package/budgets/calibration.json +4473 -0
- package/budgets/ceiling-re-records.json +71 -0
- package/budgets/ceiling-sources.json +5985 -0
- package/budgets/desktop-reference.json +7 -0
- package/budgets/g224-ceiling-re-record.json +15 -0
- package/budgets/grid-strip-room.json +9 -0
- package/budgets/nalati-ceiling-sources.json +44 -0
- package/budgets/shard-size-baseline.json +552 -0
- package/budgets/x22-ceiling-re-record.json +15 -0
- package/budgets/x7-ceiling-sources.json +41 -0
- package/index.html +622 -0
- package/lint/api-undocumented.json +7 -0
- package/lint/authored-html.d.mts +4 -0
- package/lint/authored-html.mjs +313 -0
- package/lint/base64-debt.json +18 -0
- package/lint/class-moves.json +4 -0
- package/lint/client-plan-boundary.d.mts +2 -0
- package/lint/client-plan-boundary.mjs +102 -0
- package/lint/debug-flags.d.mts +5 -0
- package/lint/debug-flags.mjs +190 -0
- package/lint/declaration-config.d.mts +2 -0
- package/lint/declaration-config.mjs +19 -0
- package/lint/edge-exemptions.json +6 -0
- package/lint/engine-internal.json +26 -0
- package/lint/engine-side-edges.json +5 -0
- package/lint/engine-sides.d.mts +30 -0
- package/lint/engine-sides.json +1794 -0
- package/lint/engine-sides.mjs +269 -0
- package/lint/engine-words.json +7 -0
- package/lint/exec-max-buffer.mjs +88 -0
- package/lint/generated-import-debt.json +117 -0
- package/lint/generated-source-debt.json +1029 -0
- package/lint/host-callback-syntax.d.mts +4 -0
- package/lint/host-callback-syntax.mjs +62 -0
- package/lint/host-callbacks.d.mts +6 -0
- package/lint/host-callbacks.mjs +123 -0
- package/lint/host-files.d.mts +1 -0
- package/lint/host-files.mjs +7 -0
- package/lint/host-reviews.json +14 -0
- package/lint/layer-edges.json +15 -0
- package/lint/layer-exports.d.mts +2 -0
- package/lint/layer-exports.mjs +23 -0
- package/lint/legacy-line-basis.json +995 -0
- package/lint/listed-view-code.json +13 -0
- package/lint/manifest-closure-budget.json +6 -0
- package/lint/nine-tiling-baseline.json +35 -0
- package/lint/no-base64.d.mts +19 -0
- package/lint/no-base64.mjs +112 -0
- package/lint/no-binary-json.json +174 -0
- package/lint/no-generated-import.d.mts +22 -0
- package/lint/no-generated-import.mjs +114 -0
- package/lint/page-events.json +895 -0
- package/lint/platform-pending-users.json +2520 -0
- package/lint/platform-pending-users.md +18 -0
- package/lint/ratchet-files.d.mts +2 -0
- package/lint/ratchet-files.mjs +45 -0
- package/lint/ratchet.json +230 -0
- package/lint/ratchet.mjs +212 -0
- package/lint/recorded-debt.mjs +24 -0
- package/lint/row-functions.json +173 -0
- package/lint/runtime-files.d.mts +12 -0
- package/lint/runtime-files.json +16 -0
- package/lint/runtime-files.mjs +69 -0
- package/lint/runtime-performance.d.mts +6 -0
- package/lint/runtime-performance.json +14 -0
- package/lint/runtime-performance.mjs +184 -0
- package/lint/schema-types.d.mts +9 -0
- package/lint/schema-types.mjs +114 -0
- package/lint/shard-coupling.json +333 -0
- package/lint/shard-imports.d.mts +5 -0
- package/lint/shard-imports.mjs +43 -0
- package/lint/shard-layout.json +64 -0
- package/lint/shard-platform.json +24 -0
- package/lint/shard-words.pin.json +421 -0
- package/lint/shardfile-boundaries.d.mts +10 -0
- package/lint/shardfile-boundaries.mjs +122 -0
- package/lint/sim-closure.d.mts +3 -0
- package/lint/sim-closure.json +3 -0
- package/lint/sim-closure.mjs +112 -0
- package/lint/sim-players.json +17 -0
- package/lint/sim-schema-leaves.json +1 -0
- package/lint/source-stamps.mjs +12 -0
- package/lint/syntax-values.mjs +299 -0
- package/lint/tile-bake-debt.json +556 -0
- package/lint/url-params.json +48 -0
- package/lint/weapon-subclasses.json +4 -0
- package/lint/wildshard-plugin.d.ts +13 -0
- package/lint/wildshard-plugin.js +1196 -0
- package/package.json +1304 -4
- package/scripts/agent-parity.mjs +1524 -0
- package/scripts/agent-sync.mjs +518 -0
- package/scripts/agent-time.py +475 -0
- package/scripts/apfs-clone.mjs +67 -0
- package/scripts/api-origin.d.mts +3 -0
- package/scripts/api-origin.mjs +38 -0
- package/scripts/app-build/appCook.ts +19 -0
- package/scripts/app-build/assetHashes.ts +57 -0
- package/scripts/app-build/assetLimits.d.mts +15 -0
- package/scripts/app-build/assetLimits.mjs +61 -0
- package/scripts/app-build/assetTables.d.mts +19 -0
- package/scripts/app-build/assetTables.mjs +68 -0
- package/scripts/app-build/audioPacks.ts +41 -0
- package/scripts/app-build/bakedTextures.d.mts +2 -0
- package/scripts/app-build/bakedTextures.mjs +59 -0
- package/scripts/app-build/basis.ts +25 -0
- package/scripts/app-build/bootExtras.ts +127 -0
- package/scripts/app-build/bootModules.ts +271 -0
- package/scripts/app-build/bootProductTiers.ts +48 -0
- package/scripts/app-build/bootProducts.ts +67 -0
- package/scripts/app-build/buildIdentity.d.mts +16 -0
- package/scripts/app-build/buildIdentity.mjs +89 -0
- package/scripts/app-build/catalogue.ts +216 -0
- package/scripts/app-build/chunkReport.d.mts +3 -0
- package/scripts/app-build/chunkReport.mjs +29 -0
- package/scripts/app-build/contentBase.d.mts +2 -0
- package/scripts/app-build/contentBase.mjs +34 -0
- package/scripts/app-build/controlChunks.ts +106 -0
- package/scripts/app-build/crossroadsRig.ts +17 -0
- package/scripts/app-build/doctorOutput.mjs +19 -0
- package/scripts/app-build/finalChunkNames.d.mts +3 -0
- package/scripts/app-build/finalChunkNames.mjs +94 -0
- package/scripts/app-build/gen.ts +100 -0
- package/scripts/app-build/gridSeams.d.mts +16 -0
- package/scripts/app-build/gridSeams.mjs +95 -0
- package/scripts/app-build/homeIcons.d.mts +20 -0
- package/scripts/app-build/homeIcons.mjs +64 -0
- package/scripts/app-build/importMap.d.mts +7 -0
- package/scripts/app-build/importMap.mjs +102 -0
- package/scripts/app-build/noTopLevelAwait.d.mts +4 -0
- package/scripts/app-build/noTopLevelAwait.mjs +36 -0
- package/scripts/app-build/outputProducts.d.mts +10 -0
- package/scripts/app-build/outputProducts.mjs +114 -0
- package/scripts/app-build/previousDeploy.d.mts +24 -0
- package/scripts/app-build/previousDeploy.mjs +245 -0
- package/scripts/app-build/serviceWorker.ts +145 -0
- package/scripts/app-build/splitOutput.d.mts +6 -0
- package/scripts/app-build/splitOutput.mjs +98 -0
- package/scripts/app-build/standaloneOutput.d.mts +4 -0
- package/scripts/app-build/standaloneOutput.mjs +31 -0
- package/scripts/app-build/validationReceipts.d.mts +2 -0
- package/scripts/app-build/validationReceipts.mjs +25 -0
- package/scripts/app-build/versionFiles.ts +20 -0
- package/scripts/app-build/worldMapAtlas.ts +62 -0
- package/scripts/app-build/writtenBundle.ts +51 -0
- package/scripts/app-build-pipeline-proof.mjs +67 -0
- package/scripts/app-build-pipeline.mjs +274 -0
- package/scripts/assert-store-layout.mjs +17 -0
- package/scripts/author-bundle-cache.d.mts +1 -0
- package/scripts/author-bundle-cache.mjs +137 -0
- package/scripts/author-bundle-usage.d.mts +3 -0
- package/scripts/author-bundle-usage.mjs +20 -0
- package/scripts/authored-manifest.d.mts +7 -0
- package/scripts/authored-manifest.mjs +217 -0
- package/scripts/authoring-inputs.d.mts +8 -0
- package/scripts/authoring-inputs.mjs +104 -0
- package/scripts/bake-grid-seams.mjs +110 -0
- package/scripts/bake-input-hashes.d.mts +6 -0
- package/scripts/bake-input-hashes.mjs +59 -0
- package/scripts/bake-loader.mjs +105 -0
- package/scripts/bake-output.d.mts +29 -0
- package/scripts/bake-output.mjs +84 -0
- package/scripts/bench-load.mjs +391 -0
- package/scripts/boot-dist-plan.mjs +47 -0
- package/scripts/boot-dist.py +251 -0
- package/scripts/boot-pack-parts.d.mts +2 -0
- package/scripts/boot-pack-parts.mjs +51 -0
- package/scripts/boot-publication-proof.d.mts +2 -0
- package/scripts/boot-publication-proof.mjs +64 -0
- package/scripts/boot-publication.d.mts +19 -0
- package/scripts/boot-publication.generated.json +3684 -0
- package/scripts/boot-publication.mjs +100 -0
- package/scripts/boot-temp-warn.sh +70 -0
- package/scripts/boot-timing-proof.mjs +264 -0
- package/scripts/browser-lane.sh +288 -0
- package/scripts/browser-slot-lock.py +49 -0
- package/scripts/budget-ceilings.mjs +88 -0
- package/scripts/budget-ratchet.d.mts +1 -0
- package/scripts/budget-ratchet.mjs +8 -0
- package/scripts/build-app.mjs +49 -0
- package/scripts/build-cache-report.d.mts +20 -0
- package/scripts/build-cache-report.mjs +104 -0
- package/scripts/build-mirror.d.mts +24 -0
- package/scripts/build-mirror.mjs +387 -0
- package/scripts/build-server.mjs +47 -0
- package/scripts/build-without-browser.mjs +14 -0
- package/scripts/built-product.d.mts +22 -0
- package/scripts/built-product.mjs +187 -0
- package/scripts/calibrate.mjs +43 -0
- package/scripts/capture-main-menu-hero.mjs +457 -0
- package/scripts/catalogue-all-heads.ts +35 -0
- package/scripts/changelog.d.mts +18 -0
- package/scripts/changelog.mjs +129 -0
- package/scripts/chaos-proxy-core.mjs +978 -0
- package/scripts/chaos-proxy-proof.mjs +1130 -0
- package/scripts/chaos-proxy.mjs +68 -0
- package/scripts/chaos-router.mjs +107 -0
- package/scripts/chaos-rules.mjs +197 -0
- package/scripts/check-chunks.d.mts +8 -0
- package/scripts/check-chunks.mjs +143 -0
- package/scripts/check-closed-components.d.mts +7 -0
- package/scripts/check-closed-components.mjs +87 -0
- package/scripts/check-css.mjs +235 -0
- package/scripts/check-custom-sections-zero.d.mts +2 -0
- package/scripts/check-custom-sections-zero.mjs +43 -0
- package/scripts/check-devserver.d.mts +2 -0
- package/scripts/check-devserver.mjs +29 -0
- package/scripts/check-engine-sides.mjs +85 -0
- package/scripts/check-graph.d.mts +9 -0
- package/scripts/check-graph.mjs +217 -0
- package/scripts/check-listeners.mjs +122 -0
- package/scripts/check-model-sources.mjs +106 -0
- package/scripts/check-models.d.mts +22 -0
- package/scripts/check-models.mjs +367 -0
- package/scripts/check-page-events.mjs +386 -0
- package/scripts/check-paths.allow.json +1282 -0
- package/scripts/check-paths.mjs +97 -0
- package/scripts/check-platform-ratchets.d.mts +7 -0
- package/scripts/check-platform-ratchets.mjs +297 -0
- package/scripts/check-shards.d.mts +5 -0
- package/scripts/check-shards.mjs +101 -0
- package/scripts/check-sim-players.mjs +82 -0
- package/scripts/check-spelled-paths.d.mts +1 -0
- package/scripts/check-spelled-paths.mjs +34 -0
- package/scripts/chromium-keychain-check.mjs +140 -0
- package/scripts/chromium-keychain.d.mts +1 -0
- package/scripts/chromium-keychain.mjs +5 -0
- package/scripts/chromium-memory-browser.d.mts +4 -0
- package/scripts/chromium-memory-browser.mjs +52 -0
- package/scripts/ci-bisect.py +91 -0
- package/scripts/ci-browser.sh +45 -0
- package/scripts/ci-checks.d.mts +2 -0
- package/scripts/ci-checks.mjs +94 -0
- package/scripts/ci-disk-census.py +58 -0
- package/scripts/ci-docs-proof.mjs +84 -0
- package/scripts/ci-exact-reuse.d.mts +3 -0
- package/scripts/ci-exact-reuse.mjs +73 -0
- package/scripts/ci-generated-manifest.sh +18 -0
- package/scripts/ci-native-fixtures.mjs +36 -0
- package/scripts/ci-pack.d.mts +14 -0
- package/scripts/ci-pack.mjs +231 -0
- package/scripts/ci-playwright-install.sh +11 -0
- package/scripts/ci-product-cache.d.mts +2 -0
- package/scripts/ci-product-cache.mjs +57 -0
- package/scripts/ci-products.py +285 -0
- package/scripts/ci-proof-jobs.d.mts +3 -0
- package/scripts/ci-proof-jobs.mjs +34 -0
- package/scripts/ci-selection.mjs +63 -0
- package/scripts/ci-shard-wall-proof.mjs +26 -0
- package/scripts/ci-shard-wall.mjs +35 -0
- package/scripts/ci-static.sh +63 -0
- package/scripts/commit.sh +305 -0
- package/scripts/commit_lane.py +42 -0
- package/scripts/committed-fast-checks.mjs +262 -0
- package/scripts/committed-source-tables.mjs +47 -0
- package/scripts/compare-platform-steps.mjs +15 -0
- package/scripts/compiler-code.d.mts +3 -0
- package/scripts/compiler-code.mjs +69 -0
- package/scripts/complete-at-control-snapshot.mjs +297 -0
- package/scripts/complete-at-control.mjs +580 -0
- package/scripts/content-base-proof.mjs +158 -0
- package/scripts/content-sw-proof.mjs +215 -0
- package/scripts/cook-admission-proof.mjs +42 -0
- package/scripts/cook-audit.ts +57 -0
- package/scripts/cook-job.mjs +32 -0
- package/scripts/cook-parts-report.mjs +34 -0
- package/scripts/cook-revision.ts +60 -0
- package/scripts/cook-to-play.mjs +96 -0
- package/scripts/cook-worker.mjs +78 -0
- package/scripts/cook-worker.service +5 -0
- package/scripts/cook.mjs +19 -0
- package/scripts/core-heap-diagnostic.d.mts +21 -0
- package/scripts/core-heap-diagnostic.mjs +52 -0
- package/scripts/cpu-admission-proof.mjs +55 -0
- package/scripts/cpu-admission.mjs +32 -0
- package/scripts/cpu-admission.py +243 -0
- package/scripts/cpu-broker-proof.mjs +96 -0
- package/scripts/cpu-broker.mjs +56 -0
- package/scripts/cpu-broker.py +119 -0
- package/scripts/cpu-census-proof.py +193 -0
- package/scripts/cpu-census.py +374 -0
- package/scripts/crossroads-proof.mjs +32 -0
- package/scripts/crossroads-rig/core.d.ts +16 -0
- package/scripts/crossroads-rig/core.js +417 -0
- package/scripts/crossroads-rig/desktop-probe.mjs +163 -0
- package/scripts/crossroads-rig/index.html +21 -0
- package/scripts/crossroads-rig/phone.js +74 -0
- package/scripts/crossroads-rig/production-probe.mjs +160 -0
- package/scripts/crossroads-rig/production.html +23 -0
- package/scripts/crossroads-rig/production.md +28 -0
- package/scripts/crossroads-rig/rig.js +36 -0
- package/scripts/crossroads-rig/sim-probe.mjs +217 -0
- package/scripts/crossroads-rig/stage.sh +11 -0
- package/scripts/crossroads-smoke.mjs +83 -0
- package/scripts/debug-settings.d.mts +24 -0
- package/scripts/debug-settings.mjs +80 -0
- package/scripts/decision-legacy-lines.d.mts +4 -0
- package/scripts/decision-legacy-lines.mjs +30 -0
- package/scripts/deck-skip-proof.mjs +63 -0
- package/scripts/deny-browser.mjs +11 -0
- package/scripts/docs-inputs-proof.mjs +31 -0
- package/scripts/doctor-proof.mjs +186 -0
- package/scripts/dome-cameras.d.mts +27 -0
- package/scripts/dome-cameras.mjs +77 -0
- package/scripts/download-bench/link.mjs +101 -0
- package/scripts/e2e-client.mjs +153 -0
- package/scripts/e2e-offline.sh +9 -0
- package/scripts/e2e-paths.mjs +31 -0
- package/scripts/e2e-watcher.mjs +191 -0
- package/scripts/e7-doctor-proof.mjs +61 -0
- package/scripts/e7-doctor-request-proof.mjs +179 -0
- package/scripts/e7-doctor-worker-proof.mjs +221 -0
- package/scripts/e7-live-staging-proof.mjs +72 -0
- package/scripts/e7-playtest-table.mjs +67 -0
- package/scripts/e7-records-proof.mjs +17 -0
- package/scripts/e7-voice-staging-proof.mjs +94 -0
- package/scripts/engine-ci-budget.ts +39 -0
- package/scripts/engine-ci-membership-proof.ts +26 -0
- package/scripts/engine-ci-plan.ts +120 -0
- package/scripts/engine-ci-proof.mjs +41 -0
- package/scripts/engine-ci-sequencer.ts +18 -0
- package/scripts/engine-ci-shard.mjs +28 -0
- package/scripts/engine-ci.config.ts +17 -0
- package/scripts/engine-order-proof.mjs +41 -0
- package/scripts/environment-boundary-proof.mjs +28 -0
- package/scripts/fetch-assets.mjs +76 -0
- package/scripts/format-hook.mjs +20 -0
- package/scripts/format-lock.d.mts +6 -0
- package/scripts/format-lock.mjs +120 -0
- package/scripts/format-package.d.mts +4 -0
- package/scripts/format-package.mjs +12 -0
- package/scripts/frame-cost-report.ts +85 -0
- package/scripts/frame-floor-args.d.mts +14 -0
- package/scripts/frame-floor-args.mjs +156 -0
- package/scripts/frame-floor-buffer-pressure.d.mts +3 -0
- package/scripts/frame-floor-buffer-pressure.mjs +91 -0
- package/scripts/frame-floor-draw-report.d.mts +38 -0
- package/scripts/frame-floor-draw-report.mjs +112 -0
- package/scripts/frame-floor-gl-time.d.mts +4 -0
- package/scripts/frame-floor-gl-time.mjs +104 -0
- package/scripts/frame-floor-gpu-bisect.mjs +120 -0
- package/scripts/frame-floor-grid.d.mts +67 -0
- package/scripts/frame-floor-grid.mjs +552 -0
- package/scripts/frame-floor-inventory.d.mts +2 -0
- package/scripts/frame-floor-inventory.mjs +10 -0
- package/scripts/frame-floor-jsc-gc.d.mts +15 -0
- package/scripts/frame-floor-jsc-gc.mjs +122 -0
- package/scripts/frame-floor-native-pressure.d.mts +4 -0
- package/scripts/frame-floor-native-pressure.mjs +78 -0
- package/scripts/frame-floor-native.mjs +108 -0
- package/scripts/frame-floor-navigation.d.mts +12 -0
- package/scripts/frame-floor-navigation.mjs +41 -0
- package/scripts/frame-floor-pause-ablation.d.mts +15 -0
- package/scripts/frame-floor-pause-ablation.mjs +90 -0
- package/scripts/frame-floor-pending.d.mts +16 -0
- package/scripts/frame-floor-pending.mjs +29 -0
- package/scripts/frame-floor-programs.mjs +39 -0
- package/scripts/frame-floor-report-phase.d.mts +10 -0
- package/scripts/frame-floor-report-phase.mjs +41 -0
- package/scripts/frame-floor-script-profile.d.mts +20 -0
- package/scripts/frame-floor-script-profile.mjs +159 -0
- package/scripts/frame-floor-settings.d.mts +6 -0
- package/scripts/frame-floor-settings.mjs +118 -0
- package/scripts/frame-floor-standing.d.mts +4 -0
- package/scripts/frame-floor-standing.mjs +20 -0
- package/scripts/frame-floor-task-clock.d.mts +4 -0
- package/scripts/frame-floor-task-clock.mjs +284 -0
- package/scripts/frame-floor-timeline-session.ts +76 -0
- package/scripts/frame-floor-wasm-constructors.d.mts +6 -0
- package/scripts/frame-floor-wasm-constructors.mjs +37 -0
- package/scripts/frame-floor-wasm-probe.d.mts +2 -0
- package/scripts/frame-floor-wasm-probe.mjs +51 -0
- package/scripts/frame-floor-webkit-timeline.d.mts +26 -0
- package/scripts/frame-floor-webkit-timeline.mjs +285 -0
- package/scripts/frame-floor.mjs +1290 -0
- package/scripts/full-test-log-proof.py +191 -0
- package/scripts/full-test-report.py +154 -0
- package/scripts/function-source.d.mts +3 -0
- package/scripts/function-source.mjs +48 -0
- package/scripts/g571-hosts.d.mts +3 -0
- package/scripts/g571-hosts.mjs +54 -0
- package/scripts/game-plugins.d.mts +22 -0
- package/scripts/gate-related-tests.d.mts +7 -0
- package/scripts/gate-related-tests.mjs +178 -0
- package/scripts/gen-api.d.mts +10 -0
- package/scripts/gen-api.mjs +134 -0
- package/scripts/gen-boot-cache.d.mts +2 -0
- package/scripts/gen-boot-cache.mjs +146 -0
- package/scripts/gen-budget-derivations.d.mts +1 -0
- package/scripts/gen-budget-derivations.mjs +43 -0
- package/scripts/gen-programs.d.mts +8 -0
- package/scripts/gen-programs.mjs +82 -0
- package/scripts/gen-shard-words.d.mts +4 -0
- package/scripts/gen-shard-words.mjs +188 -0
- package/scripts/gen-source.d.mts +4 -0
- package/scripts/gen-source.mjs +73 -0
- package/scripts/gen-starter-arm-clips.d.mts +4 -0
- package/scripts/gen-starter-arm-clips.mjs +17 -0
- package/scripts/gen-starter-bag.d.mts +4 -0
- package/scripts/gen-starter-bag.mjs +16 -0
- package/scripts/gen-starter-effects.d.mts +4 -0
- package/scripts/gen-starter-effects.mjs +16 -0
- package/scripts/gen-starter-weapons.d.mts +4 -0
- package/scripts/gen-starter-weapons.mjs +16 -0
- package/scripts/gen.mjs +6 -0
- package/scripts/generate-title-launch.mjs +55 -0
- package/scripts/generated-files.d.mts +6 -0
- package/scripts/generated-files.mjs +86 -0
- package/scripts/generated-input-reading.d.mts +3 -0
- package/scripts/generated-input-reading.mjs +89 -0
- package/scripts/generated-policy.d.mts +13 -0
- package/scripts/generated-policy.mjs +113 -0
- package/scripts/generated-source.d.mts +11 -0
- package/scripts/generated-source.mjs +214 -0
- package/scripts/generation-cache-prune.d.mts +10 -0
- package/scripts/generation-cache-prune.mjs +128 -0
- package/scripts/gfx-toggle/compare.mjs +133 -0
- package/scripts/git-common.d.mts +1 -0
- package/scripts/git-common.mjs +13 -0
- package/scripts/git-rule-counts.mjs +16 -0
- package/scripts/git-source-view.mjs +225 -0
- package/scripts/goldens/board.py +176 -0
- package/scripts/goldens/capture-inputs.d.mts +4 -0
- package/scripts/goldens/capture-inputs.mjs +35 -0
- package/scripts/goldens/capture.mjs +214 -0
- package/scripts/goldens/colour_shift.py +27 -0
- package/scripts/goldens/native-residency.d.mts +10 -0
- package/scripts/goldens/native-residency.mjs +104 -0
- package/scripts/goldens/plot-inputs.d.mts +12 -0
- package/scripts/goldens/plot-inputs.mjs +46 -0
- package/scripts/gpu-gate/matrix.d.mts +3 -0
- package/scripts/gpu-gate/matrix.mjs +48 -0
- package/scripts/gpu-gate/probe.mjs +30 -0
- package/scripts/gpu-gate/status.d.mts +4 -0
- package/scripts/gpu-gate/status.mjs +112 -0
- package/scripts/gpu-perf/com.wildshard.gpu-perf.plist +11 -0
- package/scripts/gpu-perf/install.sh +31 -0
- package/scripts/gpu-perf/nightly.mjs +216 -0
- package/scripts/gpu-perf/nightly.sh +7 -0
- package/scripts/gpu-perf/report.d.mts +18 -0
- package/scripts/gpu-perf/report.mjs +109 -0
- package/scripts/gpu-perf/timing.sh +17 -0
- package/scripts/gpu-trace-frames.mjs +113 -0
- package/scripts/grid-crossing-walk-proof.mjs +172 -0
- package/scripts/grid-gate-proof.mjs +126 -0
- package/scripts/grid-ready-latches.d.mts +7 -0
- package/scripts/grid-ready-latches.mjs +44 -0
- package/scripts/grid-ready-memory.d.mts +3 -0
- package/scripts/grid-ready-memory.mjs +86 -0
- package/scripts/grid-runtime-evidence.d.mts +4 -0
- package/scripts/grid-runtime-evidence.mjs +107 -0
- package/scripts/grid-spawn-proof.mjs +317 -0
- package/scripts/guard-counts.d.mts +8 -0
- package/scripts/guard-counts.mjs +136 -0
- package/scripts/guard-index-tree.d.mts +2 -0
- package/scripts/guard-index-tree.mjs +19 -0
- package/scripts/heavy-lane-lease.d.mts +2 -0
- package/scripts/heavy-lane-lease.mjs +33 -0
- package/scripts/heavy-lane.py +652 -0
- package/scripts/herdr-prompt.sh +13 -0
- package/scripts/herdr-question-open.sh +22 -0
- package/scripts/hero-shots.mjs +168 -0
- package/scripts/home-icons.mjs +27 -0
- package/scripts/host-activity.ts +41 -0
- package/scripts/hud-worst/chat.ts +33 -0
- package/scripts/hud-worst.mjs +344 -0
- package/scripts/inbox-pull.mjs +129 -0
- package/scripts/inline-shell-css.mjs +30 -0
- package/scripts/input-hash-memo.d.mts +16 -0
- package/scripts/input-hash-memo.mjs +109 -0
- package/scripts/input-snapshot.d.mts +2 -0
- package/scripts/input-snapshot.mjs +45 -0
- package/scripts/ios-memory-watchdog.py +339 -0
- package/scripts/iphone-mem-reading.sh +40 -0
- package/scripts/js-entry-census.mjs +54 -0
- package/scripts/js-payload-heap.mjs +23 -0
- package/scripts/json-declarations.d.mts +3 -0
- package/scripts/json-declarations.mjs +101 -0
- package/scripts/json-output-guard.d.mts +6 -0
- package/scripts/json-output-guard.mjs +50 -0
- package/scripts/ktx2-engine-map.json +156 -0
- package/scripts/ktx2-tables.d.mts +5 -0
- package/scripts/ktx2-tables.mjs +103 -0
- package/scripts/land.d.mts +17 -0
- package/scripts/land.mjs +888 -0
- package/scripts/lane-watchdog.d.mts +11 -0
- package/scripts/lane-watchdog.mjs +256 -0
- package/scripts/latch-grid-evidence.d.mts +1 -0
- package/scripts/latch-grid-evidence.mjs +68 -0
- package/scripts/lift-pending-batches-proof.mjs +135 -0
- package/scripts/lift-pending-batches.mjs +124 -0
- package/scripts/lift-pending-history-proof.mjs +41 -0
- package/scripts/lift-pending-proof.mjs +27 -0
- package/scripts/lift-pending-schedule.mjs +23 -0
- package/scripts/lift-pending.d.mts +1 -0
- package/scripts/lift-pending.mjs +78 -0
- package/scripts/link-node-modules.d.mts +1 -0
- package/scripts/link-node-modules.mjs +291 -0
- package/scripts/lint-all.mjs +50 -0
- package/scripts/lint-cli.mjs +10 -0
- package/scripts/lint-fast.mjs +30 -0
- package/scripts/lint-game-selection-proof.mjs +27 -0
- package/scripts/lint-game.mjs +26 -0
- package/scripts/lint-tools.d.mts +4 -0
- package/scripts/lint-tools.mjs +28 -0
- package/scripts/listed-view-code.d.mts +7 -0
- package/scripts/listed-view-code.mjs +93 -0
- package/scripts/live-prepush.py +352 -0
- package/scripts/load-mem-probe.mjs +248 -0
- package/scripts/loading-bar-rule.mjs +107 -0
- package/scripts/loading-benchmark/accuracy-data.d.mts +12 -0
- package/scripts/loading-benchmark/accuracy-data.mjs +92 -0
- package/scripts/loading-benchmark/cache-bodies.d.mts +14 -0
- package/scripts/loading-benchmark/cache-bodies.mjs +103 -0
- package/scripts/loading-benchmark/catalogue.d.mts +8 -0
- package/scripts/loading-benchmark/catalogue.mjs +41 -0
- package/scripts/loading-benchmark/sim-shard.d.mts +60 -0
- package/scripts/loading-benchmark/sim-shard.mjs +289 -0
- package/scripts/loading-benchmark/transport.d.mts +9 -0
- package/scripts/loading-benchmark/transport.mjs +109 -0
- package/scripts/loading-card-proof.mjs +298 -0
- package/scripts/loading-fence-proof.mjs +67 -0
- package/scripts/loading-flow/analyse.mjs +280 -0
- package/scripts/loading-flow/benchmax.mjs +179 -0
- package/scripts/loading-flow/board.py +104 -0
- package/scripts/loading-flow/drive.mjs +283 -0
- package/scripts/loading-flow/layer-parity-proof.mjs +69 -0
- package/scripts/loading-flow/link-probe.mjs +99 -0
- package/scripts/loading-flow/profile.mjs +54 -0
- package/scripts/loading-flow/run.sh +51 -0
- package/scripts/loading-flow/source-maps-proof.mjs +86 -0
- package/scripts/loading-flow/source-maps.mjs +73 -0
- package/scripts/loading-flow/stalls.d.mts +39 -0
- package/scripts/loading-flow/stalls.mjs +141 -0
- package/scripts/loading-flow/sweep-input-proof.mjs +127 -0
- package/scripts/loading-flow/sweep-input.mjs +70 -0
- package/scripts/loading-flow/sweep-report.mjs +112 -0
- package/scripts/loading-flow/sweep.sh +101 -0
- package/scripts/loading-flow/target-proof.mjs +56 -0
- package/scripts/loading-flow/target.mjs +39 -0
- package/scripts/loading-time-left-proof.mjs +121 -0
- package/scripts/loading-time-left-rule.mjs +49 -0
- package/scripts/look-loop/cameras.d.mts +18 -0
- package/scripts/look-loop/cameras.mjs +109 -0
- package/scripts/look-loop/fit-lut.py +142 -0
- package/scripts/look-loop/palette-delta.py +183 -0
- package/scripts/look-loop/regions/driftwood-isle.json +25 -0
- package/scripts/look-loop/regions/far-reach.json +225 -0
- package/scripts/look-loop/regions/open-plot-night-market.json +855 -0
- package/scripts/look-loop/regions/pine-hollow.json +22 -0
- package/scripts/look-loop/regions/sunscar-dunes.json +281 -0
- package/scripts/look-loop/targets.py +229 -0
- package/scripts/look-loop/test_look_loop.py +133 -0
- package/scripts/look-loop/views.mjs +176 -0
- package/scripts/main-menu-aerial-plan.mjs +8 -0
- package/scripts/main-menu-aerial-poses.ts +292 -0
- package/scripts/main-pull.mjs +84 -0
- package/scripts/main-watch.d.mts +19 -0
- package/scripts/main-watch.mjs +248 -0
- package/scripts/manifest-art-inputs.json +4 -0
- package/scripts/manifest-budget.mjs +44 -0
- package/scripts/manifest-declaration.d.mts +3 -0
- package/scripts/manifest-declaration.mjs +40 -0
- package/scripts/manifest-spawns.mjs +38 -0
- package/scripts/manifest-static-imports.d.mts +2 -0
- package/scripts/manifest-static-imports.mjs +83 -0
- package/scripts/map-hash.d.mts +20 -0
- package/scripts/map-hash.mjs +155 -0
- package/scripts/map-painter.d.mts +13 -0
- package/scripts/map-painter.mjs +97 -0
- package/scripts/map-stylize.py +241 -0
- package/scripts/memory/cpuOwners.d.mts +4 -0
- package/scripts/memory/cpuOwners.mjs +51 -0
- package/scripts/memory/heapReader.d.mts +3 -0
- package/scripts/memory/heapReader.mjs +59 -0
- package/scripts/memory/js-heap-ratchet.json +17 -0
- package/scripts/memory/jsHeap.d.mts +6 -0
- package/scripts/memory/jsHeap.mjs +52 -0
- package/scripts/memory-report-blocks.d.mts +28 -0
- package/scripts/memory-report-blocks.mjs +60 -0
- package/scripts/memory-report-data.d.mts +25 -0
- package/scripts/memory-report-data.mjs +222 -0
- package/scripts/memory-report-graphic.d.mts +5 -0
- package/scripts/memory-report-graphic.mjs +90 -0
- package/scripts/memory-report-snapshot.d.mts +4 -0
- package/scripts/memory-report-snapshot.mjs +13 -0
- package/scripts/memory-report.d.mts +5 -0
- package/scripts/memory-report.mjs +94 -0
- package/scripts/mmo-bots.mjs +241 -0
- package/scripts/mobile-graphics-proof.mjs +120 -0
- package/scripts/model-spin-recording.d.mts +4 -0
- package/scripts/model-spin-recording.mjs +25 -0
- package/scripts/model-spin.mjs +327 -0
- package/scripts/module-cache-proof.mjs +43 -0
- package/scripts/name-prompt-proof.mjs +136 -0
- package/scripts/native-recorder-cache.d.mts +33 -0
- package/scripts/native-recorder-cache.mjs +287 -0
- package/scripts/native-retention-proof.mjs +79 -0
- package/scripts/night-market-kit-budget.d.mts +12 -0
- package/scripts/night-market-kit-budget.mjs +80 -0
- package/scripts/nightly-heads.ts +176 -0
- package/scripts/nightly-model.ts +127 -0
- package/scripts/nightly-tag.d.mts +1 -0
- package/scripts/nightly-tag.mjs +32 -0
- package/scripts/nightly.proof.ts +105 -0
- package/scripts/nightly.ts +43 -0
- package/scripts/nine-sim-memory.mjs +353 -0
- package/scripts/no-binary-json.d.mts +12 -0
- package/scripts/no-binary-json.mjs +270 -0
- package/scripts/non-engine-admission-proof.mjs +27 -0
- package/scripts/number-path-probe.d.mts +7 -0
- package/scripts/number-path-probe.mjs +57 -0
- package/scripts/offline-proof-rules.d.mts +23 -0
- package/scripts/offline-proof-rules.mjs +123 -0
- package/scripts/offline-proof.mjs +498 -0
- package/scripts/online-phone-proof.mjs +330 -0
- package/scripts/online-proof.mjs +150 -0
- package/scripts/online-ride-proof.mjs +74 -0
- package/scripts/online-rig.mjs +114 -0
- package/scripts/page-parity.mjs +99 -0
- package/scripts/page-release/content.d.mts +30 -0
- package/scripts/page-release/content.mjs +299 -0
- package/scripts/page-release/flow.d.mts +60 -0
- package/scripts/page-release/flow.mjs +365 -0
- package/scripts/page-release/hosts/workers.d.mts +8 -0
- package/scripts/page-release/hosts/workers.mjs +160 -0
- package/scripts/page-release/packs.mjs +108 -0
- package/scripts/page-release/redact.d.mts +1 -0
- package/scripts/page-release/redact.mjs +19 -0
- package/scripts/page-release.mjs +101 -0
- package/scripts/page-size.d.mts +13 -0
- package/scripts/page-size.mjs +198 -0
- package/scripts/parallel-fast-lint.d.mts +1 -0
- package/scripts/parallel-fast-lint.mjs +54 -0
- package/scripts/parity/audio-diagnostics.d.mts +5 -0
- package/scripts/parity/audio-diagnostics.mjs +63 -0
- package/scripts/parity/audio-settle.mjs +111 -0
- package/scripts/parity/black-frame.d.mts +11 -0
- package/scripts/parity/black-frame.mjs +58 -0
- package/scripts/parity/boot-smoke.d.mts +47 -0
- package/scripts/parity/boot-smoke.mjs +585 -0
- package/scripts/parity/boot-timing-delay.mjs +54 -0
- package/scripts/parity/browser-escape.d.mts +2 -0
- package/scripts/parity/browser-escape.mjs +50 -0
- package/scripts/parity/budgetCeilings.d.mts +3 -0
- package/scripts/parity/budgetCeilings.mjs +30 -0
- package/scripts/parity/budgets.d.mts +7 -0
- package/scripts/parity/budgets.mjs +73 -0
- package/scripts/parity/cache.d.mts +1 -0
- package/scripts/parity/cache.mjs +40 -0
- package/scripts/parity/canvas-bytes.d.mts +13 -0
- package/scripts/parity/canvas-bytes.mjs +96 -0
- package/scripts/parity/capture-rpc.d.mts +2 -0
- package/scripts/parity/capture-rpc.mjs +41 -0
- package/scripts/parity/capture-trace.d.mts +6 -0
- package/scripts/parity/capture-trace.mjs +63 -0
- package/scripts/parity/clock.d.mts +1 -0
- package/scripts/parity/clock.mjs +89 -0
- package/scripts/parity/combat.d.mts +14 -0
- package/scripts/parity/combat.mjs +81 -0
- package/scripts/parity/compare.d.mts +10 -0
- package/scripts/parity/compare.mjs +177 -0
- package/scripts/parity/explorer-smoke.d.mts +21 -0
- package/scripts/parity/explorer-smoke.mjs +310 -0
- package/scripts/parity/fast-png.d.mts +18 -0
- package/scripts/parity/fast-png.mjs +68 -0
- package/scripts/parity/fingerprint.mjs +8 -0
- package/scripts/parity/fixed-render.d.mts +11 -0
- package/scripts/parity/fixed-render.mjs +79 -0
- package/scripts/parity/frame-budget.d.mts +3 -0
- package/scripts/parity/frame-budget.mjs +39 -0
- package/scripts/parity/frame-bytes.d.mts +8 -0
- package/scripts/parity/frame-bytes.mjs +45 -0
- package/scripts/parity/frames.mjs +8 -0
- package/scripts/parity/glbytes.d.mts +8 -0
- package/scripts/parity/glbytes.mjs +148 -0
- package/scripts/parity/grid-boot-waits.d.mts +13 -0
- package/scripts/parity/grid-boot-waits.mjs +43 -0
- package/scripts/parity/heat-bytes.d.mts +5 -0
- package/scripts/parity/heat-bytes.mjs +32 -0
- package/scripts/parity/hover-touch.mjs +153 -0
- package/scripts/parity/hud.d.mts +4 -0
- package/scripts/parity/hud.mjs +17 -0
- package/scripts/parity/image-routes.d.mts +5 -0
- package/scripts/parity/image-routes.mjs +29 -0
- package/scripts/parity/init.d.mts +15 -0
- package/scripts/parity/init.mjs +63 -0
- package/scripts/parity/lane-browser.mjs +14 -0
- package/scripts/parity/offline.d.mts +5 -0
- package/scripts/parity/offline.mjs +24 -0
- package/scripts/parity/phone-route-browser.d.mts +20 -0
- package/scripts/parity/phone-route-browser.mjs +241 -0
- package/scripts/parity/phone-route-page.d.mts +10 -0
- package/scripts/parity/phone-route-page.mjs +245 -0
- package/scripts/parity/phone-route-runner.d.mts +2 -0
- package/scripts/parity/phone-route-runner.mjs +39 -0
- package/scripts/parity/phone-route.d.mts +43 -0
- package/scripts/parity/phone-route.mjs +212 -0
- package/scripts/parity/pool.d.mts +4 -0
- package/scripts/parity/pool.mjs +74 -0
- package/scripts/parity/poses.d.mts +6 -0
- package/scripts/parity/poses.mjs +57 -0
- package/scripts/parity/probe.d.mts +2 -0
- package/scripts/parity/probe.mjs +13 -0
- package/scripts/parity/profile.d.mts +2 -0
- package/scripts/parity/profile.mjs +52 -0
- package/scripts/parity/record.d.mts +8 -0
- package/scripts/parity/record.mjs +102 -0
- package/scripts/parity/resources.mjs +58 -0
- package/scripts/parity/saves.d.mts +1 -0
- package/scripts/parity/saves.mjs +14 -0
- package/scripts/parity/serve.d.mts +9 -0
- package/scripts/parity/serve.mjs +125 -0
- package/scripts/parity/shader-code.d.mts +2 -0
- package/scripts/parity/shader-code.mjs +10 -0
- package/scripts/parity/ssim.d.mts +4 -0
- package/scripts/parity/ssim.mjs +44 -0
- package/scripts/parity/telemetry.d.mts +1 -0
- package/scripts/parity/telemetry.mjs +19 -0
- package/scripts/parity/timeout.mjs +7 -0
- package/scripts/parity/title-trace.d.mts +13 -0
- package/scripts/parity/title-trace.mjs +59 -0
- package/scripts/parity/value.d.mts +11 -0
- package/scripts/parity/value.mjs +50 -0
- package/scripts/parity/walk.d.mts +10 -0
- package/scripts/parity/walk.mjs +109 -0
- package/scripts/parity.mjs +310 -0
- package/scripts/perf/README.md +47 -0
- package/scripts/perf/cameras24.json +2963 -0
- package/scripts/perf/draw-census-page.d.mts +10 -0
- package/scripts/perf/draw-census-page.mjs +162 -0
- package/scripts/perf/draw-census-poses.d.mts +14 -0
- package/scripts/perf/draw-census-poses.mjs +44 -0
- package/scripts/perf/draw-census-report.d.mts +24 -0
- package/scripts/perf/draw-census-report.mjs +86 -0
- package/scripts/perf/draw-census.mjs +156 -0
- package/scripts/perf/exact-world-capture.mjs +167 -0
- package/scripts/perf/gpu-census-coverage.d.mts +6 -0
- package/scripts/perf/gpu-census-coverage.mjs +47 -0
- package/scripts/perf/gpu-census-overdraw.mjs +105 -0
- package/scripts/perf/gpu-census-page.d.mts +11 -0
- package/scripts/perf/gpu-census-page.mjs +53 -0
- package/scripts/perf/gpu-census-report.d.mts +3 -0
- package/scripts/perf/gpu-census-report.mjs +15 -0
- package/scripts/perf/gpu-census.d.mts +6 -0
- package/scripts/perf/gpu-census.mjs +95 -0
- package/scripts/perf/material-program-loan.d.mts +18 -0
- package/scripts/perf/material-program-loan.mjs +88 -0
- package/scripts/perf/world-pixel-difference.d.mts +5 -0
- package/scripts/perf/world-pixel-difference.mjs +22 -0
- package/scripts/phone-loading/chromium.ts +113 -0
- package/scripts/phone-loading/cpu-profile.ts +47 -0
- package/scripts/phone-loading/fixtures.ts +18 -0
- package/scripts/phone-loading/instrument.ts +219 -0
- package/scripts/phone-loading/link.ts +115 -0
- package/scripts/phone-loading/main.ts +261 -0
- package/scripts/phone-loading/model.ts +123 -0
- package/scripts/phone-loading/native-body.ts +40 -0
- package/scripts/phone-loading/native-sizes.ts +194 -0
- package/scripts/phone-loading/network.ts +167 -0
- package/scripts/phone-loading/play.ts +132 -0
- package/scripts/phone-loading/post-control.ts +22 -0
- package/scripts/phone-loading/recording.ts +28 -0
- package/scripts/phone-loading/shaped-preview.ts +37 -0
- package/scripts/phone-loading/tsconfig.json +11 -0
- package/scripts/physics-baseline.mjs +433 -0
- package/scripts/physics-grid-entry.d.mts +15 -0
- package/scripts/physics-grid-entry.mjs +62 -0
- package/scripts/physics-grid.d.mts +10 -0
- package/scripts/physics-grid.mjs +102 -0
- package/scripts/physics-native.d.mts +6 -0
- package/scripts/physics-native.mjs +81 -0
- package/scripts/physics-route.json +4400 -0
- package/scripts/physics-walk.d.mts +16 -0
- package/scripts/physics-walk.mjs +79 -0
- package/scripts/pid-lock.d.mts +1 -0
- package/scripts/pid-lock.mjs +63 -0
- package/scripts/pin-assets.ts +94 -0
- package/scripts/pin-format.ts +43 -0
- package/scripts/pin-packs.ts +17 -0
- package/scripts/pins-exclude.d.mts +3 -0
- package/scripts/pins-exclude.mjs +54 -0
- package/scripts/pins-reuse.d.mts +27 -0
- package/scripts/pins-reuse.mjs +321 -0
- package/scripts/pins.ts +468 -0
- package/scripts/platform-chargebacks.d.mts +9 -0
- package/scripts/platform-chargebacks.mjs +135 -0
- package/scripts/playground-grapple.mjs +154 -0
- package/scripts/playground-harness.mjs +137 -0
- package/scripts/playground-horse.mjs +106 -0
- package/scripts/prebuilt-output.py +322 -0
- package/scripts/precommit-checks.d.mts +3 -0
- package/scripts/precommit-checks.mjs +115 -0
- package/scripts/precommit-inputs.d.mts +5 -0
- package/scripts/precommit-inputs.mjs +73 -0
- package/scripts/precommit-jobs.d.mts +5 -0
- package/scripts/precommit-jobs.mjs +85 -0
- package/scripts/precommit-source.py +493 -0
- package/scripts/preparation-cache-key.d.mts +2 -0
- package/scripts/preparation-cache-key.mjs +70 -0
- package/scripts/prepush-proof.mjs +36 -0
- package/scripts/preview-encoded-cache.d.mts +7 -0
- package/scripts/preview-encoded-cache.mjs +64 -0
- package/scripts/preview-lag.mjs +80 -0
- package/scripts/preview-server.mjs +256 -0
- package/scripts/preview-telemetry.d.mts +4 -0
- package/scripts/preview-telemetry.mjs +56 -0
- package/scripts/product-build-times.d.mts +3 -0
- package/scripts/product-build-times.mjs +42 -0
- package/scripts/program-discovery.d.mts +5 -0
- package/scripts/program-discovery.mjs +42 -0
- package/scripts/progress-recording.d.mts +6 -0
- package/scripts/progress-recording.mjs +26 -0
- package/scripts/progress-video.sh +27 -0
- package/scripts/proof-run.sh +69 -0
- package/scripts/prune-local-caches.mjs +10 -0
- package/scripts/public-grid.d.mts +11 -0
- package/scripts/public-grid.mjs +56 -0
- package/scripts/push-budget.d.mts +3 -0
- package/scripts/push-budget.mjs +5 -0
- package/scripts/push-cache-git-proof.mjs +32 -0
- package/scripts/push-cache-lease-proof.mjs +22 -0
- package/scripts/push-cache-proof.mjs +29 -0
- package/scripts/push-checks.d.mts +2 -0
- package/scripts/push-checks.mjs +116 -0
- package/scripts/push-cohort-proof.mjs +15 -0
- package/scripts/push-dependencies.mjs +97 -0
- package/scripts/push-dependency-proof.mjs +53 -0
- package/scripts/push-duration-sequencer.ts +26 -0
- package/scripts/push-environment.mjs +21 -0
- package/scripts/push-exclusion-proof.mjs +81 -0
- package/scripts/push-gate-copy.mjs +168 -0
- package/scripts/push-inputs.d.mts +4 -0
- package/scripts/push-inputs.mjs +99 -0
- package/scripts/push-lint-config.d.mts +4 -0
- package/scripts/push-lint-config.mjs +26 -0
- package/scripts/push-local-split.d.mts +15 -0
- package/scripts/push-local-split.mjs +116 -0
- package/scripts/push-loop.py +317 -0
- package/scripts/push-proof-cache.mjs +131 -0
- package/scripts/push-ref-tree-proof.mjs +63 -0
- package/scripts/push-related.mjs +29 -0
- package/scripts/push-selection-dev-proof.mjs +57 -0
- package/scripts/push-selection-proof.mjs +45 -0
- package/scripts/push-selection.d.mts +2 -0
- package/scripts/push-selection.mjs +65 -0
- package/scripts/push-vitest.config.ts +20 -0
- package/scripts/push_input_cache.py +306 -0
- package/scripts/quarantine-placement-proof.mjs +28 -0
- package/scripts/quarantine-renewal-proof.mjs +34 -0
- package/scripts/quarantine-window-proof.mjs +26 -0
- package/scripts/quest-complete-proof.mjs +78 -0
- package/scripts/quiet-cli.mjs +13 -0
- package/scripts/quiet_logs.py +79 -0
- package/scripts/ratchet-approval.d.mts +3 -0
- package/scripts/ratchet-approval.mjs +70 -0
- package/scripts/record-fence-reads.mjs +115 -0
- package/scripts/release-check.mjs +22 -0
- package/scripts/release-proof-proof.mjs +71 -0
- package/scripts/reload-title-proof.mjs +100 -0
- package/scripts/remote-air-proof.mjs +137 -0
- package/scripts/remote-bar-proof.mjs +75 -0
- package/scripts/remote-board-proof.mjs +129 -0
- package/scripts/remote-body-proof.mjs +101 -0
- package/scripts/remote-death-proof.mjs +134 -0
- package/scripts/remote-gait-proof.mjs +139 -0
- package/scripts/remote-held-proof.mjs +155 -0
- package/scripts/remote-hurt-proof.mjs +121 -0
- package/scripts/remote-map-proof.mjs +103 -0
- package/scripts/remote-name-proof.mjs +123 -0
- package/scripts/remote-players-proof.mjs +214 -0
- package/scripts/remote-room.mjs +75 -0
- package/scripts/remote-strike-proof.mjs +148 -0
- package/scripts/renderer-revision-replay.mjs +49 -0
- package/scripts/renderer-revision.d.mts +12 -0
- package/scripts/renderer-revision.mjs +101 -0
- package/scripts/renderer-revision.proof.mjs +71 -0
- package/scripts/repo-size.d.mts +43 -0
- package/scripts/repo-size.mjs +540 -0
- package/scripts/ring-cook.mjs +51 -0
- package/scripts/ring-step.ts +112 -0
- package/scripts/ring1.sh +79 -0
- package/scripts/room-deploy.mjs +130 -0
- package/scripts/room-soak.mjs +40 -0
- package/scripts/runtime_input_copies.py +49 -0
- package/scripts/scorecard.mjs +1156 -0
- package/scripts/script-scenario-metrics.d.mts +10 -0
- package/scripts/script-scenario-metrics.mjs +75 -0
- package/scripts/section-types.d.mts +3 -0
- package/scripts/section-types.mjs +35 -0
- package/scripts/sentry-maps.d.mts +9 -0
- package/scripts/sentry-maps.mjs +94 -0
- package/scripts/serialize-asset-tables.mjs +13 -0
- package/scripts/serve-build.sh +392 -0
- package/scripts/serve-port-lease.py +100 -0
- package/scripts/serve-shared-preview.py +295 -0
- package/scripts/server-origin.mjs +10 -0
- package/scripts/server-release/github.mjs +142 -0
- package/scripts/server-release/publish.d.mts +19 -0
- package/scripts/server-release/publish.mjs +143 -0
- package/scripts/server-release/sign.d.mts +10 -0
- package/scripts/server-release/sign.mjs +75 -0
- package/scripts/shard-component-spans.d.mts +15 -0
- package/scripts/shard-component-spans.mjs +18 -0
- package/scripts/shard-components.d.mts +16 -0
- package/scripts/shard-components.mjs +365 -0
- package/scripts/shard-coupling.d.mts +11 -0
- package/scripts/shard-coupling.mjs +238 -0
- package/scripts/shard-folders.mjs +14 -0
- package/scripts/shard-net-lines.d.mts +13 -0
- package/scripts/shard-net-lines.mjs +62 -0
- package/scripts/shard-output-content.d.mts +4 -0
- package/scripts/shard-output-content.mjs +27 -0
- package/scripts/shard-outputs.d.mts +12 -0
- package/scripts/shard-outputs.mjs +64 -0
- package/scripts/shard-phone-memory.d.mts +37 -0
- package/scripts/shard-phone-memory.mjs +556 -0
- package/scripts/shard-platform-format.d.mts +10 -0
- package/scripts/shard-platform-format.mjs +7 -0
- package/scripts/shard-platform-hosts.d.mts +2 -0
- package/scripts/shard-platform-hosts.mjs +93 -0
- package/scripts/shard-platform-output.d.mts +12 -0
- package/scripts/shard-platform-output.mjs +74 -0
- package/scripts/shard-platform-sections.d.mts +2 -0
- package/scripts/shard-platform-sections.mjs +9 -0
- package/scripts/shard-platform.d.mts +76 -0
- package/scripts/shard-platform.mjs +1072 -0
- package/scripts/shard-public.d.mts +3 -0
- package/scripts/shard-public.mjs +36 -0
- package/scripts/shard-runtime-closure.d.mts +3 -0
- package/scripts/shard-runtime-closure.mjs +30 -0
- package/scripts/shard-size-gate.d.mts +13 -0
- package/scripts/shard-size-gate.mjs +135 -0
- package/scripts/shard-size-watch.d.mts +7 -0
- package/scripts/shard-size-watch.mjs +70 -0
- package/scripts/shard-wire-meter.mjs +107 -0
- package/scripts/shardfile-cache.d.mts +17 -0
- package/scripts/shardfile-cache.mjs +268 -0
- package/scripts/shardfile-inputs.d.mts +19 -0
- package/scripts/shardfile-inputs.mjs +452 -0
- package/scripts/shardfile-validation-revision.d.mts +1 -0
- package/scripts/shardfile-validation-revision.mjs +30 -0
- package/scripts/shards.d.mts +7 -0
- package/scripts/shards.mjs +16 -0
- package/scripts/side-parity.d.mts +8 -0
- package/scripts/side-parity.mjs +220 -0
- package/scripts/sim-boost-lap.mjs +198 -0
- package/scripts/sim-grid-entry.mjs +534 -0
- package/scripts/sim-in-runtime.d.mts +6 -0
- package/scripts/sim-in-runtime.mjs +146 -0
- package/scripts/sim-lane.sh +351 -0
- package/scripts/sim-mem-phases.py +195 -0
- package/scripts/sim-memory.mjs +414 -0
- package/scripts/sim-node-loader.mjs +37 -0
- package/scripts/sim-presentation-proof.py +37 -0
- package/scripts/sim-quiet.py +160 -0
- package/scripts/sim-safari-ready.py +896 -0
- package/scripts/sim-transport.c +93 -0
- package/scripts/slice-inputs.ts +31 -0
- package/scripts/smoke-timings.py +34 -0
- package/scripts/snapshot-admission-proof.mjs +55 -0
- package/scripts/soak/boundary.mjs +110 -0
- package/scripts/soak/inspector.d.mts +18 -0
- package/scripts/soak/inspector.mjs +74 -0
- package/scripts/soak/memory-categories.d.mts +12 -0
- package/scripts/soak/memory-categories.mjs +28 -0
- package/scripts/socket-smoke.mjs +20 -0
- package/scripts/sort-sides.d.mts +33 -0
- package/scripts/sort-sides.mjs +919 -0
- package/scripts/source-generation-outputs.json +11 -0
- package/scripts/source-generators.d.mts +11 -0
- package/scripts/source-generators.mjs +59 -0
- package/scripts/source-input-proof.d.mts +12 -0
- package/scripts/source-input-proof.mjs +106 -0
- package/scripts/source-table-cache.d.mts +2 -0
- package/scripts/source-table-cache.mjs +102 -0
- package/scripts/sp-tools.py +150 -0
- package/scripts/sp-tools.sh +6 -0
- package/scripts/split-repair-data-shard.mjs +98 -0
- package/scripts/split-repair-guardian.mjs +26 -0
- package/scripts/split-repair-hare.mjs +54 -0
- package/scripts/split-repair-held-melee.mjs +41 -0
- package/scripts/split-repair-horse-panic.mjs +45 -0
- package/scripts/split-repair-movers.mjs +92 -0
- package/scripts/split-repair-nalati-signals.mjs +94 -0
- package/scripts/split-repair-perks.mjs +73 -0
- package/scripts/split-repair-pine-writes.mjs +76 -0
- package/scripts/split-repair-proof.mjs +24 -0
- package/scripts/split-repair-sky-trails.mjs +110 -0
- package/scripts/split-repair-stun.mjs +37 -0
- package/scripts/split-repair-wake-loss.mjs +35 -0
- package/scripts/split-repair-whip.mjs +44 -0
- package/scripts/staging-proof-lines.d.mts +8 -0
- package/scripts/staging-proof-lines.mjs +85 -0
- package/scripts/standalone-smoke.mjs +116 -0
- package/scripts/storage-policy.json +89 -0
- package/scripts/temp-janitor.d.mts +6 -0
- package/scripts/temp-janitor.mjs +40 -0
- package/scripts/template-format-proof.mjs +44 -0
- package/scripts/test-amber.d.mts +11 -0
- package/scripts/test-amber.mjs +90 -0
- package/scripts/test-build-tools.ts +24 -0
- package/scripts/test-facade-instancing.mjs +53 -0
- package/scripts/test-ios-memory-watchdog.py +107 -0
- package/scripts/test-products.json +389 -0
- package/scripts/test-quarantine.d.mts +6 -0
- package/scripts/test-quarantine.mjs +132 -0
- package/scripts/test-shard-plan.ts +66 -0
- package/scripts/test-timings.d.mts +14 -0
- package/scripts/test-timings.mjs +174 -0
- package/scripts/test_agent_time.py +155 -0
- package/scripts/test_browser_lane.py +239 -0
- package/scripts/test_lease_order.py +142 -0
- package/scripts/test_partition.py +23 -0
- package/scripts/test_prebuilt_output.py +258 -0
- package/scripts/test_products.py +20 -0
- package/scripts/test_serve_ports.py +645 -0
- package/scripts/test_sim_lane.py +1661 -0
- package/scripts/test_sim_quiet.py +140 -0
- package/scripts/texture-inputs.d.mts +4 -0
- package/scripts/texture-inputs.mjs +16 -0
- package/scripts/tile-bake-policy.d.mts +4 -0
- package/scripts/tile-bake-policy.mjs +43 -0
- package/scripts/tile-bake-report.d.mts +17 -0
- package/scripts/tile-bake-report.mjs +161 -0
- package/scripts/tile-bakes.d.mts +13 -0
- package/scripts/tile-bakes.mjs +100 -0
- package/scripts/timelapse.sh +44 -0
- package/scripts/title-assets.d.mts +6 -0
- package/scripts/title-assets.generated.json +9 -0
- package/scripts/title-assets.mjs +46 -0
- package/scripts/title-exit-proof.mjs +132 -0
- package/scripts/tsconfig.json +576 -0
- package/scripts/typecheck-lint.sh +21 -0
- package/scripts/typecheck-root.d.mts +2 -0
- package/scripts/typecheck-root.mjs +18 -0
- package/scripts/types/wildshard-probe.d.ts +29 -0
- package/scripts/types/worker-page.d.ts +55 -0
- package/scripts/uncatalogued-shard-proof.mjs +48 -0
- package/scripts/vite-tmp.d.mts +23 -0
- package/scripts/vite-tmp.mjs +157 -0
- package/scripts/vitest-bench.py +800 -0
- package/scripts/vitest-ci-files.ts +90 -0
- package/scripts/vitest-ci.config.ts +15 -0
- package/scripts/vitest-cpu.ts +46 -0
- package/scripts/vitest-environments.ts +41 -0
- package/scripts/vitest-fixture-snapshots.config.ts +8 -0
- package/scripts/vitest-lane.ts +53 -0
- package/scripts/vitest-module-cache.ts +49 -0
- package/scripts/vitest-native-escape.config.ts +9 -0
- package/scripts/vitest-plan.ts +94 -0
- package/scripts/vitest-push-guards.config.ts +13 -0
- package/scripts/vitest-push.config.ts +19 -0
- package/scripts/vitest-shard.ts +109 -0
- package/scripts/vitest-timings.ts +32 -0
- package/scripts/vitest-tmp.ts +83 -0
- package/scripts/vitest.sh +5 -0
- package/scripts/vps/dump.sh +50 -0
- package/scripts/vps/harden-apply.sh +490 -0
- package/scripts/vps/harden-caddy.sh +215 -0
- package/scripts/vps/harden.sh +358 -0
- package/scripts/vps/health-stub.mjs +11 -0
- package/scripts/vps/pull.mjs +156 -0
- package/scripts/vps/rebuild.sh +531 -0
- package/scripts/vps/restore-check.sh +35 -0
- package/scripts/vps/setup-state.mjs +121 -0
- package/scripts/vps/setup.sh +442 -0
- package/scripts/vps/uptime.sh +26 -0
- package/scripts/vps/wildshard-agent.pub +1 -0
- package/scripts/vps/wildshard-apply.mjs +127 -0
- package/scripts/vps/wildshard-config +211 -0
- package/scripts/vps-harden-proof.sh +117 -0
- package/scripts/vps-rebuild-proof.sh +170 -0
- package/scripts/warm-native-chrome.d.mts +6 -0
- package/scripts/warm-native-chrome.mjs +75 -0
- package/scripts/webkit-mem-reading.mjs +157 -0
- package/scripts/webkit-render-smoke.mjs +145 -0
- package/scripts/worker-bootstrap-proof.mjs +79 -0
- package/scripts/worker-client-death-return.mjs +97 -0
- package/scripts/worker-client-death.mjs +67 -0
- package/scripts/worker-client-fights.mjs +1438 -0
- package/scripts/worker-client-grid-entry.mjs +239 -0
- package/scripts/worker-client-hurt.mjs +92 -0
- package/scripts/worker-client-moments.mjs +340 -0
- package/scripts/worker-client-partner.mjs +93 -0
- package/scripts/worker-client-pine-durable.mjs +102 -0
- package/scripts/worker-client-pine-grid.mjs +77 -0
- package/scripts/worker-client-pine-import.mjs +93 -0
- package/scripts/worker-client-pine.mjs +114 -0
- package/scripts/worker-client-play.mjs +572 -0
- package/scripts/worker-client-proof.mjs +201 -0
- package/scripts/worker-client-repairs.mjs +108 -0
- package/scripts/worker-client-returns.mjs +51 -0
- package/scripts/worker-client-saves.mjs +146 -0
- package/scripts/worker-client-windup.mjs +50 -0
- package/scripts/worktree-ignore.d.mts +4 -0
- package/scripts/worktree-ignore.mjs +36 -0
- package/scripts/worktree-reap.mjs +214 -0
- package/scripts/worktree.mjs +339 -0
- package/src/.oxfmtrc.json +48 -0
- package/src/.oxlintrc.json +190 -0
- package/src/cli/main.ts +112 -0
- package/src/cli/version.ts +13 -0
- package/src/client/app/assetTables.ts +68 -0
- package/src/client/app/bootDownloads.ts +43 -0
- package/src/client/app/bootRoute.ts +27 -0
- package/src/client/app/calibrate.ts +9 -0
- package/src/client/app/dropModal.ts +99 -0
- package/src/client/app/entry.ts +439 -0
- package/src/client/app/failScreens.ts +561 -0
- package/src/client/app/identity.ts +10 -0
- package/src/client/app/main.ts +3 -0
- package/src/client/app/pageServices.ts +20 -0
- package/src/client/app/selectedManifests.ts +31 -0
- package/src/client/app/shardSelection.ts +46 -0
- package/src/client/app/titleSettings.ts +15 -0
- package/src/client/app.tsx +53 -0
- package/src/client/engine/ai/view/eliteController.ts +148 -0
- package/src/client/engine/ai/view/eliteEntry.ts +464 -0
- package/src/client/engine/aliasFixture.webp +0 -0
- package/src/client/engine/anim/channel.ts +58 -0
- package/src/client/engine/anim/machine.ts +77 -0
- package/src/client/engine/anim/rig.ts +150 -0
- package/src/client/engine/anim/rigAtlas.ts +73 -0
- package/src/client/engine/anim/rigParser.ts +59 -0
- package/src/client/engine/app/app.ts +262 -0
- package/src/client/engine/app/assets.ts +122 -0
- package/src/client/engine/app/cachedAssets.ts +116 -0
- package/src/client/engine/app/disposalCache.ts +30 -0
- package/src/client/engine/app/runtime.ts +16 -0
- package/src/client/engine/app/sceneOwnership.ts +317 -0
- package/src/client/engine/app/services.ts +20 -0
- package/src/client/engine/app/systems.ts +71 -0
- package/src/client/engine/app/ui.ts +33 -0
- package/src/client/engine/app/view/frameScheduler.ts +65 -0
- package/src/client/engine/app/view/pageActivity.ts +12 -0
- package/src/client/engine/app/view/presentation.ts +41 -0
- package/src/client/engine/app/view/presentationLoop.ts +56 -0
- package/src/client/engine/app/view/scopeEnvironment.ts +39 -0
- package/src/client/engine/app/workerScope.js +20 -0
- package/src/client/engine/audio/AmbienceBeds.ts +197 -0
- package/src/client/engine/audio/Audio.ts +634 -0
- package/src/client/engine/audio/Cues.ts +153 -0
- package/src/client/engine/audio/Music.ts +958 -0
- package/src/client/engine/audio/SetScore.ts +297 -0
- package/src/client/engine/audio/Stems.ts +277 -0
- package/src/client/engine/audio/Voices.ts +299 -0
- package/src/client/engine/audio/aacNative.ts +46 -0
- package/src/client/engine/audio/aacPull.ts +166 -0
- package/src/client/engine/audio/aacSource.ts +122 -0
- package/src/client/engine/audio/aacTrack.ts +115 -0
- package/src/client/engine/audio/aacWindows.ts +66 -0
- package/src/client/engine/audio/activity.ts +70 -0
- package/src/client/engine/audio/activityTimers.ts +37 -0
- package/src/client/engine/audio/ambience.ts +549 -0
- package/src/client/engine/audio/audioLog.ts +22 -0
- package/src/client/engine/audio/codecs.merge.d.ts +9 -0
- package/src/client/engine/audio/credits.ts +48 -0
- package/src/client/engine/audio/cueRouting.ts +93 -0
- package/src/client/engine/audio/declared.ts +95 -0
- package/src/client/engine/audio/declaredAmbience.ts +113 -0
- package/src/client/engine/audio/declaredBank.ts +104 -0
- package/src/client/engine/audio/declaredGameplay.ts +82 -0
- package/src/client/engine/audio/dsp.ts +164 -0
- package/src/client/engine/audio/gen.ts +538 -0
- package/src/client/engine/audio/interactSfx.ts +95 -0
- package/src/client/engine/audio/levelAudio.ts +131 -0
- package/src/client/engine/audio/loopWindow.ts +24 -0
- package/src/client/engine/audio/ownership.ts +16 -0
- package/src/client/engine/audio/playerVoices.ts +278 -0
- package/src/client/engine/audio/preload.ts +166 -0
- package/src/client/engine/audio/score/score.ts +60 -0
- package/src/client/engine/audio/scoreSelection.ts +19 -0
- package/src/client/engine/audio/surface.ts +71 -0
- package/src/client/engine/audio/synth.ts +301 -0
- package/src/client/engine/audio/unlock.ts +104 -0
- package/src/client/engine/audio/util.ts +95 -0
- package/src/client/engine/blocks.ts +6 -0
- package/src/client/engine/boot/audioFiles.ts +9 -0
- package/src/client/engine/boot/audioInventory.ts +34 -0
- package/src/client/engine/boot/audioPack.ts +54 -0
- package/src/client/engine/boot/bakedApi.ts +46 -0
- package/src/client/engine/boot/bakedTextures.ts +114 -0
- package/src/client/engine/boot/bootCache.ts +16 -0
- package/src/client/engine/boot/bootTrace.ts +362 -0
- package/src/client/engine/boot/browserChunkRecovery.ts +136 -0
- package/src/client/engine/boot/bytes.ts +272 -0
- package/src/client/engine/boot/catalog.ts +35 -0
- package/src/client/engine/boot/chunkRecovery.ts +41 -0
- package/src/client/engine/boot/clearDownloads.ts +128 -0
- package/src/client/engine/boot/contentBase.ts +77 -0
- package/src/client/engine/boot/contentRead.ts +151 -0
- package/src/client/engine/boot/diagnostics.ts +195 -0
- package/src/client/engine/boot/download.ts +112 -0
- package/src/client/engine/boot/dropNotice.ts +260 -0
- package/src/client/engine/boot/earlyPrograms.ts +123 -0
- package/src/client/engine/boot/extras.ts +324 -0
- package/src/client/engine/boot/filePolicy.ts +126 -0
- package/src/client/engine/boot/firstPlayMark.ts +43 -0
- package/src/client/engine/boot/gpuFiles.ts +176 -0
- package/src/client/engine/boot/gpuTrace.ts +42 -0
- package/src/client/engine/boot/idle.ts +52 -0
- package/src/client/engine/boot/imageDecode.ts +95 -0
- package/src/client/engine/boot/imageDecode.worker.ts +69 -0
- package/src/client/engine/boot/ktx2.generated.ts +157 -0
- package/src/client/engine/boot/lastEnd.ts +312 -0
- package/src/client/engine/boot/leaveAfterPaint.ts +16 -0
- package/src/client/engine/boot/liveJsonParser.ts +124 -0
- package/src/client/engine/boot/liveJsonParser.worker.ts +22 -0
- package/src/client/engine/boot/loadingDownloadText.ts +54 -0
- package/src/client/engine/boot/loadingPacks.ts +18 -0
- package/src/client/engine/boot/lowPower.ts +96 -0
- package/src/client/engine/boot/manifest.ts +12 -0
- package/src/client/engine/boot/pack.ts +180 -0
- package/src/client/engine/boot/parsedPages.ts +115 -0
- package/src/client/engine/boot/perflog.ts +15 -0
- package/src/client/engine/boot/plan.ts +256 -0
- package/src/client/engine/boot/prefetch.ts +188 -0
- package/src/client/engine/boot/prefetchQuota.ts +84 -0
- package/src/client/engine/boot/readContentResponse.ts +17 -0
- package/src/client/engine/boot/retry.ts +14 -0
- package/src/client/engine/boot/runtime.ts +21 -0
- package/src/client/engine/boot/shardPrefetch.ts +278 -0
- package/src/client/engine/boot/shell.ts +135 -0
- package/src/client/engine/boot/stuck.ts +106 -0
- package/src/client/engine/boot/stuckStep.ts +99 -0
- package/src/client/engine/boot/sw.ts +385 -0
- package/src/client/engine/boot/swGlobal.d.ts +9 -0
- package/src/client/engine/boot/texturePack.ts +182 -0
- package/src/client/engine/boot/timeLeft.ts +106 -0
- package/src/client/engine/boot/titleArrival.ts +101 -0
- package/src/client/engine/boot/weights.ts +21 -0
- package/src/client/engine/boot.ts +51 -0
- package/src/client/engine/build.d.ts +2 -0
- package/src/client/engine/calibrate/entry.ts +29 -0
- package/src/client/engine/calibrate/js.ts +39 -0
- package/src/client/engine/calibrate/math.ts +23 -0
- package/src/client/engine/calibrate/run.ts +93 -0
- package/src/client/engine/calibrate/wasm.ts +154 -0
- package/src/client/engine/combat/EquipmentService.ts +412 -0
- package/src/client/engine/combat/cues.ts +46 -0
- package/src/client/engine/combat/types.ts +21 -0
- package/src/client/engine/combat/view/Bow.ts +462 -0
- package/src/client/engine/combat/view/DropArc.ts +64 -0
- package/src/client/engine/combat/view/EquipmentHost.ts +15 -0
- package/src/client/engine/combat/view/SweptMelee.ts +691 -0
- package/src/client/engine/combat/view/bowProfile.ts +182 -0
- package/src/client/engine/combat/view/brass.ts +65 -0
- package/src/client/engine/combat/view/firearmFx.ts +25 -0
- package/src/client/engine/combat/view/hitscan.ts +29 -0
- package/src/client/engine/combat/view/melee.ts +67 -0
- package/src/client/engine/combat/view/projectedTrail.ts +42 -0
- package/src/client/engine/combat/view/projectile.ts +315 -0
- package/src/client/engine/combat/view/ranged.ts +460 -0
- package/src/client/engine/combat/view/rangedFeel.ts +39 -0
- package/src/client/engine/combat/view/slashTrail.ts +151 -0
- package/src/client/engine/core/Game.ts +1833 -0
- package/src/client/engine/core/GpuRecovery.ts +200 -0
- package/src/client/engine/core/Grade.ts +109 -0
- package/src/client/engine/core/KeepAlive.ts +32 -0
- package/src/client/engine/core/Tour.ts +46 -0
- package/src/client/engine/core/Volumetrics.ts +260 -0
- package/src/client/engine/core/apiOrigin.ts +12 -0
- package/src/client/engine/core/assets.ts +292 -0
- package/src/client/engine/core/bootstrap.ts +175 -0
- package/src/client/engine/core/crashFlag.ts +32 -0
- package/src/client/engine/core/crossroads.ts +4 -0
- package/src/client/engine/core/deflate.ts +110 -0
- package/src/client/engine/core/devMode.ts +49 -0
- package/src/client/engine/core/devPixels.ts +62 -0
- package/src/client/engine/core/drawBudget.ts +48 -0
- package/src/client/engine/core/errorReport.ts +248 -0
- package/src/client/engine/core/gpuOnly.ts +139 -0
- package/src/client/engine/core/graphicsMode.ts +62 -0
- package/src/client/engine/core/graphicsQuality.ts +117 -0
- package/src/client/engine/core/heldTiming.ts +24 -0
- package/src/client/engine/core/ktx2.ts +511 -0
- package/src/client/engine/core/ktx2Sources.ts +22 -0
- package/src/client/engine/core/ktx2Zstd.ts +151 -0
- package/src/client/engine/core/ktx2Zstd.worker.ts +31 -0
- package/src/client/engine/core/practiceRoom.ts +16 -0
- package/src/client/engine/core/reloadGuard.ts +21 -0
- package/src/client/engine/core/scopedCpu.ts +49 -0
- package/src/client/engine/core/scopedWorkerPool.ts +55 -0
- package/src/client/engine/core/shadowLayer.ts +8 -0
- package/src/client/engine/core/slowGpuPacing.ts +118 -0
- package/src/client/engine/core/sustainedFrames.ts +73 -0
- package/src/client/engine/core/tier.ts +126 -0
- package/src/client/engine/core/viewport.ts +130 -0
- package/src/client/engine/core/webglStartup.ts +50 -0
- package/src/client/engine/core/worldDepth.ts +183 -0
- package/src/client/engine/core/zstdFrame.ts +38 -0
- package/src/client/engine/debug/probe.ts +560 -0
- package/src/client/engine/debug/timerBaseline.ts +14 -0
- package/src/client/engine/entities/AnimalFactory.ts +766 -0
- package/src/client/engine/entities/AnimalHerdView.ts +413 -0
- package/src/client/engine/entities/AnimalView.ts +583 -0
- package/src/client/engine/entities/RowBodies.ts +276 -0
- package/src/client/engine/entities/animalMatrices.ts +179 -0
- package/src/client/engine/entities/animalShadow.ts +58 -0
- package/src/client/engine/entities/animalShells.ts +14 -0
- package/src/client/engine/entities/farHerd.ts +469 -0
- package/src/client/engine/entities/lowpoly.ts +155 -0
- package/src/client/engine/entities/species/loft.ts +253 -0
- package/src/client/engine/entities/species/look.ts +122 -0
- package/src/client/engine/events/maps.ts +58 -0
- package/src/client/engine/explore/Compare.ts +126 -0
- package/src/client/engine/explore/Explore.ts +648 -0
- package/src/client/engine/explore/FreeCam.ts +280 -0
- package/src/client/engine/explore/MiniMap.ts +283 -0
- package/src/client/engine/explore/ModelExplorer.ts +1155 -0
- package/src/client/engine/explore/Select.ts +176 -0
- package/src/client/engine/explore/SetExplorer.ts +553 -0
- package/src/client/engine/explore/TouchFly.ts +236 -0
- package/src/client/engine/explore/catalog.ts +159 -0
- package/src/client/engine/explore/diorama.ts +245 -0
- package/src/client/engine/explore/fatLines.ts +47 -0
- package/src/client/engine/explore/img/mockups/nalati-camp-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-camp-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-gully-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-gully-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-rail-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nalati-rail-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-gate-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-gate-target.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-stair-live.jpg +0 -0
- package/src/client/engine/explore/img/mockups/nine-stair-target.jpg +0 -0
- package/src/client/engine/explore/pick.ts +120 -0
- package/src/client/engine/explore/registry.ts +16 -0
- package/src/client/engine/explore/setView.ts +222 -0
- package/src/client/engine/explore/tiers.ts +27 -0
- package/src/client/engine/explore/viewPoint.ts +100 -0
- package/src/client/engine/fx/Impacts.ts +154 -0
- package/src/client/engine/fx/LightPool.ts +188 -0
- package/src/client/engine/fx/ParticlePool.ts +76 -0
- package/src/client/engine/fx/SiteLights.ts +119 -0
- package/src/client/engine/fx/effectField.ts +91 -0
- package/src/client/engine/fx/groundFx.ts +144 -0
- package/src/client/engine/fx/groundTell.ts +101 -0
- package/src/client/engine/fx/lightEmitters.ts +35 -0
- package/src/client/engine/input/ControlsPanel.ts +108 -0
- package/src/client/engine/input/InputService.ts +394 -0
- package/src/client/engine/input/bindingTable.ts +124 -0
- package/src/client/engine/input/bindings.ts +101 -0
- package/src/client/engine/input/dom.ts +62 -0
- package/src/client/engine/input/equipmentInput.ts +4 -0
- package/src/client/engine/input/gameplay.ts +36 -0
- package/src/client/engine/input/keycap.ts +25 -0
- package/src/client/engine/input/menuInput.ts +7 -0
- package/src/client/engine/input/platform.ts +36 -0
- package/src/client/engine/input/weaponActions.ts +8 -0
- package/src/client/engine/level/frame.ts +95 -0
- package/src/client/engine/level/installation.ts +107 -0
- package/src/client/engine/level/load.ts +97 -0
- package/src/client/engine/level/registrations.ts +59 -0
- package/src/client/engine/math/color.ts +6 -0
- package/src/client/engine/models/animalGeometry.ts +29 -0
- package/src/client/engine/models/castawayBody.ts +257 -0
- package/src/client/engine/models/colliders.ts +186 -0
- package/src/client/engine/models/creature.ts +66 -0
- package/src/client/engine/models/cull.ts +953 -0
- package/src/client/engine/models/gear.ts +87 -0
- package/src/client/engine/models/geometryPack.ts +14 -0
- package/src/client/engine/models/hoverboard.ts +29 -0
- package/src/client/engine/models/instancedBatch.ts +324 -0
- package/src/client/engine/models/interact.ts +26 -0
- package/src/client/engine/models/live.ts +174 -0
- package/src/client/engine/models/model.ts +449 -0
- package/src/client/engine/models/modelPose.ts +14 -0
- package/src/client/engine/models/nativeGeometry.ts +114 -0
- package/src/client/engine/models/ownedGeometry.ts +294 -0
- package/src/client/engine/models/place.ts +1476 -0
- package/src/client/engine/models/roster.ts +44 -0
- package/src/client/engine/models/sets.ts +74 -0
- package/src/client/engine/models/slots.ts +69 -0
- package/src/client/engine/models/staticSets.ts +119 -0
- package/src/client/engine/models/swimHands.ts +44 -0
- package/src/client/engine/models/trainingDummy.ts +46 -0
- package/src/client/engine/models/trainingDummyFigure.ts +16 -0
- package/src/client/engine/models/weld.ts +260 -0
- package/src/client/engine/net/attackPrediction.ts +38 -0
- package/src/client/engine/net/client.ts +314 -0
- package/src/client/engine/net/heldOnOthers.ts +167 -0
- package/src/client/engine/net/hurtOther.ts +12 -0
- package/src/client/engine/net/interpolator.ts +179 -0
- package/src/client/engine/net/nameTag.ts +88 -0
- package/src/client/engine/net/netClock.ts +90 -0
- package/src/client/engine/net/netPlayer.ts +265 -0
- package/src/client/engine/net/netRecord.ts +43 -0
- package/src/client/engine/net/onRep.ts +75 -0
- package/src/client/engine/net/otherPlayers.ts +239 -0
- package/src/client/engine/net/othersOnMap.ts +80 -0
- package/src/client/engine/net/predictionWorld.ts +100 -0
- package/src/client/engine/net/predictor.ts +233 -0
- package/src/client/engine/net/redial.ts +179 -0
- package/src/client/engine/net/remoteAir.ts +134 -0
- package/src/client/engine/net/remoteBoard.ts +128 -0
- package/src/client/engine/net/remoteDeath.ts +140 -0
- package/src/client/engine/net/remoteGait.ts +114 -0
- package/src/client/engine/net/remoteHurt.ts +123 -0
- package/src/client/engine/net/remoteStrike.ts +160 -0
- package/src/client/engine/net/voiceNear.ts +55 -0
- package/src/client/engine/net/webSocketTransport.ts +91 -0
- package/src/client/engine/physics/active.ts +15 -0
- package/src/client/engine/physics/boxFrame.ts +15 -0
- package/src/client/engine/physics/calibration.ts +31 -0
- package/src/client/engine/physics/debug.ts +68 -0
- package/src/client/engine/physics/navmeshLoad.ts +86 -0
- package/src/client/engine/physics/ragdoll.ts +513 -0
- package/src/client/engine/physics/ropeDeck.ts +112 -0
- package/src/client/engine/player/AimAssist.ts +183 -0
- package/src/client/engine/player/AimTargets.ts +55 -0
- package/src/client/engine/player/CameraFX.ts +89 -0
- package/src/client/engine/player/Hands.ts +216 -0
- package/src/client/engine/player/LockOnTarget.ts +395 -0
- package/src/client/engine/player/Player.ts +678 -0
- package/src/client/engine/player/Skins.ts +109 -0
- package/src/client/engine/player/TouchControls.ts +564 -0
- package/src/client/engine/player/WaterLine.ts +94 -0
- package/src/client/engine/player/WeaponPickup.ts +465 -0
- package/src/client/engine/player/bladeGlow.ts +120 -0
- package/src/client/engine/player/firstPersonArms.ts +384 -0
- package/src/client/engine/player/heldHandParts.ts +91 -0
- package/src/client/engine/player/viewmodelSources.ts +25 -0
- package/src/client/engine/player/viewmodelTextures.ts +261 -0
- package/src/client/engine/player/viewmodelTextures.worker.ts +28 -0
- package/src/client/engine/practice/DummyClips.ts +100 -0
- package/src/client/engine/practice/DummyMotion.ts +287 -0
- package/src/client/engine/practice/DummyStudio.ts +137 -0
- package/src/client/engine/practice/TrainingArena.ts +463 -0
- package/src/client/engine/practice/TrainingDummy.ts +160 -0
- package/src/client/engine/practice/TrainingDummyAssets.ts +80 -0
- package/src/client/engine/practice/arena.css +20 -0
- package/src/client/engine/practice/dummyMetadata.ts +12 -0
- package/src/client/engine/practice/lineup.ts +17 -0
- package/src/client/engine/practice/playground/Playground.ts +52 -0
- package/src/client/engine/practice/playground/catalog.ts +44 -0
- package/src/client/engine/practice/playground/devGrid.ts +173 -0
- package/src/client/engine/practice/playground/hud.ts +80 -0
- package/src/client/engine/practice/playground/load.ts +24 -0
- package/src/client/engine/practice/practiceLoan.ts +52 -0
- package/src/client/engine/practice/targets.ts +15 -0
- package/src/client/engine/pwa/cacheNames.ts +2 -0
- package/src/client/engine/pwa/sw.js +401 -0
- package/src/client/engine/quest/view/replica.ts +88 -0
- package/src/client/engine/quest/view/ui.ts +221 -0
- package/src/client/engine/quest/view.ts +209 -0
- package/src/client/engine/render/allocationBytes.ts +16 -0
- package/src/client/engine/render/allocationJournal.ts +125 -0
- package/src/client/engine/render/aoTransparency.ts +225 -0
- package/src/client/engine/render/budgetReport.ts +53 -0
- package/src/client/engine/render/budgets.ts +72 -0
- package/src/client/engine/render/calibration.ts +32 -0
- package/src/client/engine/render/calibrationGpu.ts +84 -0
- package/src/client/engine/render/changedTextureUploads.ts +118 -0
- package/src/client/engine/render/compileLights.ts +75 -0
- package/src/client/engine/render/compileShadows.ts +29 -0
- package/src/client/engine/render/composerDepth.ts +26 -0
- package/src/client/engine/render/compressedMipmaps.ts +59 -0
- package/src/client/engine/render/compressedTextureRetirement.ts +71 -0
- package/src/client/engine/render/compressedUpload.ts +107 -0
- package/src/client/engine/render/contextErrors.ts +14 -0
- package/src/client/engine/render/dataLook.ts +691 -0
- package/src/client/engine/render/desktopReference.ts +5 -0
- package/src/client/engine/render/diagnosticJournal.ts +23 -0
- package/src/client/engine/render/displayColour.ts +55 -0
- package/src/client/engine/render/doubleElements.ts +33 -0
- package/src/client/engine/render/drawGuards.ts +47 -0
- package/src/client/engine/render/drawHooks.ts +265 -0
- package/src/client/engine/render/drawNeutral.ts +19 -0
- package/src/client/engine/render/drawnEnvironment.ts +35 -0
- package/src/client/engine/render/entryWarmupBound.ts +19 -0
- package/src/client/engine/render/families/emissive.ts +224 -0
- package/src/client/engine/render/families/ground.ts +291 -0
- package/src/client/engine/render/families/measure.ts +191 -0
- package/src/client/engine/render/families/paintedTerrain.ts +388 -0
- package/src/client/engine/render/families/painterly.ts +288 -0
- package/src/client/engine/render/families/pbr.ts +67 -0
- package/src/client/engine/render/families/registry.ts +140 -0
- package/src/client/engine/render/families/toon.ts +193 -0
- package/src/client/engine/render/fencedUnits.ts +115 -0
- package/src/client/engine/render/firstFrameParts.ts +95 -0
- package/src/client/engine/render/fogPatches.ts +56 -0
- package/src/client/engine/render/frameCounter.ts +47 -0
- package/src/client/engine/render/frameDrawRange.ts +120 -0
- package/src/client/engine/render/gltfMaterialOrder.ts +83 -0
- package/src/client/engine/render/gpuClasses.ts +29 -0
- package/src/client/engine/render/gpuLabels.ts +437 -0
- package/src/client/engine/render/graph/colourFunction.ts +83 -0
- package/src/client/engine/render/graph/glsl.ts +1056 -0
- package/src/client/engine/render/graph/glslCodec.ts +48 -0
- package/src/client/engine/render/graph/glslMaterial.ts +463 -0
- package/src/client/engine/render/graph/glslPost.ts +79 -0
- package/src/client/engine/render/graph/glslProgram.ts +698 -0
- package/src/client/engine/render/graph/presets.ts +812 -0
- package/src/client/engine/render/graph/viewRay.ts +28 -0
- package/src/client/engine/render/graphBackend.ts +176 -0
- package/src/client/engine/render/hoverboardGeometry.ts +54 -0
- package/src/client/engine/render/instancedGeometry.ts +28 -0
- package/src/client/engine/render/instancedTwin.ts +40 -0
- package/src/client/engine/render/ktx2Probe.ts +299 -0
- package/src/client/engine/render/layeredMaps.ts +64 -0
- package/src/client/engine/render/lightUniforms.ts +22 -0
- package/src/client/engine/render/lighterTargets.ts +47 -0
- package/src/client/engine/render/lightmaps.ts +36 -0
- package/src/client/engine/render/look.ts +406 -0
- package/src/client/engine/render/lookLight.ts +107 -0
- package/src/client/engine/render/lut.ts +23 -0
- package/src/client/engine/render/memoryImages.ts +31 -0
- package/src/client/engine/render/memorySaver.ts +262 -0
- package/src/client/engine/render/offscreenBuild.ts +184 -0
- package/src/client/engine/render/offscreenPreparation.ts +41 -0
- package/src/client/engine/render/parkedDraws.ts +920 -0
- package/src/client/engine/render/pmremSize.ts +21 -0
- package/src/client/engine/render/postPreparation.ts +67 -0
- package/src/client/engine/render/precompile.ts +1833 -0
- package/src/client/engine/render/programRetention.ts +125 -0
- package/src/client/engine/render/readbackPreparation.ts +23 -0
- package/src/client/engine/render/regionCinematic.ts +212 -0
- package/src/client/engine/render/regionLook.ts +301 -0
- package/src/client/engine/render/releasedArrays.ts +13 -0
- package/src/client/engine/render/renderer.ts +68 -0
- package/src/client/engine/render/scatterInstances.ts +139 -0
- package/src/client/engine/render/scenePreparation.ts +27 -0
- package/src/client/engine/render/shaderPatches.ts +303 -0
- package/src/client/engine/render/shaderText.ts +95 -0
- package/src/client/engine/render/shadowDepthVariants.ts +35 -0
- package/src/client/engine/render/shadowMaterialOwnership.ts +120 -0
- package/src/client/engine/render/skinnedSpheres.ts +30 -0
- package/src/client/engine/render/skyEnvironment.ts +222 -0
- package/src/client/engine/render/staticMatrices.ts +88 -0
- package/src/client/engine/render/streamedInstances.ts +184 -0
- package/src/client/engine/render/textureBytes.ts +185 -0
- package/src/client/engine/render/textureUploadEvents.ts +60 -0
- package/src/client/engine/render/tierBenchmark.ts +54 -0
- package/src/client/engine/render/tierBoot.ts +50 -0
- package/src/client/engine/render/tierSelect.ts +27 -0
- package/src/client/engine/render/tiers.ts +78 -0
- package/src/client/engine/render/uniformCaches.ts +143 -0
- package/src/client/engine/render/uploadOwnership.ts +335 -0
- package/src/client/engine/render/viewmodel.ts +114 -0
- package/src/client/engine/render/viewmodelFeel.ts +374 -0
- package/src/client/engine/saves/indexed.ts +250 -0
- package/src/client/engine/saves/slots.ts +42 -0
- package/src/client/engine/saves/view/storage.ts +11 -0
- package/src/client/engine/script/client.ts +240 -0
- package/src/client/engine/telemetry/bootInbox.ts +18 -0
- package/src/client/engine/telemetry/browserErrors.ts +173 -0
- package/src/client/engine/telemetry/crossroads.ts +26 -0
- package/src/client/engine/telemetry/health.ts +40 -0
- package/src/client/engine/telemetry/model.ts +36 -0
- package/src/client/engine/telemetry/runtime.ts +62 -0
- package/src/client/engine/types/meshopt-simplifier.d.ts +10 -0
- package/src/client/engine/types/n8ao.d.ts +52 -0
- package/src/client/engine/ui/BootSettings.ts +97 -0
- package/src/client/engine/ui/BossBar.ts +141 -0
- package/src/client/engine/ui/Combat.ts +299 -0
- package/src/client/engine/ui/DeathFade.ts +104 -0
- package/src/client/engine/ui/DebugMenu.ts +199 -0
- package/src/client/engine/ui/EliteBar.ts +219 -0
- package/src/client/engine/ui/ErrorModal.ts +309 -0
- package/src/client/engine/ui/Feedback.ts +346 -0
- package/src/client/engine/ui/FirstHints.ts +279 -0
- package/src/client/engine/ui/HUD.ts +714 -0
- package/src/client/engine/ui/HurtArc.ts +102 -0
- package/src/client/engine/ui/ItemCard.ts +95 -0
- package/src/client/engine/ui/KeyHelp.ts +59 -0
- package/src/client/engine/ui/Loading.ts +851 -0
- package/src/client/engine/ui/LockOn.ts +131 -0
- package/src/client/engine/ui/Map.ts +280 -0
- package/src/client/engine/ui/Menu.ts +438 -0
- package/src/client/engine/ui/Minimap.ts +840 -0
- package/src/client/engine/ui/Perf.ts +356 -0
- package/src/client/engine/ui/ReloadPrompt.ts +42 -0
- package/src/client/engine/ui/RotateGate.ts +40 -0
- package/src/client/engine/ui/SavePanel.ts +62 -0
- package/src/client/engine/ui/Settings.ts +277 -0
- package/src/client/engine/ui/SpeedLines.ts +46 -0
- package/src/client/engine/ui/StartTitle.ts +39 -0
- package/src/client/engine/ui/ToastStack.ts +90 -0
- package/src/client/engine/ui/Update.ts +116 -0
- package/src/client/engine/ui/WeaponStrip.ts +272 -0
- package/src/client/engine/ui/WindupWarn.ts +116 -0
- package/src/client/engine/ui/authoredDebugRows.ts +3 -0
- package/src/client/engine/ui/buildCheck.ts +72 -0
- package/src/client/engine/ui/buildRow.ts +71 -0
- package/src/client/engine/ui/cards.ts +41 -0
- package/src/client/engine/ui/debugOptions.ts +230 -0
- package/src/client/engine/ui/declared.ts +89 -0
- package/src/client/engine/ui/devSwitch.ts +48 -0
- package/src/client/engine/ui/developerBanner.ts +32 -0
- package/src/client/engine/ui/diagnosticsCopy.ts +20 -0
- package/src/client/engine/ui/drawBudgetCounter.ts +10 -0
- package/src/client/engine/ui/errorScreen.ts +109 -0
- package/src/client/engine/ui/frameWindow.ts +50 -0
- package/src/client/engine/ui/graphicsBlock.ts +156 -0
- package/src/client/engine/ui/graphicsControls.ts +47 -0
- package/src/client/engine/ui/haptics.ts +28 -0
- package/src/client/engine/ui/hoverBoost.ts +61 -0
- package/src/client/engine/ui/hudAdapters.ts +61 -0
- package/src/client/engine/ui/hudSlots.ts +130 -0
- package/src/client/engine/ui/icons.ts +62 -0
- package/src/client/engine/ui/layers.ts +134 -0
- package/src/client/engine/ui/leaveGuard.ts +64 -0
- package/src/client/engine/ui/loadProgress.ts +67 -0
- package/src/client/engine/ui/loading.css +125 -0
- package/src/client/engine/ui/lookLightOption.ts +22 -0
- package/src/client/engine/ui/mapLabel.ts +18 -0
- package/src/client/engine/ui/mapPainter.ts +395 -0
- package/src/client/engine/ui/menuSettings.ts +188 -0
- package/src/client/engine/ui/namePrompt.ts +138 -0
- package/src/client/engine/ui/offlineDownload.ts +83 -0
- package/src/client/engine/ui/ownership.ts +14 -0
- package/src/client/engine/ui/panel.ts +166 -0
- package/src/client/engine/ui/perf.css +93 -0
- package/src/client/engine/ui/perfDock.ts +61 -0
- package/src/client/engine/ui/perfHud.ts +332 -0
- package/src/client/engine/ui/perfLap.ts +206 -0
- package/src/client/engine/ui/perfLapSummary.ts +92 -0
- package/src/client/engine/ui/perfProbe.ts +280 -0
- package/src/client/engine/ui/pinKeepOut.ts +59 -0
- package/src/client/engine/ui/playerDeath.ts +16 -0
- package/src/client/engine/ui/playerHurt.ts +70 -0
- package/src/client/engine/ui/playerReload.ts +55 -0
- package/src/client/engine/ui/reloadChip.ts +24 -0
- package/src/client/engine/ui/reloadCover.ts +110 -0
- package/src/client/engine/ui/review.ts +158 -0
- package/src/client/engine/ui/roomMap.ts +109 -0
- package/src/client/engine/ui/saveStrings.ts +9 -0
- package/src/client/engine/ui/settingsTabs.ts +249 -0
- package/src/client/engine/ui/styles/base.css +92 -0
- package/src/client/engine/ui/styles/boss.css +97 -0
- package/src/client/engine/ui/styles/combat.css +100 -0
- package/src/client/engine/ui/styles/debug.css +22 -0
- package/src/client/engine/ui/styles/elite.css +87 -0
- package/src/client/engine/ui/styles/explore.css +435 -0
- package/src/client/engine/ui/styles/feedback.css +63 -0
- package/src/client/engine/ui/styles/game.css +290 -0
- package/src/client/engine/ui/styles/gmenu.css +407 -0
- package/src/client/engine/ui/styles/hints.css +26 -0
- package/src/client/engine/ui/styles/itemcard.css +38 -0
- package/src/client/engine/ui/styles/menu.css +129 -0
- package/src/client/engine/ui/styles/minimap.css +87 -0
- package/src/client/engine/ui/styles/namePrompt.css +27 -0
- package/src/client/engine/ui/styles/playgrounds.css +18 -0
- package/src/client/engine/ui/styles/quest.css +65 -0
- package/src/client/engine/ui/styles/rotate.css +55 -0
- package/src/client/engine/ui/styles/touch.css +303 -0
- package/src/client/engine/ui/styles/update.css +27 -0
- package/src/client/engine/ui/tabs.ts +27 -0
- package/src/client/engine/ui/unstuck.ts +38 -0
- package/src/client/engine/ui/voiceSettings.ts +135 -0
- package/src/client/engine/world/Atmosphere.ts +333 -0
- package/src/client/engine/world/BakedSky.ts +155 -0
- package/src/client/engine/world/Boundary.ts +234 -0
- package/src/client/engine/world/Grass.ts +664 -0
- package/src/client/engine/world/Horizon.ts +237 -0
- package/src/client/engine/world/HorizonMatte.ts +399 -0
- package/src/client/engine/world/Terrain.ts +560 -0
- package/src/client/engine/world/TreeFactory.ts +128 -0
- package/src/client/engine/world/backdropLayer.ts +580 -0
- package/src/client/engine/world/blenderArea.ts +23 -0
- package/src/client/engine/world/bounds.ts +57 -0
- package/src/client/engine/world/cascadeCull.ts +251 -0
- package/src/client/engine/world/cascadeLights.ts +29 -0
- package/src/client/engine/world/cloudField.ts +29 -0
- package/src/client/engine/world/coarseTileMask.ts +100 -0
- package/src/client/engine/world/csmLightBlock.ts +23 -0
- package/src/client/engine/world/declaredProps.ts +226 -0
- package/src/client/engine/world/forest/Forest.ts +378 -0
- package/src/client/engine/world/forest/treeSet.ts +140 -0
- package/src/client/engine/world/forest/treeSpecies.ts +17 -0
- package/src/client/engine/world/frameCamera.ts +58 -0
- package/src/client/engine/world/geometryBake.ts +272 -0
- package/src/client/engine/world/geometryBounds.ts +77 -0
- package/src/client/engine/world/geometryKit.ts +163 -0
- package/src/client/engine/world/hiddenFaces.ts +153 -0
- package/src/client/engine/world/interact/Interactables.ts +690 -0
- package/src/client/engine/world/interact/kit.ts +6 -0
- package/src/client/engine/world/lookFlags.ts +15 -0
- package/src/client/engine/world/lowpolyKit.ts +270 -0
- package/src/client/engine/world/lut.ts +45 -0
- package/src/client/engine/world/painterly.ts +109 -0
- package/src/client/engine/world/pointLightSkip.ts +31 -0
- package/src/client/engine/world/pond.ts +184 -0
- package/src/client/engine/world/pondGrid.ts +5 -0
- package/src/client/engine/world/registry.ts +348 -0
- package/src/client/engine/world/shadowCadence.ts +14 -0
- package/src/client/engine/world/shadowChunks.ts +193 -0
- package/src/client/engine/world/shadowFade.ts +190 -0
- package/src/client/engine/world/shadowFilter.ts +117 -0
- package/src/client/engine/world/shadowVariants.ts +115 -0
- package/src/client/engine/world/skyBackdrop.ts +526 -0
- package/src/client/engine/world/skyRig.ts +577 -0
- package/src/client/engine/world/skyTextures.ts +103 -0
- package/src/client/engine/world/terrainTileView.ts +164 -0
- package/src/client/engine/world/tileStreamer.ts +823 -0
- package/src/client/engine/world/voxelAO.ts +338 -0
- package/src/client/engine/world/water/ripplePixels.ts +51 -0
- package/src/client/engine/world/water/ripples.ts +102 -0
- package/src/client/engine/world/weakShaderMap.ts +58 -0
- package/src/client/engine/world/wind.ts +112 -0
- package/src/client/game/Boss.ts +354 -0
- package/src/client/game/Elite.ts +529 -0
- package/src/client/game/Inventory.ts +123 -0
- package/src/client/game/Progress.ts +166 -0
- package/src/client/game/ambient/ambientFlock.ts +71 -0
- package/src/client/game/ambient/crowdDraw.ts +85 -0
- package/src/client/game/ambient/foragerDraw.ts +56 -0
- package/src/client/game/ambient/pageCrowds.ts +81 -0
- package/src/client/game/ambient/wingField.ts +46 -0
- package/src/client/game/animation/limbCollision.ts +46 -0
- package/src/client/game/animation/limbQueryPose.ts +141 -0
- package/src/client/game/animation/limbQueryView.ts +53 -0
- package/src/client/game/animation/limbView.ts +28 -0
- package/src/client/game/audio/cueDirector.ts +157 -0
- package/src/client/game/audio/forestPage.ts +30 -0
- package/src/client/game/audio/sceneDirector.ts +239 -0
- package/src/client/game/audio/sceneEvents.merge.d.ts +9 -0
- package/src/client/game/audio/theme.ts +229 -0
- package/src/client/game/audio/voicePatches.ts +108 -0
- package/src/client/game/bag/BagButton.ts +85 -0
- package/src/client/game/bag/bag.ts +239 -0
- package/src/client/game/bag/equipment.ts +18 -0
- package/src/client/game/bag/tabs.ts +194 -0
- package/src/client/game/boot/audio.generated.ts +9258 -0
- package/src/client/game/boot/bytes.generated.ts +1643 -0
- package/src/client/game/boot/loadingPaths.ts +121 -0
- package/src/client/game/boot/packs.generated.ts +5 -0
- package/src/client/game/boot/spawnDownload.ts +999 -0
- package/src/client/game/boot/versions.generated.ts +868 -0
- package/src/client/game/boss/arenaFire.ts +135 -0
- package/src/client/game/boss/arenaRoom.ts +715 -0
- package/src/client/game/boss/arenaRoomView.ts +530 -0
- package/src/client/game/boss/barFeed.ts +253 -0
- package/src/client/game/boss/encounterView.ts +463 -0
- package/src/client/game/boss/presentation.ts +18 -0
- package/src/client/game/boss/roamingProjection.ts +255 -0
- package/src/client/game/boss/slotRowsView.ts +95 -0
- package/src/client/game/boss/socketRig.ts +129 -0
- package/src/client/game/boss/timedEncounters.ts +83 -0
- package/src/client/game/combat/roamingSession.ts +107 -0
- package/src/client/game/compendium/Journal.ts +85 -0
- package/src/client/game/compendium/compendium.css +135 -0
- package/src/client/game/compendium/install.ts +181 -0
- package/src/client/game/compendium/journalView.ts +224 -0
- package/src/client/game/compendium/keepsakes.ts +169 -0
- package/src/client/game/compendium/keepsakesView.ts +70 -0
- package/src/client/game/complete/ShardComplete.ts +148 -0
- package/src/client/game/complete/complete.css +71 -0
- package/src/client/game/complete/declared.ts +111 -0
- package/src/client/game/cosmetics/bodyShadow.ts +148 -0
- package/src/client/game/cosmetics/cosmetics.ts +119 -0
- package/src/client/game/cosmetics/locker.ts +88 -0
- package/src/client/game/data/pickupCatalogue.json +1008 -0
- package/src/client/game/debug/browser.d.ts +10 -0
- package/src/client/game/draftTitles.ts +26 -0
- package/src/client/game/eliteView.ts +246 -0
- package/src/client/game/engineStrings.ts +12 -0
- package/src/client/game/equipmentTypes.merge.d.ts +10 -0
- package/src/client/game/firstPlay.css +18 -0
- package/src/client/game/firstPlay.ts +94 -0
- package/src/client/game/generators/pickups.ts +92 -0
- package/src/client/game/grapple/fontPreparation.ts +31 -0
- package/src/client/game/grapple/netClaw.ts +61 -0
- package/src/client/game/grapple/ribbon.ts +159 -0
- package/src/client/game/grapple/tool.ts +478 -0
- package/src/client/game/grid/admissionPriority.ts +41 -0
- package/src/client/game/grid/admissionYield.ts +37 -0
- package/src/client/game/grid/approachProductInputs.ts +72 -0
- package/src/client/game/grid/assetResidency.ts +188 -0
- package/src/client/game/grid/borderShimmer.ts +185 -0
- package/src/client/game/grid/budgetOverlay.css +40 -0
- package/src/client/game/grid/budgetOverlay.ts +238 -0
- package/src/client/game/grid/budgetPoints.ts +184 -0
- package/src/client/game/grid/cellChanges.ts +106 -0
- package/src/client/game/grid/cellClip.ts +611 -0
- package/src/client/game/grid/cellCover.ts +58 -0
- package/src/client/game/grid/cellLoading.ts +89 -0
- package/src/client/game/grid/cellPresence.ts +28 -0
- package/src/client/game/grid/cellScreens.ts +83 -0
- package/src/client/game/grid/copyIdentity.ts +98 -0
- package/src/client/game/grid/copyLayout.ts +153 -0
- package/src/client/game/grid/copyPrompts.ts +31 -0
- package/src/client/game/grid/edgeSources.ts +120 -0
- package/src/client/game/grid/enteredEquipment.ts +65 -0
- package/src/client/game/grid/enteredInteract.ts +43 -0
- package/src/client/game/grid/entryDownloads.ts +45 -0
- package/src/client/game/grid/entryReadPrefetch.ts +64 -0
- package/src/client/game/grid/farImpostorDecodeWorker.ts +32 -0
- package/src/client/game/grid/farImpostorPack.ts +18 -0
- package/src/client/game/grid/farImpostorView.ts +130 -0
- package/src/client/game/grid/farView.ts +235 -0
- package/src/client/game/grid/frame.ts +845 -0
- package/src/client/game/grid/frameLook.ts +215 -0
- package/src/client/game/grid/frameModel.ts +126 -0
- package/src/client/game/grid/gridHud.css +47 -0
- package/src/client/game/grid/gridHud.ts +126 -0
- package/src/client/game/grid/hazeBand.ts +77 -0
- package/src/client/game/grid/homeCheckpoint.ts +11 -0
- package/src/client/game/grid/homeMetadata.ts +40 -0
- package/src/client/game/grid/intent.ts +65 -0
- package/src/client/game/grid/live.ts +787 -0
- package/src/client/game/grid/liveSession.ts +969 -0
- package/src/client/game/grid/loadingRings.ts +49 -0
- package/src/client/game/grid/mapAtlas.build.d.ts +4 -0
- package/src/client/game/grid/mapAtlas.ts +33 -0
- package/src/client/game/grid/mapFrame.ts +81 -0
- package/src/client/game/grid/memoryRows.ts +32 -0
- package/src/client/game/grid/memoryWarning.css +11 -0
- package/src/client/game/grid/memoryWarning.ts +81 -0
- package/src/client/game/grid/menu.ts +49 -0
- package/src/client/game/grid/minimapBlend.ts +185 -0
- package/src/client/game/grid/nearGrain.ts +40 -0
- package/src/client/game/grid/nearPlaceholderPlan.ts +60 -0
- package/src/client/game/grid/nearPlaceholderView.ts +182 -0
- package/src/client/game/grid/neighbourLife.ts +151 -0
- package/src/client/game/grid/neighbourPanels.ts +84 -0
- package/src/client/game/grid/neighbourRows.ts +32 -0
- package/src/client/game/grid/oneWayIn.ts +114 -0
- package/src/client/game/grid/pageEntry.ts +234 -0
- package/src/client/game/grid/pageResidency.ts +216 -0
- package/src/client/game/grid/pageShell.ts +67 -0
- package/src/client/game/grid/prefetch.ts +344 -0
- package/src/client/game/grid/prefetchIndex.ts +28 -0
- package/src/client/game/grid/prefetchIndexCore.ts +41 -0
- package/src/client/game/grid/prelinkViews.ts +31 -0
- package/src/client/game/grid/preparationAdmission.ts +34 -0
- package/src/client/game/grid/productInputs.ts +98 -0
- package/src/client/game/grid/productLeases.ts +76 -0
- package/src/client/game/grid/products.ts +350 -0
- package/src/client/game/grid/refusal.ts +73 -0
- package/src/client/game/grid/regionLight.ts +102 -0
- package/src/client/game/grid/regionShell.ts +58 -0
- package/src/client/game/grid/regionSky.ts +104 -0
- package/src/client/game/grid/regionalBuildCheckpoint.ts +19 -0
- package/src/client/game/grid/regionalInputs.ts +34 -0
- package/src/client/game/grid/regionalRuntime.ts +518 -0
- package/src/client/game/grid/regionalView.ts +205 -0
- package/src/client/game/grid/regionalWorld.ts +609 -0
- package/src/client/game/grid/renderResidency.ts +95 -0
- package/src/client/game/grid/reveal.ts +163 -0
- package/src/client/game/grid/roadCull.ts +473 -0
- package/src/client/game/grid/roadGrain.ts +32 -0
- package/src/client/game/grid/roadGrain.worker.ts +20 -0
- package/src/client/game/grid/roadGrainPreparation.ts +45 -0
- package/src/client/game/grid/roadLook.ts +487 -0
- package/src/client/game/grid/roadLookPlatform.ts +196 -0
- package/src/client/game/grid/roadResources.ts +15 -0
- package/src/client/game/grid/roadSign.worker.ts +30 -0
- package/src/client/game/grid/roadSignPaint.ts +38 -0
- package/src/client/game/grid/roadSignPixels.ts +22 -0
- package/src/client/game/grid/roadSignPreparation.ts +45 -0
- package/src/client/game/grid/roadSky.ts +219 -0
- package/src/client/game/grid/roadSolid.ts +227 -0
- package/src/client/game/grid/roadTileArchive.ts +239 -0
- package/src/client/game/grid/roadTileBacking.ts +327 -0
- package/src/client/game/grid/roadTileCapture.worker.ts +14 -0
- package/src/client/game/grid/roadTileCaptureJob.ts +37 -0
- package/src/client/game/grid/roadTileCaptureWorker.ts +104 -0
- package/src/client/game/grid/roadTileCoarse.ts +28 -0
- package/src/client/game/grid/roadTileGeometry.ts +77 -0
- package/src/client/game/grid/roadTilePool.ts +157 -0
- package/src/client/game/grid/roadTileStream.ts +69 -0
- package/src/client/game/grid/roadTileWrite.worker.ts +24 -0
- package/src/client/game/grid/roadTileWriter.ts +67 -0
- package/src/client/game/grid/runtimeCost.ts +44 -0
- package/src/client/game/grid/seamLook.ts +177 -0
- package/src/client/game/grid/session.ts +1235 -0
- package/src/client/game/grid/shardfileFar.ts +88 -0
- package/src/client/game/grid/skinEnvelope.ts +135 -0
- package/src/client/game/grid/softWallLook.ts +116 -0
- package/src/client/game/grid/tileDecodeWorker.ts +24 -0
- package/src/client/game/grid/tileDecoder.ts +102 -0
- package/src/client/game/grid/titleOrder.ts +8 -0
- package/src/client/game/grid/titlePrefetchChoice.ts +35 -0
- package/src/client/game/grid/viewAdmissions.ts +36 -0
- package/src/client/game/grid/voidLook.ts +181 -0
- package/src/client/game/icons.merge.d.ts +49 -0
- package/src/client/game/icons.ts +240 -0
- package/src/client/game/identity.ts +28 -0
- package/src/client/game/inputContexts.ts +33 -0
- package/src/client/game/keyBindings.ts +37 -0
- package/src/client/game/loadout/actors.ts +15 -0
- package/src/client/game/loadout/claims.ts +728 -0
- package/src/client/game/loadout/cosmeticFinishes.ts +217 -0
- package/src/client/game/loadout/effects.ts +97 -0
- package/src/client/game/loadout/finishes.ts +60 -0
- package/src/client/game/loadout/held.ts +207 -0
- package/src/client/game/loadout/rangedPage.ts +142 -0
- package/src/client/game/looks/coverAppearance.ts +101 -0
- package/src/client/game/looks/daySky.ts +110 -0
- package/src/client/game/looks/forestGround.ts +49 -0
- package/src/client/game/looks/forestGroundInputs.ts +27 -0
- package/src/client/game/looks/forestRoofMask.ts +15 -0
- package/src/client/game/looks/forestWeather.ts +26 -0
- package/src/client/game/looks/graphDaySky.ts +245 -0
- package/src/client/game/looks/grassPresentation.ts +334 -0
- package/src/client/game/looks/keyedSky.ts +500 -0
- package/src/client/game/looks/lettering.ts +14 -0
- package/src/client/game/looks/overcast.ts +61 -0
- package/src/client/game/looks/paintedGroundMerge.ts +12 -0
- package/src/client/game/looks/paintedLook.ts +197 -0
- package/src/client/game/looks/painterlyLook.ts +259 -0
- package/src/client/game/looks/posedBufferPool.ts +67 -0
- package/src/client/game/looks/posedInstances.ts +199 -0
- package/src/client/game/looks/postGraphLook.ts +455 -0
- package/src/client/game/looks/riggedHulls.ts +451 -0
- package/src/client/game/looks/scaledPost.ts +236 -0
- package/src/client/game/looks/speciesBook.ts +224 -0
- package/src/client/game/looks/staticCapture.ts +225 -0
- package/src/client/game/looks/streamedCover.ts +330 -0
- package/src/client/game/looks/toonLighting.ts +28 -0
- package/src/client/game/looks/toonLook.ts +69 -0
- package/src/client/game/looks/toonSky.ts +60 -0
- package/src/client/game/looks/vertexWear.ts +49 -0
- package/src/client/game/loot/CoinBurst.ts +19 -0
- package/src/client/game/loot/CoinMotion.ts +169 -0
- package/src/client/game/loot/coinModel.ts +11 -0
- package/src/client/game/loot/coins.ts +21 -0
- package/src/client/game/loot/feed.ts +23 -0
- package/src/client/game/loot/loot.css +19 -0
- package/src/client/game/loot/runtime.ts +243 -0
- package/src/client/game/loot/tables.ts +30 -0
- package/src/client/game/loot/ui/CoinChip.ts +70 -0
- package/src/client/game/loot/ui/ShopPanel.ts +211 -0
- package/src/client/game/loot/ui/shop.css +42 -0
- package/src/client/game/mainMenu.css +177 -0
- package/src/client/game/mainMenu.ts +268 -0
- package/src/client/game/models/binarySource.ts +78 -0
- package/src/client/game/models/collectionDisplay.ts +133 -0
- package/src/client/game/models/collectionWall.ts +236 -0
- package/src/client/game/models/explorerCatalogue.ts +176 -0
- package/src/client/game/models/figureCatalogue.ts +172 -0
- package/src/client/game/models/fixedDraws.ts +178 -0
- package/src/client/game/models/heldGear.ts +76 -0
- package/src/client/game/models/interact.ts +107 -0
- package/src/client/game/models/islandLibrary.ts +179 -0
- package/src/client/game/models/kitFigureCard.ts +77 -0
- package/src/client/game/models/libraryModel.ts +67 -0
- package/src/client/game/models/mountedSpecimen.ts +45 -0
- package/src/client/game/models/pickupRows.ts +12 -0
- package/src/client/game/models/ropeDeckSite.ts +114 -0
- package/src/client/game/models/scenePartSpecimen.ts +102 -0
- package/src/client/game/models/sceneSpecimens.ts +103 -0
- package/src/client/game/models/socketRigCreature.ts +65 -0
- package/src/client/game/models/specimenCatalogue.ts +540 -0
- package/src/client/game/models/treeSet.ts +149 -0
- package/src/client/game/models/worldSceneCatalogue.ts +310 -0
- package/src/client/game/nativeItems.merge.d.ts +6 -0
- package/src/client/game/pageSaveKeys.ts +13 -0
- package/src/client/game/plugin/audio.ts +277 -0
- package/src/client/game/plugin/bakedGeometry.ts +103 -0
- package/src/client/game/plugin/bladeMoves.ts +117 -0
- package/src/client/game/plugin/bossStorm.ts +40 -0
- package/src/client/game/plugin/clientChannelView.ts +135 -0
- package/src/client/game/plugin/context.ts +198 -0
- package/src/client/game/plugin/followedMovers.ts +184 -0
- package/src/client/game/plugin/geometry.ts +2083 -0
- package/src/client/game/plugin/headless.ts +127 -0
- package/src/client/game/plugin/heldEquipment.ts +208 -0
- package/src/client/game/plugin/heldFirearm.ts +395 -0
- package/src/client/game/plugin/heldRecipe.ts +43 -0
- package/src/client/game/plugin/heldTool.ts +166 -0
- package/src/client/game/plugin/moverEvents.merge.d.ts +6 -0
- package/src/client/game/plugin/moverViews.ts +114 -0
- package/src/client/game/plugin/placeholderGeometry.ts +40 -0
- package/src/client/game/plugin/scene.ts +290 -0
- package/src/client/game/plugin/shaderFamily.ts +225 -0
- package/src/client/game/plugin/ui.ts +1511 -0
- package/src/client/game/plugin/weaponFamily.ts +779 -0
- package/src/client/game/population/netCounts.ts +12 -0
- package/src/client/game/population/pageAir.ts +37 -0
- package/src/client/game/population/pageLife.ts +289 -0
- package/src/client/game/population/pageReturns.ts +17 -0
- package/src/client/game/population/productCreatures.ts +71 -0
- package/src/client/game/population/projection.ts +227 -0
- package/src/client/game/population/rowSpecies.ts +15 -0
- package/src/client/game/population/signals.ts +24 -0
- package/src/client/game/population/speciesViewSlots.ts +55 -0
- package/src/client/game/population/wildlifeFeature.ts +208 -0
- package/src/client/game/population.merge.d.ts +9 -0
- package/src/client/game/practice/course.ts +154 -0
- package/src/client/game/practice/numericCourse.ts +35 -0
- package/src/client/game/practice/registration.ts +17 -0
- package/src/client/game/practice/scene.ts +47 -0
- package/src/client/game/quest/carriedProp.ts +113 -0
- package/src/client/game/quest/chapter.ts +355 -0
- package/src/client/game/quest/chapterDirector.ts +255 -0
- package/src/client/game/quest/chapterView.ts +165 -0
- package/src/client/game/quest/continuation.ts +53 -0
- package/src/client/game/quest/contractBoardPage.ts +85 -0
- package/src/client/game/quest/declaredPage.ts +199 -0
- package/src/client/game/quest/elitePage.ts +115 -0
- package/src/client/game/quest/figureOrbit.ts +32 -0
- package/src/client/game/quest/figures.ts +259 -0
- package/src/client/game/quest/finishedAfterSeen.ts +20 -0
- package/src/client/game/quest/hints.ts +90 -0
- package/src/client/game/quest/pageComposition.ts +331 -0
- package/src/client/game/quest/pageDoors.ts +25 -0
- package/src/client/game/quest/pageFacets.ts +76 -0
- package/src/client/game/quest/pageReference.ts +17 -0
- package/src/client/game/quest/presentation.css +4 -0
- package/src/client/game/quest/questPageViews.ts +168 -0
- package/src/client/game/quest/reward.ts +48 -0
- package/src/client/game/quest/story.ts +161 -0
- package/src/client/game/quest/trader.ts +176 -0
- package/src/client/game/riding/client.ts +373 -0
- package/src/client/game/riding/hud.ts +255 -0
- package/src/client/game/riding/mount.ts +317 -0
- package/src/client/game/riding/reins.ts +177 -0
- package/src/client/game/riding/ride.css +70 -0
- package/src/client/game/riding/seatedFigure.ts +78 -0
- package/src/client/game/saves.css +34 -0
- package/src/client/game/savesSettings.ts +189 -0
- package/src/client/game/session/clockSettings.ts +66 -0
- package/src/client/game/session/context.ts +61 -0
- package/src/client/game/session/crashResume.ts +36 -0
- package/src/client/game/session/data.ts +101 -0
- package/src/client/game/session/entryReadiness.ts +13 -0
- package/src/client/game/session/exitToTitle.ts +19 -0
- package/src/client/game/session/finish.ts +414 -0
- package/src/client/game/session/hudAccent.ts +30 -0
- package/src/client/game/session/loadout.ts +176 -0
- package/src/client/game/session/play.ts +824 -0
- package/src/client/game/session/positions.ts +8 -0
- package/src/client/game/session/readyFrame.ts +10 -0
- package/src/client/game/session/session.ts +193 -0
- package/src/client/game/session/settlePrograms.ts +29 -0
- package/src/client/game/session/titlePreparation.ts +43 -0
- package/src/client/game/session/world.ts +168 -0
- package/src/client/game/shard/declaredEntry.ts +44 -0
- package/src/client/game/shard/declaredPlumbing.ts +80 -0
- package/src/client/game/shard/declaredTargets.ts +64 -0
- package/src/client/game/shard/declaredUi.ts +23 -0
- package/src/client/game/shard/discovery.ts +80 -0
- package/src/client/game/shard/list.ts +26 -0
- package/src/client/game/shard/load.ts +94 -0
- package/src/client/game/shard/manifest.ts +910 -0
- package/src/client/game/shard/pageBoot.ts +52 -0
- package/src/client/game/shard/pagePolicy.ts +17 -0
- package/src/client/game/shard/registry.ts +74 -0
- package/src/client/game/shard/retainedHooks.ts +204 -0
- package/src/client/game/shard/scopedRuntime.ts +68 -0
- package/src/client/game/shard/spec.ts +69 -0
- package/src/client/game/shard/titleList.ts +86 -0
- package/src/client/game/shardfile/accent.ts +5 -0
- package/src/client/game/shardfile/assetCache.ts +46 -0
- package/src/client/game/shardfile/audioCatalogue.ts +16 -0
- package/src/client/game/shardfile/bakedKinds.ts +313 -0
- package/src/client/game/shardfile/bakedTiles.ts +253 -0
- package/src/client/game/shardfile/buildingCloud.ts +27 -0
- package/src/client/game/shardfile/calibrationScripts.ts +30 -0
- package/src/client/game/shardfile/caveInterior.ts +162 -0
- package/src/client/game/shardfile/client.ts +671 -0
- package/src/client/game/shardfile/clientAmbientLife.ts +31 -0
- package/src/client/game/shardfile/clientAssets.ts +163 -0
- package/src/client/game/shardfile/clientBossFight.ts +39 -0
- package/src/client/game/shardfile/clientBossTelegraph.ts +43 -0
- package/src/client/game/shardfile/clientCatalogue.ts +44 -0
- package/src/client/game/shardfile/clientCosmeticFinishes.ts +37 -0
- package/src/client/game/shardfile/clientCues.ts +22 -0
- package/src/client/game/shardfile/clientEliteConstruction.ts +44 -0
- package/src/client/game/shardfile/clientEliteEntry.ts +33 -0
- package/src/client/game/shardfile/clientEntryBinds.ts +32 -0
- package/src/client/game/shardfile/clientFinds.ts +20 -0
- package/src/client/game/shardfile/clientForestPage.ts +144 -0
- package/src/client/game/shardfile/clientGraphs.ts +319 -0
- package/src/client/game/shardfile/clientHeldMelee.ts +82 -0
- package/src/client/game/shardfile/clientItems.ts +25 -0
- package/src/client/game/shardfile/clientLibrary.ts +71 -0
- package/src/client/game/shardfile/clientMaterials.ts +296 -0
- package/src/client/game/shardfile/clientMeadow.ts +30 -0
- package/src/client/game/shardfile/clientModules.ts +24 -0
- package/src/client/game/shardfile/clientMoverOwners.ts +80 -0
- package/src/client/game/shardfile/clientNativeBook.ts +38 -0
- package/src/client/game/shardfile/clientPlaceSets.ts +74 -0
- package/src/client/game/shardfile/clientPlan.ts +529 -0
- package/src/client/game/shardfile/clientPlayerEnter.ts +22 -0
- package/src/client/game/shardfile/clientPopulation.ts +49 -0
- package/src/client/game/shardfile/clientPopulationProjection.ts +28 -0
- package/src/client/game/shardfile/clientPost.ts +94 -0
- package/src/client/game/shardfile/clientPropMaterials.ts +100 -0
- package/src/client/game/shardfile/clientQuestComposition.ts +87 -0
- package/src/client/game/shardfile/clientQuestPage.ts +98 -0
- package/src/client/game/shardfile/clientRecipes.ts +76 -0
- package/src/client/game/shardfile/clientResidency.ts +29 -0
- package/src/client/game/shardfile/clientReturnModules.ts +25 -0
- package/src/client/game/shardfile/clientRuntimeHooks.ts +66 -0
- package/src/client/game/shardfile/clientSceneHandles.ts +19 -0
- package/src/client/game/shardfile/clientScripts.ts +100 -0
- package/src/client/game/shardfile/clientSkins.ts +183 -0
- package/src/client/game/shardfile/clientSource.ts +221 -0
- package/src/client/game/shardfile/clientSpeciesProgram.ts +45 -0
- package/src/client/game/shardfile/clientSplatTerrain.ts +99 -0
- package/src/client/game/shardfile/clientStealthEntry.ts +72 -0
- package/src/client/game/shardfile/clientTargets.ts +73 -0
- package/src/client/game/shardfile/clientTimedEncounters.ts +42 -0
- package/src/client/game/shardfile/clientTrails.ts +42 -0
- package/src/client/game/shardfile/clientViewProgram.ts +101 -0
- package/src/client/game/shardfile/clientViews.ts +211 -0
- package/src/client/game/shardfile/clientWater.ts +108 -0
- package/src/client/game/shardfile/clientWaterSurfaces.ts +88 -0
- package/src/client/game/shardfile/clientWorker.ts +621 -0
- package/src/client/game/shardfile/clientWorldAssembly.ts +129 -0
- package/src/client/game/shardfile/constructionCheckpoint.ts +31 -0
- package/src/client/game/shardfile/controlFiles.ts +41 -0
- package/src/client/game/shardfile/controlRefinement.ts +229 -0
- package/src/client/game/shardfile/declaredTalks.ts +114 -0
- package/src/client/game/shardfile/emptyEquipment.ts +19 -0
- package/src/client/game/shardfile/emptyLook.ts +26 -0
- package/src/client/game/shardfile/enteredTileReadout.ts +27 -0
- package/src/client/game/shardfile/entryTransport.ts +222 -0
- package/src/client/game/shardfile/farStandIn.ts +79 -0
- package/src/client/game/shardfile/forestPage.ts +289 -0
- package/src/client/game/shardfile/groundMerge.ts +232 -0
- package/src/client/game/shardfile/heldClaimsEntry.ts +34 -0
- package/src/client/game/shardfile/homeBuildCache.ts +114 -0
- package/src/client/game/shardfile/homeGeometrySnapshot.ts +92 -0
- package/src/client/game/shardfile/hybrid.ts +537 -0
- package/src/client/game/shardfile/hybridPresentation.ts +16 -0
- package/src/client/game/shardfile/islandBook.ts +87 -0
- package/src/client/game/shardfile/itemModels.ts +78 -0
- package/src/client/game/shardfile/legacyAsset.ts +30 -0
- package/src/client/game/shardfile/lentLooks.ts +210 -0
- package/src/client/game/shardfile/lightEmitters.ts +100 -0
- package/src/client/game/shardfile/livingBuildings.ts +202 -0
- package/src/client/game/shardfile/look.ts +23 -0
- package/src/client/game/shardfile/mapImage.ts +49 -0
- package/src/client/game/shardfile/pageItems.ts +57 -0
- package/src/client/game/shardfile/pagePreparation.ts +40 -0
- package/src/client/game/shardfile/pageWater.ts +29 -0
- package/src/client/game/shardfile/paintedWorldStages.ts +132 -0
- package/src/client/game/shardfile/portalRideBinding.ts +62 -0
- package/src/client/game/shardfile/preparationReads.ts +61 -0
- package/src/client/game/shardfile/preparationTiming.ts +115 -0
- package/src/client/game/shardfile/presentation.ts +36 -0
- package/src/client/game/shardfile/product.ts +718 -0
- package/src/client/game/shardfile/productCacheCompletion.ts +53 -0
- package/src/client/game/shardfile/productChecks.ts +40 -0
- package/src/client/game/shardfile/productCost.ts +422 -0
- package/src/client/game/shardfile/productGround.ts +60 -0
- package/src/client/game/shardfile/productNavigation.ts +18 -0
- package/src/client/game/shardfile/productPreflight.ts +12 -0
- package/src/client/game/shardfile/questWorld.ts +17 -0
- package/src/client/game/shardfile/readAsset.ts +44 -0
- package/src/client/game/shardfile/reusableWholeLibrary.ts +102 -0
- package/src/client/game/shardfile/runtimeProduct.ts +396 -0
- package/src/client/game/shardfile/sceneBakeFiles.ts +22 -0
- package/src/client/game/shardfile/sceneBuffers.ts +207 -0
- package/src/client/game/shardfile/sceneDraws.ts +90 -0
- package/src/client/game/shardfile/sceneDressing.ts +456 -0
- package/src/client/game/shardfile/sceneHandles.ts +170 -0
- package/src/client/game/shardfile/sceneInputs.ts +21 -0
- package/src/client/game/shardfile/sceneInstances.ts +67 -0
- package/src/client/game/shardfile/sceneMotion.ts +161 -0
- package/src/client/game/shardfile/scenePools.ts +40 -0
- package/src/client/game/shardfile/sceneProfile.ts +12 -0
- package/src/client/game/shardfile/sceneRigFiles.ts +30 -0
- package/src/client/game/shardfile/sceneScatterPages.ts +47 -0
- package/src/client/game/shardfile/sceneSources.ts +153 -0
- package/src/client/game/shardfile/serverRoute.ts +38 -0
- package/src/client/game/shardfile/skinLayerPlayback.ts +67 -0
- package/src/client/game/shardfile/skinPlayback.ts +138 -0
- package/src/client/game/shardfile/slabLibrary.ts +203 -0
- package/src/client/game/shardfile/stillImage.ts +19 -0
- package/src/client/game/shardfile/streamingView.ts +78 -0
- package/src/client/game/shardfile/tileBufferedDraws.ts +49 -0
- package/src/client/game/shardfile/tileContent.ts +564 -0
- package/src/client/game/shardfile/tileDriver.ts +462 -0
- package/src/client/game/shardfile/tileEntry.ts +18 -0
- package/src/client/game/shardfile/tiledMesh.ts +146 -0
- package/src/client/game/shardfile/water.ts +8 -0
- package/src/client/game/shardfile/weatherFields.ts +31 -0
- package/src/client/game/shardfile/wholeGeometryPieces.ts +101 -0
- package/src/client/game/shardfile/wholeLibrary.ts +47 -0
- package/src/client/game/shardfile/wholeRefinementCover.ts +78 -0
- package/src/client/game/shardfile/wirePage.ts +260 -0
- package/src/client/game/shardfile/worldAssembly.ts +531 -0
- package/src/client/game/shardfile/worldBuildYield.ts +10 -0
- package/src/client/game/shardfile/worldEntry.ts +117 -0
- package/src/client/game/shardfile/worldSceneBatch.ts +105 -0
- package/src/client/game/shardfile/worldSceneGeometry.ts +171 -0
- package/src/client/game/shardfile/worldSceneMaterials.ts +90 -0
- package/src/client/game/shardfile/worldScenePlacement.ts +364 -0
- package/src/client/game/shardfile/worldScenePlacementPages.ts +61 -0
- package/src/client/game/shardfile/worldSceneReads.ts +83 -0
- package/src/client/game/shardfile/worldSceneStepSources.ts +69 -0
- package/src/client/game/shardfile/worldSceneSurface.ts +108 -0
- package/src/client/game/shardfile/worldSceneTextures.ts +134 -0
- package/src/client/game/shardfile/worldSceneUniforms.ts +17 -0
- package/src/client/game/shardfile/worldSceneWeld.ts +339 -0
- package/src/client/game/shardfile/worldScenes.ts +760 -0
- package/src/client/game/shardfile/worldUpdates.ts +149 -0
- package/src/client/game/stealth/controller.ts +115 -0
- package/src/client/game/stealth/stealth.css +70 -0
- package/src/client/game/summary.css +8 -0
- package/src/client/game/summary.ts +67 -0
- package/src/client/game/systems/audio/crossbowSounds.ts +71 -0
- package/src/client/game/systems/audio/firearmSounds.ts +43 -0
- package/src/client/game/systems/audio/meleeSounds.ts +40 -0
- package/src/client/game/systems/audio/silentScore.ts +6 -0
- package/src/client/game/systems/effects/starter.generated.ts +2 -0
- package/src/client/game/systems/effects/status.css +3 -0
- package/src/client/game/systems/effects/view.ts +35 -0
- package/src/client/game/systems/items/declaredSword.ts +149 -0
- package/src/client/game/systems/looks/fogProgram.ts +18 -0
- package/src/client/game/systems/looks/particles.ts +407 -0
- package/src/client/game/systems/looks/rainCurtain.ts +50 -0
- package/src/client/game/systems/looks/surfaceLooks.ts +138 -0
- package/src/client/game/systems/looks/trample.ts +139 -0
- package/src/client/game/systems/looks/waterSurface.ts +179 -0
- package/src/client/game/systems/npc/figureRows.ts +169 -0
- package/src/client/game/systems/npc/figureSkins.ts +130 -0
- package/src/client/game/systems/npc/kitFigure.ts +127 -0
- package/src/client/game/systems/npc/npcRig.ts +217 -0
- package/src/client/game/systems/npc/standingFigure.ts +111 -0
- package/src/client/game/systems/props/interact.ts +236 -0
- package/src/client/game/systems/species/bear.ts +30 -0
- package/src/client/game/systems/species/boar.ts +28 -0
- package/src/client/game/systems/species/install.ts +18 -0
- package/src/client/game/systems/species/view/bear.ts +246 -0
- package/src/client/game/systems/species/view/boar.ts +249 -0
- package/src/client/game/systems/tools/hoverboard.ts +107 -0
- package/src/client/game/systems/viewmodel/armAliases.json +24 -0
- package/src/client/game/systems/viewmodel/armClips.ts +8 -0
- package/src/client/game/systems/viewmodel/armRig.ts +293 -0
- package/src/client/game/systems/viewmodel/clips.generated.ts +2 -0
- package/src/client/game/systems/viewmodel/heldView.ts +458 -0
- package/src/client/game/systems/viewmodel/rigArms.ts +280 -0
- package/src/client/game/titleAssets.ts +9 -0
- package/src/client/game/titleDeck.ts +381 -0
- package/src/client/game/travel/travel.ts +99 -0
- package/src/client/game/ui/dataPanels.ts +95 -0
- package/src/client/game/ui/panelTemplates.ts +71 -0
- package/src/client/game/ui/panels.ts +109 -0
- package/src/client/game/upgrade.css +12 -0
- package/src/client/game/weapons/Bow.ts +14 -0
- package/src/client/game/weapons/Sword.ts +30 -0
- package/src/client/game/weapons/arcPower.ts +203 -0
- package/src/client/game/weapons/heldLauncher.ts +452 -0
- package/src/client/game/weapons/heldPolearm.ts +491 -0
- package/src/client/game/weapons/mountedBlade.ts +122 -0
- package/src/client/game/weather/forest.ts +281 -0
- package/src/client/game/weather/netClimate.ts +88 -0
- package/src/client/game/weather/pageSky.ts +31 -0
- package/src/client/game/weather/rainPresentation.ts +246 -0
- package/src/client/game/weather/weatherEvents.merge.d.ts +8 -0
- package/src/client/game/whatsNew.ts +31 -0
- package/src/client/game/whatsNewBanner.ts +125 -0
- package/src/client/host/online/chatCorner.ts +46 -0
- package/src/client/host/online/chatLines.ts +213 -0
- package/src/client/host/online/doctor.ts +321 -0
- package/src/client/host/online/doctorPage.ts +26 -0
- package/src/client/host/online/doctorView.ts +144 -0
- package/src/client/host/online/linkScreens.ts +300 -0
- package/src/client/host/online/reconnectStrip.ts +26 -0
- package/src/client/host/online/release.ts +28 -0
- package/src/client/host/online/shell.ts +312 -0
- package/src/client/host/online/voice.ts +468 -0
- package/src/client/host/online/voiceUi.ts +186 -0
- package/src/client/host/standalone/shell.ts +169 -0
- package/src/client/index.html +12 -0
- package/src/client/main.tsx +10 -0
- package/src/client/side.ts +2 -0
- package/src/client/tsconfig.json +13 -0
- package/src/cook/game/brotliSizeCache.d.mts +5 -0
- package/src/cook/game/brotliSizeCache.mjs +59 -0
- package/src/cook/game/contentNamed.ts +6 -0
- package/src/cook/game/cookJob.ts +103 -0
- package/src/cook/game/cookWorker.ts +413 -0
- package/src/cook/game/encodedBytes.ts +51 -0
- package/src/cook/game/engineHalf.ts +47 -0
- package/src/cook/game/entryDownloads.ts +36 -0
- package/src/cook/game/entryReadSet.ts +67 -0
- package/src/cook/game/entryTotals.ts +320 -0
- package/src/cook/game/fenceReads.ts +218 -0
- package/src/cook/game/gridCollision.ts +53 -0
- package/src/cook/game/gridEntryDownloads.ts +33 -0
- package/src/cook/game/gridStripPages.ts +239 -0
- package/src/cook/game/installedRuntimeReads.ts +48 -0
- package/src/cook/game/packStore.ts +120 -0
- package/src/cook/game/portableEncode.ts +7 -0
- package/src/cook/game/productTarball.ts +18 -0
- package/src/cook/game/shardCook.ts +350 -0
- package/src/cook/game/spawnParts.ts +294 -0
- package/src/cook/game/stripPack.ts +31 -0
- package/src/cook/side.ts +2 -0
- package/src/e2e/playwright.config.ts +60 -0
- package/src/e2e/smoke/game.ts +217 -0
- package/src/e2e/smoke/page-globals.d.ts +37 -0
- package/src/e2e/smoke/template2.spec.ts +146 -0
- package/src/e2e/status.spec.ts +13 -0
- package/src/scripts/ask-new.sh +29 -0
- package/src/scripts/asks.mjs +142 -0
- package/src/scripts/check-sides.mjs +70 -0
- package/src/scripts/herdr-prompt.sh +34 -0
- package/src/scripts/herdr-question-open.sh +67 -0
- package/src/scripts/md-wrap.mjs +229 -0
- package/src/server/app.ts +19 -0
- package/src/server/engine/ai/CreatureBrain.ts +23 -0
- package/src/server/engine/ai/bossContenders.ts +101 -0
- package/src/server/engine/ai/burstFlyer.ts +31 -0
- package/src/server/engine/ai/challengeGrazer.ts +31 -0
- package/src/server/engine/ai/eliteContinuation.ts +141 -0
- package/src/server/engine/ai/eliteKernels.ts +187 -0
- package/src/server/engine/ai/eliteLifecycle.ts +126 -0
- package/src/server/engine/ai/eliteRoster.ts +357 -0
- package/src/server/engine/ai/grazer.ts +1360 -0
- package/src/server/engine/ai/guardian.ts +20 -0
- package/src/server/engine/ai/guardianPolicy.ts +264 -0
- package/src/server/engine/ai/herd.ts +17 -0
- package/src/server/engine/ai/hunt.ts +46 -0
- package/src/server/engine/ai/moves.ts +202 -0
- package/src/server/engine/ai/orbitDiver.ts +33 -0
- package/src/server/engine/ai/pack.ts +29 -0
- package/src/server/engine/ai/patrolDiver.ts +31 -0
- package/src/server/engine/ai/perchHunter.ts +20 -0
- package/src/server/engine/ai/phases.ts +121 -0
- package/src/server/engine/ai/platform.ts +140 -0
- package/src/server/engine/ai/ramGrazer.ts +31 -0
- package/src/server/engine/ai/scriptBrain.ts +147 -0
- package/src/server/engine/ai/skirmisher.ts +20 -0
- package/src/server/engine/ai/species.ts +33 -0
- package/src/server/engine/combat/EquipmentPickup.ts +28 -0
- package/src/server/engine/combat/contactWeapon.ts +251 -0
- package/src/server/engine/combat/damageBook.ts +45 -0
- package/src/server/engine/combat/rewind.ts +7 -0
- package/src/server/engine/entities/AnimalManager.ts +752 -0
- package/src/server/engine/entities/bodyClear.ts +47 -0
- package/src/server/engine/entities/creatureRefill.ts +119 -0
- package/src/server/engine/entities/killHeight.ts +18 -0
- package/src/server/engine/level/context.ts +111 -0
- package/src/server/engine/net/chat.ts +97 -0
- package/src/server/engine/net/combatWire.ts +49 -0
- package/src/server/engine/net/commandQueue.ts +95 -0
- package/src/server/engine/net/handles.ts +74 -0
- package/src/server/engine/net/hitHistory.ts +114 -0
- package/src/server/engine/net/ledgerBook.ts +65 -0
- package/src/server/engine/net/room.ts +560 -0
- package/src/server/engine/net/serverClock.ts +43 -0
- package/src/server/engine/net/simWorld.ts +131 -0
- package/src/server/engine/net/tiers.ts +14 -0
- package/src/server/engine/physics/edgeEntries.ts +40 -0
- package/src/server/engine/physics/rapierBindings.ts +4 -0
- package/src/server/engine/saves/forwardedStorage.ts +43 -0
- package/src/server/engine/script/composition.ts +219 -0
- package/src/server/engine/script/decision.ts +573 -0
- package/src/server/engine/script/inputInboxV2.ts +116 -0
- package/src/server/engine/script/lane.ts +185 -0
- package/src/server/engine/script/ownedSimBatchV2.ts +205 -0
- package/src/server/engine/script/queries.ts +37 -0
- package/src/server/engine/script/queriesV2.ts +149 -0
- package/src/server/engine/script/simBatchV2.ts +125 -0
- package/src/server/engine/sim/playerSim.ts +443 -0
- package/src/server/engine/sim/respawn.ts +74 -0
- package/src/server/engine/sim/restore.ts +37 -0
- package/src/server/engine/sim.ts +711 -0
- package/src/server/game/animation/limbPopulation.ts +138 -0
- package/src/server/game/bake/entryways.ts +186 -0
- package/src/server/game/boss/arenaRoomEntry.ts +97 -0
- package/src/server/game/boss/arenaRoomFight.ts +103 -0
- package/src/server/game/boss/arenaRoomNative.ts +142 -0
- package/src/server/game/boss/arenaWords.ts +46 -0
- package/src/server/game/boss/bounty.ts +37 -0
- package/src/server/game/boss/captainNative.ts +122 -0
- package/src/server/game/boss/continuation.ts +37 -0
- package/src/server/game/boss/headlessArenaPose.ts +40 -0
- package/src/server/game/boss/headlessArenaViews.ts +54 -0
- package/src/server/game/boss/headlessCloudBody.ts +93 -0
- package/src/server/game/boss/native.ts +220 -0
- package/src/server/game/boss/nativeArenaSand.ts +93 -0
- package/src/server/game/boss/nativeArenaSeal.ts +26 -0
- package/src/server/game/boss/nativeWake.ts +50 -0
- package/src/server/game/boss/openArenaNative.ts +200 -0
- package/src/server/game/boss/openArenaRoom.ts +69 -0
- package/src/server/game/boss/openArenaState.ts +25 -0
- package/src/server/game/boss/patrolNative.ts +286 -0
- package/src/server/game/boss/roaming.ts +77 -0
- package/src/server/game/boss/slotHeights.ts +103 -0
- package/src/server/game/boss/slotsNative.ts +175 -0
- package/src/server/game/boss/windEliteNative.ts +139 -0
- package/src/server/game/grapple/native.ts +181 -0
- package/src/server/game/grid/durability.ts +166 -0
- package/src/server/game/grid/room.ts +53 -0
- package/src/server/game/grid/roomNet.ts +85 -0
- package/src/server/game/grid/simulation.ts +345 -0
- package/src/server/game/items.merge.d.ts +7 -0
- package/src/server/game/loadout/nativeAmmunition.ts +139 -0
- package/src/server/game/loadout/ownedEffects.ts +68 -0
- package/src/server/game/loot/harvest.ts +43 -0
- package/src/server/game/loot/personal.ts +70 -0
- package/src/server/game/loot/playerOwned.ts +235 -0
- package/src/server/game/plugin/bossPhase.ts +904 -0
- package/src/server/game/plugin/brain.ts +1325 -0
- package/src/server/game/plugin/mover.ts +601 -0
- package/src/server/game/plugin/nativeItems.ts +437 -0
- package/src/server/game/plugin/nativeRewind.ts +37 -0
- package/src/server/game/plugin/nativeSwept.ts +249 -0
- package/src/server/game/plugin/playerSeats.ts +62 -0
- package/src/server/game/plugin/scriptSeats.ts +89 -0
- package/src/server/game/plugin/simulation.ts +1623 -0
- package/src/server/game/population/actorProjectionV2.ts +276 -0
- package/src/server/game/population/actors.ts +136 -0
- package/src/server/game/population/directedLaw.ts +69 -0
- package/src/server/game/population/encounterBook.ts +78 -0
- package/src/server/game/population/encounterIntake.ts +78 -0
- package/src/server/game/population/environment.ts +86 -0
- package/src/server/game/population/mixedRoster.ts +353 -0
- package/src/server/game/population/nativeBake.ts +202 -0
- package/src/server/game/population/nativeManager.ts +426 -0
- package/src/server/game/population/nativeReturns.ts +99 -0
- package/src/server/game/population/perchBody.ts +97 -0
- package/src/server/game/population/projectedSites.ts +41 -0
- package/src/server/game/population/relations.ts +45 -0
- package/src/server/game/population/roster.ts +259 -0
- package/src/server/game/population/scriptStrikes.ts +67 -0
- package/src/server/game/population/shelter.ts +193 -0
- package/src/server/game/population/signals.ts +9 -0
- package/src/server/game/population/spawnScript.ts +797 -0
- package/src/server/game/population/specCatalogue.ts +11 -0
- package/src/server/game/quest/bodyOps.ts +253 -0
- package/src/server/game/quest/chapterRecords.ts +97 -0
- package/src/server/game/quest/eliteDrops.ts +36 -0
- package/src/server/game/quest/eliteFeature.ts +141 -0
- package/src/server/game/quest/killSteps.ts +34 -0
- package/src/server/game/quest/nativeBodyScripts.ts +29 -0
- package/src/server/game/quest/nativeChapter.ts +80 -0
- package/src/server/game/quest/nativeComposition.ts +548 -0
- package/src/server/game/quest/nativeEntry.ts +128 -0
- package/src/server/game/quest/nativeInputs.ts +29 -0
- package/src/server/game/quest/nativeSecret.ts +80 -0
- package/src/server/game/quest/serverChapters.ts +192 -0
- package/src/server/game/quest/serverDoors.ts +89 -0
- package/src/server/game/quest/serverPlaces.ts +32 -0
- package/src/server/game/riding/native.ts +362 -0
- package/src/server/game/riding/nativePopulation.ts +384 -0
- package/src/server/game/riding/nativeTaming.ts +331 -0
- package/src/server/game/riding/pastureController.ts +131 -0
- package/src/server/game/riding/roster.ts +108 -0
- package/src/server/game/riding/wildRefill.ts +37 -0
- package/src/server/game/roomRespawn.ts +60 -0
- package/src/server/game/shard/declaredEncounters.ts +22 -0
- package/src/server/game/shard/manifest-closure.generated.json +683 -0
- package/src/server/game/shard/portShares.generated.ts +2 -0
- package/src/server/game/shard/world.ts +5 -0
- package/src/server/game/shardfile/borrowedDecisions.ts +281 -0
- package/src/server/game/shardfile/bossRow.ts +236 -0
- package/src/server/game/shardfile/brainRuntime.ts +162 -0
- package/src/server/game/shardfile/decisions.ts +597 -0
- package/src/server/game/shardfile/declaredClimate.ts +22 -0
- package/src/server/game/shardfile/declaredKitItems.ts +243 -0
- package/src/server/game/shardfile/declaredTalks.ts +52 -0
- package/src/server/game/shardfile/groupRuntime.ts +302 -0
- package/src/server/game/shardfile/homeKeeper.ts +565 -0
- package/src/server/game/shardfile/nativeAssembly.ts +102 -0
- package/src/server/game/shardfile/nativeAssemblyHosts.ts +301 -0
- package/src/server/game/shardfile/nativeAssemblyInput.ts +68 -0
- package/src/server/game/shardfile/nativePlan.ts +28 -0
- package/src/server/game/shardfile/nativeRuntimeLoans.ts +52 -0
- package/src/server/game/shardfile/phasedBossRoaming.ts +427 -0
- package/src/server/game/shardfile/portalLinkProof.ts +66 -0
- package/src/server/game/shardfile/scriptComposition.ts +57 -0
- package/src/server/game/shardfile/scripts.ts +56 -0
- package/src/server/game/shardfile/statusEffects.ts +68 -0
- package/src/server/game/stealth/nativeStealth.ts +74 -0
- package/src/server/game/weapons/nativeHeld.ts +333 -0
- package/src/server/game/weather/continuation.ts +97 -0
- package/src/server/game/weather/reactions.ts +219 -0
- package/src/server/game/weather/wire.ts +42 -0
- package/src/server/host/bake/headlessWorker.ts +132 -0
- package/src/server/host/dedicated/cellHost.ts +171 -0
- package/src/server/host/dedicated/cellProtocol.ts +64 -0
- package/src/server/host/dedicated/cellWorker.ts +33 -0
- package/src/server/host/dedicated/crossing.ts +44 -0
- package/src/server/host/dedicated/dedicatedRoom.ts +419 -0
- package/src/server/host/dedicated/doorTrust.ts +55 -0
- package/src/server/host/dedicated/gridCells.ts +53 -0
- package/src/server/host/dedicated/main.ts +134 -0
- package/src/server/host/dedicated/packReader.ts +68 -0
- package/src/server/host/dedicated/playerDoc.ts +96 -0
- package/src/server/host/dedicated/playerSaves.ts +62 -0
- package/src/server/host/dedicated/playerStore.ts +82 -0
- package/src/server/host/dedicated/playtest.ts +41 -0
- package/src/server/host/dedicated/releaseFile.ts +71 -0
- package/src/server/host/dedicated/roadRoom.ts +151 -0
- package/src/server/host/dedicated/saves/database.ts +15 -0
- package/src/server/host/dedicated/saves/migrate.ts +26 -0
- package/src/server/host/dedicated/saves/migrations/0001-saves.sql +48 -0
- package/src/server/host/dedicated/saves/migrations/0002-report-delivery.sql +3 -0
- package/src/server/host/dedicated/saves/migrations/0003-place.sql +11 -0
- package/src/server/host/dedicated/saves/migrations/0004-names.sql +4 -0
- package/src/server/host/dedicated/saves/migrations/0005-profile.sql +41 -0
- package/src/server/host/dedicated/saves/names.ts +56 -0
- package/src/server/host/dedicated/saves/pgDatabase.ts +43 -0
- package/src/server/host/dedicated/saves/profile.ts +44 -0
- package/src/server/host/dedicated/saves/reportQueue.ts +49 -0
- package/src/server/host/dedicated/saves/saveStore.ts +117 -0
- package/src/server/host/dedicated/saves/writeQueue.ts +94 -0
- package/src/server/host/dedicated/seats.ts +12 -0
- package/src/server/host/dedicated/serverReports.ts +81 -0
- package/src/server/host/dedicated/serverSentry.ts +124 -0
- package/src/server/host/dedicated/shopGate.ts +36 -0
- package/src/server/host/dedicated/socketPump.ts +74 -0
- package/src/server/host/dedicated/socketTransport.ts +123 -0
- package/src/server/host/dedicated/voiceRelay.ts +138 -0
- package/src/server/host/dedicated/workerTable.ts +29 -0
- package/src/server/host/dedicated/world.ts +428 -0
- package/src/server/host/headless.ts +280 -0
- package/src/server/host/headlessProduct.ts +52 -0
- package/src/server/host/headlessRuntime.ts +354 -0
- package/src/server/host/ropeDecks.ts +69 -0
- package/src/server/host/standalone/cellWorld.ts +188 -0
- package/src/server/host/standalone/continuation.ts +58 -0
- package/src/server/host/standalone/fallFloor.ts +83 -0
- package/src/server/host/standalone/gridServer.ts +282 -0
- package/src/server/host/standalone/ledgerFilings.ts +33 -0
- package/src/server/host/standalone/progressWatch.ts +90 -0
- package/src/server/host/standalone/roadWorld.ts +49 -0
- package/src/server/host/standalone/serverHost.ts +132 -0
- package/src/server/host/standalone/serverProduct.ts +149 -0
- package/src/server/host/standalone/serverRuntime.ts +43 -0
- package/src/server/host/standalone/serverWorker.ts +22 -0
- package/src/server/host/tickWorkerHost.ts +250 -0
- package/src/server/host/tickWorkerLoop.ts +123 -0
- package/src/server/serve.ts +49 -0
- package/src/server/side.ts +2 -0
- package/src/shared/engine/ai/BossBrain.ts +287 -0
- package/src/shared/engine/ai/GroupBrain.ts +152 -0
- package/src/shared/engine/ai/ambientFlight.ts +60 -0
- package/src/shared/engine/ai/ambientFlock.ts +297 -0
- package/src/shared/engine/ai/ambientForager.ts +289 -0
- package/src/shared/engine/ai/bossScale.ts +8 -0
- package/src/shared/engine/ai/director.ts +94 -0
- package/src/shared/engine/ai/diver.ts +540 -0
- package/src/shared/engine/ai/eliteScript.ts +85 -0
- package/src/shared/engine/ai/encounters.ts +124 -0
- package/src/shared/engine/ai/flight.ts +69 -0
- package/src/shared/engine/ai/flock.ts +334 -0
- package/src/shared/engine/ai/hfsm.ts +51 -0
- package/src/shared/engine/ai/huntPattern.ts +987 -0
- package/src/shared/engine/ai/inspect.ts +6 -0
- package/src/shared/engine/ai/pinning.ts +13 -0
- package/src/shared/engine/ai/reach.ts +19 -0
- package/src/shared/engine/ai/stalker.ts +1502 -0
- package/src/shared/engine/ai/strikeRows.ts +17 -0
- package/src/shared/engine/ai/strikeState.ts +19 -0
- package/src/shared/engine/ai/strikes.ts +199 -0
- package/src/shared/engine/ai/weighted.ts +27 -0
- package/src/shared/engine/app/identity.ts +66 -0
- package/src/shared/engine/app/ownership.ts +155 -0
- package/src/shared/engine/app/pageSeat.ts +12 -0
- package/src/shared/engine/app/resources.ts +7 -0
- package/src/shared/engine/app/scheduler.ts +162 -0
- package/src/shared/engine/app/scope.ts +557 -0
- package/src/shared/engine/app/scopeEnvironment.ts +27 -0
- package/src/shared/engine/app/scopedProperty.ts +38 -0
- package/src/shared/engine/audio/audioProfiles.ts +161 -0
- package/src/shared/engine/audio/bootAudio.ts +316 -0
- package/src/shared/engine/boot/loadingWaits.ts +62 -0
- package/src/shared/engine/boot/serverProgress.ts +27 -0
- package/src/shared/engine/boot/steps.ts +63 -0
- package/src/shared/engine/boot/tables.ts +48 -0
- package/src/shared/engine/boot/timeline.ts +189 -0
- package/src/shared/engine/boot/timing.ts +96 -0
- package/src/shared/engine/boot/waits.ts +114 -0
- package/src/shared/engine/boot/workerTiming.ts +74 -0
- package/src/shared/engine/combat/Equipment.ts +66 -0
- package/src/shared/engine/combat/Firearm.ts +200 -0
- package/src/shared/engine/combat/Melee.ts +46 -0
- package/src/shared/engine/combat/Tool.ts +8 -0
- package/src/shared/engine/combat/Weapon.ts +133 -0
- package/src/shared/engine/combat/ammo.ts +17 -0
- package/src/shared/engine/combat/blocks/ads.ts +5 -0
- package/src/shared/engine/combat/blocks/melee.ts +19 -0
- package/src/shared/engine/combat/bowDraw.ts +140 -0
- package/src/shared/engine/combat/bowLaw.ts +54 -0
- package/src/shared/engine/combat/effects/EffectService.ts +216 -0
- package/src/shared/engine/combat/effects/types.ts +47 -0
- package/src/shared/engine/combat/health.ts +92 -0
- package/src/shared/engine/combat/impact.ts +8 -0
- package/src/shared/engine/combat/itemFamilies.ts +34 -0
- package/src/shared/engine/combat/items.ts +147 -0
- package/src/shared/engine/combat/lungeTarget.ts +42 -0
- package/src/shared/engine/combat/meleeProfile.ts +48 -0
- package/src/shared/engine/combat/pipeline.ts +157 -0
- package/src/shared/engine/combat/projectileContact.ts +275 -0
- package/src/shared/engine/combat/projectileFlight.ts +89 -0
- package/src/shared/engine/combat/projectileLaw.ts +148 -0
- package/src/shared/engine/combat/shotSpread.ts +38 -0
- package/src/shared/engine/combat/sweptBasePose.ts +75 -0
- package/src/shared/engine/combat/sweptBlade.ts +108 -0
- package/src/shared/engine/combat/sweptMeleeCore.ts +223 -0
- package/src/shared/engine/combat/targets.ts +20 -0
- package/src/shared/engine/core/clock.ts +57 -0
- package/src/shared/engine/core/config.ts +66 -0
- package/src/shared/engine/core/faults.ts +129 -0
- package/src/shared/engine/core/fixedStep.ts +5 -0
- package/src/shared/engine/core/frameCost.ts +227 -0
- package/src/shared/engine/core/framePacing.ts +179 -0
- package/src/shared/engine/core/harnessTap.ts +15 -0
- package/src/shared/engine/core/memoryAttribution.ts +137 -0
- package/src/shared/engine/core/memoryResources.ts +20 -0
- package/src/shared/engine/core/noise.ts +53 -0
- package/src/shared/engine/core/perfLap.ts +37 -0
- package/src/shared/engine/core/portableMath.ts +204 -0
- package/src/shared/engine/core/portableMathFirst.ts +4 -0
- package/src/shared/engine/core/practiceRoomState.ts +3 -0
- package/src/shared/engine/core/rng.ts +101 -0
- package/src/shared/engine/core/time.ts +8 -0
- package/src/shared/engine/core/workSlice.ts +111 -0
- package/src/shared/engine/entities/AnimalSim.ts +390 -0
- package/src/shared/engine/entities/animalPose.ts +401 -0
- package/src/shared/engine/entities/animalRig.ts +76 -0
- package/src/shared/engine/entities/animalStates.ts +2 -0
- package/src/shared/engine/entities/creatureFloor.ts +13 -0
- package/src/shared/engine/entities/eliteBrain.ts +36 -0
- package/src/shared/engine/entities/fightRules.ts +80 -0
- package/src/shared/engine/entities/ids.ts +18 -0
- package/src/shared/engine/entities/poseCadence.ts +9 -0
- package/src/shared/engine/entities/species/registry.ts +382 -0
- package/src/shared/engine/entities/species/rigs.ts +53 -0
- package/src/shared/engine/events/events.ts +107 -0
- package/src/shared/engine/input/commands.ts +34 -0
- package/src/shared/engine/input/netButtons.ts +4 -0
- package/src/shared/engine/level/data.ts +163 -0
- package/src/shared/engine/level/selection.ts +44 -0
- package/src/shared/engine/level/spec.ts +132 -0
- package/src/shared/engine/net/acts.ts +48 -0
- package/src/shared/engine/net/animalNet.ts +43 -0
- package/src/shared/engine/net/bits.ts +104 -0
- package/src/shared/engine/net/chatFilter.ts +40 -0
- package/src/shared/engine/net/chatWire.ts +18 -0
- package/src/shared/engine/net/chatWords.ts +7 -0
- package/src/shared/engine/net/command.ts +96 -0
- package/src/shared/engine/net/encounterNet.ts +32 -0
- package/src/shared/engine/net/frame.ts +159 -0
- package/src/shared/engine/net/identity.ts +40 -0
- package/src/shared/engine/net/ledgerWire.ts +24 -0
- package/src/shared/engine/net/measurements.ts +14 -0
- package/src/shared/engine/net/messages.ts +213 -0
- package/src/shared/engine/net/netSchemas.ts +38 -0
- package/src/shared/engine/net/playerNet.ts +80 -0
- package/src/shared/engine/net/schema.ts +157 -0
- package/src/shared/engine/net/shardNet.ts +25 -0
- package/src/shared/engine/net/socketFrames.ts +84 -0
- package/src/shared/engine/net/transport.ts +19 -0
- package/src/shared/engine/net/wireFrames.ts +123 -0
- package/src/shared/engine/net/wireMessages.ts +115 -0
- package/src/shared/engine/net/wireValues.ts +142 -0
- package/src/shared/engine/physics/CharacterMotor.ts +429 -0
- package/src/shared/engine/physics/Physics.ts +211 -0
- package/src/shared/engine/physics/bodies.ts +600 -0
- package/src/shared/engine/physics/box.ts +42 -0
- package/src/shared/engine/physics/creatures.ts +188 -0
- package/src/shared/engine/physics/declaredProps.ts +26 -0
- package/src/shared/engine/physics/entrySockets.ts +44 -0
- package/src/shared/engine/physics/frame.ts +39 -0
- package/src/shared/engine/physics/gridBorders.ts +38 -0
- package/src/shared/engine/physics/groups.ts +64 -0
- package/src/shared/engine/physics/heightPatch.ts +49 -0
- package/src/shared/engine/physics/meshCollision.ts +84 -0
- package/src/shared/engine/physics/mover.ts +60 -0
- package/src/shared/engine/physics/navmesh.ts +206 -0
- package/src/shared/engine/physics/navmeshUrl.ts +8 -0
- package/src/shared/engine/physics/nearColliders.ts +55 -0
- package/src/shared/engine/physics/overlap.ts +26 -0
- package/src/shared/engine/physics/paths.ts +135 -0
- package/src/shared/engine/physics/pieces.ts +139 -0
- package/src/shared/engine/physics/query.ts +161 -0
- package/src/shared/engine/physics/queryBatchV2.ts +118 -0
- package/src/shared/engine/physics/rapier-bg.d.ts +5 -0
- package/src/shared/engine/physics/rapier.ts +34 -0
- package/src/shared/engine/physics/readinessWalls.ts +49 -0
- package/src/shared/engine/physics/ropeChain.ts +128 -0
- package/src/shared/engine/physics/stripColliders.ts +21 -0
- package/src/shared/engine/physics/surface.ts +31 -0
- package/src/shared/engine/physics/terrain.ts +155 -0
- package/src/shared/engine/physics/terrainTiles.ts +20 -0
- package/src/shared/engine/physics/trainingTargets.ts +51 -0
- package/src/shared/engine/physics/transferWalls.ts +84 -0
- package/src/shared/engine/physics/wasmUrl.ts +3 -0
- package/src/shared/engine/player/MeleeSweep.ts +50 -0
- package/src/shared/engine/player/board.ts +129 -0
- package/src/shared/engine/player/combatMotion.ts +5 -0
- package/src/shared/engine/player/dash.ts +60 -0
- package/src/shared/engine/player/dodge.ts +14 -0
- package/src/shared/engine/player/fall.ts +29 -0
- package/src/shared/engine/player/hoverSpeed.ts +22 -0
- package/src/shared/engine/player/impulse.ts +30 -0
- package/src/shared/engine/player/jump.ts +30 -0
- package/src/shared/engine/player/lockOrbit.ts +72 -0
- package/src/shared/engine/player/modes.ts +239 -0
- package/src/shared/engine/player/motion.ts +391 -0
- package/src/shared/engine/player/motionState.ts +84 -0
- package/src/shared/engine/player/shove.ts +27 -0
- package/src/shared/engine/player/swim.ts +196 -0
- package/src/shared/engine/player/walk.ts +25 -0
- package/src/shared/engine/quest/core.ts +174 -0
- package/src/shared/engine/quest/dialogueClock.ts +191 -0
- package/src/shared/engine/quest/discovery.ts +42 -0
- package/src/shared/engine/quest/lastPlace.ts +80 -0
- package/src/shared/engine/quest/players.ts +162 -0
- package/src/shared/engine/quest/progress.ts +25 -0
- package/src/shared/engine/quest/viewPort.ts +22 -0
- package/src/shared/engine/saves/environment.ts +13 -0
- package/src/shared/engine/saves/legacy.ts +65 -0
- package/src/shared/engine/saves/runtime.ts +28 -0
- package/src/shared/engine/saves/saves.lock.json +551 -0
- package/src/shared/engine/saves/shape.ts +157 -0
- package/src/shared/engine/saves/store.ts +423 -0
- package/src/shared/engine/script/checkpointBytes.ts +18 -0
- package/src/shared/engine/script/decisionModule.ts +158 -0
- package/src/shared/engine/script/effects.ts +111 -0
- package/src/shared/engine/script/fixedMemory.ts +92 -0
- package/src/shared/engine/script/groupBankV2.ts +376 -0
- package/src/shared/engine/script/groupStepV2.ts +987 -0
- package/src/shared/engine/script/host.ts +443 -0
- package/src/shared/engine/script/moduleV2.ts +160 -0
- package/src/shared/engine/script/observationColumnsV2.ts +431 -0
- package/src/shared/engine/script/observationsV2.ts +139 -0
- package/src/shared/engine/script/state.ts +183 -0
- package/src/shared/engine/script/strings.ts +5 -0
- package/src/shared/engine/script/viewLane.ts +335 -0
- package/src/shared/engine/script/viewProgram.ts +315 -0
- package/src/shared/engine/sim/actRoutes.ts +72 -0
- package/src/shared/engine/sim/apiVersion.ts +2 -0
- package/src/shared/engine/sim/bands.ts +174 -0
- package/src/shared/engine/sim/cableTraversal.ts +356 -0
- package/src/shared/engine/sim/dayClock.ts +76 -0
- package/src/shared/engine/sim/edgeProfiles.ts +123 -0
- package/src/shared/engine/sim/encounterRows.ts +49 -0
- package/src/shared/engine/sim/leadPlayer.ts +16 -0
- package/src/shared/engine/sim/moverLifecycle.ts +80 -0
- package/src/shared/engine/sim/moverMotion.ts +130 -0
- package/src/shared/engine/sim/nearPlayer.ts +21 -0
- package/src/shared/engine/sim/netMotion.ts +17 -0
- package/src/shared/engine/sim/readiness.ts +77 -0
- package/src/shared/engine/sim/seamError.ts +100 -0
- package/src/shared/engine/sim/seamGeometry.ts +365 -0
- package/src/shared/engine/sim/seamLattice.ts +127 -0
- package/src/shared/engine/sim/shardRows.ts +106 -0
- package/src/shared/engine/sim/shore.ts +14 -0
- package/src/shared/engine/sim/snapshot.ts +482 -0
- package/src/shared/engine/sim/snapshotBase64.ts +25 -0
- package/src/shared/engine/sim/snapshotData.ts +460 -0
- package/src/shared/engine/sim/snapshotPhysics.ts +163 -0
- package/src/shared/engine/sim/snapshotReferenceMemo.ts +271 -0
- package/src/shared/engine/sim/strips.ts +134 -0
- package/src/shared/engine/strings.ts +751 -0
- package/src/shared/engine/world/BakedTerrain.ts +131 -0
- package/src/shared/engine/world/Heightfield.ts +129 -0
- package/src/shared/engine/world/bakedTerrainField.ts +85 -0
- package/src/shared/engine/world/dayCycle.ts +198 -0
- package/src/shared/engine/world/easedFields.ts +32 -0
- package/src/shared/engine/world/forest/placement.ts +391 -0
- package/src/shared/engine/world/forest/treeSpec.ts +15 -0
- package/src/shared/engine/world/groundField.ts +21 -0
- package/src/shared/engine/world/interact/barrel.ts +114 -0
- package/src/shared/engine/world/interact/flags.ts +229 -0
- package/src/shared/engine/world/interact/pickup.ts +22 -0
- package/src/shared/engine/world/interact/prompts.ts +47 -0
- package/src/shared/engine/world/interact/types.ts +327 -0
- package/src/shared/engine/world/interact/validate.ts +67 -0
- package/src/shared/engine/world/scalarChannel.ts +146 -0
- package/src/shared/engine/world/steppeWind.ts +193 -0
- package/src/shared/engine/world/terrainField.ts +217 -0
- package/src/shared/engine/world/terrainHeight.ts +19 -0
- package/src/shared/engine/world/water/body.ts +88 -0
- package/src/shared/engine/world/water/declared.ts +106 -0
- package/src/shared/engine/world/waves.ts +57 -0
- package/src/shared/engine/world/weather.ts +166 -0
- package/src/shared/engine/world/weatherContinuation.ts +121 -0
- package/src/shared/engine/world/windField.ts +49 -0
- package/src/shared/engine/world/windStrength.ts +6 -0
- package/src/shared/engine/world/yawFrame.ts +38 -0
- package/src/shared/game/achievements.ts +140 -0
- package/src/shared/game/ambient/flock.ts +374 -0
- package/src/shared/game/animation/limbBlend.ts +70 -0
- package/src/shared/game/animation/limbRig.ts +208 -0
- package/src/shared/game/bag/findsCatalogue.ts +58 -0
- package/src/shared/game/bag/itemCatalog.ts +18 -0
- package/src/shared/game/bag/items.ts +5 -0
- package/src/shared/game/bag/starter.generated.ts +3 -0
- package/src/shared/game/bag/starterItems.json +62 -0
- package/src/shared/game/boss/arenaAnswers.ts +49 -0
- package/src/shared/game/boss/arenaCollision.ts +16 -0
- package/src/shared/game/boss/arenaGround.ts +121 -0
- package/src/shared/game/boss/arenaPortal.ts +63 -0
- package/src/shared/game/boss/arenaRoomRows.ts +403 -0
- package/src/shared/game/boss/arenaWhirls.ts +88 -0
- package/src/shared/game/boss/jointTargets.ts +41 -0
- package/src/shared/game/boss/lane.ts +62 -0
- package/src/shared/game/boss/openArenaFight.ts +644 -0
- package/src/shared/game/boss/patrolLaw.ts +136 -0
- package/src/shared/game/boss/slotLaw.ts +173 -0
- package/src/shared/game/boss/wake.ts +60 -0
- package/src/shared/game/compendium/finds.ts +49 -0
- package/src/shared/game/compendium/registry.ts +28 -0
- package/src/shared/game/compendium/rules.ts +136 -0
- package/src/shared/game/compendium/state.ts +23 -0
- package/src/shared/game/compendium/tracker.ts +138 -0
- package/src/shared/game/compendium/types.ts +115 -0
- package/src/shared/game/eliteSystem.ts +349 -0
- package/src/shared/game/grapple/course.ts +14 -0
- package/src/shared/game/grapple/feed.ts +27 -0
- package/src/shared/game/grapple/sim.ts +352 -0
- package/src/shared/game/grid/allocator.ts +479 -0
- package/src/shared/game/grid/assembly.ts +73 -0
- package/src/shared/game/grid/catalogue.ts +197 -0
- package/src/shared/game/grid/catalogueDocument.ts +6 -0
- package/src/shared/game/grid/catalogueSlot.ts +53 -0
- package/src/shared/game/grid/cellEvents.ts +37 -0
- package/src/shared/game/grid/collisionStrips.ts +18 -0
- package/src/shared/game/grid/compiledStrips.ts +282 -0
- package/src/shared/game/grid/continuations.ts +43 -0
- package/src/shared/game/grid/crossing.ts +143 -0
- package/src/shared/game/grid/edgeProfiles.ts +31 -0
- package/src/shared/game/grid/farProxy.ts +302 -0
- package/src/shared/game/grid/ghosts.ts +42 -0
- package/src/shared/game/grid/gridAssetBytes.ts +59 -0
- package/src/shared/game/grid/gridCollision.ts +37 -0
- package/src/shared/game/grid/instances.ts +9 -0
- package/src/shared/game/grid/pageMode.ts +32 -0
- package/src/shared/game/grid/platformInputs.ts +11 -0
- package/src/shared/game/grid/postPairs.ts +40 -0
- package/src/shared/game/grid/readinessEdges.ts +13 -0
- package/src/shared/game/grid/recovery.ts +221 -0
- package/src/shared/game/grid/roadLayout.ts +169 -0
- package/src/shared/game/grid/roadRecovery.ts +99 -0
- package/src/shared/game/grid/rules.ts +45 -0
- package/src/shared/game/grid/runtimeCheckpoint.ts +58 -0
- package/src/shared/game/grid/seamData.ts +74 -0
- package/src/shared/game/grid/seamGeometry.ts +219 -0
- package/src/shared/game/grid/singleplayer.json +701 -0
- package/src/shared/game/grid/travellerCombat.ts +34 -0
- package/src/shared/game/grid/wallet.ts +104 -0
- package/src/shared/game/harvest.ts +16 -0
- package/src/shared/game/instanceSaves.ts +14 -0
- package/src/shared/game/inventoryLaw.ts +131 -0
- package/src/shared/game/ledger.ts +188 -0
- package/src/shared/game/loadout/itemCatalogue.ts +44 -0
- package/src/shared/game/loadout/persistence.ts +20 -0
- package/src/shared/game/loadout/pouch.ts +46 -0
- package/src/shared/game/localSaveKeys.ts +9 -0
- package/src/shared/game/looks/dayClock.ts +112 -0
- package/src/shared/game/looks/dayLookPresets.ts +75 -0
- package/src/shared/game/looks/keyedSkyClock.ts +15 -0
- package/src/shared/game/loot/Bounty.ts +49 -0
- package/src/shared/game/loot/Owned.ts +112 -0
- package/src/shared/game/loot/Purse.ts +94 -0
- package/src/shared/game/loot/coinAmounts.ts +17 -0
- package/src/shared/game/loot/coinBurstState.ts +23 -0
- package/src/shared/game/loot/deaths.ts +14 -0
- package/src/shared/game/loot/exchange.ts +71 -0
- package/src/shared/game/loot/ownedRows.ts +24 -0
- package/src/shared/game/loot/tableRows.ts +11 -0
- package/src/shared/game/newGame.ts +56 -0
- package/src/shared/game/plugin/animation.ts +618 -0
- package/src/shared/game/plugin/bodyBoss.ts +119 -0
- package/src/shared/game/plugin/borrowed.ts +62 -0
- package/src/shared/game/plugin/bossRecord.ts +28 -0
- package/src/shared/game/plugin/channelPrograms.ts +307 -0
- package/src/shared/game/plugin/channels.ts +355 -0
- package/src/shared/game/plugin/creatureFrame.ts +46 -0
- package/src/shared/game/plugin/director.ts +435 -0
- package/src/shared/game/plugin/moduleHash.ts +49 -0
- package/src/shared/game/plugin/quests.ts +450 -0
- package/src/shared/game/plugin/runtimeRows.ts +288 -0
- package/src/shared/game/population/census.ts +67 -0
- package/src/shared/game/population/groupNotices.ts +34 -0
- package/src/shared/game/population/pageHomes.ts +125 -0
- package/src/shared/game/population/pageRows.ts +20 -0
- package/src/shared/game/population/perchRoot.ts +17 -0
- package/src/shared/game/population/respawn.ts +89 -0
- package/src/shared/game/population/returnProgram.ts +448 -0
- package/src/shared/game/population/returnProjectionV2.ts +203 -0
- package/src/shared/game/population/wildlifeOwner.ts +20 -0
- package/src/shared/game/quest/boundState.ts +55 -0
- package/src/shared/game/quest/carriedRound.ts +59 -0
- package/src/shared/game/quest/chapterBindings.ts +64 -0
- package/src/shared/game/quest/chapterClock.ts +56 -0
- package/src/shared/game/quest/chapterDecision.ts +31 -0
- package/src/shared/game/quest/chapterFlow.ts +54 -0
- package/src/shared/game/quest/chapterLeads.ts +10 -0
- package/src/shared/game/quest/contractBoard.ts +108 -0
- package/src/shared/game/quest/contracts.ts +145 -0
- package/src/shared/game/quest/declared.ts +152 -0
- package/src/shared/game/quest/effectPresentation.ts +23 -0
- package/src/shared/game/quest/effects.ts +61 -0
- package/src/shared/game/quest/eliteDecisions.ts +123 -0
- package/src/shared/game/quest/eliteStreams.ts +7 -0
- package/src/shared/game/quest/featCounters.ts +41 -0
- package/src/shared/game/quest/flagGates.ts +103 -0
- package/src/shared/game/quest/interactionRows.ts +214 -0
- package/src/shared/game/quest/ledger.ts +23 -0
- package/src/shared/game/quest/legacyRecords.ts +17 -0
- package/src/shared/game/quest/nativeProps.ts +117 -0
- package/src/shared/game/quest/pagePersistence.ts +91 -0
- package/src/shared/game/quest/pageReads.ts +39 -0
- package/src/shared/game/quest/pageResources.ts +19 -0
- package/src/shared/game/quest/pageState.ts +66 -0
- package/src/shared/game/quest/persistence.ts +110 -0
- package/src/shared/game/quest/questObservation.ts +50 -0
- package/src/shared/game/quest/steps.ts +116 -0
- package/src/shared/game/quest/storyLaw.ts +17 -0
- package/src/shared/game/riding/bindingTypes.ts +43 -0
- package/src/shared/game/riding/companions.ts +135 -0
- package/src/shared/game/riding/entered.ts +21 -0
- package/src/shared/game/riding/pagePopulation.ts +28 -0
- package/src/shared/game/riding/pastureCues.ts +24 -0
- package/src/shared/game/riding/physics.ts +691 -0
- package/src/shared/game/riding/presentation.ts +27 -0
- package/src/shared/game/riding/taming.ts +164 -0
- package/src/shared/game/rng.merge.d.ts +10 -0
- package/src/shared/game/saves.ts +90 -0
- package/src/shared/game/shard/api.ts +2 -0
- package/src/shared/game/shard/declaredRows.ts +121 -0
- package/src/shared/game/shard/enteredServices.ts +14 -0
- package/src/shared/game/shard/runtime.ts +90 -0
- package/src/shared/game/shard/slug.ts +9 -0
- package/src/shared/game/shard/terrainBake.ts +12 -0
- package/src/shared/game/shardfile/aimTargetFilter.ts +12 -0
- package/src/shared/game/shardfile/bakedPlacementPoses.ts +25 -0
- package/src/shared/game/shardfile/buildingDoor.ts +52 -0
- package/src/shared/game/shardfile/clientGround.ts +86 -0
- package/src/shared/game/shardfile/clientState.ts +133 -0
- package/src/shared/game/shardfile/collisionBindings.ts +31 -0
- package/src/shared/game/shardfile/contentHash.ts +7 -0
- package/src/shared/game/shardfile/crowdRuntime.ts +254 -0
- package/src/shared/game/shardfile/customSchema.ts +57 -0
- package/src/shared/game/shardfile/dataCreaturePorts.ts +239 -0
- package/src/shared/game/shardfile/entryOwners.ts +153 -0
- package/src/shared/game/shardfile/fileInputs.ts +21 -0
- package/src/shared/game/shardfile/identity.ts +18 -0
- package/src/shared/game/shardfile/items.ts +180 -0
- package/src/shared/game/shardfile/ktx2Targets.ts +62 -0
- package/src/shared/game/shardfile/ladder.ts +137 -0
- package/src/shared/game/shardfile/liftRider.ts +62 -0
- package/src/shared/game/shardfile/logicalState.ts +57 -0
- package/src/shared/game/shardfile/movers.ts +14 -0
- package/src/shared/game/shardfile/namedJsonChecks.ts +12 -0
- package/src/shared/game/shardfile/outputChecksNode.ts +11 -0
- package/src/shared/game/shardfile/outputDescriptor.ts +317 -0
- package/src/shared/game/shardfile/outputIndexChecks.ts +8 -0
- package/src/shared/game/shardfile/packReads.ts +93 -0
- package/src/shared/game/shardfile/playArea.ts +42 -0
- package/src/shared/game/shardfile/portalRide.ts +170 -0
- package/src/shared/game/shardfile/portalTraversal.ts +49 -0
- package/src/shared/game/shardfile/productData.ts +22 -0
- package/src/shared/game/shardfile/props.ts +11 -0
- package/src/shared/game/shardfile/resourceRole.ts +14 -0
- package/src/shared/game/shardfile/runtimeState.ts +69 -0
- package/src/shared/game/shardfile/schemaReferences.ts +33 -0
- package/src/shared/game/shardfile/scriptNotice.ts +38 -0
- package/src/shared/game/shardfile/serverPack.ts +23 -0
- package/src/shared/game/shardfile/shardProduct.ts +206 -0
- package/src/shared/game/shardfile/spawnManifest.ts +126 -0
- package/src/shared/game/shardfile/talks.ts +22 -0
- package/src/shared/game/shardfile/targets.ts +11 -0
- package/src/shared/game/shardfile/tileOrder.ts +64 -0
- package/src/shared/game/shardfile/walkInPortalRide.ts +160 -0
- package/src/shared/game/shardfile/wholeInputs.ts +18 -0
- package/src/shared/game/shardfile/wirePrompts.ts +35 -0
- package/src/shared/game/shardfile/worldActionsV2.ts +113 -0
- package/src/shared/game/shardfile/worldTargets.ts +71 -0
- package/src/shared/game/stealth/stealthLaw.ts +120 -0
- package/src/shared/game/strings.ts +88 -0
- package/src/shared/game/systems/cellField.ts +144 -0
- package/src/shared/game/systems/effects/starterEffects.ts +20 -0
- package/src/shared/game/systems/effects/starterRows.json +98 -0
- package/src/shared/game/systems/looks/grassField.ts +249 -0
- package/src/shared/game/systems/looks/trampleField.ts +263 -0
- package/src/shared/game/weapons/heldBowBase.ts +15 -0
- package/src/shared/game/weapons/heldDecision.ts +20 -0
- package/src/shared/game/weapons/javelinFlight.ts +139 -0
- package/src/shared/game/weapons/launcherSpring.ts +11 -0
- package/src/shared/game/weapons/mountedPass.ts +70 -0
- package/src/shared/game/weapons/polearmContact.ts +73 -0
- package/src/shared/game/weapons/polearmDecision.ts +152 -0
- package/src/shared/game/weapons/starter.generated.ts +2 -0
- package/src/shared/game/weapons/starterBow.json +21 -0
- package/src/shared/game/weapons/starterBowProfile.ts +17 -0
- package/src/shared/game/weapons/starterCombat.ts +19 -0
- package/src/shared/game/weapons/starterGlyphs.ts +9 -0
- package/src/shared/game/weapons/starterMeleeProfile.ts +67 -0
- package/src/shared/game/weapons/starterMoves.ts +101 -0
- package/src/shared/game/weather/feed.ts +57 -0
- package/src/shared/health.ts +10 -0
- package/src/shared/host/author.ts +14 -0
- package/src/shared/host/formatJsonSchema.ts +1114 -0
- package/src/shared/host/headlessJourney.ts +152 -0
- package/src/shared/host/headlessObservation.ts +16 -0
- package/src/shared/host/headlessSections.ts +18 -0
- package/src/shared/host/headlessTape.ts +99 -0
- package/src/shared/host/headlessTapeParts.ts +35 -0
- package/src/shared/host/immutable.ts +14 -0
- package/src/shared/host/releaseRows.ts +23 -0
- package/src/shared/host/shardfile.ts +23 -0
- package/src/shared/host/standalone/harnessPlace.ts +23 -0
- package/src/shared/host/standalone/heldReads.ts +45 -0
- package/src/shared/host/standalone/netInput.ts +112 -0
- package/src/shared/host/standalone/workerLoopback.ts +51 -0
- package/src/shared/host/tickProtocol.ts +246 -0
- package/src/shared/side.ts +2 -0
- package/src/test/engine/FakeGame.ts +123 -0
- package/src/test/engine/creatureStride.ts +29 -0
- package/src/test/engine/declarationConsumer.ts +24 -0
- package/src/test/engine/linkedGl.ts +7 -0
- package/src/test/engine/manager.ts +58 -0
- package/src/test/engine/nativeBytes.ts +5 -0
- package/src/test/engine/netLoopback.ts +64 -0
- package/src/test/engine/realGc.ts +34 -0
- package/src/test/engine/terrain.ts +32 -0
- package/src/test/engine/textureUploadRenderer.ts +34 -0
- package/src/test/engine/weaponParity.ts +119 -0
- package/src/test/engine/world.ts +48 -0
- package/src/test/game/creatureRecipe.ts +11 -0
- package/src/test/helpers/git.ts +94 -0
- package/src/test/tsconfig.app.json +28 -0
- package/src/test/tsconfig.engine.json +27 -0
- package/src/test/tsconfig.game.json +28 -0
- package/src/test/tsconfig.host.json +27 -0
- package/src/tools/build-web.ts +58 -0
- package/src/tsconfig.json +39 -0
- package/tsconfig.app.json +32 -0
- package/tsconfig.engine.json +22 -0
- package/tsconfig.game.json +34 -0
- package/tsconfig.host.json +33 -0
- package/tsconfig.json +54 -0
- package/tsconfig.layers.json +35 -0
- package/types/format-standards.d.ts +19 -0
- package/vite/rapier.ts +35 -0
- package/README.md +0 -6
|
@@ -0,0 +1,1511 @@
|
|
|
1
|
+
import { createClientChannelView, moverChannelValues, type ClientGeometryKernels } from './clientChannelView';
|
|
2
|
+
import { bindPageQuest, type RuntimeQuestPorts } from '../../../shared/game/quest/pageState';
|
|
3
|
+
import { bindPagePersistence, bindPageBossRecord, type PagePersistenceRows, type PagePersistence } from '../../../shared/game/quest/pagePersistence';
|
|
4
|
+
import { lightEmitterPresentation } from '../shardfile/lightEmitters';
|
|
5
|
+
import { residentWorldScope } from '../shardfile/hybridPresentation';
|
|
6
|
+
import { readBorrowedOwner, type BorrowedOwnerPath } from '../../../shared/game/plugin/borrowed';
|
|
7
|
+
import { createClientChannels, type ClientChannelObservation, type ClientChannelFrame } from '../../../shared/game/plugin/channels';
|
|
8
|
+
import type { World } from '@wildshard/engine/core/bootstrap';
|
|
9
|
+
import { installFollowedMovers, type FollowedMovers, type MoverView } from './followedMovers';
|
|
10
|
+
import { BossRowBar } from '../boss/barFeed';
|
|
11
|
+
import { easeField } from '@wildshard/engine/world/easedFields';
|
|
12
|
+
import { wirePage } from '../shardfile/wirePage';
|
|
13
|
+
import { liftPrompt } from '../../../shared/game/shardfile/wirePrompts';
|
|
14
|
+
import { WorldTargetHost, type WorldTargetLanding } from '../../../shared/game/shardfile/worldTargets';
|
|
15
|
+
import { outputDescriptor } from '../../../shared/game/shardfile/outputDescriptor';
|
|
16
|
+
import { parseWorldTargets, type WorldTargets } from '@wildshard/format/worldTargets';
|
|
17
|
+
import "../quest/presentation.css";
|
|
18
|
+
import { parseClientChannels, type ClientChannelProgram } from '@wildshard/format/clientChannels';
|
|
19
|
+
import { AdditiveBlending, type InstancedMesh, Euler, PerspectiveCamera, Quaternion, Scene, ShaderMaterial, Vector3, type Object3D, Group, type BufferGeometry, type Texture, type Material } from 'three';
|
|
20
|
+
import type { WorldRegistry } from '@wildshard/engine/world/registry';
|
|
21
|
+
import type { Scope } from '@wildshard/engine/app/scope';
|
|
22
|
+
import { ParticlePool, pointScale } from '@wildshard/engine/fx/ParticlePool';
|
|
23
|
+
import { CLIENT_SCRIPT_LIMITS, type ClientScriptFrame } from '@wildshard/engine/script/client';
|
|
24
|
+
import type { SystemSpec } from '@wildshard/engine/app/systems';
|
|
25
|
+
import { practiceRoom } from '@wildshard/engine/core/practiceRoom';
|
|
26
|
+
import type { Events } from '@wildshard/engine/events/events';
|
|
27
|
+
import type { HudVerbs, LevelContext } from '@wildshard/engine/level/context';
|
|
28
|
+
import type { MapPoi, MapQuest } from '@wildshard/engine/ui/Map';
|
|
29
|
+
import type { MapMark } from '@wildshard/engine/ui/Minimap';
|
|
30
|
+
import { Flags, test as testFlags } from '@wildshard/engine/world/interact/flags';
|
|
31
|
+
import type { BoxSpec } from '@wildshard/engine/physics/box';
|
|
32
|
+
import { boxInFrame } from '@wildshard/engine/physics/boxFrame';
|
|
33
|
+
import type { MoverPose } from '@wildshard/engine/physics/mover';
|
|
34
|
+
import type { Place, QuestPlace, Interactable } from '@wildshard/engine/world/interact/types';
|
|
35
|
+
import { questMessageHandlers, type QuestMessageRows, QuestState, type QuestDef, type QuestStep, type NpcDef } from '@wildshard/engine/quest/core';
|
|
36
|
+
import type { QuestView } from '@wildshard/engine/quest/viewPort';
|
|
37
|
+
import { QuestChip, NpcTalk, type LiveMarker, type NpcTalkOpts } from '@wildshard/engine/quest/view';
|
|
38
|
+
import {placesWithDiscovery,type PlacePoint,type Places} from '@wildshard/engine/quest/discovery';
|
|
39
|
+
import { DialogueBox } from '@wildshard/engine/quest/view/ui';
|
|
40
|
+
import { InteractionRules } from '../../../shared/game/quest/interactionRows';
|
|
41
|
+
import { parseQuestPageInteractions, type QuestPageInteractionsData } from '@wildshard/format/questInteractions';
|
|
42
|
+
import { QuestRewardBeat, type QuestRewardSpec, type QuestRewardPlayer } from '../quest/reward';
|
|
43
|
+
import { createLevelInstallation } from '@wildshard/engine/level/installation';
|
|
44
|
+
import type { ShardContext } from './context';
|
|
45
|
+
import type { BossDefinition, BossSaved, BossScript } from '@wildshard/engine/ai/BossBrain';
|
|
46
|
+
import type { Animal } from '@wildshard/engine/entities/AnimalView';
|
|
47
|
+
import { BossBar } from '@wildshard/engine/ui/BossBar';
|
|
48
|
+
import { app } from '@wildshard/engine/app/runtime';
|
|
49
|
+
import { CoinMotion } from '../loot/CoinMotion';
|
|
50
|
+
import { DirectorBossBrain, bindDirectorActions, type DirectorActionBinding, type BoundDirectorActions } from '../../../shared/game/plugin/director';
|
|
51
|
+
import { bindRuntimeCoins, type RuntimeBoss, type RuntimeCoins } from '../../../shared/game/plugin/runtimeRows';
|
|
52
|
+
import type { BossViewRows } from '../../../server/game/shardfile/bossRow';
|
|
53
|
+
import type { Shardfile } from '@wildshard/format/shardSchema';
|
|
54
|
+
import { npcDef, type NpcRow } from '../../../shared/game/plugin/quests';
|
|
55
|
+
import { installPivotNpc, pivotNpcParts, type PivotNpcGeometry, type PivotNpcLevel, type PivotNpcPorts } from './geometry';
|
|
56
|
+
import { parseQuestNpcBinding, type QuestNpcTalkBinding } from '@wildshard/format/npcs';
|
|
57
|
+
import { parseBossProfile, parseMarkedBossPresentation, type MarkedBossPresentation } from '@wildshard/format/bossProfiles';
|
|
58
|
+
import { bodyBossFight, type HeldBossBrain } from '../../../shared/game/plugin/bodyBoss';
|
|
59
|
+
import { bossStorm } from './bossStorm';
|
|
60
|
+
import { enterMovers } from './moverViews';
|
|
61
|
+
import { finishedAfterSeen } from '../quest/finishedAfterSeen';
|
|
62
|
+
import { installEnteredRuntimeAttachment, installEnteredRuntimeObserver, installEnteredRuntimeService, retainsRuntimeServices } from '../shard/retainedHooks';
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* The client-script view adapter (SHARD-PLATFORM SF25, the render side; G66 "frozen, but alive-looking"). sp-x5's
|
|
68
|
+
* `ClientScriptLane` runs presentation-only AssemblyScript and hands back detached frames (`offset`, `rotation`,
|
|
69
|
+
* `scale`, particle requests); this adapter is the only thing that turns them into pixels:
|
|
70
|
+
*
|
|
71
|
+
* - **pose on top of the pose**: each frame, after the views have written their own pose (a creature view's sim sync,
|
|
72
|
+
* a placed panel), `apply` composes the script's offset (in the target's own frame), rotation and scale on top of it;
|
|
73
|
+
* `restore` puts the exact base back before the next sim sync, so a live entity's sim pose is never replaced and a
|
|
74
|
+
* static one never drifts. A frame is eased in over a few render frames (the lane ticks at 60 / divisor Hz).
|
|
75
|
+
* - **particles**: every emitter's requests spawn into one pooled `THREE.Points` draw (the engine's `ParticlePool`),
|
|
76
|
+
* sized to the declared live limits (never above the lane's global ceiling), so the cost is one draw whatever the count.
|
|
77
|
+
* Their look (colour, size, velocity, gravity) is the emitter's numeric recipe; lifetimes are the lane's.
|
|
78
|
+
* - **scope-owned**: disposal restores every base pose and frees the pool's geometry and material.
|
|
79
|
+
*
|
|
80
|
+
* The adapter never reads or writes a simulation: it sees the lane's copies and the view objects only.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
/** Keep authored quest state resident, but recreate modal input and cancel timers at every home exit. */
|
|
88
|
+
export class QuestViews {
|
|
89
|
+
private readonly retained: boolean;
|
|
90
|
+
private readonly resident: Scope;
|
|
91
|
+
private entered: Scope | undefined;
|
|
92
|
+
private readonly names = new Set<string>();
|
|
93
|
+
constructor(private readonly context: ShardContext) {
|
|
94
|
+
if (context.scope.disposed) throw new Error('Quest views need a live scope');
|
|
95
|
+
this.retained = retainsRuntimeServices(context);
|
|
96
|
+
this.resident = context.scope;
|
|
97
|
+
this.entered = this.resident;
|
|
98
|
+
if (this.retained) installEnteredRuntimeService(context, (scope) => {
|
|
99
|
+
this.entered = scope;
|
|
100
|
+
scope.onDispose(() => { if (this.entered === scope) this.entered = undefined; });
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
/** Construct one resident widget, or one scoped widget per retained home entry. */
|
|
104
|
+
view<T>(name: string, create: (scope: Scope) => T): () => T {
|
|
105
|
+
if (!/^[a-z][a-z0-9.-]{0,63}$/u.test(name) || this.names.has(name) || this.names.size >= 16) throw new Error('Invalid or duplicate quest view');
|
|
106
|
+
this.names.add(name);
|
|
107
|
+
if (!this.retained) { const view = create(this.resident.child(name)); return () => view; }
|
|
108
|
+
let current: T | undefined;
|
|
109
|
+
installEnteredRuntimeService(this.context, (scope) => {
|
|
110
|
+
const view = create(scope.child(name)); current = view;
|
|
111
|
+
scope.onDispose(() => { if (current === view) current = undefined; });
|
|
112
|
+
});
|
|
113
|
+
return () => { if (current === undefined) throw new Error('Quest view left its home'); return current; };
|
|
114
|
+
}
|
|
115
|
+
/** Wire the newly constructed widgets without rebuilding quest data or NPC figures. */
|
|
116
|
+
enter(run: () => void): void {
|
|
117
|
+
if (!this.retained) run(); else installEnteredRuntimeService(this.context, run);
|
|
118
|
+
}
|
|
119
|
+
leave(run: () => void): void {
|
|
120
|
+
if (this.retained) installEnteredRuntimeService(this.context, (scope) => { scope.onDispose(run); });
|
|
121
|
+
}
|
|
122
|
+
/** Preserve the original resident teardown order; entered views have already disposed when their cell left. */
|
|
123
|
+
disposeLegacy(run: () => void): void { if (!this.retained) run(); }
|
|
124
|
+
timeout(ms: number, run: () => void): ReturnType<Scope['timeout']> {
|
|
125
|
+
const scope = this.entered;
|
|
126
|
+
if (scope === undefined) throw new Error('Quest timer left its home');
|
|
127
|
+
return scope.timeout(ms, run);
|
|
128
|
+
}
|
|
129
|
+
cancelTimer(timer: ReturnType<Scope['timeout']>): void { this.entered?.cancelTimer(timer); }
|
|
130
|
+
/** Share modal input release while borrowing each world's stow, resume and pause policies. */
|
|
131
|
+
panelHold(ports: {
|
|
132
|
+
readonly hud: { holdPause: boolean; readonly entered: boolean; onResume?: () => void; setPaused: (on: boolean) => void };
|
|
133
|
+
readonly weapons: { setEnabled: (on: boolean) => void };
|
|
134
|
+
readonly menu: { readonly isOpen: boolean; close: (silent?: boolean) => void };
|
|
135
|
+
readonly nolock: boolean; readonly touchUi: () => boolean;
|
|
136
|
+
readonly stow?: (on: boolean) => void; readonly resume?: () => void;
|
|
137
|
+
readonly panels?: readonly (() => { readonly isOpen: boolean; onOpen?: () => void; onClose?: () => void })[];
|
|
138
|
+
readonly closeMenu?: boolean; readonly resetOnLeave?: boolean; readonly restartOnClose?: boolean;
|
|
139
|
+
}): (on: boolean) => void {
|
|
140
|
+
let timer: ReturnType<Scope['timeout']> = 0, still: Scope | null = null;
|
|
141
|
+
const hold = (on: boolean): void => {
|
|
142
|
+
if (on || ports.restartOnClose === true) this.cancelTimer(timer);
|
|
143
|
+
ports.stow?.(on);
|
|
144
|
+
// FC3 (G909): the world holds one still behind the open panel and resumes the moment it closes
|
|
145
|
+
still?.dispose(); still = null;
|
|
146
|
+
if (on) {
|
|
147
|
+
still = (this.entered ?? this.resident).child('still'); this.context.app.ui.holdStill(still);
|
|
148
|
+
ports.hud.holdPause = true; ports.weapons.setEnabled(false);
|
|
149
|
+
if (ports.closeMenu === true && ports.menu.isOpen) ports.menu.close(true);
|
|
150
|
+
if (document.pointerLockElement) document.exitPointerLock();
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
ports.resume?.(); ports.hud.onResume?.();
|
|
154
|
+
timer = this.timeout(450, () => {
|
|
155
|
+
ports.hud.holdPause = false;
|
|
156
|
+
if (!ports.nolock && !ports.touchUi() && !document.pointerLockElement && ports.hud.entered && !ports.menu.isOpen
|
|
157
|
+
&& !(ports.panels?.some(panel => panel().isOpen) ?? false)) ports.hud.setPaused(true);
|
|
158
|
+
});
|
|
159
|
+
};
|
|
160
|
+
if (ports.panels !== undefined) this.enter(() => { for (const view of ports.panels ?? []) {
|
|
161
|
+
const panel = view(); panel.onOpen = () => { hold(true); }; panel.onClose = () => { hold(false); };
|
|
162
|
+
} });
|
|
163
|
+
if (ports.resetOnLeave === true) this.leave(() => { ports.hud.holdPause = false; timer = 0; });
|
|
164
|
+
this.resident.onDispose(() => { this.cancelTimer(timer); });
|
|
165
|
+
return hold;
|
|
166
|
+
}
|
|
167
|
+
/** The retained browser observer leaves with its cell; a resident one is assigned on the window for the scope. */
|
|
168
|
+
exposeBrowser(name: string, observer: object): void {
|
|
169
|
+
if (!this.retained) { this.resident.expose(window, name, observer); return; }
|
|
170
|
+
installEnteredRuntimeObserver(this.context, name, observer);
|
|
171
|
+
}
|
|
172
|
+
/** The resident objective/caption keep their exact DOM insertion positions while hidden on the road. */
|
|
173
|
+
retainRoot(root: HTMLElement, reset: () => void): void {
|
|
174
|
+
if (!this.retained) return;
|
|
175
|
+
installEnteredRuntimeAttachment(this.context, root);
|
|
176
|
+
installEnteredRuntimeService(this.context, (scope) => {
|
|
177
|
+
scope.onDispose(reset);
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
type Vec3 = readonly [number, number, number];
|
|
183
|
+
/** The part of a client lane the adapter reads: its published frames (read in the frame, never kept) and their tick. */
|
|
184
|
+
export interface ClientScriptFrames { readonly frame: (entity: number) => Readonly<ClientScriptFrame> | undefined; readonly tick: number }
|
|
185
|
+
/** One admitted emitter's numeric look (sp-x5's `platform.particles` recipe) and its declared live limit. */
|
|
186
|
+
export interface ClientScriptEmitterLook { readonly id: number; readonly live: number; readonly colour: Vec3; readonly size: number; readonly velocity: Vec3; readonly gravity: number }
|
|
187
|
+
/** One bound visual: the view object a pose composes onto (null: particles only) and where its particles start. */
|
|
188
|
+
export interface ClientScriptViewTarget {
|
|
189
|
+
readonly entity: number;
|
|
190
|
+
/** Read each frame: a creature's body is a row's, which may arrive late or come back as another body. */
|
|
191
|
+
readonly object: Object3D | null;
|
|
192
|
+
/** the particle origin in the adapter root's space */
|
|
193
|
+
readonly anchor: (out: Vector3) => Vector3;
|
|
194
|
+
readonly emitters: readonly ClientScriptEmitterLook[];
|
|
195
|
+
}
|
|
196
|
+
/** The adapter's readout (tests, the debug panel). */
|
|
197
|
+
export interface ClientScriptViewState { readonly targets: number; readonly posed: number; readonly particles: number; readonly capacity: number; readonly tick: number }
|
|
198
|
+
|
|
199
|
+
const VERTEX = /* glsl */ `
|
|
200
|
+
attribute vec3 aColour; attribute float aSize; attribute float aAlpha;
|
|
201
|
+
uniform float uScale; varying vec3 vColour; varying float vAlpha;
|
|
202
|
+
void main() {
|
|
203
|
+
vec4 mv = modelViewMatrix * vec4(position, 1.0);
|
|
204
|
+
gl_Position = projectionMatrix * mv;
|
|
205
|
+
gl_PointSize = aSize * uScale / max(0.1, -mv.z);
|
|
206
|
+
vColour = aColour; vAlpha = aAlpha;
|
|
207
|
+
}`;
|
|
208
|
+
const FRAGMENT = /* glsl */ `
|
|
209
|
+
varying vec3 vColour; varying float vAlpha;
|
|
210
|
+
void main() {
|
|
211
|
+
vec2 p = gl_PointCoord * 2.0 - 1.0; float d = dot(p, p);
|
|
212
|
+
if (d > 1.0 || vAlpha <= 0.0) discard;
|
|
213
|
+
gl_FragColor = vec4(vColour, vAlpha * (1.0 - d));
|
|
214
|
+
}`;
|
|
215
|
+
const PARK_Y = -10_000;
|
|
216
|
+
|
|
217
|
+
interface Posed { readonly target: ClientScriptViewTarget; object: Object3D | null; readonly base: { p: Vector3; q: Quaternion; s: Vector3 }; saved: boolean;
|
|
218
|
+
/** the eased pose being drawn */ readonly offset: Vector3; readonly rotation: Vector3; readonly scale: Vector3 }
|
|
219
|
+
|
|
220
|
+
/** a deterministic jitter in [-1, 1] from integers (no clock, no Math.random) */
|
|
221
|
+
function jitter(a: number, b: number, c: number): number {
|
|
222
|
+
let h = Math.imul(a ^ 0x9e3779b9, 0x85ebca6b) ^ Math.imul(b + 0x632be5ab, 0xc2b2ae35) ^ Math.imul(c + 0x27d4eb2f, 0x165667b1);
|
|
223
|
+
h = Math.imul(h ^ (h >>> 15), 0x2c1b3c6d); h ^= h >>> 12;
|
|
224
|
+
return ((h >>> 0) / 0xffffffff) * 2 - 1;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** Applies one client lane's frames to its bound views and particles; disposed with `scope`. */
|
|
228
|
+
export class ClientScriptViews {
|
|
229
|
+
private readonly lane: ClientScriptFrames;
|
|
230
|
+
private readonly targets: ReadonlyMap<number, ClientScriptViewTarget>;
|
|
231
|
+
// Particle requests are emitted in entity order, as the lane's sorted frames were.
|
|
232
|
+
private readonly order: readonly number[];
|
|
233
|
+
private readonly posed: readonly Posed[];
|
|
234
|
+
private readonly pool: ParticlePool<'aColour' | 'aSize' | 'aAlpha'> | null;
|
|
235
|
+
private readonly lifetimes: Float32Array;
|
|
236
|
+
private readonly gravity: Float32Array;
|
|
237
|
+
private readonly material: ShaderMaterial | null;
|
|
238
|
+
private seen = -1;
|
|
239
|
+
private alive = 0;
|
|
240
|
+
private disposed = false;
|
|
241
|
+
private readonly _v = new Vector3();
|
|
242
|
+
private readonly _q = new Quaternion();
|
|
243
|
+
private readonly _e = new Euler();
|
|
244
|
+
|
|
245
|
+
constructor(lane: ClientScriptFrames, targets: readonly ClientScriptViewTarget[], ports: { root: Object3D; scope: Scope }) {
|
|
246
|
+
this.lane = lane;
|
|
247
|
+
this.targets = new Map(targets.map((t) => [t.entity, t])); this.order = [...this.targets.keys()].sort((a, b) => a - b);
|
|
248
|
+
if (this.targets.size !== targets.length) throw new Error('client script views: one view per bound entity');
|
|
249
|
+
this.posed = targets.map((target): Posed => ({ target, object: null, saved: false,
|
|
250
|
+
base: { p: new Vector3(), q: new Quaternion(), s: new Vector3(1, 1, 1) }, offset: new Vector3(), rotation: new Vector3(), scale: new Vector3(1, 1, 1) }));
|
|
251
|
+
const capacity = Math.min(CLIENT_SCRIPT_LIMITS.particlesLive, targets.reduce((n, t) => n + t.emitters.reduce((m, e) => m + e.live, 0), 0));
|
|
252
|
+
this.lifetimes = new Float32Array(capacity); this.gravity = new Float32Array(capacity);
|
|
253
|
+
if (capacity > 0) {
|
|
254
|
+
const material = new ShaderMaterial({ vertexShader: VERTEX, fragmentShader: FRAGMENT, uniforms: { uScale: { value: 600 } }, transparent: true, depthWrite: false, blending: AdditiveBlending });
|
|
255
|
+
const pool = new ParticlePool({ capacity, material, renderOrder: 6, parkY: PARK_Y,
|
|
256
|
+
attributes: { aColour: { itemSize: 3, dynamic: true }, aSize: { itemSize: 1, dynamic: true }, aAlpha: { itemSize: 1, dynamic: true } } });
|
|
257
|
+
pool.points.name = 'client-script-particles';
|
|
258
|
+
const scale = material.uniforms['uScale'];
|
|
259
|
+
pool.points.onBeforeRender = (renderer, _scene, camera) => { if (scale !== undefined && camera instanceof PerspectiveCamera) scale.value = pointScale(renderer, camera); };
|
|
260
|
+
ports.root.add(pool.points);
|
|
261
|
+
this.pool = pool; this.material = material;
|
|
262
|
+
} else { this.pool = null; this.material = null; }
|
|
263
|
+
ports.scope.onDispose(() => { this.dispose(); });
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
/** Put every composed view back to the base it had before `apply` (run before the views write their own pose). */
|
|
267
|
+
restore(): void {
|
|
268
|
+
for (const p of this.posed) {
|
|
269
|
+
if (!p.saved || p.object === null) continue;
|
|
270
|
+
p.object.position.copy(p.base.p); p.object.quaternion.copy(p.base.q); p.object.scale.copy(p.base.s); p.saved = false;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
/** Compose the latest frames onto the views and advance the particles by `dt` seconds (run after the views' own pose). */
|
|
275
|
+
apply(dt: number): void {
|
|
276
|
+
if (this.disposed) return;
|
|
277
|
+
this.restore();
|
|
278
|
+
const lane = this.lane, ease = 1 - Math.exp(-Math.max(0, dt) * 14);
|
|
279
|
+
for (const p of this.posed) {
|
|
280
|
+
const frame = lane.frame(p.target.entity), o = p.object = p.target.object;
|
|
281
|
+
if (o === null) continue;
|
|
282
|
+
if (frame !== undefined) {
|
|
283
|
+
p.offset.lerp(this._v.fromArray(frame.offset), ease); p.rotation.lerp(this._v.fromArray(frame.rotation), ease); p.scale.lerp(this._v.fromArray(frame.scale), ease);
|
|
284
|
+
}
|
|
285
|
+
p.base.p.copy(o.position); p.base.q.copy(o.quaternion); p.base.s.copy(o.scale); p.saved = true;
|
|
286
|
+
o.position.add(this._v.copy(p.offset).applyQuaternion(p.base.q));
|
|
287
|
+
o.quaternion.multiply(this._q.setFromEuler(this._e.set(p.rotation.x, p.rotation.y, p.rotation.z, 'YXZ')));
|
|
288
|
+
o.scale.multiply(p.scale);
|
|
289
|
+
}
|
|
290
|
+
const tick = lane.tick;
|
|
291
|
+
if (tick > this.seen) { this.seen = tick; for (const entity of this.order) { const frame = lane.frame(entity); if (frame !== undefined) this.emit(frame); } }
|
|
292
|
+
this.particles(dt);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
private emit(frame: ClientScriptFrame): void {
|
|
296
|
+
const pool = this.pool, target = this.targets.get(frame.entity);
|
|
297
|
+
if (pool === null || target === undefined) return;
|
|
298
|
+
for (const request of frame.particles) {
|
|
299
|
+
const look = target.emitters.find((e) => e.id === request.emitter); if (look === undefined) continue;
|
|
300
|
+
const at = target.anchor(this._v);
|
|
301
|
+
for (let k = 0; k < request.count; k++) {
|
|
302
|
+
const i = pool.claim(), j = (n: number): number => jitter(frame.tick, frame.entity * 31 + k, n);
|
|
303
|
+
if (this.lifetimes[i] === undefined) continue;
|
|
304
|
+
if ((this.lifetimes[i] ?? 0) <= 0) this.alive++;
|
|
305
|
+
pool.place(i, { x: at.x + j(1) * 0.15, y: at.y + j(2) * 0.08, z: at.z + j(3) * 0.15 });
|
|
306
|
+
pool.vel[i * 3] = look.velocity[0] * (1 + j(4) * 0.25) + j(5) * 0.1; pool.vel[i * 3 + 1] = look.velocity[1] * (1 + j(6) * 0.25); pool.vel[i * 3 + 2] = look.velocity[2] * (1 + j(7) * 0.25) + j(8) * 0.1;
|
|
307
|
+
pool.life[i] = request.lifetimeTicks / 60; this.lifetimes[i] = request.lifetimeTicks / 60; this.gravity[i] = look.gravity;
|
|
308
|
+
pool.data.aColour.set(look.colour, i * 3); pool.data.aSize[i] = look.size; pool.data.aAlpha[i] = 1;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
private particles(dt: number): void {
|
|
314
|
+
const pool = this.pool; if (pool === null || this.alive === 0) return;
|
|
315
|
+
const { pos, vel, life } = pool, alpha = pool.data.aAlpha;
|
|
316
|
+
for (let i = 0; i < pool.capacity; i++) {
|
|
317
|
+
const total = this.lifetimes[i] ?? 0; if (total <= 0) continue;
|
|
318
|
+
const left = (life[i] ?? 0) - dt;
|
|
319
|
+
if (left <= 0) { life[i] = 0; this.lifetimes[i] = 0; alpha[i] = 0; pos[i * 3 + 1] = PARK_Y; this.alive--; continue; }
|
|
320
|
+
life[i] = left;
|
|
321
|
+
vel[i * 3 + 1] = (vel[i * 3 + 1] ?? 0) + (this.gravity[i] ?? 0) * dt;
|
|
322
|
+
pos[i * 3] = (pos[i * 3] ?? 0) + (vel[i * 3] ?? 0) * dt; pos[i * 3 + 1] = (pos[i * 3 + 1] ?? 0) + (vel[i * 3 + 1] ?? 0) * dt; pos[i * 3 + 2] = (pos[i * 3 + 2] ?? 0) + (vel[i * 3 + 2] ?? 0) * dt;
|
|
323
|
+
const u = left / total; alpha[i] = Math.min(1, u * 3) * Math.min(1, (1 - u) * 6 + 0.2);
|
|
324
|
+
}
|
|
325
|
+
pool.posAttr.needsUpdate = true; pool.attr.aColour.needsUpdate = true; pool.attr.aSize.needsUpdate = true; pool.attr.aAlpha.needsUpdate = true;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
state(): ClientScriptViewState {
|
|
329
|
+
return { targets: this.targets.size, posed: this.posed.filter(p => p.object !== null).length, particles: this.alive, capacity: this.pool?.capacity ?? 0, tick: this.seen };
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
/** Restore every base pose and free the particle draw; further `apply` calls draw nothing. */
|
|
333
|
+
dispose(): void {
|
|
334
|
+
if (this.disposed) return;
|
|
335
|
+
this.restore(); this.disposed = true;
|
|
336
|
+
const pool = this.pool;
|
|
337
|
+
if (pool !== null) { pool.points.removeFromParent(); pool.points.geometry.dispose(); }
|
|
338
|
+
this.material?.dispose();
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/** Run the adapter in the page's frame: restore at input (before the views' sim sync), compose at late. */
|
|
343
|
+
export function driveClientScriptViews(views: ClientScriptViews, ports: { system: (spec: { id: string; phase: 'input' | 'late'; run: (dt: number) => void }) => void; id: string }): void {
|
|
344
|
+
ports.system({ id: `${ports.id}.restore`, phase: 'input', run: () => { views.restore(); } });
|
|
345
|
+
ports.system({ id: `${ports.id}.apply`, phase: 'late', run: (dt) => { views.apply(dt); } });
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** World position and label for a quest objective, with an optional dialogue NPC. */
|
|
349
|
+
export interface QuestTarget {
|
|
350
|
+
position: Vector3;
|
|
351
|
+
label: string;
|
|
352
|
+
short?: string;
|
|
353
|
+
npc?: QuestPresentationNpc;
|
|
354
|
+
}
|
|
355
|
+
/** Authored dialogue and proximity hooks for a quest giver or step target. */
|
|
356
|
+
export interface QuestPresentationNpc {
|
|
357
|
+
npc: NpcDef;
|
|
358
|
+
at: Vector3;
|
|
359
|
+
label: string;
|
|
360
|
+
speaker: NpcTalkOpts['speaker'];
|
|
361
|
+
radius?: number;
|
|
362
|
+
/** A target NPC is offered only during this step; omit for a persistent quest giver. */
|
|
363
|
+
step?: string;
|
|
364
|
+
onOpen?: NonNullable<NpcTalkOpts['onOpen']>;
|
|
365
|
+
onDone?: NonNullable<NpcTalkOpts['onDone']>;
|
|
366
|
+
}
|
|
367
|
+
/** A quest step with its display title and world target. */
|
|
368
|
+
export interface PresentedQuestStep extends Omit<QuestStep, 'objective'> {
|
|
369
|
+
title: string;
|
|
370
|
+
target: QuestTarget;
|
|
371
|
+
}
|
|
372
|
+
/** Quest data whose steps have authored presentation targets. */
|
|
373
|
+
export interface PresentedQuestDef extends Omit<QuestDef, 'steps'> { steps: PresentedQuestStep[] }
|
|
374
|
+
/** Scoped marker, dialogue, reward and toast choices for the existing quest UI. */
|
|
375
|
+
export interface QuestPresentationOptions {
|
|
376
|
+
flags?: Flags;
|
|
377
|
+
/** Resolve existing POI-local markers; simple target positions need no resolver. */
|
|
378
|
+
place?: (at: Place) => { x: number; y: number; z: number };
|
|
379
|
+
/** Admitted world coordinates keyed by the authored marker placement. */
|
|
380
|
+
placements?: Readonly<Record<string, { readonly x: number; readonly y: number; readonly z: number }>>;
|
|
381
|
+
introTitle?: string;
|
|
382
|
+
npc?: QuestPresentationNpc;
|
|
383
|
+
npcs?: QuestPresentationNpc[];
|
|
384
|
+
places?: PlacePoint[];
|
|
385
|
+
reward?: QuestRewardSpec | false;
|
|
386
|
+
/** Existing adventures can retain their authored beat strings and leftovers. */
|
|
387
|
+
messages?: QuestMessageRows;
|
|
388
|
+
/** A borrowed page beat follows the sting, without owning a cursor or save. */
|
|
389
|
+
afterStep?: (step: QuestStep | null) => void;
|
|
390
|
+
stepToast?: (step: QuestStep, previous: QuestStep | null, quest: QuestView) => string;
|
|
391
|
+
stepCompleteToast?: false | ((step: QuestStep) => string);
|
|
392
|
+
completeToast?: (quest: QuestView) => string;
|
|
393
|
+
chip?: () => { label: string; count: string };
|
|
394
|
+
markers?: () => LiveMarker[];
|
|
395
|
+
worldPins?: boolean;
|
|
396
|
+
mapMarkers?: boolean;
|
|
397
|
+
minimapMarks?: boolean;
|
|
398
|
+
}
|
|
399
|
+
/** Owned play services required to present a quest without owning its state. */
|
|
400
|
+
export interface QuestPresentationHost {
|
|
401
|
+
scope: Scope;
|
|
402
|
+
player: QuestRewardPlayer;
|
|
403
|
+
toast: (text: string) => void;
|
|
404
|
+
sting: () => void;
|
|
405
|
+
pin?: HudVerbs['pin'];
|
|
406
|
+
fullMap?: { setQuest?: (source: () => MapQuest | null) => void; addQuest?: (source: () => MapQuest | null) => () => void; addPois?: (source: () => MapPoi[]) => () => void };
|
|
407
|
+
minimap?: { addMarks: (source: () => readonly MapMark[]) => () => void } | null;
|
|
408
|
+
prompts?: NpcTalk['prompt'][];
|
|
409
|
+
stowWeapon?: (on: boolean) => void;
|
|
410
|
+
setViewmodel?: (on: boolean) => void;
|
|
411
|
+
dayNight?: { phase: number } | null;
|
|
412
|
+
}
|
|
413
|
+
/** The live quest presentation and its entered-scope update/disposal ports. */
|
|
414
|
+
export interface QuestPresentation<Q extends QuestView = QuestState> {
|
|
415
|
+
quest: Q;
|
|
416
|
+
chip: QuestChip;
|
|
417
|
+
markers: () => LiveMarker[];
|
|
418
|
+
places: Places | null;
|
|
419
|
+
reward: QuestRewardBeat | null;
|
|
420
|
+
update: (dt: number, t: number) => void;
|
|
421
|
+
dispose: () => void;
|
|
422
|
+
}
|
|
423
|
+
/** Structural play-context port; a ShardContext supplies all of it. */
|
|
424
|
+
export interface QuestPresentationContext {
|
|
425
|
+
scope: Scope;
|
|
426
|
+
app: { events: Events };
|
|
427
|
+
manifest: { slug: string };
|
|
428
|
+
system: (spec: SystemSpec) => void;
|
|
429
|
+
hud: Pick<HudVerbs, 'pin'>;
|
|
430
|
+
game: { runtime?: {
|
|
431
|
+
world: { player: QuestRewardPlayer; sky: { dayNight?: { phase: number } | null } } | null;
|
|
432
|
+
play: {
|
|
433
|
+
hud: { toast: (text: string) => void };
|
|
434
|
+
music: { sting: (name: 'chunk') => void };
|
|
435
|
+
weapons: { visible: boolean; stowed: boolean };
|
|
436
|
+
fullMap: NonNullable<QuestPresentationHost['fullMap']>;
|
|
437
|
+
minimap?: QuestPresentationHost['minimap'];
|
|
438
|
+
} | null;
|
|
439
|
+
interactables: NpcTalk['prompt'][];
|
|
440
|
+
} };
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
/** Frozen callbacks keep their closed Place vocabulary until NEXT N5. */
|
|
444
|
+
function legacyQuestPlace(at: QuestPlace): Place {
|
|
445
|
+
const poi = at.poi;
|
|
446
|
+
if (poi === 'world' || poi === 'hut' || poi === 'lookout' || poi === 'wreck' || poi === 'shrine' || poi === 'cave' || poi === 'pier') return { ...at, poi };
|
|
447
|
+
throw new Error('Authored quest frame requires a live frame resolver');
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
/** The MAP card a quest shows: read from the view, so the page's quest and a client's replica draw the same card. */
|
|
451
|
+
export function questCard(quest: QuestView, introTitle?: string): MapQuest {
|
|
452
|
+
return { title: quest.isStarted ? quest.def.title : introTitle ?? quest.def.title, objective: quest.objective(), hint: quest.isComplete ? '' : quest.hint() };
|
|
453
|
+
}
|
|
454
|
+
/** Shared wiring for older adventures that own their frame order. New shards use installQuestPresentation.
|
|
455
|
+
* The chip, card, pins and marks read a `QuestView`; only places and talks write flags, so only they need `flags`. */
|
|
456
|
+
export function presentQuest<Q extends QuestView & { readonly flags?: Flags }>(host: QuestPresentationHost, source: Q, options: QuestPresentationOptions = {}): QuestPresentation<Q> {
|
|
457
|
+
// J130: on the wire a view reads the server's rows, and the page's quest only carries its flag book
|
|
458
|
+
const quest: QuestView & { readonly flags?: Flags | undefined } = Object.assign(Object.create(wirePage.quest(source.def)) as QuestView, { flags: source.flags });
|
|
459
|
+
const messages=options.messages===undefined?null:questMessageHandlers(quest,options.messages,{toast:host.toast,sting:host.sting,
|
|
460
|
+
...(options.afterStep===undefined?{}:{afterStep:options.afterStep})});
|
|
461
|
+
const scope = host.scope.child(`quest.${quest.def.id}`);
|
|
462
|
+
if (options.place !== undefined && options.placements !== undefined) throw new Error('Quest presentation requires one frame resolver');
|
|
463
|
+
const legacy = options.place, placements = options.placements;
|
|
464
|
+
const resolve = (at: QuestPlace): { x: number; y: number; z: number } => {
|
|
465
|
+
if (placements !== undefined) {
|
|
466
|
+
const point = placements[JSON.stringify(at)];
|
|
467
|
+
if (point === undefined) throw new Error('Quest marker lacks an admitted frame placement');
|
|
468
|
+
return point;
|
|
469
|
+
}
|
|
470
|
+
if (legacy !== undefined) return legacy(legacyQuestPlace(at));
|
|
471
|
+
if (at.poi !== 'world' || at.anchor !== undefined) throw new Error('Quest POI markers require a place resolver');
|
|
472
|
+
return { x: at.x, y: (at.y ?? 0) + (at.dy ?? 0), z: at.z };
|
|
473
|
+
};
|
|
474
|
+
const markers = (): LiveMarker[] => quest.markers().map((m) => {
|
|
475
|
+
const p = resolve(m.at);
|
|
476
|
+
return { id: m.id, label: m.label, short: m.short ?? m.label, x: p.x, z: p.z };
|
|
477
|
+
});
|
|
478
|
+
const chip = new QuestChip({ chip: options.chip ?? (() => quest.chip()), markers: options.markers ?? markers });
|
|
479
|
+
scope.onDispose(() => { chip.line.scope.dispose(); });
|
|
480
|
+
const onStep = (step: QuestStep | null, prev: QuestStep | null): void => {
|
|
481
|
+
if (prev && typeof options.stepCompleteToast === 'function') host.toast(options.stepCompleteToast(prev));
|
|
482
|
+
if(messages!==null){messages.step(step,prev);return;}
|
|
483
|
+
if (step) host.toast(options.stepToast?.(step, prev, quest) ?? (prev === null ? `New quest · ${quest.def.title}` : `Objective · ${quest.objective()}`));
|
|
484
|
+
host.sting();options.afterStep?.(step);
|
|
485
|
+
};
|
|
486
|
+
const onComplete = (): void => { if(messages!==null)messages.complete();else host.toast(options.completeToast?.(quest) ?? `Quest complete · ${quest.def.title}`); };
|
|
487
|
+
scope.onDispose(quest.observe({ step: onStep, complete: onComplete }));
|
|
488
|
+
const card = (): MapQuest => questCard(quest, options.introTitle);
|
|
489
|
+
if (host.fullMap?.addQuest) scope.onDispose(host.fullMap.addQuest(card));
|
|
490
|
+
else host.fullMap?.setQuest?.(card);
|
|
491
|
+
const flags = options.flags ?? quest.flags;
|
|
492
|
+
if (flags === undefined && (options.places !== undefined || options.npc !== undefined || (options.npcs?.length ?? 0) > 0)) throw new Error('Quest places and talks write flags: they need an owner');
|
|
493
|
+
const places = options.places && flags ? placesWithDiscovery(options.places, flags, host.toast, markers) : null;
|
|
494
|
+
if (options.mapMarkers !== false && host.fullMap?.addPois) scope.onDispose(host.fullMap.addPois(() => places?.mapPois() ?? markers().map((m) => ({ x: m.x, z: m.z, label: m.label, short: m.short, kind: 'quest' }))));
|
|
495
|
+
if (options.minimapMarks !== false && host.minimap) scope.onDispose(host.minimap.addMarks(() => markers().map((m) => ({ x: m.x, z: m.z, color: '#8fe3ff' }))));
|
|
496
|
+
|
|
497
|
+
const pins = new Map<string, { root: HTMLElement; distance: HTMLElement; position: Vector3 }>();
|
|
498
|
+
if (options.worldPins !== false && host.pin) {
|
|
499
|
+
const all = [...(quest.def.intro?.markers ?? []), ...quest.def.steps.flatMap((step) => step.markers ?? [])];
|
|
500
|
+
for (const m of all) {
|
|
501
|
+
// The same id can occur at a different position in a later step; projection reads the active marker.
|
|
502
|
+
if (pins.has(m.id)) continue;
|
|
503
|
+
const root = document.createElement('span'); root.className = 'ws-quest-pin';
|
|
504
|
+
const label = document.createElement('span'), distance = document.createElement('b');
|
|
505
|
+
root.append(label, distance);
|
|
506
|
+
const position = new Vector3(); pins.set(m.id, { root, distance, position });
|
|
507
|
+
host.pin(() => {
|
|
508
|
+
if (scope.disposed || practiceRoom.open) return null;
|
|
509
|
+
const active = quest.markers().find((a) => a.id === m.id);
|
|
510
|
+
if (!active) return null;
|
|
511
|
+
const at = resolve(active.at); position.set(at.x, at.y + 2.2, at.z);
|
|
512
|
+
label.textContent = active.short ?? active.label;
|
|
513
|
+
return position;
|
|
514
|
+
}, root);
|
|
515
|
+
scope.onDispose(() => { root.remove(); });
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
const npcs = [...(options.npc ? [options.npc] : []), ...(options.npcs ?? [])];
|
|
519
|
+
const dialogue = npcs.length > 0 ? new DialogueBox(scope.child('dialogue')) : null;
|
|
520
|
+
const talks = dialogue && flags ? npcs.map((npc) => {
|
|
521
|
+
const talk = new NpcTalk({ ...npc, radius: npc.radius ?? 3.2, flags, dialogue });
|
|
522
|
+
const prompt = { ...talk.prompt, get radius() { return npc.step === undefined || quest.current?.id === npc.step || talk.talking ? talk.prompt.radius : 0; } };
|
|
523
|
+
host.prompts?.push(prompt);
|
|
524
|
+
scope.onDispose(() => {
|
|
525
|
+
const i = host.prompts?.indexOf(prompt) ?? -1; if (i >= 0) host.prompts?.splice(i, 1);
|
|
526
|
+
npc.speaker.talking = false;
|
|
527
|
+
});
|
|
528
|
+
return talk;
|
|
529
|
+
}) : [];
|
|
530
|
+
let stowed = false;
|
|
531
|
+
scope.onDispose(() => { if (stowed) host.stowWeapon?.(false); });
|
|
532
|
+
const reward = options.reward !== undefined && options.reward !== false ? new QuestRewardBeat({ ...host, scope, objective: chip.line.root }, options.reward) : null;
|
|
533
|
+
const update = (dt: number, t: number): void => {
|
|
534
|
+
if (scope.disposed || practiceRoom.open) return;
|
|
535
|
+
chip.update(t, host.player);
|
|
536
|
+
places?.update(host.player.position.x, host.player.position.z, host.player.position.y);
|
|
537
|
+
for (const pin of pins.values()) pin.distance.textContent = `${Math.round(Math.hypot(pin.position.x - host.player.position.x, pin.position.z - host.player.position.z))} m`;
|
|
538
|
+
dialogue?.update(dt); for (const talk of talks) talk.update(host.player.position);
|
|
539
|
+
const talking = talks.some((talk) => talk.talking);
|
|
540
|
+
if (talking !== stowed) { stowed = talking; host.stowWeapon?.(stowed); }
|
|
541
|
+
reward?.update(dt);
|
|
542
|
+
};
|
|
543
|
+
return { quest: source, chip, markers, places, reward, update, dispose: () => { scope.dispose(); } };
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
/** One call in play(ctx): Wendell's chip, MAP card, diamonds, world pins, discovery, dialogue and reward. */
|
|
547
|
+
export function installQuestPresentation(ctx: QuestPresentationContext, source: QuestState | QuestDef | PresentedQuestDef, options: QuestPresentationOptions = {}): QuestPresentation {
|
|
548
|
+
const runtime = ctx.game.runtime, world = runtime?.world, play = runtime?.play;
|
|
549
|
+
if (!runtime || !world || !play || ctx.scope.disposed) throw new Error('Quest presentation requires a live play host');
|
|
550
|
+
const flags = options.flags ?? (source instanceof QuestState ? source.flags : new Flags(ctx.manifest.slug));
|
|
551
|
+
const def: QuestDef | null = source instanceof QuestState ? null : { ...source, steps: source.steps.map((s) => {
|
|
552
|
+
if (!('target' in s)) return s;
|
|
553
|
+
const { target, title, ...step } = s;
|
|
554
|
+
return { ...step, objective: title, markers: s.markers ?? [{ id: s.id, label: target.label, ...(target.short === undefined ? {} : { short: target.short }), at: { poi: 'world', x: target.position.x, y: target.position.y, z: target.position.z } }] };
|
|
555
|
+
}) };
|
|
556
|
+
const quest = source instanceof QuestState ? source : new QuestState(def ?? source as QuestDef, flags, ctx.app.events, ctx.scope);
|
|
557
|
+
const targetNpcs = source instanceof QuestState ? [] : source.steps.flatMap((s) => 'target' in s && s.target.npc ? [{ ...s.target.npc, step: s.id }] : []);
|
|
558
|
+
const targetPlaces = source instanceof QuestState ? [] : source.steps.flatMap((s) => 'target' in s ? [{ id: `${source.id}.${s.id}`, label: s.target.label, x: s.target.position.x, y: s.target.position.y, z: s.target.position.z, r: 12 }] : []);
|
|
559
|
+
const finishedHere = finishedAfterSeen(quest, wirePage, cancel => { ctx.scope.onDispose(cancel); });
|
|
560
|
+
const reward: QuestRewardSpec | false = options.reward ?? { kicker: 'Quest complete', title: quest.def.title, subtitle: '', when: finishedHere, finish: () => undefined };
|
|
561
|
+
const presentation = presentQuest({ scope: ctx.scope, player: world.player, toast: (text) => { play.hud.toast(text); }, sting: () => { play.music.sting('chunk'); },
|
|
562
|
+
pin: ctx.hud.pin, fullMap: play.fullMap, minimap: play.minimap ?? null, prompts: runtime.interactables,
|
|
563
|
+
dayNight: world.sky.dayNight ?? null, setViewmodel: (on) => { play.weapons.visible = on; }, stowWeapon: (on) => { play.weapons.stowed = on; } }, quest, { ...options, flags, reward,
|
|
564
|
+
stepCompleteToast: options.stepCompleteToast ?? ((step) => `Step complete · ${step.chip ?? step.objective}`),
|
|
565
|
+
places: options.places ?? targetPlaces, npcs: [...(options.npcs ?? []), ...targetNpcs] });
|
|
566
|
+
ctx.system({ id: `game.quest.${quest.def.id}`, phase: 'update', when: (live) => live.state === 'play', run: presentation.update });
|
|
567
|
+
if (!(source instanceof QuestState)) {
|
|
568
|
+
const disposeView = presentation.dispose;
|
|
569
|
+
presentation.dispose = () => { disposeView(); quest.dispose(); };
|
|
570
|
+
}
|
|
571
|
+
return presentation;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/** Keep quest state resident while rebuilding its ordinary presentation and input in each entered cell scope. */
|
|
575
|
+
export function installEnteredQuestPresentation(context: ShardContext, quest: QuestState, options: QuestPresentationOptions = {}): () => QuestPresentation | null {
|
|
576
|
+
if (!retainsRuntimeServices(context)) throw new Error('Entered quest presentation needs a retained context');
|
|
577
|
+
let current: QuestPresentation | null = null;
|
|
578
|
+
installEnteredRuntimeService(context, scope => {
|
|
579
|
+
// A fresh ordinary installation binds pins and systems to this entry without registering new retained installers.
|
|
580
|
+
const installation = createLevelInstallation(context.app, scope, context.app.levelAdapters, () => context.progress);
|
|
581
|
+
const presentation = installQuestPresentation({ ...context, ...installation.context }, quest, options);
|
|
582
|
+
current = presentation;
|
|
583
|
+
scope.onDispose(() => { presentation.dispose(); if (current === presentation) current = null; });
|
|
584
|
+
});
|
|
585
|
+
return () => current;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
|
|
589
|
+
/** Authored native installation and flag bit grants on the existing motion owner. */
|
|
590
|
+
export interface ClientMoverInstallation {
|
|
591
|
+
readonly viewSystemId?: string;
|
|
592
|
+
readonly socketLiftPrompts?: boolean;
|
|
593
|
+
readonly systemId: string;
|
|
594
|
+
readonly permissions?: readonly { readonly mover: string; readonly flags: readonly { readonly name: string; readonly bit: number }[] }[];
|
|
595
|
+
}
|
|
596
|
+
/** Declared visual channels and input prompts, with clocks lent by their existing owners. */
|
|
597
|
+
export function bindClientChannels(programs: readonly ClientChannelProgram[], ports: {
|
|
598
|
+
readonly targets: ReadonlyMap<string, unknown>; readonly nativeOwners?: readonly string[]; readonly copiedOwners?: readonly string[];
|
|
599
|
+
readonly initialPoses?: readonly (MoverPose & { readonly id: string })[];
|
|
600
|
+
readonly bindings?: readonly { readonly updateMovers: (pose: (id: string) => MoverPose) => void }[];
|
|
601
|
+
readonly kernels?: ClientGeometryKernels; readonly observed?: (id: string, frame: ClientChannelFrame) => void;
|
|
602
|
+
}): {
|
|
603
|
+
readonly movers: ReadonlyMap<string, MoverView>; readonly interactables: readonly Interactable[];
|
|
604
|
+
readonly runtime: FollowedMovers | null;
|
|
605
|
+
/** Release borrowed view/prompt references; their geometry and materials stay caller-owned. */
|
|
606
|
+
readonly dispose: () => void;
|
|
607
|
+
readonly installMovers: (ctx: LevelContext, world: World, source: Shardfile, row: ClientMoverInstallation, flags: Pick<Flags, 'has'>) => FollowedMovers;
|
|
608
|
+
readonly evaluate: (id: string, observation: ClientChannelObservation) => void;
|
|
609
|
+
readonly view: (id: string) => ReturnType<typeof createClientChannelView>;
|
|
610
|
+
readonly prompt: (id: string) => Interactable;
|
|
611
|
+
readonly bindPrompts: (bind: Parameters<typeof createClientChannelPrompt>[1]) => void;
|
|
612
|
+
readonly updateMovers: (pose?: (id: string) => MoverPose) => void;
|
|
613
|
+
} {
|
|
614
|
+
let runtime: FollowedMovers | null = null, installed = false;
|
|
615
|
+
const owners = ports.nativeOwners ?? [];
|
|
616
|
+
if (owners.length > 32 || new Set(owners).size !== owners.length) throw new Error('Invalid native mover view owners');
|
|
617
|
+
const copiedOwners = ports.copiedOwners ?? [];
|
|
618
|
+
if (copiedOwners.length > 32 || new Set([...owners, ...copiedOwners]).size !== owners.length + copiedOwners.length) throw new Error('Invalid copied mover view owners');
|
|
619
|
+
const copiedViews: { id: string; view: ReturnType<typeof createClientChannelView> }[] = [];
|
|
620
|
+
const pending = new Set<InstancedMesh>(); let batching = false;
|
|
621
|
+
const changed = (mesh: InstancedMesh): void => { if (batching) pending.add(mesh); else mesh.instanceMatrix.needsUpdate = true; };
|
|
622
|
+
const rows = parseClientChannels(programs), movers = new Map<string, MoverView>(owners.map(id => [id, { pose: () => undefined }]));
|
|
623
|
+
const views = new Map<string, ReturnType<typeof createClientChannelView>>(), bound = new Set<string>();
|
|
624
|
+
for (const row of rows) {
|
|
625
|
+
if (row.bindings === undefined && row.geometry === undefined && row.connectors === undefined) continue;
|
|
626
|
+
const view = createClientChannelView(row, ports.targets, ports.kernels, changed); views.set(row.id, view);
|
|
627
|
+
if (row.mover === undefined) continue;
|
|
628
|
+
const id = row.mover;
|
|
629
|
+
if (copiedOwners.includes(id)) {
|
|
630
|
+
if (view.reads.some(read => read.startsWith('field.'))) throw new Error('Copied pose view has no native field grant');
|
|
631
|
+
copiedViews.push({ id, view }); continue;
|
|
632
|
+
}
|
|
633
|
+
if (!movers.has(id) || bound.has(id)) throw new Error('Mover channels require one borrowed native owner');
|
|
634
|
+
bound.add(id); movers.set(id, { pose: (pose, fields) => {
|
|
635
|
+
view.evaluate({ time: 0, delta: 0, values: moverChannelValues(view.reads, pose, fields) }); ports.observed?.(id, view.frame);
|
|
636
|
+
} });
|
|
637
|
+
}
|
|
638
|
+
const prompts = new Map<string, ReturnType<typeof createClientChannelPrompt>>();
|
|
639
|
+
let promptRows: readonly { id: string; lane: ReturnType<typeof createClientChannelPrompt> }[] = [];
|
|
640
|
+
let interactables: readonly Interactable[] = Object.freeze([]), promptsBound = false;
|
|
641
|
+
const binding = Object.freeze({ movers, get runtime() { return runtime; }, get interactables() { return interactables; },
|
|
642
|
+
dispose: () => {
|
|
643
|
+
movers.clear(); views.clear(); prompts.clear(); pending.clear(); copiedViews.length = 0;
|
|
644
|
+
promptRows = []; interactables = Object.freeze([]); runtime = null;
|
|
645
|
+
installed = true; promptsBound = true;
|
|
646
|
+
},
|
|
647
|
+
installMovers: (ctx: LevelContext, world: World, source: Shardfile, row: ClientMoverInstallation, flags: Pick<Flags, 'has'>) => {
|
|
648
|
+
if (installed) throw new Error('Client motion is already installed');
|
|
649
|
+
const grants = row.permissions ?? [];
|
|
650
|
+
if (grants.length > 32 || new Set(grants.map(grant => grant.mover)).size !== grants.length
|
|
651
|
+
|| grants.some(grant => !source.movers.some(mover => mover.id === grant.mover) || grant.flags.length > 16
|
|
652
|
+
|| new Set(grant.flags.map(flag => flag.name)).size !== grant.flags.length
|
|
653
|
+
|| grant.flags.some(flag => flag.name.length === 0 || !Number.isSafeInteger(flag.bit) || flag.bit < 0 || flag.bit > 65536))) throw new Error('Invalid client mover flag grants');
|
|
654
|
+
installed = true;
|
|
655
|
+
runtime = installFollowedMovers(ctx, world, { data: source.movers, views: movers, systemId: row.systemId,
|
|
656
|
+
restoreFlags: new Set(source.movers.flatMap(mover => mover.restoreFrom !== undefined && flags.has(mover.restoreFrom.flag) ? [mover.restoreFrom.flag] : [])),
|
|
657
|
+
onDispose: () => { runtime = null; } });
|
|
658
|
+
if (row.socketLiftPrompts === true) binding.bindPrompts({ socketLifts: { entryways: source.entryways, runtime: () => runtime } });
|
|
659
|
+
if (row.viewSystemId !== undefined) ctx.system({ id: row.viewSystemId, phase: 'update', run: () => {
|
|
660
|
+
const active = runtime;
|
|
661
|
+
if (active === null) return;
|
|
662
|
+
const pose = active.pose.bind(active);
|
|
663
|
+
for (const child of ports.bindings ?? []) child.updateMovers(pose);
|
|
664
|
+
binding.updateMovers();
|
|
665
|
+
} });
|
|
666
|
+
return runtime;
|
|
667
|
+
},
|
|
668
|
+
view: (id: string) => { const view = views.get(id); if (view === undefined) throw new Error('Unknown declared visual channel'); return view; },
|
|
669
|
+
prompt: (id: string) => { const prompt = prompts.get(id); if (prompt === undefined) throw new Error('Unknown declared prompt channel'); return prompt.spot; },
|
|
670
|
+
evaluate: (id: string, observation: ClientChannelObservation) => {
|
|
671
|
+
const view = views.get(id), prompt = prompts.get(id);
|
|
672
|
+
if (view === undefined && prompt === undefined) throw new Error('Unknown declared client channel');
|
|
673
|
+
view?.evaluate(observation); prompt?.evaluate(observation);
|
|
674
|
+
},
|
|
675
|
+
// Bind in the caller's original phase: no service, input, body or clock is installed here.
|
|
676
|
+
bindPrompts: (bind: Parameters<typeof createClientChannelPrompt>[1]) => {
|
|
677
|
+
if (promptsBound) throw new Error('Declared prompts are already bound');
|
|
678
|
+
const next = rows.flatMap(row => row.prompt === undefined ? [] : [{ row, lane: createClientChannelPrompt(row, bind) }]);
|
|
679
|
+
for (const { row, lane } of next) prompts.set(row.id, lane);
|
|
680
|
+
promptRows = next.flatMap(({ row, lane }) => row.mover === undefined ? [] : [{ id: row.mover, lane }]);
|
|
681
|
+
interactables = Object.freeze(next.map(({ lane }) => lane.spot)); promptsBound = true;
|
|
682
|
+
},
|
|
683
|
+
// Native views are published by the existing mover callback; only copied-pose prompts evaluate here.
|
|
684
|
+
updateMovers: (provided?: (id: string) => MoverPose) => {
|
|
685
|
+
const active = runtime;
|
|
686
|
+
if (provided === undefined && active === null) return;
|
|
687
|
+
const pose = provided ?? ((id: string) => { if (active === null) throw new Error('Missing client motion owner'); return active.pose(id); });
|
|
688
|
+
batching = true;
|
|
689
|
+
try {
|
|
690
|
+
for (const row of copiedViews) row.view.evaluate({ time: 0, delta: 0, values: moverChannelValues(row.view.reads, pose(row.id), {}) });
|
|
691
|
+
for (const row of promptRows) row.lane.evaluate({ time: 0, delta: 0, values: moverChannelValues(row.lane.reads, pose(row.id), {}) });
|
|
692
|
+
} finally {
|
|
693
|
+
batching = false;
|
|
694
|
+
for (const mesh of pending) mesh.instanceMatrix.needsUpdate = true;
|
|
695
|
+
pending.clear();
|
|
696
|
+
}
|
|
697
|
+
},
|
|
698
|
+
});
|
|
699
|
+
const initial = ports.initialPoses;
|
|
700
|
+
if (initial !== undefined) {
|
|
701
|
+
if (initial.length > 32 || new Set(initial.map(pose => pose.id)).size !== initial.length) throw new Error('Invalid initial channel poses');
|
|
702
|
+
const poses = new Map(initial.map(pose => [pose.id, pose]));
|
|
703
|
+
binding.updateMovers(id => { const pose = poses.get(id); if (pose === undefined) throw new Error('Missing initial channel pose'); return pose; });
|
|
704
|
+
}
|
|
705
|
+
return binding;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
/** Declarative prompt dispatch over existing named handlers and admitted lift/mover owners. */
|
|
709
|
+
export interface ClientPromptBindings {
|
|
710
|
+
readonly named?: ReadonlyMap<string, (spot: Interactable) => void>;
|
|
711
|
+
readonly socketLifts?: { readonly entryways: Shardfile['entryways']; readonly runtime: () => FollowedMovers | null };
|
|
712
|
+
}
|
|
713
|
+
/** A channel-owned prompt: copied coordinates plus a separately bound real input action. */
|
|
714
|
+
export function createClientChannelPrompt(input: unknown,
|
|
715
|
+
bind: ClientPromptBindings | ((action: NonNullable<ClientChannelProgram['prompt']>['action']) => (spot: Interactable) => void)): {
|
|
716
|
+
readonly spot: Interactable; readonly reads: readonly string[]; readonly evaluate: (observation: ClientChannelObservation) => void;
|
|
717
|
+
} {
|
|
718
|
+
const program = parseClientChannels([input])[0];
|
|
719
|
+
if (program?.prompt === undefined) throw new Error('Missing declared client prompt');
|
|
720
|
+
const declaration = structuredClone(program.prompt);
|
|
721
|
+
if (typeof bind !== 'function' && (bind.named?.size ?? 0) > 64) throw new Error('Prompt action table exceeds its bound');
|
|
722
|
+
const resolve = typeof bind === 'function' ? bind : (row: NonNullable<ClientChannelProgram['prompt']>['action']): ((spot: Interactable) => void) => {
|
|
723
|
+
if (row.kind === 'named') { const handler = bind.named?.get(row.name); if (handler === undefined) throw new Error('Unknown named prompt action'); return handler; }
|
|
724
|
+
const ports = bind.socketLifts, entry = ports?.entryways.find(value => value.kind === 'socketLift' && value.edge === row.edge), lift = entry?.lift;
|
|
725
|
+
if (ports === undefined || lift === undefined) throw new Error('Unknown socket lift prompt action');
|
|
726
|
+
return () => { if (ports.runtime() !== null) wirePage.send(liftPrompt(lift.mover, row.action)); };
|
|
727
|
+
};
|
|
728
|
+
const action = resolve(Object.freeze(declaration.action));
|
|
729
|
+
const lane = createClientChannels(program);
|
|
730
|
+
const spot: Interactable = { label: declaration.label, radius: declaration.radius,
|
|
731
|
+
position: new Vector3(...declaration.at), onInteract: () => undefined };
|
|
732
|
+
spot.onInteract = () => { action(spot); };
|
|
733
|
+
const evaluate = (observation: ClientChannelObservation): void => {
|
|
734
|
+
lane.evaluate(observation);
|
|
735
|
+
const { x, y, z } = lane.frame;
|
|
736
|
+
if (x === undefined || y === undefined || z === undefined) throw new Error('Missing prompt coordinates');
|
|
737
|
+
spot.position.set(x, y, z);
|
|
738
|
+
};
|
|
739
|
+
return Object.freeze({ spot, reads: lane.reads, evaluate });
|
|
740
|
+
}
|
|
741
|
+
/** Bounded installation policy for an existing quest figure and its talk prompt.
|
|
742
|
+
* Figure geometry, placement, dialogue, flags and save owners are borrowed.
|
|
743
|
+
*/
|
|
744
|
+
export interface NpcInstallationRow {
|
|
745
|
+
readonly id: string; readonly label: string; readonly radius: number; readonly file: string;
|
|
746
|
+
readonly copyPrompt: boolean; readonly updateOrder: 'figure-first' | 'talk-first';
|
|
747
|
+
readonly bark?: { readonly enter: number; readonly leave: number };
|
|
748
|
+
readonly approach?: { readonly radius: number; readonly unlessFlag: string };
|
|
749
|
+
}
|
|
750
|
+
/** A figure already knows its pose and its collider; the installer changes neither. */
|
|
751
|
+
export interface QuestTalkFigure {
|
|
752
|
+
readonly group: Object3D; readonly collider: BoxSpec; talking: boolean;
|
|
753
|
+
}
|
|
754
|
+
/** Borrowed owners for an NPC's original scene, registry and reading clock. */
|
|
755
|
+
export interface NpcInstallationPorts<F extends QuestTalkFigure> {
|
|
756
|
+
readonly create: () => F; readonly npc: NpcDef; readonly dialogue: () => DialogueBox; readonly flags: Flags;
|
|
757
|
+
readonly scene: Object3D; readonly registry: Pick<WorldRegistry, 'add'>; readonly prompts: Interactable[];
|
|
758
|
+
readonly at: (figure: F) => Vector3;
|
|
759
|
+
readonly advance: (figure: F, dt: number, time: number, player: Vector3) => void;
|
|
760
|
+
readonly own?: (figure: F, register: () => void) => void;
|
|
761
|
+
readonly open?: (figure: F) => void; readonly done?: () => void;
|
|
762
|
+
readonly bark?: (figure: F) => void;
|
|
763
|
+
readonly approach?: { readonly at: (figure: F) => Vector3; readonly run: (figure: F) => void };
|
|
764
|
+
readonly stow?: (talking: boolean) => void; readonly lod?: (figure: F, distance: number) => void;
|
|
765
|
+
}
|
|
766
|
+
/** The same installed figure, talk and prompt, advanced at the caller's original phase. */
|
|
767
|
+
export interface NpcTalkInstallation<F extends QuestTalkFigure> {
|
|
768
|
+
readonly fig: F; readonly talk: NpcTalk; readonly prompt: Interactable;
|
|
769
|
+
readonly update: (dt: number, time: number, player: Vector3) => void;
|
|
770
|
+
readonly lod: (camera: Vector3) => void;
|
|
771
|
+
}
|
|
772
|
+
/** Install a preflighted NPC row through the existing NpcTalk. No second timer,
|
|
773
|
+
* saved state or resource owner is created; optional entry ownership is lent.
|
|
774
|
+
* Greeting hysteresis and one-time approach actions retain their authored order.
|
|
775
|
+
*/
|
|
776
|
+
export function installNpcTalk<F extends QuestTalkFigure>(row: NpcInstallationRow, ports: NpcInstallationPorts<F>): NpcTalkInstallation<F> {
|
|
777
|
+
const text = (value: string): boolean => typeof value === 'string' && value.length > 0 && value.length <= 4096;
|
|
778
|
+
const radius = (value: number): boolean => Number.isFinite(value) && value > 0 && value <= 1000;
|
|
779
|
+
if (!text(row.id) || !text(row.label) || !text(row.file) || row.file.startsWith('/') || row.file.split('/').some(part => part === '..') ||
|
|
780
|
+
!radius(row.radius) || typeof row.copyPrompt !== 'boolean' || !['figure-first', 'talk-first'].includes(row.updateOrder) ||
|
|
781
|
+
!text(ports.npc.id) || !text(ports.npc.name) || ports.npc.dialogue.length > 1024) throw new Error('Invalid NPC installation row');
|
|
782
|
+
if (row.bark !== undefined && (!radius(row.bark.enter) || !radius(row.bark.leave) || row.bark.leave <= row.bark.enter || ports.bark === undefined)) throw new Error('Invalid NPC greeting owner or range');
|
|
783
|
+
if (row.approach !== undefined && (!radius(row.approach.radius) || !text(row.approach.unlessFlag) || ports.approach === undefined)) throw new Error('Invalid NPC approach owner or range');
|
|
784
|
+
const fig = ports.create();
|
|
785
|
+
ports.scene.add(fig.group);
|
|
786
|
+
const register = (): void => { ports.registry.add({ id: row.id, name: ports.npc.name, category: 'people', file: row.file,
|
|
787
|
+
colliders: [boxInFrame(fig.collider, fig.group, 'wood', false)], follows: fig.group, followRotation: false }); };
|
|
788
|
+
if (ports.own === undefined) register(); else ports.own(fig, register);
|
|
789
|
+
const at = ports.at(fig);
|
|
790
|
+
const talk = new NpcTalk({ get dialogue() { return ports.dialogue(); }, flags: ports.flags, npc: ports.npc,
|
|
791
|
+
at, radius: row.radius, label: row.label, speaker: fig,
|
|
792
|
+
onOpen: () => { ports.open?.(fig); }, onDone: () => { ports.done?.(); }, onEmpty: () => { ports.done?.(); } });
|
|
793
|
+
const prompt = talk.prompt;
|
|
794
|
+
if (row.copyPrompt) prompt.position = at.clone();
|
|
795
|
+
ports.prompts.push(prompt);
|
|
796
|
+
let barked = false, approached = false, stowed = false;
|
|
797
|
+
return { fig, talk, prompt,
|
|
798
|
+
update: (dt, time, player) => {
|
|
799
|
+
if (row.updateOrder === 'figure-first') ports.advance(fig, dt, time, player);
|
|
800
|
+
talk.update(player);
|
|
801
|
+
if (row.updateOrder === 'talk-first') ports.advance(fig, dt, time, player);
|
|
802
|
+
if (talk.talking !== stowed) { stowed = talk.talking; ports.stow?.(stowed); }
|
|
803
|
+
if (row.bark !== undefined) {
|
|
804
|
+
const distance = at.distanceToSquared(player);
|
|
805
|
+
if (!barked && distance < row.bark.enter ** 2) { barked = true; ports.bark?.(fig); }
|
|
806
|
+
else if (barked && distance > row.bark.leave ** 2) barked = false;
|
|
807
|
+
}
|
|
808
|
+
if (row.approach !== undefined && !approached && !ports.flags.has(row.approach.unlessFlag) &&
|
|
809
|
+
ports.approach !== undefined && player.distanceToSquared(ports.approach.at(fig)) < row.approach.radius ** 2) {
|
|
810
|
+
approached = true; ports.approach.run(fig);
|
|
811
|
+
}
|
|
812
|
+
}, lod: camera => { ports.lod?.(fig, camera.distanceTo(at)); },
|
|
813
|
+
};
|
|
814
|
+
}
|
|
815
|
+
|
|
816
|
+
/** Posed people already implement their native head, update and distance policy. */
|
|
817
|
+
export interface PosedQuestTalkFigure extends QuestTalkFigure {
|
|
818
|
+
readonly talkPoint: Vector3; update: (dt: number, time: number, player: Vector3) => void; lod: (distance: number) => void;
|
|
819
|
+
}
|
|
820
|
+
type QuestNpcTalkModel<F extends QuestTalkFigure> = {
|
|
821
|
+
readonly kind: 'posed'; readonly create: (at: { x: number; y: number; z: number }, yaw: number) => F & PosedQuestTalkFigure;
|
|
822
|
+
readonly bark: (figure: F) => void;
|
|
823
|
+
} | (Omit<NpcInstallationPorts<F>, 'dialogue' | 'flags' | 'scene' | 'registry' | 'prompts' | 'npc' | 'done'> & { readonly kind: 'borrowed' });
|
|
824
|
+
/** Root rows select real posed or borrowed figure factories and named completion owners. */
|
|
825
|
+
export type QuestNpcTalkPorts<F extends QuestTalkFigure> = Pick<NpcInstallationPorts<F>, 'dialogue' | 'flags' | 'scene' | 'registry' | 'prompts'> & {
|
|
826
|
+
readonly figures: ReadonlyMap<string, QuestNpcTalkModel<F>>;
|
|
827
|
+
readonly groundAt?: (x: number, z: number) => number;
|
|
828
|
+
readonly calls: ReadonlyMap<string, () => void>;
|
|
829
|
+
};
|
|
830
|
+
/** Install posed NPCs in their declared order, retaining the caller's update clock and actual figure ownership. */
|
|
831
|
+
export function installDeclaredNpcTalks<F extends QuestTalkFigure>(source: Pick<Shardfile, 'questNpcs'>, ports: QuestNpcTalkPorts<F>): (NpcTalkInstallation<F> & { readonly kind: string })[] {
|
|
832
|
+
const rows = (source.questNpcs ?? []).filter((row): row is QuestNpcTalkBinding => 'kind' in row);
|
|
833
|
+
if (rows.length === 0) throw new Error('Missing declared posed quest NPCs');
|
|
834
|
+
const bound = rows.map(row => {
|
|
835
|
+
const model = ports.figures.get(row.figure), done = row.done === undefined ? undefined : ports.calls.get(row.done.call);
|
|
836
|
+
if (model === undefined || row.done !== undefined && done === undefined) throw new Error('Unbound quest NPC figure or completion');
|
|
837
|
+
const ground = ports.groundAt;
|
|
838
|
+
if ((model.kind === 'posed' || row.prompt !== undefined) && ground === undefined) throw new Error('Unbound quest NPC ground');
|
|
839
|
+
if (model.kind === 'posed' && (row.at === undefined || row.yaw === undefined || row.install.approach !== undefined)) throw new Error('Missing posed quest NPC placement or approach owner');
|
|
840
|
+
if (model.kind === 'borrowed' && row.at !== undefined) throw new Error('Borrowed quest NPC placement belongs to its native owner');
|
|
841
|
+
if (model.kind === 'borrowed' && (row.install.bark !== undefined && model.bark === undefined || row.install.approach !== undefined && model.approach === undefined)) throw new Error('Unbound quest NPC greeting or approach');
|
|
842
|
+
return { row, model, done, ground };
|
|
843
|
+
});
|
|
844
|
+
const installed: (NpcTalkInstallation<F> & { readonly kind: string })[] = [];
|
|
845
|
+
for (const { row, model, done, ground } of bound) {
|
|
846
|
+
const common = { ...ports, npc: row.npc, done: () => { if (done !== undefined && testFlags(ports.flags, row.done?.when)) done(); } };
|
|
847
|
+
let person: NpcTalkInstallation<F>;
|
|
848
|
+
if (model.kind === 'borrowed') person = installNpcTalk(row.install, { ...common, ...model });
|
|
849
|
+
else {
|
|
850
|
+
if (row.at === undefined || row.yaw === undefined || ground === undefined) throw new Error('Missing posed quest NPC placement');
|
|
851
|
+
const at = row.at, yaw = row.yaw;
|
|
852
|
+
person = installNpcTalk(row.install, { ...common, create: () => model.create({ ...at, y: ground(at.x, at.z) }, yaw),
|
|
853
|
+
at: figure => figure.talkPoint, advance: (figure, dt, time, player) => { figure.update(dt, time, player); },
|
|
854
|
+
lod: (figure, distance) => { figure.lod(distance); }, open: model.bark, bark: model.bark });
|
|
855
|
+
}
|
|
856
|
+
if (row.prompt !== undefined && ports.groundAt !== undefined) person.prompt.position.set(row.prompt.at.x, ports.groundAt(row.prompt.at.x, row.prompt.at.z) + row.prompt.height, row.prompt.at.z);
|
|
857
|
+
installed.push({ ...person, kind: row.figure });
|
|
858
|
+
}
|
|
859
|
+
return installed;
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
/** The page's coins, on the cosmetic stream: looked up on each throw, as the burst always has. */
|
|
863
|
+
const coinBurst = (scene: Scene): CoinMotion => new CoinMotion(scene, () => app.rng.stream('cosmetic').next());
|
|
864
|
+
|
|
865
|
+
/** A quest's coin reward: the burst that flies the coins to the player, `pay`, which pays once per save, and `spawn`, any other coins through the same burst. */
|
|
866
|
+
export interface QuestReward { readonly burst: CoinMotion; readonly pay: () => undefined; readonly spawn: (amount: number, toast: string) => void }
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* A declared quest's coin reward (SHARD-PLATFORM M3; Signal Dunes and Sky Reach): `amount` coins burst out of the player through the platform purse
|
|
870
|
+
* (`coins`), the `toast` after the last lands; `paid` / `markPaid` are the save's once-only record (a quest flag, a shard
|
|
871
|
+
* save). The burst lives on the play scene, or on a scene of its own headless.
|
|
872
|
+
*/
|
|
873
|
+
export function questReward(ctx: ShardContext, o: { readonly player: Vector3; readonly coins: RuntimeCoins; readonly amount: number; readonly paid: () => boolean; readonly markPaid: () => void; readonly toast: string }): QuestReward {
|
|
874
|
+
const scene = ctx.game.runtime?.world?.game.scene ?? new Scene(), burst = coinBurst(scene);
|
|
875
|
+
// J130: on a page the coins a burst flies are the server's, already in the purse's line: they land and count for nothing.
|
|
876
|
+
const spawn = (amount: number, toast: string): void => { burst.spawn(o.player, amount, () => undefined, () => { ctx.game.runtime?.play?.hud.toast(toast); }); };
|
|
877
|
+
const pay = (): undefined => {
|
|
878
|
+
if (o.paid()) return undefined;
|
|
879
|
+
o.markPaid(); spawn(o.amount, o.toast);
|
|
880
|
+
return undefined;
|
|
881
|
+
};
|
|
882
|
+
return { burst, pay, spawn };
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
/**
|
|
886
|
+
* A quest's one-call presentation with its coin reward (ENGINE §20): the chip, markers, MAP card, places and step toasts,
|
|
887
|
+
* the held reward beat (`reward`, shown while the quest is complete and `unpaid` holds) that pays; entered
|
|
888
|
+
* for a retained home, installed in plain play, absent headless (the reward then pays at once on completion). A quest
|
|
889
|
+
* still open toasts `newQuest` on the first frame. The burst animates under the system `id` and is freed with the level.
|
|
890
|
+
*/
|
|
891
|
+
export function presentRewardedQuest(ctx: ShardContext, quest: QuestState, reward: QuestReward, o: { readonly id: string; readonly player: Vector3; readonly unpaid: () => boolean; readonly newQuest: string; readonly presentation: Omit<QuestPresentationOptions, 'reward'>; readonly beat: Omit<QuestRewardSpec, 'when' | 'finish'> }): () => QuestPresentation | null {
|
|
892
|
+
const runtime = ctx.game.runtime, live = runtime?.world && runtime.play ? runtime : null, { burst, pay } = reward;
|
|
893
|
+
const presentation: QuestPresentationOptions = { ...o.presentation, reward: { ...o.beat, when: () => o.unpaid() && quest.isComplete, finish: pay } };
|
|
894
|
+
const entered = live !== null && retainsRuntimeServices(ctx) ? installEnteredQuestPresentation(ctx, quest, presentation) : null;
|
|
895
|
+
const view = live === null || entered !== null ? null : installQuestPresentation(ctx, quest, presentation);
|
|
896
|
+
ctx.scope.onDispose(quest.observe({ complete: () => { if (live === null) pay(); } }));
|
|
897
|
+
if (!quest.isComplete) ctx.game.runtime?.play?.hud.toast(o.newQuest);
|
|
898
|
+
ctx.system({ id: o.id, phase: 'update', run: (dt) => { burst.update(dt, o.player); } });
|
|
899
|
+
ctx.scope.onDispose(() => { burst.update(3, o.player); burst.dispose(); });
|
|
900
|
+
return () => entered === null ? view : entered();
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
/** A rewarded quest's strings: the reward's toast, the new-quest toast's lead, the quest's title and the beat's kicker and subtitle. */
|
|
904
|
+
export interface RewardedQuestStrings { readonly reward: string; readonly newQuest: string; readonly quest: string; readonly rewardKicker: string; readonly rewardSubtitle: string }
|
|
905
|
+
/** The NPC's existing resource owners lend geometry/material, flags and dressing; the binding supplies only data. */
|
|
906
|
+
export interface QuestNpcPorts {
|
|
907
|
+
readonly player: Vector3;
|
|
908
|
+
readonly flags: Pick<Flags, 'has'>;
|
|
909
|
+
readonly model: (id: string) => { readonly geometry: NonNullable<PivotNpcPorts['source']>; readonly material?: Material } | null;
|
|
910
|
+
readonly dress?: PivotNpcPorts['dress'];
|
|
911
|
+
}
|
|
912
|
+
/** Bind an admitted quest NPC without replacing its model, material, motion, collider or missing-model policy. */
|
|
913
|
+
export function installQuestNpc(ctx: PivotNpcLevel, input: unknown, ports: QuestNpcPorts): ReturnType<NonNullable<RewardedQuestPorts['npc']>> {
|
|
914
|
+
const binding = parseQuestNpcBinding(input), resource = ports.model(binding.npc.figure.model);
|
|
915
|
+
if (resource === null && binding.missing === 'omit') return null;
|
|
916
|
+
const met = (): boolean => binding.met === 'flag' && ports.flags.has(binding.npc.metFlag);
|
|
917
|
+
const figure = installPivotNpc({ root: ctx.root, piece: piece => { ctx.piece(piece); },
|
|
918
|
+
system: spec => { ctx.system({ ...spec, id: binding.system }); } }, binding.npc, {
|
|
919
|
+
source: resource?.geometry ?? null, ...(resource?.material === undefined ? {} : { material: resource.material }),
|
|
920
|
+
groundAt: (x, z) => {
|
|
921
|
+
if (binding.ground.at !== null && (x !== binding.ground.at.x || z !== binding.ground.at.z)) throw new Error(binding.ground.error);
|
|
922
|
+
return binding.ground.height;
|
|
923
|
+
}, player: ports.player, met, file: binding.sourceFile,
|
|
924
|
+
...(ports.dress === undefined ? {} : { dress: ports.dress }),
|
|
925
|
+
});
|
|
926
|
+
if (resource === null && binding.update === 'always') ctx.system({ id: binding.system, phase: 'update', run: (dt, t) => { figure.update(dt, t, ports.player, met()); } });
|
|
927
|
+
return { row: binding.npc, figure, label: binding.label };
|
|
928
|
+
}
|
|
929
|
+
/** Bind a root-declared NPC by identity; missing declarations refuse before any model or resource is borrowed. */
|
|
930
|
+
export function installDeclaredQuestNpc(ctx: PivotNpcLevel, source: Pick<Shardfile, 'questNpcs'>, id: string, ports: QuestNpcPorts): ReturnType<typeof installQuestNpc> {
|
|
931
|
+
const binding = source.questNpcs?.find(row => row.npc.id === id);
|
|
932
|
+
if (binding === undefined) throw new Error(`Undeclared quest NPC ${id}`);
|
|
933
|
+
return installQuestNpc(ctx, binding, ports);
|
|
934
|
+
}
|
|
935
|
+
/** What `installRewardedQuest` is lent beyond the runtime quest's ports (flags, facts, marker places). */
|
|
936
|
+
export interface RewardedQuestPorts extends RuntimeQuestPorts {
|
|
937
|
+
/** The declared quest's id and the reward burst's system id. */
|
|
938
|
+
readonly id: string; readonly rewardId: string;
|
|
939
|
+
readonly strings: RewardedQuestStrings;
|
|
940
|
+
readonly player: Vector3; readonly coins: RuntimeCoins;
|
|
941
|
+
/** The save's once-only reward record. */
|
|
942
|
+
readonly paid: () => boolean; readonly markPaid: () => void;
|
|
943
|
+
/** Whether the held reward beat still shows (absent: unpaid when the quest was bound). */
|
|
944
|
+
readonly unpaid?: () => boolean;
|
|
945
|
+
/** The quest-giver: its row and its installed figure, made after the reward and before the presentation (absent or null: none). */
|
|
946
|
+
readonly npc?: () => { readonly row: NpcRow; readonly figure: Pick<QuestPresentationNpc, 'speaker'> & { readonly head: Vector3 }; readonly label: string } | null;
|
|
947
|
+
/** The presentation's other options (the places, their discovery flags). */
|
|
948
|
+
readonly presentation: Omit<QuestPresentationOptions, 'reward' | 'npc' | 'introTitle'>;
|
|
949
|
+
/** The reward beat's held view (absent: the player's own). */
|
|
950
|
+
readonly beat?: Pick<QuestRewardSpec, 'at' | 'yaw' | 'pitch' | 'holdSeconds'>;
|
|
951
|
+
}
|
|
952
|
+
/**
|
|
953
|
+
* A shard's declared quest with its coin reward in one call (SHARD-PLATFORM M3; Signal Dunes and Sky Reach): the
|
|
954
|
+
* shardfile's quest bound over the shard's flags, its coins once per save through the purse, its quest-giver, and the
|
|
955
|
+
* rewarded presentation (`presentRewardedQuest`) titled by the quest's strings.
|
|
956
|
+
*/
|
|
957
|
+
export function installRewardedQuest(ctx: ShardContext, source: Shardfile, o: RewardedQuestPorts): { quest: QuestState; reward: QuestReward; view: () => QuestPresentation | null } {
|
|
958
|
+
const { strings: s, player } = o;
|
|
959
|
+
const bound = bindPageQuest(ctx, source, o.id, { flags: o.flags, ...(o.facts === undefined ? {} : { facts: o.facts }), ...(o.place === undefined ? {} : { place: o.place }) });
|
|
960
|
+
const quest = bound.state, paidAtLoad = o.paid();
|
|
961
|
+
const reward = questReward(ctx, { player, coins: o.coins, amount: bound.reward.coins, paid: o.paid, markPaid: o.markPaid, toast: s.reward });
|
|
962
|
+
const giver = o.npc?.() ?? null, npc = giver === null ? null
|
|
963
|
+
: { npc: npcDef(giver.row), at: giver.figure.head, label: giver.label, speaker: giver.figure.speaker, radius: giver.row.talkRadius };
|
|
964
|
+
const view = presentRewardedQuest(ctx, quest, reward, { id: o.rewardId, player, unpaid: o.unpaid ?? (() => !paidAtLoad), newQuest: `${s.newQuest} · ${s.quest}`,
|
|
965
|
+
presentation: { ...o.presentation, introTitle: s.quest, ...(npc === null ? {} : { npc }) },
|
|
966
|
+
beat: { kicker: s.rewardKicker, title: s.quest, subtitle: s.rewardSubtitle, ...o.beat } });
|
|
967
|
+
return { quest, reward, view };
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
/** Enter a page's declared movers: the feed's owner, lent to the quest page's mover facet. */
|
|
971
|
+
export const enterPageMovers: typeof enterMovers = (...args) => enterMovers(...args);
|
|
972
|
+
|
|
973
|
+
/** A real prompt awaiting its admitted page action; using it before binding refuses. */
|
|
974
|
+
export function questPagePrompt(label:string,position:Vector3,radius:number):Interactable {
|
|
975
|
+
return {label,position,radius,onInteract:()=>{throw new Error('Quest prompt is not bound');}};
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/** Create named prompt frames from admitted rows, borrowing the actual world positions. */
|
|
979
|
+
/** Admitted shard page rows, or independently admitted presentation over caller-owned native rules. */
|
|
980
|
+
type QuestPageSource=Pick<Shardfile,'questHost'>|({readonly actions:readonly unknown[]}&Readonly<Record<string,unknown>>);
|
|
981
|
+
function questPageData(source:QuestPageSource):QuestPageInteractionsData {
|
|
982
|
+
const data='actions' in source?source:source.questHost?.page;
|
|
983
|
+
if(data===undefined)throw new Error('Page interactions need admitted presentation rows');
|
|
984
|
+
return parseQuestPageInteractions(data);
|
|
985
|
+
}
|
|
986
|
+
function questPageObservations(data:QuestPageInteractionsData,owners:ReadonlyMap<string,unknown>,provided?:ReadonlyMap<string,()=>boolean>,needed?:ReadonlySet<string>):Map<string,()=>boolean> {
|
|
987
|
+
const observations=new Map(provided);
|
|
988
|
+
for(const row of data.bindings?.observations??[])if(!observations.has(row.target)&&(needed===undefined||needed.has(row.target))){
|
|
989
|
+
const target=readBorrowedOwner(owners,row);if(target===null||typeof target.value!=='boolean')throw new Error(`Invalid borrowed observation ${row.target}`);
|
|
990
|
+
observations.set(row.target,()=>{const current=readBorrowedOwner(owners,row);if(current===null||typeof current.value!=='boolean')throw new Error('Borrowed observation changed type');return current.value;});
|
|
991
|
+
}
|
|
992
|
+
return observations;
|
|
993
|
+
}
|
|
994
|
+
/** Resolve selected positions and conditional label/reach owners before returning any unregistered prompt. */
|
|
995
|
+
export function createQuestPagePrompts<const Names extends readonly string[]>(source:QuestPageSource,
|
|
996
|
+
owners:ReadonlyMap<string,unknown>,names:Names,ports?:{readonly flags:Pick<Flags,'has'>;readonly observations?:ReadonlyMap<string,()=>boolean>}):{readonly [K in keyof Names]:Interactable} {
|
|
997
|
+
if(names.length>128)throw new Error('Quest prompt selection must be bounded');
|
|
998
|
+
const data=questPageData(source);
|
|
999
|
+
const frames=names.map(id=>{
|
|
1000
|
+
const row=data.prompts?.find(entry=>entry.id===id);if(row===undefined)throw new Error(`Undeclared quest prompt ${id}`);
|
|
1001
|
+
if((row.when!==undefined||(row.labels?.length??0)>0)&&ports===undefined)throw new Error('Conditional quest prompt needs its flag owner');
|
|
1002
|
+
const field=readBorrowedOwner(owners,row.at);if(!(field?.value instanceof Vector3))throw new Error('Quest prompt needs its actual position');
|
|
1003
|
+
return {row,position:field.value};
|
|
1004
|
+
});
|
|
1005
|
+
const needed=new Set(frames.flatMap(({row})=>[row.when].concat((row.labels??[]).map(label=>label.when))).flatMap(condition=>(condition?.all??[]).concat(condition?.any??[],condition?.none??[])));
|
|
1006
|
+
const observations=questPageObservations(data,owners,ports?.observations,needed);
|
|
1007
|
+
const state={has:(id:string):boolean=>observations.get(id)?.()??ports?.flags.has(id)??false};
|
|
1008
|
+
return frames.map(({row,position})=>row.when===undefined&&row.labels===undefined?questPagePrompt(row.label,position,row.radius):{
|
|
1009
|
+
position,get label(){return row.labels?.find(label=>testFlags(state,label.when))?.text??row.label;},
|
|
1010
|
+
get radius(){return testFlags(state,row.when)?row.radius:0;},onInteract:()=>{throw new Error('Quest page prompt is not bound');},
|
|
1011
|
+
}) as {readonly [K in keyof Names]:Interactable};
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
/** Borrowed view ports for declared page interaction presentation. Native rules remain the state owner. */
|
|
1015
|
+
export interface QuestPageInteractionPorts {
|
|
1016
|
+
readonly flags:Pick<Flags,'has'|'set'>; readonly rules?:InteractionRules;
|
|
1017
|
+
/** Compiled presentation effects resolve scene resources from this context. */
|
|
1018
|
+
readonly context?: Pick<ShardContext, 'scope' | 'product'>;
|
|
1019
|
+
readonly interactions?:ConstructorParameters<typeof InteractionRules>[1];
|
|
1020
|
+
/** Construct these admitted prompts under the reserved borrowed owner `prompts`. */
|
|
1021
|
+
readonly promptIds?:readonly string[];
|
|
1022
|
+
/** Register the preflighted actual prompts in their declared binding order. */
|
|
1023
|
+
readonly interactables?:Interactable[];
|
|
1024
|
+
readonly labels?:ReadonlyMap<string,Pick<Interactable,'label'>>;
|
|
1025
|
+
readonly visible?:ReadonlyMap<string,{visible:boolean}>;
|
|
1026
|
+
readonly calls?:ReadonlyMap<string,()=>void>;
|
|
1027
|
+
readonly observations?:ReadonlyMap<string,()=>boolean>;
|
|
1028
|
+
readonly toast:(text:string)=>void;
|
|
1029
|
+
/** Borrow the entered quest timer; exit cancellation remains with its original scope. */
|
|
1030
|
+
readonly timer?:Pick<QuestViews,'timeout'>;
|
|
1031
|
+
/** Actual world objects, named by the admitted bounded binding rows. */
|
|
1032
|
+
readonly owners?:ReadonlyMap<string,unknown>;
|
|
1033
|
+
}
|
|
1034
|
+
/** Validated presentation actions; run returns the native acceptance and action supplies a prompt callback. */
|
|
1035
|
+
export interface QuestPageInteractions {
|
|
1036
|
+
readonly run:(id:string)=>boolean; readonly action:(id:string)=>()=>void; readonly prompt:(id:string)=>Interactable;
|
|
1037
|
+
/** Lend the platform's admitted dispatcher to the actual held weapon; never supplies shard callbacks. */
|
|
1038
|
+
readonly bindWorldTargets: (landing: WorldTargetLanding) => void;
|
|
1039
|
+
}
|
|
1040
|
+
/** Bind page view rows only after every native rule and borrowed target resolves; seed saved view state once. */
|
|
1041
|
+
export function bindQuestPageInteractions(source:QuestPageSource,ports:QuestPageInteractionPorts,worldTargets?:WorldTargets):QuestPageInteractions {
|
|
1042
|
+
const data=questPageData(source);
|
|
1043
|
+
const promptOwners=new Map(ports.owners),owners=ports.promptIds===undefined?(ports.owners??promptOwners):promptOwners,made=new Map<string,Interactable>();
|
|
1044
|
+
if(ports.promptIds!==undefined){
|
|
1045
|
+
if(owners.has('prompts'))throw new Error('Quest prompt owner already bound');
|
|
1046
|
+
const prompts=createQuestPagePrompts(source,owners,ports.promptIds,{flags:ports.flags,...(ports.observations===undefined?{}:{observations:ports.observations})});
|
|
1047
|
+
for(const [i,id] of ports.promptIds.entries()){const prompt=prompts[i];if(prompt===undefined||made.has(id))throw new Error('Duplicate quest prompt selection');made.set(id,prompt);}
|
|
1048
|
+
promptOwners.set('prompts',Object.fromEntries(made));
|
|
1049
|
+
}
|
|
1050
|
+
const labels=new Map(ports.labels), visible=new Map(ports.visible), calls=new Map(ports.calls), observations=questPageObservations(data,owners,ports.observations);
|
|
1051
|
+
const field=(row:BorrowedOwnerPath):ReturnType<typeof readBorrowedOwner>=>readBorrowedOwner(owners,row);
|
|
1052
|
+
for(const row of data.bindings?.labels??[])if(!labels.has(row.target)){
|
|
1053
|
+
const target=field(row);if(target===null||typeof target.value!=='string')throw new Error(`Invalid borrowed label ${row.target}`);
|
|
1054
|
+
labels.set(row.target,{get label(){const value=target.receiver[target.key];if(typeof value!=='string')throw new Error('Borrowed label changed type');return value;},set label(value){target.receiver[target.key]=value;}});
|
|
1055
|
+
}
|
|
1056
|
+
for(const row of data.bindings?.visible??[])if(!visible.has(row.target)){
|
|
1057
|
+
const target=field(row);if(target===null||typeof target.value!=='boolean')throw new Error(`Invalid borrowed visibility ${row.target}`);
|
|
1058
|
+
visible.set(row.target,{get visible(){return target.receiver[target.key]===true;},set visible(value){target.receiver[target.key]=value;}});
|
|
1059
|
+
}
|
|
1060
|
+
const callable=(value:unknown):value is (...args:readonly unknown[])=>unknown=>typeof value==='function';
|
|
1061
|
+
for(const row of data.bindings?.calls??[])if(!calls.has(row.target)){
|
|
1062
|
+
const initial=readBorrowedOwner(owners,row);
|
|
1063
|
+
if(!(row.optional===true&&(initial?.value??null)===null)&&(initial===null||!callable(initial.value)))throw new Error(`Invalid borrowed call ${row.target}`);
|
|
1064
|
+
const argument=(arg:NonNullable<typeof row.args>[number]):unknown=>{
|
|
1065
|
+
if(typeof arg!=='object')return arg;
|
|
1066
|
+
const value=readBorrowedOwner(owners,arg);if(!(value?.value instanceof Vector3)||!Number.isFinite(value.value.x)||!Number.isFinite(value.value.y)||!Number.isFinite(value.value.z))throw new Error(`Missing borrowed point argument ${row.target}`);return value.value;
|
|
1067
|
+
};
|
|
1068
|
+
for(const arg of row.args??[])argument(arg);
|
|
1069
|
+
const timer=ports.timer;if(row.delay!==undefined&&timer===undefined)throw new Error(`Missing quest timer ${row.target}`);
|
|
1070
|
+
const invoke=():void=>{const current=readBorrowedOwner(owners,row);if(row.optional===true&&(current?.value??null)===null)return;
|
|
1071
|
+
if(current===null||!callable(current.value))throw new Error(`Invalid borrowed call ${row.target}`);current.value.call(current.receiver,...(row.args??[]).map(argument));};
|
|
1072
|
+
calls.set(row.target,()=>{if(row.delay===undefined)invoke();else timer?.timeout(row.delay,invoke);});
|
|
1073
|
+
}
|
|
1074
|
+
const rules=ports.rules??('actions' in source?new InteractionRules(ports.flags,ports.interactions??{marks:[],rows:[]}):InteractionRules.fromDeclared(source,ports.flags));
|
|
1075
|
+
const view={has:(id:string):boolean=>observations.get(id)?.()??rules.has(id)};
|
|
1076
|
+
type Effect=QuestPageInteractionsData['actions'][number]['after'];
|
|
1077
|
+
const compile=(rows:Effect):(()=>void)[] => (rows??[]).map(row=>{
|
|
1078
|
+
if(row.kind==='emitter'){
|
|
1079
|
+
const context=ports.context;if(context===undefined)throw new Error('Emitter effects require their presentation context');
|
|
1080
|
+
const emitters=lightEmitterPresentation(residentWorldScope(context),context.product.slug);
|
|
1081
|
+
return ()=>{emitters.set(row.target,row.value);};
|
|
1082
|
+
}
|
|
1083
|
+
if(row.kind==='toast')return ()=>{
|
|
1084
|
+
const progress=row.progress;if(progress===undefined){ports.toast(row.text);return;}
|
|
1085
|
+
const lit=progress.flags.filter(flag=>rules.has(flag)).length;
|
|
1086
|
+
ports.toast(lit<progress.flags.length?`${row.text} · ${String(lit)}/${String(progress.flags.length)}`:progress.complete);
|
|
1087
|
+
};
|
|
1088
|
+
if(row.kind==='mark'){if(!rules.data.marks.some(mark=>mark.id===row.target))throw new Error(`Unknown page interaction mark ${row.target}`);return ()=>{rules.mark(row.target,row.value);};}
|
|
1089
|
+
if(row.kind==='call'){const call=calls.get(row.target);if(call===undefined)throw new Error(`Missing page interaction command ${row.target}`);return call;}
|
|
1090
|
+
if(row.kind==='label'){const target=labels.get(row.target);if(target===undefined)throw new Error(`Missing page interaction label ${row.target}`);return ()=>{target.label=row.text;};}
|
|
1091
|
+
const target=visible.get(row.target);if(target===undefined)throw new Error(`Missing page interaction visibility ${row.target}`);return ()=>{target.visible=row.value;};
|
|
1092
|
+
});
|
|
1093
|
+
const actions=new Map(data.actions.map(row=>{
|
|
1094
|
+
if(row.interaction!==undefined)rules.row(row.interaction);
|
|
1095
|
+
const before=compile(row.before),after=compile(row.after),refused=new Map(Object.entries(row.refused??{}).map(([reason,effects])=>[reason,compile(effects)]));
|
|
1096
|
+
const refusal=(reason:string):false=>{const text=row.denied?.[reason];if(text!==undefined)ports.toast(text);for(const effect of refused.get(reason)??[])effect();return false;};
|
|
1097
|
+
return [row.id,():boolean=>{
|
|
1098
|
+
for(const need of row.needs??[])if(!testFlags(view,need))return refusal(need.else??'refused');
|
|
1099
|
+
const beat=():void=>{for(const effect of before)effect();};
|
|
1100
|
+
if(row.interaction!==undefined){const result=rules.run(row.interaction,beat);if(!result.ok)return refusal(result.reason);}
|
|
1101
|
+
else beat();
|
|
1102
|
+
for(const effect of after)effect();return true;
|
|
1103
|
+
}] as const;
|
|
1104
|
+
}));
|
|
1105
|
+
const initial=(data.initial??[]).map(row=>({when:row.when,effects:compile(row.effects)}));
|
|
1106
|
+
const read=(id:string):(()=>boolean)=>{const action=actions.get(id);if(action===undefined)throw new Error(`Unknown page interaction ${id}`);return action;};
|
|
1107
|
+
const registered:Interactable[]=[];
|
|
1108
|
+
const isPrompt=(target:Record<string,unknown>):target is Record<string,unknown>&Interactable=>typeof target['label']==='string'
|
|
1109
|
+
&&target['position'] instanceof Vector3&&typeof target['radius']==='number'&&Number.isFinite(target['radius'])&&target['radius']>=0&&typeof target['onInteract']==='function';
|
|
1110
|
+
const prompts=(data.bindings?.prompts??[]).map(row=>{
|
|
1111
|
+
const prompt=readBorrowedOwner(owners,row),action=read(row.target);
|
|
1112
|
+
if(prompt===null||typeof prompt.value!=='function')throw new Error(`Invalid borrowed prompt ${row.target}`);
|
|
1113
|
+
if(ports.interactables!==undefined){if(prompt.key!=='onInteract'||!isPrompt(prompt.receiver))throw new Error(`Invalid registered quest prompt ${row.target}`);registered.push(prompt.receiver);}
|
|
1114
|
+
return ()=>{prompt.receiver[prompt.key]=()=>{action();};};
|
|
1115
|
+
});
|
|
1116
|
+
for(const row of data.world??[])if(row.action!==undefined)read(row.action);
|
|
1117
|
+
const targetData = worldTargets ?? ('files' in source && typeof source['files'] === 'object' && source['files'] !== null
|
|
1118
|
+
? outputDescriptor({files:source['files']})?.sections.get('world/targets') : undefined);
|
|
1119
|
+
// Effects name native interaction identities, independently of page action aliases.
|
|
1120
|
+
const targetActions = new Map<string, {run:()=>boolean}>();
|
|
1121
|
+
if (targetData !== undefined) for (const row of rules.data.rows) {
|
|
1122
|
+
const matches = data.actions.filter(action => action.interaction === row.id);
|
|
1123
|
+
if (matches.length === 1) {
|
|
1124
|
+
const action = matches[0]; if (action !== undefined) targetActions.set(row.id, {run:read(action.id)});
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
const parsedTargets = targetData === undefined ? undefined : parseWorldTargets(targetData);
|
|
1128
|
+
const contacts = parsedTargets === undefined || parsedTargets.targets.length === 0 ? null : new WorldTargetHost(parsedTargets, {
|
|
1129
|
+
flags:{has:id=>rules.has(id),set:id=>{ports.flags.set(id);}}, interactions:targetActions, hints:{show:ports.toast},
|
|
1130
|
+
});
|
|
1131
|
+
for(const bind of prompts)bind();
|
|
1132
|
+
for(const row of initial)if(testFlags(view,row.when))for(const effect of row.effects)effect();
|
|
1133
|
+
ports.interactables?.push(...registered);
|
|
1134
|
+
return {run:id=>read(id)(),action:id=>{const action=read(id);return ()=>{action();};},prompt:id=>{const prompt=made.get(id);if(prompt===undefined)throw new Error(`Undeclared quest prompt ${id}`);return prompt;},
|
|
1135
|
+
bindWorldTargets:landing=>{if(contacts===null)throw new Error('Missing admitted world targets');landing.bindWorldTargets(contacts);}};
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
/** Live page owners lent to the already admitted quest stages. */
|
|
1139
|
+
export interface PageQuestStagePorts {
|
|
1140
|
+
readonly flags: Pick<Flags, 'has' | 'set'>;
|
|
1141
|
+
readonly actor?: (id: string) => { readonly alive: boolean } | null;
|
|
1142
|
+
readonly observations?: ReadonlyMap<string, () => boolean>;
|
|
1143
|
+
readonly bindings?: ReadonlyMap<string, readonly DirectorActionBinding[]>;
|
|
1144
|
+
readonly motion?: Pick<FollowedMovers, 'atEnd'> & Partial<Pick<FollowedMovers, 'pose'>>;
|
|
1145
|
+
}
|
|
1146
|
+
/** Advance a declared event stage; tick stages are registered with the page owner. */
|
|
1147
|
+
export interface PageQuestStages { readonly advance: (id: string) => void }
|
|
1148
|
+
/** Use the native quest's stage rows on the page without creating another saved cursor. */
|
|
1149
|
+
export function bindPageQuestStages(ctx: Pick<ShardContext, 'system'>, source: Pick<Shardfile, 'questHost'>, ports: PageQuestStagePorts): PageQuestStages {
|
|
1150
|
+
const host = source.questHost;
|
|
1151
|
+
if (host === undefined || host === null) throw new Error('Missing admitted page quest host');
|
|
1152
|
+
const observations = new Map<string, () => boolean>();
|
|
1153
|
+
for (const row of host.observations) {
|
|
1154
|
+
if (row.kind === 'all-dead') {
|
|
1155
|
+
const actor = ports.actor;
|
|
1156
|
+
if (actor === undefined) throw new Error('Quest stage needs its live actor owner');
|
|
1157
|
+
observations.set(row.binding, () => row.actors.length > 0 && row.actors.every(id => actor(id)?.alive === false));
|
|
1158
|
+
} else if (row.kind === 'owner') {
|
|
1159
|
+
const owner = ports.observations?.get(row.owner);
|
|
1160
|
+
if (owner === undefined) throw new Error(`Unbound page quest observation ${row.owner}`);
|
|
1161
|
+
observations.set(row.binding, owner);
|
|
1162
|
+
} else if (row.kind === 'mover') {
|
|
1163
|
+
const motion = ports.motion;
|
|
1164
|
+
if (motion === undefined) throw new Error(`Unbound page quest mover ${row.mover}`);
|
|
1165
|
+
const pose = motion.pose?.bind(motion);
|
|
1166
|
+
if (row.state === 'enabled' && pose === undefined) throw new Error(`Missing page mover pose ${row.mover}`);
|
|
1167
|
+
const read = row.state === 'at-end' ? () => motion.atEnd(row.mover) : () => {
|
|
1168
|
+
if (pose === undefined) throw new Error('Missing page mover pose'); return pose(row.mover).enabled;
|
|
1169
|
+
};
|
|
1170
|
+
read(); observations.set(row.binding, read);
|
|
1171
|
+
} else {
|
|
1172
|
+
throw new Error(`Quest ${row.kind} observation needs its native mechanic owner`);
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1175
|
+
const observe = (binding: string): boolean => {
|
|
1176
|
+
const owner = observations.get(binding);
|
|
1177
|
+
if (owner === undefined) throw new Error(`Unbound page quest observation ${binding}`);
|
|
1178
|
+
return owner();
|
|
1179
|
+
};
|
|
1180
|
+
const stages = new Map<string, BoundDirectorActions>();
|
|
1181
|
+
for (const row of host.stages) {
|
|
1182
|
+
const stage = bindDirectorActions(row.row, { flags: ports.flags, observe, bindings: ports.bindings?.get(row.row.id) ?? [],
|
|
1183
|
+
initial: row.seed !== undefined && ports.flags.has(row.seed.flag) ? row.seed.initial : row.initial });
|
|
1184
|
+
stages.set(row.row.id, stage);
|
|
1185
|
+
if (row.tick) ctx.system({ id: row.row.id, phase: 'update', run: stage.advance });
|
|
1186
|
+
}
|
|
1187
|
+
return { advance: id => {
|
|
1188
|
+
const stage = stages.get(id);
|
|
1189
|
+
if (stage === undefined) throw new Error(`Undeclared page quest stage ${id}`);
|
|
1190
|
+
stage.advance();
|
|
1191
|
+
} };
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
/** A declared NPC's existing copied geometry provider; prepared pivots stay prepared. */
|
|
1195
|
+
export type QuestNpcModelSource =
|
|
1196
|
+
{ readonly kind: 'mesh'; readonly read: () => BufferGeometry | null } |
|
|
1197
|
+
{ readonly kind: 'pivots'; readonly read: () => { readonly geometry: BufferGeometry; readonly map: Texture; readonly pivots?: PivotNpcGeometry } | null;
|
|
1198
|
+
readonly material: (map: Texture) => Material };
|
|
1199
|
+
/** Model identity and preparation form, shared by page and Explorer consumers. */
|
|
1200
|
+
export interface QuestNpcModelRow { readonly id: string; readonly kind: QuestNpcModelSource['kind']; readonly material?: string }
|
|
1201
|
+
|
|
1202
|
+
function questNpcModelReader(row: QuestNpcModelRow, source: QuestNpcModelSource): QuestNpcPorts['model'] {
|
|
1203
|
+
if (row.kind !== source.kind) throw new Error('Quest model provider has the wrong preparation form');
|
|
1204
|
+
return id => {
|
|
1205
|
+
if (id !== row.id) throw new Error(`Unknown quest model ${id}`);
|
|
1206
|
+
if (source.kind === 'mesh') {
|
|
1207
|
+
const geometry = source.read();
|
|
1208
|
+
return geometry === null ? null : { geometry };
|
|
1209
|
+
}
|
|
1210
|
+
const copied = source.read();
|
|
1211
|
+
if (copied === null) return null;
|
|
1212
|
+
copied.geometry.dispose();
|
|
1213
|
+
if (copied.pivots === undefined) throw new Error('Missing authored NPC pivots');
|
|
1214
|
+
return { geometry: copied.pivots, material: source.material(copied.map) };
|
|
1215
|
+
};
|
|
1216
|
+
}
|
|
1217
|
+
/** An Explorer specimen uses the same admitted figure row and model provider as its live NPC. */
|
|
1218
|
+
export function questNpcSpecimen(source: Pick<Shardfile, 'questNpcs'>, id: string, ports: QuestNpcModelSource): Group;
|
|
1219
|
+
export function questNpcSpecimen(source: Pick<Shardfile, 'questNpcs'>, id: string, model: QuestNpcModelRow, ports: QuestNpcModelSource): Group;
|
|
1220
|
+
/** The admitted figure supplies its model identity; the borrowed provider supplies the preparation form. */
|
|
1221
|
+
export function questNpcSpecimen(source: Pick<Shardfile, 'questNpcs'>, id: string, modelOrPorts: QuestNpcModelRow | QuestNpcModelSource, borrowed?: QuestNpcModelSource): Group {
|
|
1222
|
+
const binding = source.questNpcs?.find(row => row.npc.id === id);
|
|
1223
|
+
if (binding === undefined || 'kind' in binding) throw new Error(`Undeclared quest NPC ${id}`);
|
|
1224
|
+
let model: QuestNpcModelRow, ports: QuestNpcModelSource;
|
|
1225
|
+
if ('read' in modelOrPorts) { ports = modelOrPorts; model = { id: binding.npc.figure.model, kind: ports.kind }; }
|
|
1226
|
+
else { if (borrowed === undefined) throw new Error('Missing quest model provider'); model = modelOrPorts; ports = borrowed; }
|
|
1227
|
+
const copied = questNpcModelReader(model, ports)(binding.npc.figure.model);
|
|
1228
|
+
return copied === null ? new Group() : pivotNpcParts(binding.npc, copied.geometry, copied.material).root;
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1231
|
+
/** Saved quest presentation rows shared by native and flag-backed rewards. */
|
|
1232
|
+
export interface PersistedQuestRows {
|
|
1233
|
+
readonly id: string; readonly rewardId: string; readonly npc: string;
|
|
1234
|
+
readonly strings: RewardedQuestStrings; readonly persistence: PagePersistenceRows;
|
|
1235
|
+
readonly model?: QuestNpcModelRow;
|
|
1236
|
+
readonly places: readonly PlacePoint[];
|
|
1237
|
+
readonly markers?: Readonly<Record<string, NonNullable<ReturnType<NonNullable<RuntimeQuestPorts['place']>>>>>;
|
|
1238
|
+
readonly presentationFlags?: boolean; readonly projectProgress?: boolean;
|
|
1239
|
+
readonly unpaid?: 'live' | 'initial';
|
|
1240
|
+
readonly beat?: { readonly at: { readonly x: number; readonly y: number; readonly z: number };
|
|
1241
|
+
readonly toward: { readonly x: number; readonly z: number }; readonly pitch: number; readonly holdSeconds: number };
|
|
1242
|
+
readonly finishFlags?: readonly string[];
|
|
1243
|
+
readonly stages?: readonly { readonly system: string; readonly data: unknown; readonly initial: readonly Readonly<Record<string, boolean>>[] }[];
|
|
1244
|
+
/** A bounded transient startup repair; saved flags are its continuation. */
|
|
1245
|
+
readonly repair?: { readonly data: unknown; readonly initial: readonly Readonly<Record<string, boolean>>[];
|
|
1246
|
+
readonly legacyObservation: string; readonly advances: number };
|
|
1247
|
+
}
|
|
1248
|
+
/** Borrow the existing model/material owner and purse; rows own quest composition. */
|
|
1249
|
+
export interface PersistedQuestPorts {
|
|
1250
|
+
readonly player: Vector3; readonly flags?: Flags; readonly coins?: RuntimeCoins;
|
|
1251
|
+
readonly model: QuestNpcPorts['model'] | QuestNpcModelSource; readonly dress?: QuestNpcPorts['dress'];
|
|
1252
|
+
}
|
|
1253
|
+
/** Live quest services over the original durable flag, reward and boss owners. */
|
|
1254
|
+
export interface PersistedQuest {
|
|
1255
|
+
readonly quest: QuestState; readonly flags: Flags; readonly reward: QuestReward; readonly burst: CoinMotion;
|
|
1256
|
+
readonly view: QuestPresentation | null; readonly persistence: PagePersistence;
|
|
1257
|
+
readonly facts: PagePersistence['facts']; readonly finished: () => void;
|
|
1258
|
+
}
|
|
1259
|
+
export function installPersistedQuest(ctx: ShardContext, source: Shardfile,
|
|
1260
|
+
rows: PersistedQuestRows & { readonly persistence: PagePersistenceRows & { readonly boss: NonNullable<PagePersistenceRows['boss']> } },
|
|
1261
|
+
ports: PersistedQuestPorts): PersistedQuest & { readonly persistence: PagePersistence & { readonly boss: NonNullable<PagePersistence['boss']> } };
|
|
1262
|
+
export function installPersistedQuest(ctx: ShardContext, source: Shardfile, rows: PersistedQuestRows, ports: PersistedQuestPorts): PersistedQuest;
|
|
1263
|
+
/** Compose declared NPCs, saved rewards and flag stages without replacing a save owner. */
|
|
1264
|
+
export function installPersistedQuest(ctx: ShardContext, source: Shardfile, rows: PersistedQuestRows, ports: PersistedQuestPorts): PersistedQuest {
|
|
1265
|
+
const flags = ports.flags ?? new Flags(ctx.manifest.slug);
|
|
1266
|
+
const persistence = bindPagePersistence(ctx, source, rows.persistence, flags, ctx.manifest.slug);
|
|
1267
|
+
if (rows.projectProgress === true) persistence.bindProgress(ctx.game.runtime?.play?.progress);
|
|
1268
|
+
if (rows.repair !== undefined) {
|
|
1269
|
+
const repairRow = rows.repair;
|
|
1270
|
+
if (!Number.isSafeInteger(repairRow.advances) || repairRow.advances < 1 || repairRow.advances > 16) throw new Error('Quest repair must be bounded');
|
|
1271
|
+
const legacy = !persistence.rewarded.read() && persistence.legacyPaid;
|
|
1272
|
+
const repair = bindDirectorActions(repairRow.data, { flags, bindings: [], initial: repairRow.initial, observe: binding => {
|
|
1273
|
+
if (binding !== repairRow.legacyObservation) throw new Error('Unknown quest repair observation');
|
|
1274
|
+
return legacy;
|
|
1275
|
+
} });
|
|
1276
|
+
for (let step = 0; step < repairRow.advances; step++) repair.advance();
|
|
1277
|
+
}
|
|
1278
|
+
const beat = rows.beat;
|
|
1279
|
+
let model: QuestNpcPorts['model'];
|
|
1280
|
+
if (typeof ports.model === 'function') model = ports.model;
|
|
1281
|
+
else {
|
|
1282
|
+
if (rows.model === undefined) throw new Error('Missing declared quest model');
|
|
1283
|
+
model = questNpcModelReader(rows.model, ports.model);
|
|
1284
|
+
}
|
|
1285
|
+
const installed = installRewardedQuest(ctx, source, { id: rows.id, rewardId: rows.rewardId, strings: rows.strings,
|
|
1286
|
+
flags, facts: persistence.facts, player: ports.player, coins: ports.coins ?? bindRuntimeCoins(ctx, null),
|
|
1287
|
+
paid: persistence.rewarded.read, markPaid: () => { persistence.rewarded.write(true); },
|
|
1288
|
+
...(rows.unpaid === 'live' ? { unpaid: () => !persistence.rewarded.read() } : {}),
|
|
1289
|
+
...(rows.markers === undefined ? {} : { place: marker => rows.markers?.[marker.id] }),
|
|
1290
|
+
presentation: { places: [...rows.places], ...(rows.presentationFlags === true ? { flags } : {}) },
|
|
1291
|
+
...(beat === undefined ? {} : { beat: { at: new Vector3(beat.at.x, beat.at.y, beat.at.z),
|
|
1292
|
+
yaw: Math.atan2(-(beat.toward.x - beat.at.x), -(beat.toward.z - beat.at.z)), pitch: beat.pitch, holdSeconds: beat.holdSeconds } }),
|
|
1293
|
+
npc: () => installDeclaredQuestNpc(ctx, source, rows.npc, { player: ports.player, flags, model,
|
|
1294
|
+
...(ports.dress === undefined ? {} : { dress: ports.dress }) }),
|
|
1295
|
+
});
|
|
1296
|
+
for (const row of rows.stages ?? []) {
|
|
1297
|
+
const stage = bindDirectorActions(row.data, { flags, bindings: [], initial: row.initial });
|
|
1298
|
+
ctx.system({ id: row.system, phase: 'update', run: stage.advance });
|
|
1299
|
+
}
|
|
1300
|
+
return { quest: installed.quest, flags, reward: installed.reward, burst: installed.reward.burst, facts: persistence.facts, persistence,
|
|
1301
|
+
get view() { return installed.view(); }, finished: () => {
|
|
1302
|
+
persistence.rewarded.write(true);
|
|
1303
|
+
for (const flag of rows.finishFlags ?? []) flags.set(flag);
|
|
1304
|
+
} };
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
/** What a boss row's browser encounter is given: its rows, its view-free script, its body and its record. */
|
|
1308
|
+
export interface BossViewSpec {
|
|
1309
|
+
readonly definition: BossDefinition;
|
|
1310
|
+
/** The row a server publishes this fight under, where that isn't its definition's id. */
|
|
1311
|
+
readonly row?: string;
|
|
1312
|
+
/** The encounter's authored stage rows (`DirectorBossBrain`). */
|
|
1313
|
+
readonly stages: unknown;
|
|
1314
|
+
readonly script: BossScript;
|
|
1315
|
+
/** The player's live position (the arena check, the reward's target). */
|
|
1316
|
+
readonly player: Vector3;
|
|
1317
|
+
/** The boss's live body: a hit on it is refused while `shielded`. */
|
|
1318
|
+
readonly body: () => Animal | null;
|
|
1319
|
+
readonly shielded: () => boolean;
|
|
1320
|
+
readonly saved: BossSaved;
|
|
1321
|
+
readonly persist: (value: BossSaved) => void;
|
|
1322
|
+
/** What a page shows of a win a server's row reports, where a page's script would have shown it. */
|
|
1323
|
+
readonly won?: () => void;
|
|
1324
|
+
/** A fight began on a server's row: what `won` will say is read now, ahead of the win's own flags. */
|
|
1325
|
+
readonly started?: () => void;
|
|
1326
|
+
/** A quest armed the fight on a server's row, where `installBossView`'s summon would have said so. */
|
|
1327
|
+
readonly summoned?: () => void;
|
|
1328
|
+
/** The one point an intro faces, for a fight whose intro doesn't turn to its body. */
|
|
1329
|
+
readonly introAt?: Vector3;
|
|
1330
|
+
/** The first fall's reward (absent: the victory callback pays it). */
|
|
1331
|
+
readonly spawnReward?: () => void;
|
|
1332
|
+
/** Toast the brain's own lines on the HUD (a later fall's); absent, the shard's victory callback says it. */
|
|
1333
|
+
readonly toast?: boolean;
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
/**
|
|
1337
|
+
* A boss row's encounter in the browser (SHARD-PLATFORM BR-2), the twin of `installBossRow` in the renderer-free host:
|
|
1338
|
+
* the engine's `BossBrain` under its authored stages over the shard's view-free script, with the engine's `BossBar` (boss
|
|
1339
|
+
* bar, name card, skip hold), the player's weapons locked through the intro, respawn / face-toward on the player's motor,
|
|
1340
|
+
* its toasts on the HUD when asked, and `damage.modify` refusing hits on the body while the script is shielded. Signal's Dune Matriarch
|
|
1341
|
+
* and Sky Reach's Storm Roc are these.
|
|
1342
|
+
*/
|
|
1343
|
+
export class BossView extends DirectorBossBrain {
|
|
1344
|
+
private readonly pinned: () => Animal | null;
|
|
1345
|
+
/** J130: a bar has one driver. On the wire the row draws it and this page's brain never steps. */
|
|
1346
|
+
private readonly rowBar: BossRowBar | null;
|
|
1347
|
+
private readonly rowId: string;
|
|
1348
|
+
constructor(ctx: ShardContext, spec: BossViewSpec) {
|
|
1349
|
+
const bar = new BossBar(), motor = (): { position: Vector3; yaw: number } | null => ctx.game.runtime?.world?.player ?? null, aim = new Vector3();
|
|
1350
|
+
const faceToward = (target: Vector3): void => { const m = motor(); if (m) m.yaw = Math.atan2(m.position.x - target.x, m.position.z - target.z); };
|
|
1351
|
+
ctx.scope.onDispose(() => { bar.scope.dispose(); });
|
|
1352
|
+
ctx.answer('damage.modify', (request) => { const body = spec.body(); return request !== null && body !== null && request.target === body.combatActor() && spec.shielded() ? null : request; });
|
|
1353
|
+
super(spec.definition, spec.script, { events: ctx.app.events, player: { position: spec.player },
|
|
1354
|
+
lockInput: (on) => { ctx.game.runtime?.play?.weapons.setEnabled(!on); }, skipHeld: () => ctx.app.input.held('skip'),
|
|
1355
|
+
respawn: (pos, yaw) => { const m = motor(); if (m) { m.position.copy(pos); m.yaw = yaw; } },
|
|
1356
|
+
faceToward, spawnReward: () => { spec.spawnReward?.(); }, toast: spec.toast === true ? (message) => { ctx.game.runtime?.play?.hud.toast(message); } : undefined,
|
|
1357
|
+
persist: spec.persist }, bar, spec.saved, spec.stages);
|
|
1358
|
+
this.pinned = spec.body; this.rowId = spec.row ?? spec.definition.id;
|
|
1359
|
+
this.rowBar = new BossRowBar(bar, { ...spec.definition, id: spec.row ?? spec.definition.id }, null, { lock: on => { ctx.game.runtime?.play?.weapons.setEnabled(!on); }, ...(spec.won === undefined ? {} : { won: spec.won }), ...(spec.summoned === undefined ? {} : { summoned: spec.summoned }),
|
|
1360
|
+
face: body => { faceToward(spec.introAt ?? (wirePage.head(body, aim) ? aim : spec.script.rewardPoint())); },
|
|
1361
|
+
attempt: outcome => { if (outcome === 'started') spec.started?.(); ctx.app.events.emit('boss.attempt', { boss: spec.definition.id, outcome }); } });
|
|
1362
|
+
}
|
|
1363
|
+
/** The boss's body is drawn at any distance (no tier draw-distance shrink), whichever body is up this frame. */
|
|
1364
|
+
override update(dt: number, t: number): void {
|
|
1365
|
+
const body = this.pinned();
|
|
1366
|
+
if (body !== null) body.drawPinned = true;
|
|
1367
|
+
if (this.rowBar !== null) {
|
|
1368
|
+
const rows = wirePage.encounters(), row = rows.find(entry => entry.id === this.rowId), rowBody = row === undefined ? null : wirePage.rowBody(row.body);
|
|
1369
|
+
if (rowBody !== null) rowBody.drawPinned = true;
|
|
1370
|
+
this.rowBar.draw(rows, dt); return;
|
|
1371
|
+
}
|
|
1372
|
+
super.update(dt, t);
|
|
1373
|
+
}
|
|
1374
|
+
}
|
|
1375
|
+
|
|
1376
|
+
/**
|
|
1377
|
+
* Registers a browser boss with the level's encounters under `id`: armed now when `armed`, answering the health model's
|
|
1378
|
+
* death checkpoint, updated each frame. `summon` arms a dormant boss (`onSummon` runs then, e.g. its summons toast).
|
|
1379
|
+
*/
|
|
1380
|
+
export function installBossView<T extends BossView>(ctx: ShardContext, id: string, brain: T, armed: boolean, onSummon?: () => void): { boss: T; summon: () => void } {
|
|
1381
|
+
const live = ctx.app.encounters.boss(id, brain, ctx.scope);
|
|
1382
|
+
if (armed) live.arm();
|
|
1383
|
+
ctx.answer('death.checkpoint', (value) => live.onPlayerDeath() || value === true);
|
|
1384
|
+
ctx.system({ id, phase: 'update', run: (dt, t) => { live.update(dt, t); } });
|
|
1385
|
+
return { boss: live, summon: () => { if (live.state === 'dormant') { live.arm(); onSummon?.(); } } };
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/** A body boss's rows: its encounter definition, its authored stages and its spawned or held fight profile. */
|
|
1389
|
+
export interface RowBossRows { readonly definition: BossDefinition; readonly stages: unknown; readonly profile: unknown; /** The server's row for this fight. */ readonly row?: string }
|
|
1390
|
+
/** A boss record: the saved state to start from and how it persists. */
|
|
1391
|
+
export interface RowBossRecord { readonly saved: BossSaved; readonly persist: (value: BossSaved) => void; /** The record as it stands now. */ readonly read: () => BossSaved }
|
|
1392
|
+
/**
|
|
1393
|
+
* What a `RowBossView` is lent. A spawned body (a fresh body per checkpoint): the bound body row, its arena
|
|
1394
|
+
* presentation (reward floor, respawn, storm, toasts), its admitted shardfile (the storm shells' look materials), its
|
|
1395
|
+
* coins through the purse and the victory's beat. A held body: the retained body, its brain and the victory callback,
|
|
1396
|
+
* which pays and toasts itself.
|
|
1397
|
+
*/
|
|
1398
|
+
export type RowBossPorts = { readonly player: Vector3; readonly record: RowBossRecord;
|
|
1399
|
+
/** A page on a server shows a win without writing it: `won` hears the row's win, `started` its fight beginning. */
|
|
1400
|
+
readonly won: () => void; readonly started: () => void } & ({
|
|
1401
|
+
readonly body: RuntimeBoss; readonly presentation: MarkedBossPresentation; readonly reward: number; readonly coins: RuntimeCoins;
|
|
1402
|
+
readonly source: Shardfile; readonly onDown?: () => void;
|
|
1403
|
+
} | { readonly held: Animal | null; readonly brain: HeldBossBrain | null; readonly victory: (at: Vector3) => void });
|
|
1404
|
+
|
|
1405
|
+
interface RowBossMade { readonly spec: BossViewSpec; readonly at: Vector3 | null; readonly weather: { storm: number }; readonly after: () => void }
|
|
1406
|
+
function rowBossSpec(ctx: ShardContext, rows: RowBossRows, ports: RowBossPorts): RowBossMade {
|
|
1407
|
+
const profile = parseBossProfile(rows.profile), { player, record } = ports, saved = record.saved;
|
|
1408
|
+
const base = { definition: rows.definition, stages: rows.stages, player, saved, persist: record.persist, ...(rows.row === undefined ? {} : { row: rows.row }),
|
|
1409
|
+
started: () => { Object.assign(saved, record.read()); ports.started(); } };
|
|
1410
|
+
if ('held' in ports) {
|
|
1411
|
+
if (profile.pattern !== 'held') throw new Error(`${rows.definition.id} requires its declared held-body pattern`);
|
|
1412
|
+
const fight = bodyBossFight(profile, { body: ports.held, brain: ports.brain, victory: ports.victory });
|
|
1413
|
+
return { spec: { ...base, script: fight.script, body: () => ports.held, shielded: fight.shielded, won: ports.won, introAt: fight.script.rewardPoint() }, at: null, weather: { storm: 0 }, after: () => undefined };
|
|
1414
|
+
}
|
|
1415
|
+
if (profile.pattern !== 'spawned') throw new Error(`${rows.definition.id} requires its declared spawned-body pattern`);
|
|
1416
|
+
const look = ports.presentation, body = ports.body, onDown = ports.onDown;
|
|
1417
|
+
const at = new Vector3(body.row.at[0], look.floor, body.row.at[1]);
|
|
1418
|
+
const scene = ctx.game.runtime?.world?.game.scene ?? new Scene(), burst = coinBurst(scene), weather = bossStorm(ctx, ports.source, player, look.storm)(scene);
|
|
1419
|
+
const fight = bodyBossFight<Animal>(profile, { body: { spawn: (previous) => body.spawn(previous), retire: (a) => { body.retire(a); } }, rewardPoint: at,
|
|
1420
|
+
respawnPoint: () => ({ pos: new Vector3(look.respawn.x, ctx.manifest.ground.terrain?.heightAt(look.respawn.x, look.respawn.z) ?? 0, look.respawn.z), yaw: look.respawn.yaw }),
|
|
1421
|
+
victory: () => { ctx.game.runtime?.play?.hud.toast(saved.rewardTaken ? look.toasts.rewardAgain : look.toasts.reward); onDown?.(); },
|
|
1422
|
+
update: (dt, strength) => { weather(dt, strength); burst.update(dt, player); } });
|
|
1423
|
+
return { at, weather: fight.weather, spec: { ...base, script: fight.script, body: fight.body, shielded: fight.invulnerable, toast: true,
|
|
1424
|
+
won: () => {
|
|
1425
|
+
const first = !saved.rewardTaken;
|
|
1426
|
+
ctx.game.runtime?.play?.hud.toast(first ? look.toasts.reward : look.toasts.rewardAgain);
|
|
1427
|
+
if (first) burst.spawn(player, ports.reward, () => undefined, () => undefined);
|
|
1428
|
+
saved.rewardTaken = true; ports.won();
|
|
1429
|
+
},
|
|
1430
|
+
summoned: () => { ctx.game.runtime?.play?.hud.toast(look.toasts.summoned); },
|
|
1431
|
+
spawnReward: () => { saved.rewardTaken = true; record.persist(saved); burst.spawn(player, ports.reward, ports.coins, () => undefined); } },
|
|
1432
|
+
after: () => {
|
|
1433
|
+
if (saved.defeated) onDown?.();
|
|
1434
|
+
ctx.scope.onDispose(() => { burst.update(3, player); burst.dispose(); const animal = fight.body(); if (animal) body.retire(animal); fight.adopt(null); });
|
|
1435
|
+
// J130: a page on a server steps no fight, so its row says when the storm blows, by the same phases and at the same ease.
|
|
1436
|
+
ctx.system({ id: `${rows.definition.id}.storm`, phase: 'update', run: dt => {
|
|
1437
|
+
const row = wirePage.encounters().find(entry => entry.id === (rows.row ?? rows.definition.id));
|
|
1438
|
+
const goal = (row?.state === 'fight' || row?.state === 'beat') && profile.fight.stormPhases.includes(row.phase) ? 1 : 0;
|
|
1439
|
+
fight.weather.storm = easeField(fight.weather.storm, goal, dt, { seconds: profile.fight.stormFade });
|
|
1440
|
+
weather(dt, fight.weather.storm); burst.update(dt, player);
|
|
1441
|
+
} });
|
|
1442
|
+
} };
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
/**
|
|
1446
|
+
* A declared body boss in the browser (SHARD-PLATFORM SF27; Signal's Dune Matriarch, spawned, and Sky Reach's Storm Roc,
|
|
1447
|
+
* held): its profile through the platform's view-free `bossFight`, the `BossView` over it. A spawned body adds the
|
|
1448
|
+
* presentation row's views (its storm through `bossStorm`, the reward's coin burst from the arena floor, the respawn on
|
|
1449
|
+
* the ground) and its toasts; the view refuses hits while the fight is invulnerable.
|
|
1450
|
+
*/
|
|
1451
|
+
export class RowBossView extends BossView {
|
|
1452
|
+
/** The arena's reward point (a spawned body's spot on the floor; null held). */
|
|
1453
|
+
readonly at: Vector3 | null;
|
|
1454
|
+
/** The storm's strength 0..1 (captures and tests read it). */
|
|
1455
|
+
readonly weather: { storm: number };
|
|
1456
|
+
/** The boss's body while it is up. */
|
|
1457
|
+
readonly body: () => Animal | null;
|
|
1458
|
+
constructor(ctx: ShardContext, rows: RowBossRows, ports: RowBossPorts) {
|
|
1459
|
+
const made = rowBossSpec(ctx, rows, ports);
|
|
1460
|
+
super(ctx, made.spec);
|
|
1461
|
+
this.at = made.at; this.weather = made.weather; this.body = made.spec.body;
|
|
1462
|
+
made.after();
|
|
1463
|
+
}
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
/** Actual owners lent to the same held or spawned presentation interpreter. */
|
|
1467
|
+
export type DeclaredFightPorts = { readonly player: Vector3; readonly flags: Pick<Flags, 'has' | 'set'>;
|
|
1468
|
+
readonly facts: (name: string, actor: string) => unknown; readonly armed: boolean } & ({
|
|
1469
|
+
readonly kind: 'held'; readonly held: Animal | null;
|
|
1470
|
+
readonly record: RowBossRecord; readonly reward: (amount: number, label: string) => void;
|
|
1471
|
+
} | { readonly kind: 'spawned'; readonly source: Shardfile; readonly coins?: RuntimeCoins;
|
|
1472
|
+
readonly body: RuntimeBoss;
|
|
1473
|
+
readonly dress?: (animal: Animal) => void;
|
|
1474
|
+
});
|
|
1475
|
+
/** Bind authored boss presentation at the caller's original phase, on its
|
|
1476
|
+
* population's actual body/controller and original record, flags and reward. */
|
|
1477
|
+
export function bindDeclaredFight(ctx: ShardContext, row: BossViewRows | undefined, ports: DeclaredFightPorts): {
|
|
1478
|
+
boss: RowBossView; summon: () => void;
|
|
1479
|
+
} {
|
|
1480
|
+
if (row === undefined) throw new Error('Missing declared browser fight');
|
|
1481
|
+
const toast = (text: string): void => { ctx.game.runtime?.play?.hud.toast(text); };
|
|
1482
|
+
const victory = (): void => {
|
|
1483
|
+
if (row.victory.once && ports.flags.has(row.victory.flag)) { if (row.victory.again !== undefined) toast(row.victory.again); return; }
|
|
1484
|
+
ports.flags.set(row.victory.flag); ports.facts(row.victory.fact, row.id);
|
|
1485
|
+
if (ports.kind === 'held') ports.reward(row.reward, row.victory.rewardLabel ?? '');
|
|
1486
|
+
};
|
|
1487
|
+
/** A win as a server's row reports it: what `victory` says, and nothing it writes. The win's own flag can reach a page first, so `again` is what stood as the fight began. */
|
|
1488
|
+
let again = ports.flags.has(row.victory.flag);
|
|
1489
|
+
const told = { started: (): void => { again = ports.flags.has(row.victory.flag); }, won: (): void => {
|
|
1490
|
+
if (row.victory.once && again) { if (row.victory.again !== undefined) toast(row.victory.again); return; }
|
|
1491
|
+
again = true;
|
|
1492
|
+
if (ports.kind === 'held') ports.reward(row.reward, row.victory.rewardLabel ?? '');
|
|
1493
|
+
} };
|
|
1494
|
+
let boss: RowBossView, summoned: (() => void) | undefined;
|
|
1495
|
+
const rows = { definition: row.definition, stages: row.stages, profile: row.profile, ...(row.row === undefined ? {} : { row: row.row }) };
|
|
1496
|
+
if (ports.kind === 'held') {
|
|
1497
|
+
boss = new RowBossView(ctx, rows, { player: ports.player, held: ports.held, brain: ports.held === null ? null : { phase: 0, fighting: false, restart: () => undefined }, victory, record: ports.record, ...told });
|
|
1498
|
+
} else {
|
|
1499
|
+
if (row.record === undefined) throw new Error('Spawned presentation requires its declared record');
|
|
1500
|
+
const body = ports.body;
|
|
1501
|
+
const record = bindPageBossRecord(ctx, ports.source, row.record, ports.flags);
|
|
1502
|
+
const presentation = parseMarkedBossPresentation(row.presentation);
|
|
1503
|
+
boss = new RowBossView(ctx, rows, { player: ports.player, body, record: { saved: record.read(), persist: record.write, read: record.read }, presentation,
|
|
1504
|
+
reward: row.reward, coins: ports.coins ?? bindRuntimeCoins(ctx, null), onDown: victory, source: ports.source, ...told });
|
|
1505
|
+
summoned = () => { toast(presentation.toasts.summoned); };
|
|
1506
|
+
}
|
|
1507
|
+
return installBossView(ctx, row.id, boss, ports.armed, summoned);
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
/** TE-ENG3: the dialogue box a data shard's talks open, made in this presentation module. */
|
|
1511
|
+
export function talkBox(scope: Scope): DialogueBox { return new DialogueBox(scope); }
|