diff --git a/.github/CI.md b/.github/CI.md index 1cbbcac7..51441c10 100644 --- a/.github/CI.md +++ b/.github/CI.md @@ -2,13 +2,18 @@ GitHub Actions builds PAL3 and PAL3A with the Unity version in `ProjectSettings/ProjectVersion.txt`. Each variant covers Android, iOS, -macOS, Linux, and 32-bit/64-bit Windows. The workflows run on pushes and pull -requests, and successful desktop/Android builds upload artifacts. +macOS, Linux, and 32-bit/64-bit Windows. The workflows run only on pull requests. +New commits cancel superseded runs for the same pull request and workflow. +Successful desktop/Android builds upload artifacts. Codacy is not part of this repository's CI. Its repository webhook is disabled; there is no Codacy workflow or Codacy-required branch protection check. Re-enabling that external integration would resume its checks independently of these workflows. +The workflows use checkout v7.0.1, cache v6.1.0, and unity-builder v6.0.0. +The builder CLI is pinned to v0.1.73 so its behavior does not change independently +of the workflow. Update and validate this pin together with builder upgrades. + Keep the committed project configured for PAL3. PAL3A workflows switch their own checkout before building. Public builds reject imported private VFX and legacy Toon assets; do not add them or original game data to CI inputs. diff --git a/.github/workflows/build-pal3-mono-android.yml b/.github/workflows/build-pal3-mono-android.yml index aae95106..f5bbd915 100644 --- a/.github/workflows/build-pal3-mono-android.yml +++ b/.github/workflows/build-pal3-mono-android.yml @@ -1,6 +1,10 @@ name: Builds - PAL3 - Mono - Android -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3_mono_android: @@ -21,16 +25,16 @@ jobs: large-packages: true docker-images: true swap-storage: true - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -39,8 +43,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3 versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/build-pal3-mono-ios.yml b/.github/workflows/build-pal3-mono-ios.yml index 573aefb0..101661c5 100644 --- a/.github/workflows/build-pal3-mono-ios.yml +++ b/.github/workflows/build-pal3-mono-ios.yml @@ -1,6 +1,10 @@ name: Builds - PAL3 - Mono - iOS -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3_mono_ios: @@ -12,16 +16,16 @@ jobs: targetPlatform: - iOS # Build an iOS player. steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -30,4 +34,5 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3 versioning: Semantic - # do not upload artifacts for iOS builds \ No newline at end of file + cliVersion: v0.1.73 + # do not upload artifacts for iOS builds diff --git a/.github/workflows/build-pal3-mono-linux.yml b/.github/workflows/build-pal3-mono-linux.yml index cf43f1e0..a5854881 100644 --- a/.github/workflows/build-pal3-mono-linux.yml +++ b/.github/workflows/build-pal3-mono-linux.yml @@ -1,6 +1,10 @@ name: Builds - PAL3 - Mono - Linux -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3_mono_linux: @@ -12,16 +16,16 @@ jobs: targetPlatform: - StandaloneLinux64 # Build a Linux 64-bit standalone. steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -30,8 +34,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3 versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/build-pal3-mono-macos.yml b/.github/workflows/build-pal3-mono-macos.yml index a1cacf1b..9c44def3 100644 --- a/.github/workflows/build-pal3-mono-macos.yml +++ b/.github/workflows/build-pal3-mono-macos.yml @@ -1,6 +1,10 @@ name: Builds - PAL3 - Mono - MacOS -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3_mono_macos: @@ -12,16 +16,16 @@ jobs: targetPlatform: - StandaloneOSX # Build a macOS standalone (Intel 64-bit). steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -30,8 +34,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3 versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/build-pal3-mono-windows.yml b/.github/workflows/build-pal3-mono-windows.yml index 7bf474c4..1c9c107e 100644 --- a/.github/workflows/build-pal3-mono-windows.yml +++ b/.github/workflows/build-pal3-mono-windows.yml @@ -1,6 +1,10 @@ name: Builds - PAL3 - Mono - Windows -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3_mono_windows: @@ -13,16 +17,16 @@ jobs: - StandaloneWindows # Build a Windows standalone. - StandaloneWindows64 # Build a Windows 64-bit standalone. steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -31,8 +35,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3 versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/build-pal3a-mono-android.yml b/.github/workflows/build-pal3a-mono-android.yml index 7be560d9..d96ef963 100644 --- a/.github/workflows/build-pal3a-mono-android.yml +++ b/.github/workflows/build-pal3a-mono-android.yml @@ -1,6 +1,10 @@ name: Builds - PAL3A - Mono - Android -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3a_mono_android: @@ -21,7 +25,7 @@ jobs: large-packages: true docker-images: true swap-storage: true - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true @@ -37,12 +41,12 @@ jobs: find: "6b32649dccc45df4ebe8e3f8eccee249" replace: "d03d417e5660d5849939c8fe43732dbd" include: "**ProjectSettings.asset" - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -52,8 +56,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3A versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3A-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/build-pal3a-mono-ios.yml b/.github/workflows/build-pal3a-mono-ios.yml index e860b3de..0c297dc8 100644 --- a/.github/workflows/build-pal3a-mono-ios.yml +++ b/.github/workflows/build-pal3a-mono-ios.yml @@ -1,6 +1,10 @@ name: Builds - PAL3A - Mono - iOS -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3a_mono_ios: @@ -12,7 +16,7 @@ jobs: targetPlatform: - iOS # Build an iOS player. steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true @@ -28,12 +32,12 @@ jobs: find: "6b32649dccc45df4ebe8e3f8eccee249" replace: "d03d417e5660d5849939c8fe43732dbd" include: "**ProjectSettings.asset" - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -43,4 +47,5 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3A versioning: Semantic - # do not upload artifacts for iOS builds \ No newline at end of file + cliVersion: v0.1.73 + # do not upload artifacts for iOS builds diff --git a/.github/workflows/build-pal3a-mono-linux.yml b/.github/workflows/build-pal3a-mono-linux.yml index a0f3f250..602759e9 100644 --- a/.github/workflows/build-pal3a-mono-linux.yml +++ b/.github/workflows/build-pal3a-mono-linux.yml @@ -1,6 +1,10 @@ name: Builds - PAL3A - Mono - Linux -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3a_mono_linux: @@ -12,7 +16,7 @@ jobs: targetPlatform: - StandaloneLinux64 # Build a Linux 64-bit standalone. steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true @@ -28,12 +32,12 @@ jobs: find: "6b32649dccc45df4ebe8e3f8eccee249" replace: "d03d417e5660d5849939c8fe43732dbd" include: "**ProjectSettings.asset" - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -43,8 +47,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3A versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3A-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/build-pal3a-mono-macos.yml b/.github/workflows/build-pal3a-mono-macos.yml index c8008804..ea9a332e 100644 --- a/.github/workflows/build-pal3a-mono-macos.yml +++ b/.github/workflows/build-pal3a-mono-macos.yml @@ -1,6 +1,10 @@ name: Builds - PAL3A - Mono - MacOS -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3a_mono_macos: @@ -12,7 +16,7 @@ jobs: targetPlatform: - StandaloneOSX # Build a macOS standalone (Intel 64-bit). steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true @@ -28,12 +32,12 @@ jobs: find: "6b32649dccc45df4ebe8e3f8eccee249" replace: "d03d417e5660d5849939c8fe43732dbd" include: "**ProjectSettings.asset" - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -43,8 +47,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3A versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3A-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/.github/workflows/build-pal3a-mono-windows.yml b/.github/workflows/build-pal3a-mono-windows.yml index e8f5caab..d20df774 100644 --- a/.github/workflows/build-pal3a-mono-windows.yml +++ b/.github/workflows/build-pal3a-mono-windows.yml @@ -1,6 +1,10 @@ name: Builds - PAL3A - Mono - Windows -on: [push, pull_request] +on: [pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number }} + cancel-in-progress: true jobs: build_pal3a_mono_windows: @@ -13,7 +17,7 @@ jobs: - StandaloneWindows # Build a Windows standalone. - StandaloneWindows64 # Build a Windows 64-bit standalone. steps: - - uses: actions/checkout@v6.0.3 + - uses: actions/checkout@v7.0.1 with: fetch-depth: 0 lfs: true @@ -29,12 +33,12 @@ jobs: find: "6b32649dccc45df4ebe8e3f8eccee249" replace: "d03d417e5660d5849939c8fe43732dbd" include: "**ProjectSettings.asset" - - uses: actions/cache@v5.0.5 + - uses: actions/cache@v6.1.0 with: path: Library key: Library-${{ matrix.targetPlatform }} restore-keys: Library- - - uses: game-ci/unity-builder@v5 + - uses: game-ci/unity-builder@v6.0.0 env: UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }} UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }} @@ -44,8 +48,9 @@ jobs: targetPlatform: ${{ matrix.targetPlatform }} buildName: PAL3A versioning: Semantic + cliVersion: v0.1.73 - uses: actions/upload-artifact@v7.0.1 with: name: PAL3A-Mono-${{ matrix.targetPlatform }} path: build/${{ matrix.targetPlatform }} - retention-days: 14 \ No newline at end of file + retention-days: 14 diff --git a/Assets/Rendering/ScreenEffects/Pal3PostEffectDistortion.shader b/Assets/Rendering/ScreenEffects/Pal3PostEffectDistortion.shader index a223d3b2..e51594c3 100644 --- a/Assets/Rendering/ScreenEffects/Pal3PostEffectDistortion.shader +++ b/Assets/Rendering/ScreenEffects/Pal3PostEffectDistortion.shader @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ /* reference: https://www.shadertoy.com/view/MsKXDh diff --git a/Assets/Rendering/ScreenEffects/Pal3RoundedFrostedGlass.shader b/Assets/Rendering/ScreenEffects/Pal3RoundedFrostedGlass.shader index 182d6969..5a3cfe38 100644 --- a/Assets/Rendering/ScreenEffects/Pal3RoundedFrostedGlass.shader +++ b/Assets/Rendering/ScreenEffects/Pal3RoundedFrostedGlass.shader @@ -1,7 +1,8 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ + // Based on cician's shader from https://forum.unity3d.com/threads/simple-optimized-blur-shader.185327/#post-1267642 // Based on RoundedCorners.shader from https://github.com/kirevdokimov/Unity-UI-Rounded-Corners // with some modifications diff --git a/Assets/Rendering/ScreenEffects/Pal3Snow.shader b/Assets/Rendering/ScreenEffects/Pal3Snow.shader index a0a94c3a..033656e1 100644 --- a/Assets/Rendering/ScreenEffects/Pal3Snow.shader +++ b/Assets/Rendering/ScreenEffects/Pal3Snow.shader @@ -1,7 +1,8 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ + // Based on https://www.shadertoy.com/view/4dl3R4 Shader "Pal3/Snow" diff --git a/Assets/Rendering/Toon/Pal3ToonDepth.hlsl b/Assets/Rendering/Toon/Pal3ToonDepth.hlsl index 9ce9c6c0..d68bcc6d 100644 --- a/Assets/Rendering/Toon/Pal3ToonDepth.hlsl +++ b/Assets/Rendering/Toon/Pal3ToonDepth.hlsl @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ #include "Pal3ToonInput.hlsl" diff --git a/Assets/Rendering/Toon/Pal3ToonForward.hlsl b/Assets/Rendering/Toon/Pal3ToonForward.hlsl index 5c64d962..fe8d71df 100644 --- a/Assets/Rendering/Toon/Pal3ToonForward.hlsl +++ b/Assets/Rendering/Toon/Pal3ToonForward.hlsl @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ #include "Pal3ToonInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Lighting.hlsl" diff --git a/Assets/Rendering/Toon/Pal3ToonInput.hlsl b/Assets/Rendering/Toon/Pal3ToonInput.hlsl index 53251f93..02c60dd3 100644 --- a/Assets/Rendering/Toon/Pal3ToonInput.hlsl +++ b/Assets/Rendering/Toon/Pal3ToonInput.hlsl @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ #ifndef PAL3_TOON_INPUT_INCLUDED #define PAL3_TOON_INPUT_INCLUDED diff --git a/Assets/Rendering/Toon/Pal3ToonShadow.hlsl b/Assets/Rendering/Toon/Pal3ToonShadow.hlsl index 5370b000..726a0476 100644 --- a/Assets/Rendering/Toon/Pal3ToonShadow.hlsl +++ b/Assets/Rendering/Toon/Pal3ToonShadow.hlsl @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ #include "Pal3ToonInput.hlsl" #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Shadows.hlsl" diff --git a/Assets/Rendering/Toon/Resources/Pal3ToonCutout.shader b/Assets/Rendering/Toon/Resources/Pal3ToonCutout.shader index 51f517ce..011e210e 100644 --- a/Assets/Rendering/Toon/Resources/Pal3ToonCutout.shader +++ b/Assets/Rendering/Toon/Resources/Pal3ToonCutout.shader @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ Shader "Pal3/ToonCutout" { diff --git a/Assets/Rendering/Toon/Resources/Pal3ToonOpaque.shader b/Assets/Rendering/Toon/Resources/Pal3ToonOpaque.shader index 2c9c2f4e..b596454f 100644 --- a/Assets/Rendering/Toon/Resources/Pal3ToonOpaque.shader +++ b/Assets/Rendering/Toon/Resources/Pal3ToonOpaque.shader @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ Shader "Pal3/ToonOpaque" { diff --git a/Assets/Rendering/Toon/Resources/Pal3ToonTransparent.shader b/Assets/Rendering/Toon/Resources/Pal3ToonTransparent.shader index 5dbcd5e4..714198ba 100644 --- a/Assets/Rendering/Toon/Resources/Pal3ToonTransparent.shader +++ b/Assets/Rendering/Toon/Resources/Pal3ToonTransparent.shader @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ Shader "Pal3/ToonTransparent" { diff --git a/Assets/Rendering/Toon/Resources/Pal3ToonWater.shader b/Assets/Rendering/Toon/Resources/Pal3ToonWater.shader index 33d08c1f..520851b7 100644 --- a/Assets/Rendering/Toon/Resources/Pal3ToonWater.shader +++ b/Assets/Rendering/Toon/Resources/Pal3ToonWater.shader @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ Shader "Pal3/ToonWater" { diff --git a/Assets/Resources/Shaders/Pal3Dev.shader b/Assets/Resources/Shaders/Pal3Dev.shader index 43e4f9bd..758d8884 100644 --- a/Assets/Resources/Shaders/Pal3Dev.shader +++ b/Assets/Resources/Shaders/Pal3Dev.shader @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ Shader "Pal3/Dev" { diff --git a/Assets/Resources/Shaders/Pal3Opaque.shader b/Assets/Resources/Shaders/Pal3Opaque.shader index 3b0577c3..8f93cb50 100644 --- a/Assets/Resources/Shaders/Pal3Opaque.shader +++ b/Assets/Resources/Shaders/Pal3Opaque.shader @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ Shader "Pal3/Opaque" { diff --git a/Assets/Resources/Shaders/Pal3Sprite.shader b/Assets/Resources/Shaders/Pal3Sprite.shader index 3f9c1a32..4ce72b5c 100644 --- a/Assets/Resources/Shaders/Pal3Sprite.shader +++ b/Assets/Resources/Shaders/Pal3Sprite.shader @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ Shader "Pal3/Sprite" { diff --git a/Assets/Resources/Shaders/Pal3Transparent.shader b/Assets/Resources/Shaders/Pal3Transparent.shader index 26e90830..bd23a296 100644 --- a/Assets/Resources/Shaders/Pal3Transparent.shader +++ b/Assets/Resources/Shaders/Pal3Transparent.shader @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ Shader "Pal3/Transparent" { diff --git a/Assets/Resources/Shaders/Pal3TransparentOpaquePart.shader b/Assets/Resources/Shaders/Pal3TransparentOpaquePart.shader index d87ea1ce..b139c3f7 100644 --- a/Assets/Resources/Shaders/Pal3TransparentOpaquePart.shader +++ b/Assets/Resources/Shaders/Pal3TransparentOpaquePart.shader @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ Shader "Pal3/TransparentOpaquePart" { diff --git a/Assets/Resources/Shaders/Pal3Water.shader b/Assets/Resources/Shaders/Pal3Water.shader index d9ed7184..1cee8603 100644 --- a/Assets/Resources/Shaders/Pal3Water.shader +++ b/Assets/Resources/Shaders/Pal3Water.shader @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ Shader "Pal3/Water" { diff --git a/Assets/Resources/Shaders/SkyboxEffect.shader b/Assets/Resources/Shaders/SkyboxEffect.shader new file mode 100644 index 00000000..6935e793 --- /dev/null +++ b/Assets/Resources/Shaders/SkyboxEffect.shader @@ -0,0 +1,42 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +Shader "Pal3/SkyboxEffect" +{ + Properties { _MainTex ("Sequence frame", 2D) = "black" {} } + SubShader + { + Tags { "RenderPipeline"="UniversalPipeline" "Queue"="Transparent-10" "RenderType"="Transparent" } + Pass + { + Blend SrcAlpha One + ZWrite Off + Cull Off + HLSLPROGRAM + #pragma vertex vert + #pragma fragment frag + #include "Packages/com.unity.render-pipelines.universal/ShaderLibrary/Core.hlsl" + TEXTURE2D(_MainTex); SAMPLER(sampler_MainTex); + struct Attributes { float4 positionOS : POSITION; float2 uv : TEXCOORD0; }; + struct Varyings { float4 positionCS : SV_POSITION; float2 uv : TEXCOORD0; }; + Varyings vert(Attributes input) + { + Varyings output; + output.positionCS = TransformObjectToHClip(input.positionOS.xyz); + // Sky effects must remain behind all scene geometry, including + // mountains farther away than the effect cube's actual mesh. + #if UNITY_REVERSED_Z + output.positionCS.z = 0.0; + #else + output.positionCS.z = output.positionCS.w; + #endif + output.uv = input.uv; + return output; + } + half4 frag(Varyings input) : SV_Target { return SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, input.uv); } + ENDHLSL + } + } +} diff --git a/Assets/Resources/Shaders/SkyboxEffect.shader.meta b/Assets/Resources/Shaders/SkyboxEffect.shader.meta new file mode 100644 index 00000000..4ddf31aa --- /dev/null +++ b/Assets/Resources/Shaders/SkyboxEffect.shader.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 0d3ce4f585ff416caf911181f6f5dd56 diff --git a/Assets/Scripts/Build/Editor/EnableFileSharingPostBuildProcessor.cs b/Assets/Scripts/Build/Editor/EnableFileSharingPostBuildProcessor.cs index c5ac9768..2f3658bf 100644 --- a/Assets/Scripts/Build/Editor/EnableFileSharingPostBuildProcessor.cs +++ b/Assets/Scripts/Build/Editor/EnableFileSharingPostBuildProcessor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if UNITY_EDITOR_OSX && UNITY_IOS diff --git a/Assets/Scripts/Build/Editor/SetDisplaySafeAreaCompatibilityModeProcessor.cs b/Assets/Scripts/Build/Editor/SetDisplaySafeAreaCompatibilityModeProcessor.cs index b1d56b16..a5421597 100644 --- a/Assets/Scripts/Build/Editor/SetDisplaySafeAreaCompatibilityModeProcessor.cs +++ b/Assets/Scripts/Build/Editor/SetDisplaySafeAreaCompatibilityModeProcessor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if UNITY_EDITOR_OSX && UNITY_STANDALONE_OSX diff --git a/Assets/Scripts/Editor/GameVariantSwitcher.cs b/Assets/Scripts/Editor/GameVariantSwitcher.cs index f546eb11..bfbde8f0 100644 --- a/Assets/Scripts/Editor/GameVariantSwitcher.cs +++ b/Assets/Scripts/Editor/GameVariantSwitcher.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor { diff --git a/Assets/Scripts/Editor/PrivateAssetBuildGuard.cs b/Assets/Scripts/Editor/PrivateAssetBuildGuard.cs index e2c5c5cd..7d69698e 100644 --- a/Assets/Scripts/Editor/PrivateAssetBuildGuard.cs +++ b/Assets/Scripts/Editor/PrivateAssetBuildGuard.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor { diff --git a/Assets/Scripts/Editor/ReleaseBuildPipeline.cs b/Assets/Scripts/Editor/ReleaseBuildPipeline.cs index 9f048948..fe9b62a7 100644 --- a/Assets/Scripts/Editor/ReleaseBuildPipeline.cs +++ b/Assets/Scripts/Editor/ReleaseBuildPipeline.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor { diff --git a/Assets/Scripts/Editor/RuntimePipelineAssetSaveGuard.cs b/Assets/Scripts/Editor/RuntimePipelineAssetSaveGuard.cs index 0a69f718..874d5c70 100644 --- a/Assets/Scripts/Editor/RuntimePipelineAssetSaveGuard.cs +++ b/Assets/Scripts/Editor/RuntimePipelineAssetSaveGuard.cs @@ -1,4 +1,7 @@ -// See LICENSE in the project root. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ namespace Editor { diff --git a/Assets/Scripts/Editor/SourceGenerator/Base/CodeWriter.cs b/Assets/Scripts/Editor/SourceGenerator/Base/CodeWriter.cs index 20c4a73a..68c0edd7 100644 --- a/Assets/Scripts/Editor/SourceGenerator/Base/CodeWriter.cs +++ b/Assets/Scripts/Editor/SourceGenerator/Base/CodeWriter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor.SourceGenerator.Base { diff --git a/Assets/Scripts/Editor/SourceGenerator/Base/ISourceGenerator.cs b/Assets/Scripts/Editor/SourceGenerator/Base/ISourceGenerator.cs index 4d6f7c96..26cf707a 100644 --- a/Assets/Scripts/Editor/SourceGenerator/Base/ISourceGenerator.cs +++ b/Assets/Scripts/Editor/SourceGenerator/Base/ISourceGenerator.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor.SourceGenerator.Base { diff --git a/Assets/Scripts/Editor/SourceGenerator/Base/Utility.cs b/Assets/Scripts/Editor/SourceGenerator/Base/Utility.cs index 939bc337..26b9af34 100644 --- a/Assets/Scripts/Editor/SourceGenerator/Base/Utility.cs +++ b/Assets/Scripts/Editor/SourceGenerator/Base/Utility.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor.SourceGenerator.Base { diff --git a/Assets/Scripts/Editor/SourceGenerator/ConsoleCommandsAutoGen.cs b/Assets/Scripts/Editor/SourceGenerator/ConsoleCommandsAutoGen.cs index 1960f188..2140c101 100644 --- a/Assets/Scripts/Editor/SourceGenerator/ConsoleCommandsAutoGen.cs +++ b/Assets/Scripts/Editor/SourceGenerator/ConsoleCommandsAutoGen.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor.SourceGenerator { @@ -24,11 +24,11 @@ public class ConsoleCommandsAutoGen : ISourceGenerator public void GenerateSourceClass(CodeWriter writer, string className, string nameSpace) { // Header. - writer.WriteLine("// ---------------------------------------------------------------------------------------------"); + writer.WriteLine("// ------------------------------------------------------------------------"); writer.WriteLine("// "); writer.WriteLine($"// This code was auto-generated by {GetType().Name}"); writer.WriteLine("// "); - writer.WriteLine("// ---------------------------------------------------------------------------------------------"); + writer.WriteLine("// ------------------------------------------------------------------------"); writer.WriteLine(); // Begin namespace. diff --git a/Assets/Scripts/Editor/SourceGeneratorEditorOptions.cs b/Assets/Scripts/Editor/SourceGeneratorEditorOptions.cs index 4881c5a0..f9161512 100644 --- a/Assets/Scripts/Editor/SourceGeneratorEditorOptions.cs +++ b/Assets/Scripts/Editor/SourceGeneratorEditorOptions.cs @@ -1,12 +1,14 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor { + using System; using System.IO; using System.Text; + using System.Text.RegularExpressions; using Pal3.Core.Command; using SourceGenerator; using SourceGenerator.Base; @@ -39,6 +41,18 @@ public static void GenerateConsoleCommands() GenerateSourceInternal(OutputFileName, writePath, ClassName, NameSpace, sourceGenerator, true); } + private static string CopyrightHeader(string writePath) + { + int currentYear = DateTime.Now.Year; + Match previous = Regex.Match(File.Exists(writePath) ? File.ReadAllText(writePath) : string.Empty, + @"Copyright \(c\) (?\d{4})"); + int firstYear = previous.Success ? int.Parse(previous.Groups["first"].Value) : currentYear; + string years = firstYear == currentYear ? $"{currentYear}" : $"{firstYear}-{currentYear}"; + const string separator = "// ------------------------------------------------------------------------"; + return $"{separator}\n// Copyright (c) {years}, Jiaqi (0x7c13) Liu. All rights reserved.\n" + + $"// See LICENSE file in the project root for license information.\n{separator}\n\n"; + } + private static void GenerateSourceInternal(string fileName, string writePath, string className, @@ -63,7 +77,7 @@ private static void GenerateSourceInternal(string fileName, sourceGenerator.GenerateSourceClass(writer, className, nameSpace); // Final output string - string output = $"#if {GAME_VARIANT_SYMBOL}\n\n{writer.Buffer}\n#endif"; + string output = CopyrightHeader(writePath) + $"#if {GAME_VARIANT_SYMBOL}\n\n{writer.Buffer}\n#endif"; // Write to file using StreamWriter sw = new(writePath); diff --git a/Assets/Scripts/Editor/SymbolsHelper.cs b/Assets/Scripts/Editor/SymbolsHelper.cs index 4138e587..6fdaf508 100644 --- a/Assets/Scripts/Editor/SymbolsHelper.cs +++ b/Assets/Scripts/Editor/SymbolsHelper.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Editor { diff --git a/Assets/Scripts/Engine/Animation/CoreAnimation.cs b/Assets/Scripts/Engine/Animation/CoreAnimation.cs index c9a7c504..b6331739 100644 --- a/Assets/Scripts/Engine/Animation/CoreAnimation.cs +++ b/Assets/Scripts/Engine/Animation/CoreAnimation.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Animation { diff --git a/Assets/Scripts/Engine/Core/Abstraction/IGameEntity.cs b/Assets/Scripts/Engine/Core/Abstraction/IGameEntity.cs index 6bea0208..fee1d7ea 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/IGameEntity.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/IGameEntity.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/IManagedObject.cs b/Assets/Scripts/Engine/Core/Abstraction/IManagedObject.cs index 3ee1451d..b6535daf 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/IManagedObject.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/IManagedObject.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/IMaterial.cs b/Assets/Scripts/Engine/Core/Abstraction/IMaterial.cs index 3d998e1b..fdeca05a 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/IMaterial.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/IMaterial.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/IMaterialFactory.cs b/Assets/Scripts/Engine/Core/Abstraction/IMaterialFactory.cs index 61123e1a..f179aed0 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/IMaterialFactory.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/IMaterialFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/ISprite.cs b/Assets/Scripts/Engine/Core/Abstraction/ISprite.cs index 473d81c4..45f00f4f 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/ISprite.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/ISprite.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITexture2D.cs b/Assets/Scripts/Engine/Core/Abstraction/ITexture2D.cs index 3180e1ea..256c5f95 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/ITexture2D.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/ITexture2D.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITextureDataSource.cs b/Assets/Scripts/Engine/Core/Abstraction/ITextureDataSource.cs new file mode 100644 index 00000000..040559fa --- /dev/null +++ b/Assets/Scripts/Engine/Core/Abstraction/ITextureDataSource.cs @@ -0,0 +1,43 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Engine.Core.Abstraction +{ + using System; + + public enum TextureDataFormat + { + Rgba32, + Bc1, + Bc2, + } + + /// + /// Texture pixels and mip layout, independent of a file container or graphics API. + /// The caller owns this source and disposes it after synchronous texture creation. + /// Upload buffers must remain unchanged until then and may be pooled. + /// + public interface ITextureDataSource : IDisposable + { + int Width { get; } + int Height { get; } + int MipCount { get; } + TextureDataFormat Format { get; } + /// Conservative indication that alpha coverage must be preserved. + bool HasTransparency { get; } + + /// Borrow one tightly packed mip in Format encoding; do not modify its data. + ArraySegment GetMipData(int mip); + + /// Copy or decode one mip to RGBA32 in a caller-owned buffer. + void CopyMipToRgba32(int mip, byte[] destination); + + /// + /// Create a reader whose backing data remains valid after this source is disposed. + /// The texture retains the reader until Destroy; owned immutable data may be shared. + /// + ITexturePixelReader CreatePixelReader(); + } +} diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITextureDataSource.cs.meta b/Assets/Scripts/Engine/Core/Abstraction/ITextureDataSource.cs.meta new file mode 100644 index 00000000..96227ada --- /dev/null +++ b/Assets/Scripts/Engine/Core/Abstraction/ITextureDataSource.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 336875a34c8a40fdb3e81bea05b5db7f diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITextureFactory.cs b/Assets/Scripts/Engine/Core/Abstraction/ITextureFactory.cs index dd2cae7e..9fdd7cb1 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/ITextureFactory.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/ITextureFactory.cs @@ -1,29 +1,31 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { - /// - /// Interface for a texture factory that creates textures. - /// + /// Creates graphics textures from CPU-side pixel data. public interface ITextureFactory { - /// - /// Creates a new texture with the specified width, height, and RGBA data. - /// - /// The width of the texture. - /// The height of the texture. - /// The RGBA32 data of the texture to be read from. - /// Size should be greater than or equal to width * height * 4. - /// The created texture. - public ITexture2D CreateTexture(int width, int height, byte[] rgba32DataBuffer); + /// Create a readable, base-only RGBA32 texture from a borrowed buffer. + /// Positive texture width in pixels. + /// Positive texture height in pixels. + /// At least width * height * 4 bytes in RGBA order. + /// The caller may reuse the buffer after this call returns. + /// The created texture, owned by the caller. + ITexture2D CreateTexture(int width, int height, byte[] rgba32DataBuffer); /// - /// Creates a new white texture. + /// Synchronously upload a format-neutral data source using resolved creation options. + /// The caller still owns the source and may dispose it after this call returns. /// - /// The created texture. - public ITexture2D CreateWhiteTexture(); + /// Borrowed pixel data and mip layout; remains caller-owned. + /// Resolved mip, compression and CPU-readability requirements. + /// The created texture, which retains any required independent pixel reader. + ITexture2D CreateTexture(ITextureDataSource source, TextureCreateOptions options); + + /// Create a new white texture. + ITexture2D CreateWhiteTexture(); } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITextureLoader.cs b/Assets/Scripts/Engine/Core/Abstraction/ITextureLoader.cs index 5c75b00f..cfd3fd34 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/ITextureLoader.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/ITextureLoader.cs @@ -1,31 +1,19 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { - /// - /// Texture loader and ITexture2D creator interface. - /// The reason we have a separate Load method interface is because - /// uploading texture to GPU is single threaded (upload texture to VRAM), - /// while the loading and decoding part can run in parallel and it should - /// be thread-safe in general. This two-step approach gives caller - /// more flexibility. - /// + /// Decode a file into CPU-side data without creating graphics objects. public interface ITextureLoader { /// - /// Load and decode texture data. + /// Load texture data. The caller disposes the returned source after uploading it. + /// This operation may run off the graphics thread; loaders hold no per-image state. /// - /// Raw texture data in byte array - /// True if texture has alpha channel - public void Load(byte[] data, out bool hasAlphaChannel); - - /// - /// Convert loaded data into ITexture2D instance. - /// - /// ITexture2D instance - public ITexture2D ToTexture(); + /// Owned file bytes, which must not be modified after loading. + /// Legacy material classification, independent of sampling policy. + ITextureDataSource Load(byte[] data, out bool hasAlphaChannel); } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITexturePixelReader.cs b/Assets/Scripts/Engine/Core/Abstraction/ITexturePixelReader.cs new file mode 100644 index 00000000..812fc7d6 --- /dev/null +++ b/Assets/Scripts/Engine/Core/Abstraction/ITexturePixelReader.cs @@ -0,0 +1,14 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Engine.Core.Abstraction +{ + /// Owned, immutable CPU pixel data, independent of upload-buffer lifetime. + public interface ITexturePixelReader + { + /// Read an in-bounds base-level pixel in RGBA byte order. + (byte r, byte g, byte b, byte a) GetPixel(int x, int y); + } +} diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITexturePixelReader.cs.meta b/Assets/Scripts/Engine/Core/Abstraction/ITexturePixelReader.cs.meta new file mode 100644 index 00000000..661f2622 --- /dev/null +++ b/Assets/Scripts/Engine/Core/Abstraction/ITexturePixelReader.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: c24ebc56cb2a45bca760e20bded1ab02 diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITextureResourceProvider.cs b/Assets/Scripts/Engine/Core/Abstraction/ITextureResourceProvider.cs index e79cc3cc..74cccd3e 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/ITextureResourceProvider.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/ITextureResourceProvider.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/ITransform.cs b/Assets/Scripts/Engine/Core/Abstraction/ITransform.cs index 56ada004..0f8c6e7c 100644 --- a/Assets/Scripts/Engine/Core/Abstraction/ITransform.cs +++ b/Assets/Scripts/Engine/Core/Abstraction/ITransform.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Abstraction { diff --git a/Assets/Scripts/Engine/Core/Abstraction/TextureCreateOptions.cs b/Assets/Scripts/Engine/Core/Abstraction/TextureCreateOptions.cs new file mode 100644 index 00000000..7f83adad --- /dev/null +++ b/Assets/Scripts/Engine/Core/Abstraction/TextureCreateOptions.cs @@ -0,0 +1,32 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Engine.Core.Abstraction +{ + public enum TextureMipMode + { + BaseOnly, + Preserve, + GenerateIfMissing, + } + + /// Resolved creation requirements; contains no game-specific sampling policy. + public readonly struct TextureCreateOptions + { + public TextureMipMode Mipmaps { get; } + public bool PreferNativeCompression { get; } + public bool KeepCpuReadable { get; } + + public TextureCreateOptions(TextureMipMode mipmaps, bool preferNativeCompression, bool keepCpuReadable) + { + Mipmaps = mipmaps; + PreferNativeCompression = preferNativeCompression; + KeepCpuReadable = keepCpuReadable; + } + + public static TextureCreateOptions Readable => new(TextureMipMode.BaseOnly, + preferNativeCompression: false, keepCpuReadable: true); + } +} diff --git a/Assets/Scripts/Engine/Core/Abstraction/TextureCreateOptions.cs.meta b/Assets/Scripts/Engine/Core/Abstraction/TextureCreateOptions.cs.meta new file mode 100644 index 00000000..ef517ed0 --- /dev/null +++ b/Assets/Scripts/Engine/Core/Abstraction/TextureCreateOptions.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: e86d1e0ca8f948be888eb88254554127 diff --git a/Assets/Scripts/Engine/Core/Implementation/GameEntity.cs b/Assets/Scripts/Engine/Core/Implementation/GameEntity.cs index 7481f46c..7d82a891 100644 --- a/Assets/Scripts/Engine/Core/Implementation/GameEntity.cs +++ b/Assets/Scripts/Engine/Core/Implementation/GameEntity.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Core/Implementation/GameEntityFactory.cs b/Assets/Scripts/Engine/Core/Implementation/GameEntityFactory.cs index 78a3b57e..370cf7ab 100644 --- a/Assets/Scripts/Engine/Core/Implementation/GameEntityFactory.cs +++ b/Assets/Scripts/Engine/Core/Implementation/GameEntityFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Core/Implementation/GameEntityScript.cs b/Assets/Scripts/Engine/Core/Implementation/GameEntityScript.cs index 3999437b..a95fb3fe 100644 --- a/Assets/Scripts/Engine/Core/Implementation/GameEntityScript.cs +++ b/Assets/Scripts/Engine/Core/Implementation/GameEntityScript.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Core/Implementation/Rgba32TextureDataSource.cs b/Assets/Scripts/Engine/Core/Implementation/Rgba32TextureDataSource.cs new file mode 100644 index 00000000..c26d8cf3 --- /dev/null +++ b/Assets/Scripts/Engine/Core/Implementation/Rgba32TextureDataSource.cs @@ -0,0 +1,96 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Engine.Core.Implementation +{ + using System; + using System.Buffers; + using Abstraction; + + /// A base-level RGBA32 upload buffer, optionally owned by the shared array pool. + public sealed class Rgba32TextureDataSource : ITextureDataSource + { + public int Width { get; } + public int Height { get; } + public int MipCount => 1; + public TextureDataFormat Format => TextureDataFormat.Rgba32; + public bool HasTransparency { get; } + + private byte[] _data; + private readonly int _length; + private readonly bool _returnToPool; + + /// Borrow a buffer; the caller must keep it unchanged until upload completes. + public Rgba32TextureDataSource(int width, int height, byte[] data, bool hasTransparency = true) + : this(width, height, data, hasTransparency, returnToPool: false) { } + + private Rgba32TextureDataSource(int width, int height, byte[] data, + bool hasTransparency, bool returnToPool) + { + if (width <= 0 || height <= 0) throw new ArgumentOutOfRangeException(nameof(width)); + _length = checked(width * height * 4); + if (data == null || data.Length < _length) throw new ArgumentException("Incomplete RGBA32 data", nameof(data)); + Width = width; + Height = height; + HasTransparency = hasTransparency; + _data = data; + _returnToPool = returnToPool; + } + + /// Transfer a rented buffer to this source, which returns it on Dispose. + internal static Rgba32TextureDataSource TakePooledBuffer(int width, int height, byte[] data, + bool hasTransparency) => new(width, height, data, hasTransparency, returnToPool: true); + + public ArraySegment GetMipData(int mip) + { + if (mip != 0) throw new ArgumentOutOfRangeException(nameof(mip)); + if (_data == null) throw new ObjectDisposedException(nameof(Rgba32TextureDataSource)); + return new ArraySegment(_data, 0, _length); + } + + public void CopyMipToRgba32(int mip, byte[] destination) + { + var data = GetMipData(mip); + Buffer.BlockCopy(data.Array, data.Offset, destination, 0, data.Count); + } + + public ITexturePixelReader CreatePixelReader() + { + var data = GetMipData(0); + var ownedPixels = new byte[data.Count]; + Buffer.BlockCopy(data.Array, data.Offset, ownedPixels, 0, data.Count); + return new PixelReader(Width, Height, ownedPixels); + } + + public void Dispose() + { + if (_data == null) return; + if (_returnToPool) ArrayPool.Shared.Return(_data); + _data = null; + } + + private sealed class PixelReader : ITexturePixelReader + { + private readonly int _width; + private readonly int _height; + private readonly byte[] _pixels; + + public PixelReader(int width, int height, byte[] pixels) + { + _width = width; + _height = height; + _pixels = pixels; + } + + public (byte r, byte g, byte b, byte a) GetPixel(int x, int y) + { + if ((uint)x >= (uint)_width || (uint)y >= (uint)_height) + throw new ArgumentOutOfRangeException(nameof(x)); + int offset = (y * _width + x) * 4; + return (_pixels[offset], _pixels[offset + 1], _pixels[offset + 2], _pixels[offset + 3]); + } + } + } +} diff --git a/Assets/Scripts/Engine/Core/Implementation/Rgba32TextureDataSource.cs.meta b/Assets/Scripts/Engine/Core/Implementation/Rgba32TextureDataSource.cs.meta new file mode 100644 index 00000000..07b3bbdf --- /dev/null +++ b/Assets/Scripts/Engine/Core/Implementation/Rgba32TextureDataSource.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: fc5fd6d3991f4cc29604a6fc6303fe36 diff --git a/Assets/Scripts/Engine/Core/Implementation/TickableGameEntityScript.cs b/Assets/Scripts/Engine/Core/Implementation/TickableGameEntityScript.cs index 297560a8..3c1c7ced 100644 --- a/Assets/Scripts/Engine/Core/Implementation/TickableGameEntityScript.cs +++ b/Assets/Scripts/Engine/Core/Implementation/TickableGameEntityScript.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Core/Implementation/UnityMaterial.cs b/Assets/Scripts/Engine/Core/Implementation/UnityMaterial.cs index 6e41b83a..e12d6378 100644 --- a/Assets/Scripts/Engine/Core/Implementation/UnityMaterial.cs +++ b/Assets/Scripts/Engine/Core/Implementation/UnityMaterial.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Core/Implementation/UnityMaterialFactory.cs b/Assets/Scripts/Engine/Core/Implementation/UnityMaterialFactory.cs index 7b9635ee..b3748b73 100644 --- a/Assets/Scripts/Engine/Core/Implementation/UnityMaterialFactory.cs +++ b/Assets/Scripts/Engine/Core/Implementation/UnityMaterialFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Core/Implementation/UnitySprite.cs b/Assets/Scripts/Engine/Core/Implementation/UnitySprite.cs index 5190a427..597e4d2e 100644 --- a/Assets/Scripts/Engine/Core/Implementation/UnitySprite.cs +++ b/Assets/Scripts/Engine/Core/Implementation/UnitySprite.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Core/Implementation/UnityTexture2D.cs b/Assets/Scripts/Engine/Core/Implementation/UnityTexture2D.cs index 6cdeb84b..e9001e49 100644 --- a/Assets/Scripts/Engine/Core/Implementation/UnityTexture2D.cs +++ b/Assets/Scripts/Engine/Core/Implementation/UnityTexture2D.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { @@ -16,10 +16,12 @@ public sealed class UnityTexture2D : ITexture2D public bool IsNativeObjectDisposed => _texture2D == null; private Texture2D _texture2D; + private ITexturePixelReader _pixelReader; - public UnityTexture2D(Texture2D texture2D) + public UnityTexture2D(Texture2D texture2D, ITexturePixelReader pixelReader = null) { _texture2D = texture2D; + _pixelReader = pixelReader; } public int Width => _texture2D.width; @@ -38,6 +40,15 @@ public void SetWrapMode(Abstraction.WrapMode wrapMode) public (float r, float g, float b, float a) GetPixel(int x, int y) { + if (_pixelReader != null) + { + x = _texture2D.wrapMode == TextureWrapMode.Clamp + ? Mathf.Clamp(x, 0, Width - 1) : (x % Width + Width) % Width; + y = _texture2D.wrapMode == TextureWrapMode.Clamp + ? Mathf.Clamp(y, 0, Height - 1) : (y % Height + Height) % Height; + var rgba = _pixelReader.GetPixel(x, y); + return (rgba.r / 255f, rgba.g / 255f, rgba.b / 255f, rgba.a / 255f); + } Color pixel = _texture2D.GetPixel(x, y); return (pixel.r, pixel.g, pixel.b, pixel.a); } @@ -64,6 +75,7 @@ public void Destroy() } _texture2D = null; + _pixelReader = null; } } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Engine/Core/Implementation/UnityTextureFactory.cs b/Assets/Scripts/Engine/Core/Implementation/UnityTextureFactory.cs index b33897ec..5fcab665 100644 --- a/Assets/Scripts/Engine/Core/Implementation/UnityTextureFactory.cs +++ b/Assets/Scripts/Engine/Core/Implementation/UnityTextureFactory.cs @@ -1,29 +1,94 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { using System; + using System.Buffers; using Abstraction; using UnityEngine; + using UnityEngine.Experimental.Rendering; public sealed class UnityTextureFactory : ITextureFactory { public ITexture2D CreateTexture(int width, int height, byte[] rgba32DataBuffer) { - if (rgba32DataBuffer.Length < width * height * 4) + using var source = new Rgba32TextureDataSource(width, height, rgba32DataBuffer); + return CreateTexture(source, TextureCreateOptions.Readable); + } + + public ITexture2D CreateTexture(ITextureDataSource source, TextureCreateOptions options) + { + if (source == null) throw new ArgumentNullException(nameof(source)); + int mipCount = options.Mipmaps switch + { + TextureMipMode.BaseOnly => 1, + TextureMipMode.Preserve or TextureMipMode.GenerateIfMissing => source.MipCount, + _ => throw new ArgumentOutOfRangeException(nameof(options)), + }; + bool generateMips = options.Mipmaps == TextureMipMode.GenerateIfMissing && mipCount == 1; + GraphicsFormat format = source.Format switch { - throw new ArgumentException("rgba32DataBuffer.Length < width * height * 4"); + TextureDataFormat.Rgba32 => GraphicsFormat.R8G8B8A8_SRGB, + TextureDataFormat.Bc1 => GraphicsFormat.RGBA_DXT1_SRGB, + TextureDataFormat.Bc2 => GraphicsFormat.RGBA_DXT3_SRGB, + _ => throw new NotSupportedException($"Unsupported texture data format: {source.Format}"), + }; + Texture2D texture = null; + try + { + // Native blocks cannot synthesize missing mips or serve readable sprite pixels. + bool uploadCompressed = source.Format != TextureDataFormat.Rgba32 && + options.PreferNativeCompression && !options.KeepCpuReadable && !generateMips && + source.Width % 4 == 0 && source.Height % 4 == 0 && + SystemInfo.IsFormatSupported(format, GraphicsFormatUsage.Sample); + if (uploadCompressed) + { + texture = new Texture2D(source.Width, source.Height, format, mipCount, TextureCreationFlags.None); + for (int mip = 0; mip < mipCount; mip++) + { + var data = source.GetMipData(mip); + texture.SetPixelData(data.Array, mip, data.Offset); + } + texture.Apply(updateMipmaps: false, makeNoLongerReadable: true); + } + else + { + texture = new Texture2D(source.Width, source.Height, TextureFormat.RGBA32, + generateMips ? -1 : mipCount, linear: false); + byte[] rgba = source.Format == TextureDataFormat.Rgba32 ? null : + ArrayPool.Shared.Rent(checked(source.Width * source.Height * 4)); + try + { + for (int mip = 0; mip < mipCount; mip++) + { + if (rgba == null) + { + var data = source.GetMipData(mip); + texture.SetPixelData(data.Array, mip, data.Offset); + } + else + { + source.CopyMipToRgba32(mip, rgba); + texture.SetPixelData(rgba, mip); + } + } + texture.Apply(updateMipmaps: generateMips, makeNoLongerReadable: !options.KeepCpuReadable); + } + finally { if (rgba != null) ArrayPool.Shared.Return(rgba); } + } + if (texture.mipmapCount > 1) texture.filterMode = FilterMode.Trilinear; + return new UnityTexture2D(texture, options.KeepCpuReadable ? null : source.CreatePixelReader()); + } + catch + { + if (texture != null) UnityEngine.Object.Destroy(texture); + throw; } - - Texture2D texture = new Texture2D(width, height, TextureFormat.RGBA32, mipChain: false); - texture.LoadRawTextureData(rgba32DataBuffer); - texture.Apply(updateMipmaps: false); - return new UnityTexture2D(texture); } public ITexture2D CreateWhiteTexture() => new UnityTexture2D(Texture2D.whiteTexture); } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Engine/Core/Implementation/UnityTransform.cs b/Assets/Scripts/Engine/Core/Implementation/UnityTransform.cs index 7a12b49f..53acca9a 100644 --- a/Assets/Scripts/Engine/Core/Implementation/UnityTransform.cs +++ b/Assets/Scripts/Engine/Core/Implementation/UnityTransform.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Core.Implementation { diff --git a/Assets/Scripts/Engine/Coroutine/CoroutineYieldInstruction.cs b/Assets/Scripts/Engine/Coroutine/CoroutineYieldInstruction.cs index 0f6f7f83..7cf42441 100644 --- a/Assets/Scripts/Engine/Coroutine/CoroutineYieldInstruction.cs +++ b/Assets/Scripts/Engine/Coroutine/CoroutineYieldInstruction.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Coroutine { diff --git a/Assets/Scripts/Engine/DataLoader/AudioClipLoader.cs b/Assets/Scripts/Engine/DataLoader/AudioClipLoader.cs index ce0ec9df..1207f105 100644 --- a/Assets/Scripts/Engine/DataLoader/AudioClipLoader.cs +++ b/Assets/Scripts/Engine/DataLoader/AudioClipLoader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.DataLoader { diff --git a/Assets/Scripts/Engine/DataLoader/BmpTextureLoader.cs b/Assets/Scripts/Engine/DataLoader/BmpTextureLoader.cs index c390f6e5..76e49a89 100644 --- a/Assets/Scripts/Engine/DataLoader/BmpTextureLoader.cs +++ b/Assets/Scripts/Engine/DataLoader/BmpTextureLoader.cs @@ -1,84 +1,50 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.DataLoader { - using System; using System.Buffers; using Core.Abstraction; + using Core.Implementation; using Pal3.Core.DataReader.Bmp; - /// - /// .bmp file loader and Texture2D converter. - /// public sealed class BmpTextureLoader : ITextureLoader { - private readonly ITextureFactory _textureFactory; - private BmpFile _image; - - public BmpTextureLoader(ITextureFactory textureFactory) + public ITextureDataSource Load(byte[] data, out bool hasAlphaChannel) { - _textureFactory = textureFactory; - } - - public void Load(byte[] data, out bool hasAlphaChannel) - { - if (_image != null) throw new Exception("BMP texture already loaded"); - hasAlphaChannel = false; - _image = new BmpFileReader().Read(data); - } - - // Flip image if height is negative - private void FlipImage() - { - if (_image.Info.Height > 0) return; - - int width = _image.Info.AbsWidth; - int height = _image.Info.AbsHeight; + BmpFile image = new BmpFileReader().Read(data); + int width = image.Info.AbsWidth; + int height = image.Info.AbsHeight; - for (int y = 0; y < height / 2; y++) + if (image.Info.Height < 0) { - for(int x = 0, o1 = y * width, o2 = (height - y - 1) * width; x < width; x++, o1++, o2++) + for (int y = 0; y < height / 2; y++) { - (_image.ImageData[o1], _image.ImageData[o2]) = (_image.ImageData[o2], _image.ImageData[o1]); + for (int x = 0, o1 = y * width, o2 = (height - y - 1) * width; x < width; x++, o1++, o2++) + (image.ImageData[o1], image.ImageData[o2]) = (image.ImageData[o2], image.ImageData[o1]); } } - _image.Info.Height = height; - } - - public ITexture2D ToTexture() - { - if (_image == null) return null; - - if (_image.Info.Height < 0) - { - FlipImage(); - } - - byte[] rawRgbaDataBuffer = ArrayPool.Shared.Rent(_image.ImageData.Length * 4); - + byte[] rgba = ArrayPool.Shared.Rent(checked(image.ImageData.Length * 4)); try { - for (int i = 0; i < _image.ImageData.Length; i++) + for (int i = 0; i < image.ImageData.Length; i++) { - rawRgbaDataBuffer[i * 4 + 0] = _image.ImageData[i].B; - rawRgbaDataBuffer[i * 4 + 1] = _image.ImageData[i].G; - rawRgbaDataBuffer[i * 4 + 2] = _image.ImageData[i].R; - rawRgbaDataBuffer[i * 4 + 3] = _image.ImageData[i].A; + rgba[i * 4 + 0] = image.ImageData[i].B; + rgba[i * 4 + 1] = image.ImageData[i].G; + rgba[i * 4 + 2] = image.ImageData[i].R; + rgba[i * 4 + 3] = image.ImageData[i].A; } - - // Use the buffer instead of a new array - return _textureFactory.CreateTexture(_image.Info.AbsWidth, _image.Info.AbsHeight, rawRgbaDataBuffer); + return Rgba32TextureDataSource.TakePooledBuffer(width, height, rgba, hasTransparency: false); } - finally + catch { - ArrayPool.Shared.Return(rawRgbaDataBuffer); - _image = null; + ArrayPool.Shared.Return(rgba); + throw; } } } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Engine/DataLoader/DxtTextureDataSource.cs b/Assets/Scripts/Engine/DataLoader/DxtTextureDataSource.cs new file mode 100644 index 00000000..acaedd79 --- /dev/null +++ b/Assets/Scripts/Engine/DataLoader/DxtTextureDataSource.cs @@ -0,0 +1,43 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Engine.DataLoader +{ + using System; + using Core.Abstraction; + using Pal3.Core.DataReader.Dxt; + + /// Adapts validated DDS data to format-neutral texture blocks and pixel reads. + internal sealed class DxtTextureDataSource : ITextureDataSource, ITexturePixelReader + { + private readonly DxtImage _image; + + public DxtTextureDataSource(DxtImage image) => _image = image; + + public int Width => _image.Width; + public int Height => _image.Height; + public int MipCount => _image.MipCount; + public TextureDataFormat Format => _image.HasAlphaChannel ? TextureDataFormat.Bc2 : TextureDataFormat.Bc1; + public bool HasTransparency => _image.HasTransparency; + + public ArraySegment GetMipData(int mip) + { + int offset = _image.GetOffset(mip); + int length = ((_image.GetWidth(mip) + 3) / 4) * ((_image.GetHeight(mip) + 3) / 4) * + (Format == TextureDataFormat.Bc2 ? 16 : 8); + return new ArraySegment(_image.Data, offset, length); + } + + public void CopyMipToRgba32(int mip, byte[] destination) => _image.Decode(mip, destination); + + // DDS bytes are owned managed data, never a pooled upload buffer. Sharing this reader + // keeps compressed blocks alive without allocating an uncompressed CPU copy. + public ITexturePixelReader CreatePixelReader() => this; + + public (byte r, byte g, byte b, byte a) GetPixel(int x, int y) => _image.GetPixel(x, y); + + public void Dispose() { } + } +} diff --git a/Assets/Scripts/Engine/DataLoader/DxtTextureDataSource.cs.meta b/Assets/Scripts/Engine/DataLoader/DxtTextureDataSource.cs.meta new file mode 100644 index 00000000..1845fa76 --- /dev/null +++ b/Assets/Scripts/Engine/DataLoader/DxtTextureDataSource.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 297f6c8fd4754f03b14fd961080d843a diff --git a/Assets/Scripts/Engine/DataLoader/DxtTextureLoader.cs b/Assets/Scripts/Engine/DataLoader/DxtTextureLoader.cs index be61a500..64a3d60a 100644 --- a/Assets/Scripts/Engine/DataLoader/DxtTextureLoader.cs +++ b/Assets/Scripts/Engine/DataLoader/DxtTextureLoader.cs @@ -1,81 +1,20 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.DataLoader { - using System; - using System.Buffers; - using System.IO; - using Core.Abstraction; - using Pal3.Core.DataReader.Dxt; - - /// - /// .dds file loader and Texture2D converter. - /// - public sealed class DxtTextureLoader : ITextureLoader - { - private readonly ITextureFactory _textureFactory; - - private int _width; - private int _height; - private byte[] _rawRgbaDataBuffer; - - public DxtTextureLoader(ITextureFactory textureFactory) - { - _textureFactory = textureFactory; - } - - public void Load(byte[] data, out bool hasAlphaChannel) - { - if (_rawRgbaDataBuffer != null) throw new Exception("DXT texture already loaded"); - - using MemoryStream stream = new(data); - using BinaryReader headerReader = new(stream); - - if (new string(headerReader.ReadChars(4)) != "DDS ") - { - throw new InvalidDataException("Not a valid DXT file"); - } - - DxtHeader header = DxtHeader.ReadHeader(headerReader); - - _width = header.Width; - _height = header.Height; - - _rawRgbaDataBuffer = ArrayPool.Shared.Rent(_width * _height * 4); - - switch (header.DxtPixelFormat.Format) - { - case "DXT1": - hasAlphaChannel = false; - Dxt1Decoder.ToRgba32(data, _width, _height, _rawRgbaDataBuffer); - break; - case "DXT3": - hasAlphaChannel = true; - Dxt3Decoder.ToRgba32(data, _width, _height, _rawRgbaDataBuffer); - break; - case "DXT5": - throw new NotImplementedException("DXT5 decoder not implemented"); - default: - throw new Exception($"DXT Texture format: {header.DxtPixelFormat.Format} is not supported"); - } - } - - public ITexture2D ToTexture() - { - if (_rawRgbaDataBuffer == null) return null; - - try - { - return _textureFactory.CreateTexture(_width, _height, _rawRgbaDataBuffer); - } - finally - { - ArrayPool.Shared.Return(_rawRgbaDataBuffer); - _rawRgbaDataBuffer = null; - } - } - } + using Core.Abstraction; + using Pal3.Core.DataReader.Dxt; + + public sealed class DxtTextureLoader : ITextureLoader + { + public ITextureDataSource Load(byte[] data, out bool hasAlphaChannel) + { + var image = new DxtImage(data); + hasAlphaChannel = image.HasAlphaChannel; + return new DxtTextureDataSource(image); + } + } } diff --git a/Assets/Scripts/Engine/DataLoader/TgaTextureLoader.cs b/Assets/Scripts/Engine/DataLoader/TgaTextureLoader.cs index 2e08187e..7f9a9f73 100644 --- a/Assets/Scripts/Engine/DataLoader/TgaTextureLoader.cs +++ b/Assets/Scripts/Engine/DataLoader/TgaTextureLoader.cs @@ -1,75 +1,52 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.DataLoader { using System; using System.Buffers; using Core.Abstraction; + using Core.Implementation; using Pal3.Core.DataReader.Tga; - /// - /// .tga file loader and Texture2D converter. - /// public sealed class TgaTextureLoader : ITextureLoader { - private readonly ITextureFactory _textureFactory; - - private short _width; - private short _height; - private byte[] _rawRgbaDataBuffer; - - public TgaTextureLoader(ITextureFactory textureFactory) + public unsafe ITextureDataSource Load(byte[] data, out bool hasAlphaChannel) { - _textureFactory = textureFactory; - } - - public unsafe void Load(byte[] data, out bool hasAlphaChannel) - { - if (_rawRgbaDataBuffer != null) throw new Exception("TGA texture already loaded"); - + short width; + short height; byte bitDepth; - fixed (byte* p = &data[12]) { - _width = *(short*)p; - _height = *(short*)(p + 2); + width = *(short*)p; + height = *(short*)(p + 2); bitDepth = *(p + 4); } - _rawRgbaDataBuffer = ArrayPool.Shared.Rent(_width * _height * 4); - - switch (bitDepth) - { - case 24: - hasAlphaChannel = false; - TgaDecoder.Decode24BitDataToRgba32( - data, _width, _height, _rawRgbaDataBuffer); - break; - case 32: - TgaDecoder.Decode32BitDataToRgba32( - data, _width, _height, _rawRgbaDataBuffer, out hasAlphaChannel); - break; - default: - throw new Exception("TGA texture had non 32/24 bit depth"); - } - } - - public ITexture2D ToTexture() - { - if (_rawRgbaDataBuffer == null) return null; - + byte[] rgba = ArrayPool.Shared.Rent(checked(width * height * 4)); try { - return _textureFactory.CreateTexture(_width, _height, _rawRgbaDataBuffer); + switch (bitDepth) + { + case 24: + hasAlphaChannel = false; + TgaDecoder.Decode24BitDataToRgba32(data, width, height, rgba); + break; + case 32: + TgaDecoder.Decode32BitDataToRgba32(data, width, height, rgba, out hasAlphaChannel); + break; + default: + throw new Exception("TGA texture had non 32/24 bit depth"); + } + return Rgba32TextureDataSource.TakePooledBuffer(width, height, rgba, hasTransparency: true); } - finally + catch { - ArrayPool.Shared.Return(_rawRgbaDataBuffer); - _rawRgbaDataBuffer = null; + ArrayPool.Shared.Return(rgba); + throw; } } } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Engine/Extensions/GameEntityExtensions.cs b/Assets/Scripts/Engine/Extensions/GameEntityExtensions.cs index 76f208c4..ce4f9794 100644 --- a/Assets/Scripts/Engine/Extensions/GameEntityExtensions.cs +++ b/Assets/Scripts/Engine/Extensions/GameEntityExtensions.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Extensions { diff --git a/Assets/Scripts/Engine/Extensions/UnityObjectExtensions.cs b/Assets/Scripts/Engine/Extensions/UnityObjectExtensions.cs index 3544d4bd..01373efe 100644 --- a/Assets/Scripts/Engine/Extensions/UnityObjectExtensions.cs +++ b/Assets/Scripts/Engine/Extensions/UnityObjectExtensions.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Extensions { diff --git a/Assets/Scripts/Engine/Extensions/UnityPrimitivesConvertor.cs b/Assets/Scripts/Engine/Extensions/UnityPrimitivesConvertor.cs index 439d8b7a..3c22d8c7 100644 --- a/Assets/Scripts/Engine/Extensions/UnityPrimitivesConvertor.cs +++ b/Assets/Scripts/Engine/Extensions/UnityPrimitivesConvertor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Extensions { diff --git a/Assets/Scripts/Engine/Logging/EngineLogger.cs b/Assets/Scripts/Engine/Logging/EngineLogger.cs index 6e420b1b..6dbc80f7 100644 --- a/Assets/Scripts/Engine/Logging/EngineLogger.cs +++ b/Assets/Scripts/Engine/Logging/EngineLogger.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Logging { diff --git a/Assets/Scripts/Engine/Navigation/Direction.cs b/Assets/Scripts/Engine/Navigation/Direction.cs index e7bde3f4..c5f29b86 100644 --- a/Assets/Scripts/Engine/Navigation/Direction.cs +++ b/Assets/Scripts/Engine/Navigation/Direction.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Navigation { diff --git a/Assets/Scripts/Engine/Navigation/DirectionUtils.cs b/Assets/Scripts/Engine/Navigation/DirectionUtils.cs index 1e9b5c84..a3cd9473 100644 --- a/Assets/Scripts/Engine/Navigation/DirectionUtils.cs +++ b/Assets/Scripts/Engine/Navigation/DirectionUtils.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Navigation { diff --git a/Assets/Scripts/Engine/Navigation/Path.cs b/Assets/Scripts/Engine/Navigation/Path.cs index cd9ad511..c71ad5d6 100644 --- a/Assets/Scripts/Engine/Navigation/Path.cs +++ b/Assets/Scripts/Engine/Navigation/Path.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Navigation { diff --git a/Assets/Scripts/Engine/Renderer/AnimatedBillboardRenderer.cs b/Assets/Scripts/Engine/Renderer/AnimatedBillboardRenderer.cs index 34f14bd6..6249eb67 100644 --- a/Assets/Scripts/Engine/Renderer/AnimatedBillboardRenderer.cs +++ b/Assets/Scripts/Engine/Renderer/AnimatedBillboardRenderer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Renderer { diff --git a/Assets/Scripts/Engine/Renderer/SkyBoxRenderer.cs b/Assets/Scripts/Engine/Renderer/SkyBoxRenderer.cs index e6def8c6..4142472c 100644 --- a/Assets/Scripts/Engine/Renderer/SkyBoxRenderer.cs +++ b/Assets/Scripts/Engine/Renderer/SkyBoxRenderer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Renderer { diff --git a/Assets/Scripts/Engine/Renderer/StaticBillboardRenderer.cs b/Assets/Scripts/Engine/Renderer/StaticBillboardRenderer.cs index ee673568..d1d2059e 100644 --- a/Assets/Scripts/Engine/Renderer/StaticBillboardRenderer.cs +++ b/Assets/Scripts/Engine/Renderer/StaticBillboardRenderer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Renderer { diff --git a/Assets/Scripts/Engine/Renderer/StaticMeshRenderer.cs b/Assets/Scripts/Engine/Renderer/StaticMeshRenderer.cs index 32f6d97f..9a4e120f 100644 --- a/Assets/Scripts/Engine/Renderer/StaticMeshRenderer.cs +++ b/Assets/Scripts/Engine/Renderer/StaticMeshRenderer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Renderer { @@ -40,6 +40,7 @@ public Mesh Render(Vector3[] vertices, _meshFilter = GameEntity.AddComponent(); Mesh mesh = new(); + if (vertices.Length > ushort.MaxValue) mesh.indexFormat = IndexFormat.UInt32; if (isDynamic) { diff --git a/Assets/Scripts/Engine/Services/GameTimeProvider.cs b/Assets/Scripts/Engine/Services/GameTimeProvider.cs index 1205c88e..2923c074 100644 --- a/Assets/Scripts/Engine/Services/GameTimeProvider.cs +++ b/Assets/Scripts/Engine/Services/GameTimeProvider.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/Services/IGameTimeProvider.cs b/Assets/Scripts/Engine/Services/IGameTimeProvider.cs index cf920866..95857961 100644 --- a/Assets/Scripts/Engine/Services/IGameTimeProvider.cs +++ b/Assets/Scripts/Engine/Services/IGameTimeProvider.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/Services/IPhysicsManager.cs b/Assets/Scripts/Engine/Services/IPhysicsManager.cs index c73aff67..a5a5194f 100644 --- a/Assets/Scripts/Engine/Services/IPhysicsManager.cs +++ b/Assets/Scripts/Engine/Services/IPhysicsManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/Services/ITextureCache.cs b/Assets/Scripts/Engine/Services/ITextureCache.cs index 7daa6f38..d8178674 100644 --- a/Assets/Scripts/Engine/Services/ITextureCache.cs +++ b/Assets/Scripts/Engine/Services/ITextureCache.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/Services/PhysicsManager.cs b/Assets/Scripts/Engine/Services/PhysicsManager.cs index b4dcb77f..ad9df616 100644 --- a/Assets/Scripts/Engine/Services/PhysicsManager.cs +++ b/Assets/Scripts/Engine/Services/PhysicsManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/Services/ServiceLocator.cs b/Assets/Scripts/Engine/Services/ServiceLocator.cs index f824709c..9c382ce6 100644 --- a/Assets/Scripts/Engine/Services/ServiceLocator.cs +++ b/Assets/Scripts/Engine/Services/ServiceLocator.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/Services/ShaderUtility.cs b/Assets/Scripts/Engine/Services/ShaderUtility.cs index 28d23981..6693eb1f 100644 --- a/Assets/Scripts/Engine/Services/ShaderUtility.cs +++ b/Assets/Scripts/Engine/Services/ShaderUtility.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/Services/TextureCache.cs b/Assets/Scripts/Engine/Services/TextureCache.cs index 5af61533..3a7a24f2 100644 --- a/Assets/Scripts/Engine/Services/TextureCache.cs +++ b/Assets/Scripts/Engine/Services/TextureCache.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Services { diff --git a/Assets/Scripts/Engine/UI/ButtonHighlightingFixer.cs b/Assets/Scripts/Engine/UI/ButtonHighlightingFixer.cs index 06b1b638..ec05f111 100644 --- a/Assets/Scripts/Engine/UI/ButtonHighlightingFixer.cs +++ b/Assets/Scripts/Engine/UI/ButtonHighlightingFixer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.UI { diff --git a/Assets/Scripts/Engine/UI/ImageScroller.cs b/Assets/Scripts/Engine/UI/ImageScroller.cs index e42c23f3..24a5a761 100644 --- a/Assets/Scripts/Engine/UI/ImageScroller.cs +++ b/Assets/Scripts/Engine/UI/ImageScroller.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.UI { diff --git a/Assets/Scripts/Engine/UI/RectTransformMaxWidthLimiter.cs b/Assets/Scripts/Engine/UI/RectTransformMaxWidthLimiter.cs index b4364fb5..5bbbeeff 100644 --- a/Assets/Scripts/Engine/UI/RectTransformMaxWidthLimiter.cs +++ b/Assets/Scripts/Engine/UI/RectTransformMaxWidthLimiter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.UI { diff --git a/Assets/Scripts/Engine/UI/RoundedFrostedGlassImage.cs b/Assets/Scripts/Engine/UI/RoundedFrostedGlassImage.cs index c043a8b8..a0895b5f 100644 --- a/Assets/Scripts/Engine/UI/RoundedFrostedGlassImage.cs +++ b/Assets/Scripts/Engine/UI/RoundedFrostedGlassImage.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.UI { diff --git a/Assets/Scripts/Engine/Utilities/FpsCounter.cs b/Assets/Scripts/Engine/Utilities/FpsCounter.cs index ae16cf60..05f6a4c3 100644 --- a/Assets/Scripts/Engine/Utilities/FpsCounter.cs +++ b/Assets/Scripts/Engine/Utilities/FpsCounter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Utilities { diff --git a/Assets/Scripts/Engine/Utilities/GridOverlay.cs b/Assets/Scripts/Engine/Utilities/GridOverlay.cs index 91af9050..809bc720 100644 --- a/Assets/Scripts/Engine/Utilities/GridOverlay.cs +++ b/Assets/Scripts/Engine/Utilities/GridOverlay.cs @@ -1,4 +1,9 @@ -namespace Engine.Utilities +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Engine.Utilities { using UnityEngine; using UnityEngine.Rendering; diff --git a/Assets/Scripts/Engine/Utilities/PlayerPrefsStore.cs b/Assets/Scripts/Engine/Utilities/PlayerPrefsStore.cs index f155f531..c9075c92 100644 --- a/Assets/Scripts/Engine/Utilities/PlayerPrefsStore.cs +++ b/Assets/Scripts/Engine/Utilities/PlayerPrefsStore.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Utilities { diff --git a/Assets/Scripts/Engine/Utilities/Singleton.cs b/Assets/Scripts/Engine/Utilities/Singleton.cs index 6ad5cdaf..22555322 100644 --- a/Assets/Scripts/Engine/Utilities/Singleton.cs +++ b/Assets/Scripts/Engine/Utilities/Singleton.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Utilities { diff --git a/Assets/Scripts/Engine/Utilities/UnityEngineUtility.cs b/Assets/Scripts/Engine/Utilities/UnityEngineUtility.cs index d6004ac3..fa4e49d4 100644 --- a/Assets/Scripts/Engine/Utilities/UnityEngineUtility.cs +++ b/Assets/Scripts/Engine/Utilities/UnityEngineUtility.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Utilities { diff --git a/Assets/Scripts/Engine/Utilities/UnitySupportedVideoFormats.cs b/Assets/Scripts/Engine/Utilities/UnitySupportedVideoFormats.cs index 5dd82492..7a6bd2eb 100644 --- a/Assets/Scripts/Engine/Utilities/UnitySupportedVideoFormats.cs +++ b/Assets/Scripts/Engine/Utilities/UnitySupportedVideoFormats.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Engine.Utilities { diff --git a/Assets/Scripts/Pal3.Core/Algorithm/PathFinding/LazyThetaStarPathFinder.cs b/Assets/Scripts/Pal3.Core/Algorithm/PathFinding/LazyThetaStarPathFinder.cs index 294485a3..213503fe 100644 --- a/Assets/Scripts/Pal3.Core/Algorithm/PathFinding/LazyThetaStarPathFinder.cs +++ b/Assets/Scripts/Pal3.Core/Algorithm/PathFinding/LazyThetaStarPathFinder.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Algorithm.PathFinding { diff --git a/Assets/Scripts/Pal3.Core/AssemblyInfo.cs b/Assets/Scripts/Pal3.Core/AssemblyInfo.cs new file mode 100644 index 00000000..a13cd830 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/AssemblyInfo.cs @@ -0,0 +1,8 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Pal3.Core.Tests")] diff --git a/Assets/Scripts/Pal3.Core/AssemblyInfo.cs.meta b/Assets/Scripts/Pal3.Core/AssemblyInfo.cs.meta new file mode 100644 index 00000000..ba6c210f --- /dev/null +++ b/Assets/Scripts/Pal3.Core/AssemblyInfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: de42056036fe94fde99a1bee982fe8a5 \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/ICommand.cs b/Assets/Scripts/Pal3.Core/Command/ICommand.cs index e5c05562..c37bd0a8 100644 --- a/Assets/Scripts/Pal3.Core/Command/ICommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/ICommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/ICommandExecutor.cs b/Assets/Scripts/Pal3.Core/Command/ICommandExecutor.cs index 12e8c369..65184e35 100644 --- a/Assets/Scripts/Pal3.Core/Command/ICommandExecutor.cs +++ b/Assets/Scripts/Pal3.Core/Command/ICommandExecutor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/ICommandExecutorRegistry.cs b/Assets/Scripts/Pal3.Core/Command/ICommandExecutorRegistry.cs index 67295f43..51a016b8 100644 --- a/Assets/Scripts/Pal3.Core/Command/ICommandExecutorRegistry.cs +++ b/Assets/Scripts/Pal3.Core/Command/ICommandExecutorRegistry.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/ISceCommandParser.cs b/Assets/Scripts/Pal3.Core/Command/ISceCommandParser.cs index 86e8a41e..0fe645ff 100644 --- a/Assets/Scripts/Pal3.Core/Command/ISceCommandParser.cs +++ b/Assets/Scripts/Pal3.Core/Command/ISceCommandParser.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/ISceCommandPreprocessor.cs b/Assets/Scripts/Pal3.Core/Command/ISceCommandPreprocessor.cs index 48e6063e..006a855f 100644 --- a/Assets/Scripts/Pal3.Core/Command/ISceCommandPreprocessor.cs +++ b/Assets/Scripts/Pal3.Core/Command/ISceCommandPreprocessor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/ISceCommandTypeResolver.cs b/Assets/Scripts/Pal3.Core/Command/ISceCommandTypeResolver.cs index f49e1695..35f4a8ae 100644 --- a/Assets/Scripts/Pal3.Core/Command/ISceCommandTypeResolver.cs +++ b/Assets/Scripts/Pal3.Core/Command/ISceCommandTypeResolver.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/SceActorIdAttribute.cs b/Assets/Scripts/Pal3.Core/Command/SceActorIdAttribute.cs index 3912eb6b..50dff4b2 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceActorIdAttribute.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceActorIdAttribute.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommandAttribute.cs b/Assets/Scripts/Pal3.Core/Command/SceCommandAttribute.cs index bd444ff1..db05258a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommandAttribute.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommandAttribute.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommandParser.cs b/Assets/Scripts/Pal3.Core/Command/SceCommandParser.cs index e565fa8e..376d585e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommandParser.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommandParser.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { @@ -45,7 +45,7 @@ public ICommand ParseNextCommand(IBinaryReader reader, $"user variable mask: {Convert.ToString(userVariableMask, 2)})"); } - PropertyInfo[] properties = commandType.GetProperties(); + PropertyInfo[] properties = SceCommandSchema.GetProperties(commandType); object[] args = new object[properties.Length]; for (int i = properties.Length - 1; i >= 0; i--) diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommandPreprocessor.cs b/Assets/Scripts/Pal3.Core/Command/SceCommandPreprocessor.cs index 75607283..bdcdbe30 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommandPreprocessor.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommandPreprocessor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommandSchema.cs b/Assets/Scripts/Pal3.Core/Command/SceCommandSchema.cs new file mode 100644 index 00000000..01126cb3 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommandSchema.cs @@ -0,0 +1,45 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Pal3.Core.Command +{ + using System; + using System.Collections.Concurrent; + using System.Linq; + using System.Reflection; + using System.Runtime.Serialization; + + // Constructor parameters define protocol order. Reflection property enumeration does not. + internal static class SceCommandSchema + { + private static readonly ConcurrentDictionary Cache = new(); + + internal static PropertyInfo[] GetProperties(Type type) => Cache.GetOrAdd(type, Build); + + private static PropertyInfo[] Build(Type type) + { + ConstructorInfo[] constructors = type.GetConstructors(); + PropertyInfo[] properties = type.GetProperties(BindingFlags.Public | BindingFlags.Instance); + if (constructors.Length != 1 || properties.Length > 16) + throw new InvalidDataContractException($"Invalid SCE command constructor or parameter count: {type.Name}"); + + ParameterInfo[] parameters = constructors[0].GetParameters(); + if (parameters.Length != properties.Length) + throw new InvalidDataContractException($"SCE command properties must match constructor parameters: {type.Name}"); + + return parameters.Select(parameter => + { + PropertyInfo property = properties.SingleOrDefault(p => + string.Equals(p.Name, parameter.Name, StringComparison.OrdinalIgnoreCase)); + if (property == null || property.PropertyType != parameter.ParameterType || + property.GetIndexParameters().Length != 0 || property.GetMethod == null) + throw new InvalidDataContractException($"Invalid SCE parameter {type.Name}.{parameter.Name}"); + if (property.IsDefined(typeof(SceUserVariableAttribute)) && property.PropertyType != typeof(ushort)) + throw new InvalidDataContractException($"SCE user variable must be UInt16: {type.Name}.{property.Name}"); + return property; + }).ToArray(); + } + } +} diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommandSchema.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommandSchema.cs.meta new file mode 100644 index 00000000..dcb95c25 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommandSchema.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: b8b1e2663d5ac47dc8ccbe70a1297631 \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommandTypeResolver.cs b/Assets/Scripts/Pal3.Core/Command/SceCommandTypeResolver.cs index 7d142d76..92e4df53 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommandTypeResolver.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommandTypeResolver.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { @@ -25,22 +25,31 @@ public void Init() IEnumerable commandTypes = Assembly.GetExecutingAssembly().GetTypes() .Where(t => t.IsClass && t.GetInterfaces().Contains(typeof(ICommand))); - foreach (Type commandType in commandTypes) - { - if (commandType.GetCustomAttribute(typeof(SceCommandAttribute)) is SceCommandAttribute attribute) - { - ushort userVariableMask = CalculateUserVariableMask(commandType); - uint hashCode = GetHashCode(attribute.CommandId, userVariableMask); - SceCommandTypeCache[hashCode] = commandType; - } - } + Dictionary definitions = BuildTypeMap(commandTypes); + foreach (var definition in definitions) + SceCommandTypeCache.Add(definition.Key, definition.Value); _isInitialized = true; } + internal static Dictionary BuildTypeMap(IEnumerable commandTypes) + { + var definitions = new Dictionary(); + foreach (Type type in commandTypes) + { + if (type.GetCustomAttribute() is not { } attribute) continue; + ushort mask = CalculateUserVariableMask(type); + uint key = GetHashCode(attribute.CommandId, mask); + if (!definitions.TryAdd(key, type)) + throw new InvalidDataContractException( + $"Duplicate SCE command id/mask: {attribute.CommandId}/{mask} ({definitions[key].Name}, {type.Name})"); + } + return definitions; + } + private static ushort CalculateUserVariableMask(Type commandType) { - PropertyInfo[] propertyInfos = commandType.GetProperties(); + PropertyInfo[] propertyInfos = SceCommandSchema.GetProperties(commandType); ushort userVariableMask = 0; for (int i = 0; i < propertyInfos.Length; i++) diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorActivateCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorActivateCommand.cs index caaf9ada..c1e60975 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorActivateCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorActivateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAddSkillCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAddSkillCommand.cs index 1b735ccc..f29a812a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAddSkillCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAddSkillCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAutoStandCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAutoStandCommand.cs index 6061c876..af59edc7 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAutoStandCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorAutoStandCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeColliderSettingCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeColliderSettingCommand.cs index a4dcb823..78403b1e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeColliderSettingCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeColliderSettingCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeScaleCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeScaleCommand.cs index 99a016fe..ba66db10 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeScaleCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeScaleCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTextureCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTextureCommand.cs index a58923df..1d6afd93 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTextureCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTextureCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTransparencyCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTransparencyCommand.cs index 5b73f56e..08e15ccc 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTransparencyCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorChangeTransparencyCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorEnablePlayerControlCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorEnablePlayerControlCommand.cs index 455b91cd..b9a7cee2 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorEnablePlayerControlCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorEnablePlayerControlCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeInCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeInCommand.cs index c0731c79..85994735 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeInCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeInCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeOutCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeOutCommand.cs index f5d9a1fa..70285a65 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeOutCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorFadeOutCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLoadActionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLoadActionCommand.cs index 562e7961..e6f4fca1 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLoadActionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLoadActionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLookAtActorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLookAtActorCommand.cs index 69ea5df7..fb9e96f5 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLookAtActorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorLookAtActorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveBackwardsCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveBackwardsCommand.cs index aa53f2db..dc6aae26 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveBackwardsCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveBackwardsCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveOutOfScreenCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveOutOfScreenCommand.cs index 33276f8e..1bdc6812 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveOutOfScreenCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveOutOfScreenCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveToCommand.cs index 77aa7f51..4c111aaa 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorMoveToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPathToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPathToCommand.cs index 95ef5740..0f970f58 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPathToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPathToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformActionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformActionCommand.cs index cdf169e5..664af607 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformActionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformActionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformAttackCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformAttackCommand.cs new file mode 100644 index 00000000..359ef947 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformAttackCommand.cs @@ -0,0 +1,24 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(166, "按装备武器类别播放攻击动作")] + public sealed class ActorPerformAttackCommand : ICommand + { + public ActorPerformAttackCommand(int actorId, int loopCount) + { + ActorId = actorId; + LoopCount = loopCount; + } + + [SceActorId] + public int ActorId { get; set; } + + public int LoopCount { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand166.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformAttackCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand166.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformAttackCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformClimbActionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformClimbActionCommand.cs index 76e45a0c..2c87afce 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformClimbActionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorPerformClimbActionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingCommand.cs index 6d97d19a..bba2161a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingDirectionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingDirectionCommand.cs index cf72d59c..3ba67d92 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingDirectionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorRotateFacingDirectionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeToFullCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeToFullCommand.cs index 0e5257b3..8dfd6081 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeToFullCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeToFullCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeValueCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeValueCommand.cs index 2304519b..ea0ead31 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeValueCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetAttributeValueCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetFacingDirectionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetFacingDirectionCommand.cs index 8092677d..190cc75e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetFacingDirectionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetFacingDirectionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNavLayerCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNavLayerCommand.cs index c81f5531..a4d3a5b6 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNavLayerCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNavLayerCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNoTurnCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNoTurnCommand.cs new file mode 100644 index 00000000..8419e813 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNoTurnCommand.cs @@ -0,0 +1,24 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(197, "设置角色对话时是否保留动作和朝向")] + public sealed class ActorSetNoTurnCommand : ICommand + { + public ActorSetNoTurnCommand(int actorId, int noTurn) + { + ActorId = actorId; + NoTurn = noTurn; + } + + [SceActorId] + public int ActorId { get; set; } + + public int NoTurn { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand197.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNoTurnCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand197.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetNoTurnCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetScriptCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetScriptCommand.cs index c67eed9b..067a2d01 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetScriptCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetScriptCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetTilePositionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetTilePositionCommand.cs index d6d8f67d..ffafe568 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetTilePositionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetTilePositionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetYPositionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetYPositionCommand.cs index ad3aec84..895d6b08 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetYPositionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorSetYPositionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmoji2Command.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmoji2Command.cs index 734eb26b..72617ed0 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmoji2Command.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmoji2Command.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmojiCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmojiCommand.cs index ce2c5034..8eb88710 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmojiCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorShowEmojiCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionAndStandCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionAndStandCommand.cs index dae84f6b..547f5167 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionAndStandCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionAndStandCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionCommand.cs index 2234bc7f..baf1bd78 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorStopActionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorWalkToUsingActionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorWalkToUsingActionCommand.cs index 57b932cb..391426e8 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorWalkToUsingActionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ActorWalkToUsingActionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInCommand.cs index 3d9f2d31..5f508fa7 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInWhiteCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInWhiteCommand.cs index 2740dc93..06261db1 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInWhiteCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeInWhiteCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutCommand.cs index a6abe5b5..80f902f1 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutWhiteCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutWhiteCommand.cs index 37996285..a52a6c0e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutWhiteCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFadeOutWhiteCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnActorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnActorCommand.cs index 409bad14..13e47cf7 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnActorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnActorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnPositionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnPositionCommand.cs index 5c3cba78..7d5e5b76 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnPositionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnPositionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnSceneObjectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnSceneObjectCommand.cs index 875e9da4..44543e35 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnSceneObjectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFocusOnSceneObjectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFollowPlayerCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFollowPlayerCommand.cs index 99435f9d..32b5bd42 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFollowPlayerCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraFollowPlayerCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveCommand.cs index 17b17965..408d371e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToDefaultLookAtPointCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToDefaultLookAtPointCommand.cs index 4e841b8b..2ac65428 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToDefaultLookAtPointCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToDefaultLookAtPointCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToLookAtPointCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToLookAtPointCommand.cs index 8fe1f7b1..a024cc22 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToLookAtPointCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraMoveToLookAtPointCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitCommand.cs index 49511e56..8668de5a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { @@ -13,17 +13,27 @@ public CameraOrbitCommand( float yaw, float pitch, float duration, - int curveType) + int curveType + #if PAL3A + , int synchronous + #endif + ) { Yaw = yaw; Pitch = pitch; Duration = duration; CurveType = curveType; + #if PAL3A + Synchronous = synchronous; + #endif } public float Yaw { get; } public float Pitch { get; } public float Duration { get; } public int CurveType { get; } + #if PAL3A + public int Synchronous { get; } + #endif } } \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitHorizontalCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitHorizontalCommand.cs index 44d3addb..e108d694 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitHorizontalCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitHorizontalCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitVerticalCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitVerticalCommand.cs index c61c6bda..0082133b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitVerticalCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraOrbitVerticalCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPopStateCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPopStateCommand.cs index 5d638380..e85b193f 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPopStateCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPopStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushCommand.cs index 9d54fad8..c3f5b143 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushStateCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushStateCommand.cs index 23a5b3d1..676361bb 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushStateCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraPushStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraResetHorizontalDirectionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraResetHorizontalDirectionCommand.cs new file mode 100644 index 00000000..5b743c21 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraResetHorizontalDirectionCommand.cs @@ -0,0 +1,17 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(198, "解除相机水平朝向约束")] + public sealed class CameraResetHorizontalDirectionCommand : ICommand + { + public CameraResetHorizontalDirectionCommand() + { + } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand198.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraResetHorizontalDirectionCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand198.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/CameraResetHorizontalDirectionCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraRotateCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraRotateCommand.cs index 95b4a2c6..06e9a87b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraRotateCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraRotateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetDefaultTransformCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetDefaultTransformCommand.cs index 2b1b42bf..44e235ef 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetDefaultTransformCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetDefaultTransformCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetHorizontalDirectionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetHorizontalDirectionCommand.cs new file mode 100644 index 00000000..aa7139fa --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetHorizontalDirectionCommand.cs @@ -0,0 +1,29 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(181, "用两点设置相机水平朝向约束")] + public sealed class CameraSetHorizontalDirectionCommand : ICommand + { + public CameraSetHorizontalDirectionCommand(float x1, float z1, float x2, float z2) + { + X1 = x1; + Z1 = z1; + X2 = x2; + Z2 = z2; + } + + public float X1 { get; } + + public float Z1 { get; } + + public float X2 { get; } + + public float Z2 { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand181.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetHorizontalDirectionCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand181.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetHorizontalDirectionCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetTransformCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetTransformCommand.cs index 7878d7e7..9862d8de 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetTransformCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetTransformCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetYawCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetYawCommand.cs index 7543071b..a7cad01a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetYawCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraSetYawCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraShakeEffectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraShakeEffectCommand.cs index aac8b7e0..b819b701 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraShakeEffectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CameraShakeEffectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightCommand.cs index a984ccaa..2cb29d4b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicCommand.cs index 2021e65a..1888b097 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicWithSpecialActorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicWithSpecialActorCommand.cs deleted file mode 100644 index 0b563df9..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicWithSpecialActorCommand.cs +++ /dev/null @@ -1,42 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(192, "南宫煌以变身状态下进入Boss战斗")] - public sealed class CombatEnterBossFightUsingMusicWithSpecialActorCommand : ICommand - { - public CombatEnterBossFightUsingMusicWithSpecialActorCommand( - uint monster1Id, - uint monster2Id, - uint monster3Id, - uint monster4Id, - uint monster5Id, - uint monster6Id, - string combatMusicName, - int combatCommandId) - { - Monster1Id = monster1Id; - Monster2Id = monster2Id; - Monster3Id = monster3Id; - Monster4Id = monster4Id; - Monster5Id = monster5Id; - Monster6Id = monster6Id; - CombatMusicName = combatMusicName; - CombatCommandId = combatCommandId; - } - - public uint Monster1Id { get; } - public uint Monster2Id { get; } - public uint Monster3Id { get; } - public uint Monster4Id { get; } - public uint Monster5Id { get; } - public uint Monster6Id { get; } - public string CombatMusicName { get; } - public int CombatCommandId { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterNormalFightCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterNormalFightCommand.cs index c033caa7..5b203007 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterNormalFightCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterNormalFightCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareNanGongHuangTransformCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareNanGongHuangTransformCommand.cs new file mode 100644 index 00000000..627442ee --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareNanGongHuangTransformCommand.cs @@ -0,0 +1,17 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(192, "下一场战斗让南宫煌以狼形态参战")] + public sealed class CombatPrepareNanGongHuangTransformCommand : ICommand + { + public CombatPrepareNanGongHuangTransformCommand() + { + } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicWithSpecialActorCommand.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareNanGongHuangTransformCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/CombatEnterBossFightUsingMusicWithSpecialActorCommand.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareNanGongHuangTransformCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareWangPengXuTransformCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareWangPengXuTransformCommand.cs new file mode 100644 index 00000000..eae70299 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareWangPengXuTransformCommand.cs @@ -0,0 +1,17 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(196, "下一场战斗让王蓬絮以特殊形态参战")] + public sealed class CombatPrepareWangPengXuTransformCommand : ICommand + { + public CombatPrepareWangPengXuTransformCommand() + { + } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand196.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareWangPengXuTransformCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand196.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPrepareWangPengXuTransformCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPreserveDamageForLiaoRiCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPreserveDamageForLiaoRiCommand.cs new file mode 100644 index 00000000..2c17dbaa --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPreserveDamageForLiaoRiCommand.cs @@ -0,0 +1,17 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(216, "保留我方精和神的损失累计量以强化燎日后续形态")] + public sealed class CombatPreserveDamageForLiaoRiCommand : ICommand + { + public CombatPreserveDamageForLiaoRiCommand() + { + } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand216.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPreserveDamageForLiaoRiCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand216.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/CombatPreserveDamageForLiaoRiCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetMaxRoundCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetMaxRoundCommand.cs index 29432922..82e6c7eb 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetMaxRoundCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetMaxRoundCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetNoGameOverWhenLoseCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetNoGameOverWhenLoseCommand.cs index 4cd051ef..f27f3f2f 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetNoGameOverWhenLoseCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetNoGameOverWhenLoseCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetUnbeatableCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetUnbeatableCommand.cs index a1423c29..82464377 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetUnbeatableCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/CombatSetUnbeatableCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueAddSelectionsCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueAddSelectionsCommand.cs index ade00fd1..1047f966 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueAddSelectionsCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueAddSelectionsCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderActorAvatarCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderActorAvatarCommand.cs index 846b4adb..da8fa983 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderActorAvatarCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderActorAvatarCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextCommand.cs index d9523a1d..c7b087e5 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextWithTimeLimitCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextWithTimeLimitCommand.cs index 05699cb8..12b4b1ff 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextWithTimeLimitCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/DialogueRenderTextWithTimeLimitCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectAttachToActorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectAttachToActorCommand.cs index 7b9c2f66..da2d1eda 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectAttachToActorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectAttachToActorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPlayCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPlayCommand.cs index 1de39830..beea1f98 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPlayCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPlayCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPreLoadCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPreLoadCommand.cs index a32b3112..f9ef868c 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPreLoadCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectPreLoadCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetPositionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetPositionCommand.cs index 6f7dcee1..fb3ca37e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetPositionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetPositionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetScreenEffectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetScreenEffectCommand.cs index 308f4b19..cb741870 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetScreenEffectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectSetScreenEffectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowSnowCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowSnowCommand.cs index 018dc0e7..6a24f2ba 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowSnowCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowSnowCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowWaterMagicCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowWaterMagicCommand.cs index 479fff11..743ee47c 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowWaterMagicCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/EffectShowWaterMagicCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/FavorAddCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/FavorAddCommand.cs index 86476530..e4333c4e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/FavorAddCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/FavorAddCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableJusticeBookCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableJusticeBookCommand.cs index 8e166106..d7d3e761 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableJusticeBookCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableJusticeBookCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordPurifyingCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordPurifyingCommand.cs index e6092761..fce7fa01 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordPurifyingCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordPurifyingCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordSkillCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordSkillCommand.cs index 7ad3f153..3238e2f5 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordSkillCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/FeatureEnableSwordSkillCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/FengYaSongCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/FengYaSongCommand.cs index ac70ea35..28daed4d 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/FengYaSongCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/FengYaSongCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/FlyingActorFlyToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/FlyingActorFlyToCommand.cs index 2244f7ce..73831428 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/FlyingActorFlyToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/FlyingActorFlyToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/GameCompleteCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/GameCompleteCommand.cs index 1d420ab5..9edaecc0 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/GameCompleteCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/GameCompleteCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchRenderingStateCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchRenderingStateCommand.cs index 8a1d7409..1ed3dc22 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchRenderingStateCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchRenderingStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchToMainMenuCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchToMainMenuCommand.cs index b21e05cd..55941597 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchToMainMenuCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/GameSwitchToMainMenuCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/HuaYingSwitchBehaviourModeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/HuaYingSwitchBehaviourModeCommand.cs index 6f9e9fb1..81fd16e8 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/HuaYingSwitchBehaviourModeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/HuaYingSwitchBehaviourModeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddItemCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddItemCommand.cs index fbf83085..7cf8f594 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddItemCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddItemCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddMoneyCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddMoneyCommand.cs index fc1d3da7..762effac 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddMoneyCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryAddMoneyCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryRemoveItemCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryRemoveItemCommand.cs index b81adf20..dc9ac31f 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryRemoveItemCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/InventoryRemoveItemCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/LongKuiSwitchModeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/LongKuiSwitchModeCommand.cs index afcfd146..d6941408 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/LongKuiSwitchModeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/LongKuiSwitchModeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGamePawnshopShowNoteCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGamePawnshopShowNoteCommand.cs index edcccc32..df303734 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGamePawnshopShowNoteCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGamePawnshopShowNoteCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartAppraisalsCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartAppraisalsCommand.cs index 940065b4..eb106471 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartAppraisalsCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartAppraisalsCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartCaveExperienceCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartCaveExperienceCommand.cs index 27b9b8e2..5fa8d4a1 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartCaveExperienceCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartCaveExperienceCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartEncampCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartEncampCommand.cs index b8720550..ace9e83a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartEncampCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartEncampCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartFortuneTellingCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartFortuneTellingCommand.cs new file mode 100644 index 00000000..889edea1 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartFortuneTellingCommand.cs @@ -0,0 +1,23 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(185, "显示算命界面并等待结果")] + public sealed class MiniGameStartFortuneTellingCommand : ICommand + { + public MiniGameStartFortuneTellingCommand(int symbol1, int symbol2) + { + Symbol1 = symbol1; + Symbol2 = symbol2; + } + + public int Symbol1 { get; } + + public int Symbol2 { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand185.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartFortuneTellingCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand185.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartFortuneTellingCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartGhostHuntingCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartGhostHuntingCommand.cs index fca3abb2..fc5603a9 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartGhostHuntingCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartGhostHuntingCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartHideFightCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartHideFightCommand.cs index 5dcf7e33..d89e9230 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartHideFightCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartHideFightCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartPawnshopCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartPawnshopCommand.cs index 51d8006d..45a81aaa 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartPawnshopCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartPawnshopCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSailingCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSailingCommand.cs index b53c6652..fb669768 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSailingCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSailingCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSkiCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSkiCommand.cs index b13c4f86..90b3719a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSkiCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSkiCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSwatAFlyCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSwatAFlyCommand.cs index 077d9681..46a1ba06 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSwatAFlyCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/MiniGameStartSwatAFlyCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangDisableTransformEffectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangDisableTransformEffectCommand.cs index a6ebc216..8ade2c39 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangDisableTransformEffectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangDisableTransformEffectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableCombatAbilitiesCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableCombatAbilitiesCommand.cs new file mode 100644 index 00000000..ac808495 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableCombatAbilitiesCommand.cs @@ -0,0 +1,20 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(176, "开启或关闭南宫煌特殊战斗能力")] + public sealed class NanGongHuangEnableCombatAbilitiesCommand : ICommand + { + public NanGongHuangEnableCombatAbilitiesCommand(int enable) + { + Enable = enable; + } + + public int Enable { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand176.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableCombatAbilitiesCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand176.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableCombatAbilitiesCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableTransformEffectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableTransformEffectCommand.cs index fe120fe5..10a095aa 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableTransformEffectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/NanGongHuangEnableTransformEffectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/NavigationBeeFlyToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/NavigationBeeFlyToCommand.cs index 31afe29f..bea5328b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/NavigationBeeFlyToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/NavigationBeeFlyToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayMusicCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayMusicCommand.cs index 3c0fb3a6..a2dc44d2 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayMusicCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayMusicCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlaySfxCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlaySfxCommand.cs index c353ea43..71f6bd92 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlaySfxCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlaySfxCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayVideoCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayVideoCommand.cs index 22440688..7ff6be73 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayVideoCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayVideoCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerEnableInputCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerEnableInputCommand.cs index 82232fee..58bda6c2 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerEnableInputCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerEnableInputCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerInteractWithObjectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerInteractWithObjectCommand.cs index c87b0608..ba5cf88e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerInteractWithObjectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerInteractWithObjectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerLearnComposeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerLearnComposeCommand.cs index f472a8b4..b5dc0228 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerLearnComposeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerLearnComposeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerSetActorLevelCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerSetActorLevelCommand.cs index 8e4c943c..94f12037 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerSetActorLevelCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/PlayerSetActorLevelCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { @@ -20,22 +20,11 @@ public PlayerSetActorLevelCommand(int actorId, int levelIncrease) public int LevelIncrease { get; } } #elif PAL3A - [SceCommand(145, "设置目标角色等级(所有当前角色等级的平均值+增加值)," + - "参数:角色ID,等级增加值")] + [SceCommand(145, "将角色等级提升到其他在队角色的平均等级,不降低原等级")] public sealed class PlayerSetActorLevelCommand : ICommand { - public PlayerSetActorLevelCommand(int actorId, int unknown1, int unknown2, int levelIncrease) - { - ActorId = actorId; - Unknown1 = unknown1; - Unknown2 = unknown2; - LevelIncrease = levelIncrease; - } - + public PlayerSetActorLevelCommand(int actorId) { ActorId = actorId; } [SceActorId] public int ActorId { get; set; } - public int Unknown1 { get; } - public int Unknown2 { get; } - public int LevelIncrease { get; } } #endif } \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneActivateObjectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneActivateObjectCommand.cs index e1b890ce..6f2a8306 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneActivateObjectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneActivateObjectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneCloseDoorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneCloseDoorCommand.cs index 5e8355af..8e9bac77 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneCloseDoorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneCloseDoorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneEnableFogCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneEnableFogCommand.cs index a94a1577..c075c81a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneEnableFogCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneEnableFogCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneInitDivineTreeFlowerCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneInitDivineTreeFlowerCommand.cs index ba9f83c8..efcb636c 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneInitDivineTreeFlowerCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneInitDivineTreeFlowerCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneLoadCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneLoadCommand.cs index 282924bb..5af6968c 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneLoadCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneLoadCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneMoveObjectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneMoveObjectCommand.cs index 6861757e..43519903 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneMoveObjectCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneMoveObjectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneObjectDoNotLoadFromSaveStateCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneObjectDoNotLoadFromSaveStateCommand.cs index 8fca067a..5d72b56d 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneObjectDoNotLoadFromSaveStateCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneObjectDoNotLoadFromSaveStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneOpenDoorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneOpenDoorCommand.cs index fc9b5fc9..10211c55 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneOpenDoorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneOpenDoorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldCommand.cs index a8d0e3ce..3e91d4dd 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldInverseCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldInverseCommand.cs index 3279eeaf..6aca9ed0 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldInverseCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SceneRotateWorldInverseCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfActorInTeamCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfActorInTeamCommand.cs index 69980483..0b9bd1ef 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfActorInTeamCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfActorInTeamCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfPlayerHaveItemCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfPlayerHaveItemCommand.cs index cd361e20..e2fac475 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfPlayerHaveItemCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIfPlayerHaveItemCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsEqualToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsEqualToCommand.cs index 7c3a6ddd..e1e7a701 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsEqualToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsEqualToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanCommand.cs index be680bbf..3c2a146a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanOrEqualToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanOrEqualToCommand.cs index 6161c3fe..74254cfb 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanOrEqualToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsGreaterThanOrEqualToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsInRangeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsInRangeCommand.cs index f2959b25..253665d0 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsInRangeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsInRangeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanCommand.cs index b79c7a70..22d4ea49 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanOrEqualToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanOrEqualToCommand.cs index 7cae2700..782aaa7c 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanOrEqualToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsLessThanOrEqualToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsNotEqualToCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsNotEqualToCommand.cs index 500f7038..081f7401 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsNotEqualToCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptEvaluateVarIsNotEqualToCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptExecuteCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptExecuteCommand.cs index bdce0f83..ab3140d2 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptExecuteCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptExecuteCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerChangeExecutionModeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerChangeExecutionModeCommand.cs index d5c612db..48591388 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerChangeExecutionModeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerChangeExecutionModeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoCommand.cs index fb8c5fe9..16fa549a 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoIfNotCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoIfNotCommand.cs index 204b0152..517337ec 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoIfNotCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerGotoIfNotCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerSetOperatorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerSetOperatorCommand.cs index 61e665b8..5d2f6f50 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerSetOperatorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerSetOperatorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerWaitUntilTimeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerWaitUntilTimeCommand.cs index fbb22074..127930f8 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerWaitUntilTimeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptRunnerWaitUntilTimeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarAddValueCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarAddValueCommand.cs index 020aa072..79ebd703 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarAddValueCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarAddValueCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarDistractAnotherVarCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarDistractAnotherVarCommand.cs index b597fa6f..f940569f 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarDistractAnotherVarCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarDistractAnotherVarCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetActorFavorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetActorFavorCommand.cs index c57d26d8..5cb10645 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetActorFavorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetActorFavorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetAppraisalsResultCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetAppraisalsResultCommand.cs index 9bb6f4e4..ab1c0ed0 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetAppraisalsResultCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetAppraisalsResultCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetCombatResultCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetCombatResultCommand.cs index effefb75..0597442d 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetCombatResultCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetCombatResultCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetDialogueSelectionResultCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetDialogueSelectionResultCommand.cs index b4a82541..256a9e39 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetDialogueSelectionResultCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetDialogueSelectionResultCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetFortuneTellingResultCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetFortuneTellingResultCommand.cs new file mode 100644 index 00000000..63d06671 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetFortuneTellingResultCommand.cs @@ -0,0 +1,21 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(186, "将算命结果写入脚本变量")] + public sealed class ScriptVarSetFortuneTellingResultCommand : ICommand + { + public ScriptVarSetFortuneTellingResultCommand(ushort variable) + { + Variable = variable; + } + + [SceUserVariable] + public ushort Variable { get; set; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetFortuneTellingResultCommand.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetFortuneTellingResultCommand.cs.meta new file mode 100644 index 00000000..8f5926b8 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetFortuneTellingResultCommand.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: ed46753daa214055905c8d5b51707b04 diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLeastFavorableActorIdCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLeastFavorableActorIdCommand.cs index 4d084689..ea0df76d 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLeastFavorableActorIdCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLeastFavorableActorIdCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLimitTimeDialogueSelectionResultCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLimitTimeDialogueSelectionResultCommand.cs index 25c6b800..b3831e11 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLimitTimeDialogueSelectionResultCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLimitTimeDialogueSelectionResultCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLongKuiDressIdCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLongKuiDressIdCommand.cs index c7e14ac8..a340df81 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLongKuiDressIdCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetLongKuiDressIdCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMazeSwitchStatusCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMazeSwitchStatusCommand.cs index bc1bbf30..840d2fd7 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMazeSwitchStatusCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMazeSwitchStatusCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMoneyCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMoneyCommand.cs index 727f1845..dac32130 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMoneyCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMoneyCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMostFavorableActorIdCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMostFavorableActorIdCommand.cs index 765b2ec6..42450f1b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMostFavorableActorIdCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetMostFavorableActorIdCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetObjectUsageStatusCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetObjectUsageStatusCommand.cs index a71be7e4..8ff2ac10 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetObjectUsageStatusCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetObjectUsageStatusCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopAccrualTypeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopAccrualTypeCommand.cs index 89f250e7..78b4bd56 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopAccrualTypeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopAccrualTypeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopLevelCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopLevelCommand.cs index 945d3c91..289d4e7b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopLevelCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopLevelCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopManageTypeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopManageTypeCommand.cs index 64f10287..865cf739 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopManageTypeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopManageTypeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopPeriodTypeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopPeriodTypeCommand.cs index f186a627..faa8d27e 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopPeriodTypeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopPeriodTypeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopUnHockTypeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopUnHockTypeCommand.cs index 92519c7f..8b77c9ef 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopUnHockTypeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetPawnshopUnHockTypeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetRandomValueCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetRandomValueCommand.cs index 7bb42f74..e4ce2ed2 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetRandomValueCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetRandomValueCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetValueCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetValueCommand.cs index 49672fa8..c8dfbc99 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetValueCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetValueCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetWheelOfTheFiveElementsUsageCountCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetWheelOfTheFiveElementsUsageCountCommand.cs index 9d52e46f..ad0f0d24 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetWheelOfTheFiveElementsUsageCountCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/ScriptVarSetWheelOfTheFiveElementsUsageCountCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxAddEffectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxAddEffectCommand.cs new file mode 100644 index 00000000..20f83ee6 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxAddEffectCommand.cs @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(167, "在天空盒面添加循环序列帧特效")] + public sealed class SkyboxAddEffectCommand : ICommand + { + public SkyboxAddEffectCommand(string sequence, int face, float x, float y, float scale, float fps, float interval, float initialDelay) + { + Sequence = sequence; + Face = face; + X = x; + Y = y; + Scale = scale; + Fps = fps; + Interval = interval; + InitialDelay = initialDelay; + } + + public string Sequence { get; } + + public int Face { get; } + + public float X { get; } + + public float Y { get; } + + public float Scale { get; } + + public float Fps { get; } + + public float Interval { get; } + + public float InitialDelay { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand167.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxAddEffectCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand167.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxAddEffectCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxRemoveEffectCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxRemoveEffectCommand.cs new file mode 100644 index 00000000..e5469eb6 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxRemoveEffectCommand.cs @@ -0,0 +1,20 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(168, "按序列名称移除天空盒特效")] + public sealed class SkyboxRemoveEffectCommand : ICommand + { + public SkyboxRemoveEffectCommand(string sequence) + { + Sequence = sequence; + } + + public string Sequence { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxRemoveEffectCommand.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxRemoveEffectCommand.cs.meta new file mode 100644 index 00000000..4578178f --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/SkyboxRemoveEffectCommand.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8de0c52c108d471c81986524e153fe42 diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/StopMusicCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/StopMusicCommand.cs index be84977b..81a85809 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/StopMusicCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/StopMusicCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskCompleteCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskCompleteCommand.cs index 0b49d145..2fbe32cc 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskCompleteCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskCompleteCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskOpenCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskOpenCommand.cs index face3042..3cc58885 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskOpenCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TaskOpenCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorCommand.cs index 905cfe28..eb484c96 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorSilentlyCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorSilentlyCommand.cs new file mode 100644 index 00000000..3ec1f6d2 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorSilentlyCommand.cs @@ -0,0 +1,24 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Command.SceCommands +{ + [SceCommand(193, "静默加入或离开队伍")] + public sealed class TeamAddOrRemoveActorSilentlyCommand : ICommand + { + public TeamAddOrRemoveActorSilentlyCommand(int actorId, int isIn) + { + ActorId = actorId; + IsIn = isIn; + } + + [SceActorId] + public int ActorId { get; set; } + + public int IsIn { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand193.cs.meta b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorSilentlyCommand.cs.meta similarity index 100% rename from Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand193.cs.meta rename to Assets/Scripts/Pal3.Core/Command/SceCommands/TeamAddOrRemoveActorSilentlyCommand.cs.meta diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseCommand.cs index f4d7257c..7ae1df99 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseOnSceneChangeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseOnSceneChangeCommand.cs index 0f8f5137..b0b3d181 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseOnSceneChangeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamCloseOnSceneChangeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenCommand.cs index 9a4e2371..5e8e4fa8 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenOnSceneChangeCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenOnSceneChangeCommand.cs index 1e42d102..ad5330fa 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenOnSceneChangeCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamOpenOnSceneChangeCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamSetAttributeToFullCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamSetAttributeToFullCommand.cs index 5b1358e9..7735edcc 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamSetAttributeToFullCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/TeamSetAttributeToFullCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayCaptionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayCaptionCommand.cs index a2685082..b2c27cc1 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayCaptionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayCaptionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNextCaptionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNextCaptionCommand.cs index 0f06df6c..67cd17e8 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNextCaptionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNextCaptionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNoteCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNoteCommand.cs index d10e0383..0f36919b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNoteCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayNoteCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayXueJianPictureCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayXueJianPictureCommand.cs index 9b281fb2..48b4d244 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayXueJianPictureCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIDisplayXueJianPictureCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowDealerMenuCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowDealerMenuCommand.cs index de189682..2af6e023 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowDealerMenuCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowDealerMenuCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowHotelMenuCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowHotelMenuCommand.cs index b01f9e56..e6c50f60 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowHotelMenuCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowHotelMenuCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowSmeltingMenuCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowSmeltingMenuCommand.cs index 001dcb48..702c400b 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowSmeltingMenuCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/UIShowSmeltingMenuCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand166.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand166.cs deleted file mode 100644 index 37d9941d..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand166.cs +++ /dev/null @@ -1,24 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(166, "???")] - public sealed class UnknownCommand166 : ICommand - { - public UnknownCommand166( - int unknown1, - int unknown2) - { - Unknown1 = unknown1; - Unknown2 = unknown2; - } - - public int Unknown1 { get; } - public int Unknown2 { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand167.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand167.cs deleted file mode 100644 index ed60da23..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand167.cs +++ /dev/null @@ -1,42 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(167, "在场景固定位置处播放特效(蜀山雷电特效)")] - public sealed class UnknownCommand167 : ICommand - { - public UnknownCommand167( - string unknown1, - int unknown2, - float unknown3, - float unknown4, - float unknown5, - float unknown6, - float unknown7, - float unknown8) - { - Unknown1 = unknown1; - Unknown2 = unknown2; - Unknown3 = unknown3; - Unknown4 = unknown4; - Unknown5 = unknown5; - Unknown6 = unknown6; - Unknown7 = unknown7; - Unknown8 = unknown8; - } - - public string Unknown1 { get; } - public int Unknown2 { get; } - public float Unknown3 { get; } - public float Unknown4 { get; } - public float Unknown5 { get; } - public float Unknown6 { get; } - public float Unknown7 { get; } - public float Unknown8 { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand176.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand176.cs deleted file mode 100644 index be990eec..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand176.cs +++ /dev/null @@ -1,27 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(176, "南宫煌开启摄灵法阵")] - public sealed class UnknownCommand176 : ICommand - { - public UnknownCommand176( - int unknown1, - int unknown2, - int unknown3) - { - Unknown1 = unknown1; - Unknown2 = unknown2; - Unknown3 = unknown3; - } - - public int Unknown1 { get; } - public int Unknown2 { get; } - public int Unknown3 { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand181.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand181.cs deleted file mode 100644 index 8046b908..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand181.cs +++ /dev/null @@ -1,30 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(181, "???")] - public sealed class UnknownCommand181 : ICommand - { - public UnknownCommand181( - float unknown1, - float unknown2, - float unknown3, - float unknown4) - { - Unknown1 = unknown1; - Unknown2 = unknown2; - Unknown3 = unknown3; - Unknown4 = unknown4; - } - - public float Unknown1 { get; } - public float Unknown2 { get; } - public float Unknown3 { get; } - public float Unknown4 { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand185.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand185.cs deleted file mode 100644 index 342c5960..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand185.cs +++ /dev/null @@ -1,41 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(185, "PAL3A打开算命小游戏UI")] - public sealed class UnknownCommand185 : ICommand - { - public UnknownCommand185(int unknown1, - int unknown2, - int unknown3, - int unknown4, - int unknown5, - int unknown6, - int unknown7, - int unknown8) - { - Unknown1 = unknown1; - Unknown2 = unknown2; - Unknown3 = unknown3; - Unknown4 = unknown4; - Unknown5 = unknown5; - Unknown6 = unknown6; - Unknown7 = unknown7; - Unknown8 = unknown8; - } - - public int Unknown1 { get; } - public int Unknown2 { get; } - public int Unknown3 { get; } - public int Unknown4 { get; } - public int Unknown5 { get; } - public int Unknown6 { get; } - public int Unknown7 { get; } - public int Unknown8 { get; } - } -#endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand193.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand193.cs deleted file mode 100644 index 2cc48c2b..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand193.cs +++ /dev/null @@ -1,22 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(193, "???")] - public sealed class UnknownCommand193 : ICommand - { - public UnknownCommand193(int unknown1, int unknown2) - { - Unknown1 = unknown1; - Unknown2 = unknown2; - } - - public int Unknown1 { get; } - public int Unknown2 { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand196.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand196.cs deleted file mode 100644 index b153f8e7..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand196.cs +++ /dev/null @@ -1,15 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(196, "???")] - public sealed class UnknownCommand196 : ICommand - { - public UnknownCommand196() { } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand197.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand197.cs deleted file mode 100644 index cacb7332..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand197.cs +++ /dev/null @@ -1,22 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(197, "设置风雅颂宿主角色ID?")] - public sealed class UnknownCommand197 : ICommand - { - public UnknownCommand197(int actorId, int enable) - { - ActorId = actorId; - Enable = enable; - } - - [SceActorId] public int ActorId { get; set; } - public int Enable { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand198.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand198.cs deleted file mode 100644 index 9fa9fd2a..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand198.cs +++ /dev/null @@ -1,22 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(198, "???")] - public sealed class UnknownCommand198 : ICommand - { - public UnknownCommand198(int unknown1, int unknown2) - { - Unknown1 = unknown1; - Unknown2 = unknown2; - } - - public int Unknown1 { get; } - public int Unknown2 { get; } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand216.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand216.cs deleted file mode 100644 index c057e9d7..00000000 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/UnknownCommand216.cs +++ /dev/null @@ -1,15 +0,0 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. -// See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- - -namespace Pal3.Core.Command.SceCommands -{ - #if PAL3A - [SceCommand(216, "???")] - public sealed class UnknownCommand216 : ICommand - { - public UnknownCommand216() { } - } - #endif -} \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/WangPengXuEnableCombatTransformCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/WangPengXuEnableCombatTransformCommand.cs index 24916188..1c714d3f 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/WangPengXuEnableCombatTransformCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/WangPengXuEnableCombatTransformCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceCommands/WorldMapEnableRegionCommand.cs b/Assets/Scripts/Pal3.Core/Command/SceCommands/WorldMapEnableRegionCommand.cs index df6174cd..5ec8f93c 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceCommands/WorldMapEnableRegionCommand.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceCommands/WorldMapEnableRegionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command.SceCommands { diff --git a/Assets/Scripts/Pal3.Core/Command/SceUserVariableAttribute.cs b/Assets/Scripts/Pal3.Core/Command/SceUserVariableAttribute.cs index 65b3f5ef..56fae079 100644 --- a/Assets/Scripts/Pal3.Core/Command/SceUserVariableAttribute.cs +++ b/Assets/Scripts/Pal3.Core/Command/SceUserVariableAttribute.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Command { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/ActorConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/ActorConstants.cs index c9ba6241..ee0b1f73 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/ActorConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/ActorConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/AudioConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/AudioConstants.cs index 9b7f950e..ca45e8c5 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/AudioConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/AudioConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/EffectConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/EffectConstants.cs index c14801e4..dc9bdc99 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/EffectConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/EffectConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/EmojiConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/EmojiConstants.cs index 4768b0d6..80abd9b8 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/EmojiConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/EmojiConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/FileConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/FileConstants.cs index 3c71a3a2..873cd301 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/FileConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/FileConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/MusicConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/MusicConstants.cs index 09fd997d..033de6f6 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/MusicConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/MusicConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/SceneConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/SceneConstants.cs index 25a3baae..f419ffc8 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/SceneConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/SceneConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/ScriptConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/ScriptConstants.cs index 720318e6..c1f3ff26 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/ScriptConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/ScriptConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { @@ -18,5 +18,7 @@ public static class ScriptConstants public const int PortalScriptIdMax = 1000; public const ushort MainStoryVariableId = 0x8000; // 32768 + + public const ushort GlobalVariableFlag = 0x8000; } } \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/TaskConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/TaskConstants.cs index aeddf933..8643b25c 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/TaskConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/TaskConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if PAL3A diff --git a/Assets/Scripts/Pal3.Core/Contract/Constants/WorldMapConstants.cs b/Assets/Scripts/Pal3.Core/Contract/Constants/WorldMapConstants.cs index 943b03e6..c19d3c5f 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Constants/WorldMapConstants.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Constants/WorldMapConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Constants { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/ActorEnums.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/ActorEnums.cs index e39aa2ec..b9b32705 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/ActorEnums.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/ActorEnums.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/CombatEnums.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/CombatEnums.cs index f2cfa967..7c65bf5a 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/CombatEnums.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/CombatEnums.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/EffectEnums.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/EffectEnums.cs index 5d0ddc21..e038ce8f 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/EffectEnums.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/EffectEnums.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/ItemEnums.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/ItemEnums.cs index bd206a42..fc9935a4 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/ItemEnums.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/ItemEnums.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/MovementMode.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/MovementMode.cs index aa275cfe..9db9c17d 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/MovementMode.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/MovementMode.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/RenderingState.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/RenderingState.cs index 1a3d2a03..2cd5cfc7 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/RenderingState.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/RenderingState.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/SceneEnums.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/SceneEnums.cs index e4bc517b..3caa9092 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/SceneEnums.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/SceneEnums.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Enums/ScriptEnums.cs b/Assets/Scripts/Pal3.Core/Contract/Enums/ScriptEnums.cs index c1fc2aae..2613af71 100644 --- a/Assets/Scripts/Pal3.Core/Contract/Enums/ScriptEnums.cs +++ b/Assets/Scripts/Pal3.Core/Contract/Enums/ScriptEnums.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Contract.Enums { diff --git a/Assets/Scripts/Pal3.Core/Contract/Pal3ACombatScriptState.cs b/Assets/Scripts/Pal3.Core/Contract/Pal3ACombatScriptState.cs new file mode 100644 index 00000000..78d0afe7 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Contract/Pal3ACombatScriptState.cs @@ -0,0 +1,69 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Core.Contract +{ + using System; + using Enums; + + // Original 176/177 are persistent abilities; 192/196 are next-battle flags. + public sealed class Pal3ACombatScriptState + { + public bool NanGongHuangAbilitiesEnabled { get; set; } + + public bool WangPengXuTransformEnabled { get; set; } + + public bool NextNanGongHuangTransform { get; set; } + + public bool NextWangPengXuTransform { get; set; } + + public bool PreserveLosses { get; set; } + + public int LostHp { get; private set; } + + public int LostMp { get; private set; } + + public int Flags => (NanGongHuangAbilitiesEnabled ? 1 : 0) | (WangPengXuTransformEnabled ? 2 : 0) | + (NextNanGongHuangTransform ? 4 : 0) | (NextWangPengXuTransform ? 8 : 0) | (PreserveLosses ? 16 : 0); + public void Restore(int flags, int lostHp, int lostMp) + { + NanGongHuangAbilitiesEnabled = (flags & 1) != 0; + WangPengXuTransformEnabled = (flags & 2) != 0; + NextNanGongHuangTransform = (flags & 4) != 0; + NextWangPengXuTransform = (flags & 8) != 0; + PreserveLosses = (flags & 16) != 0; + LostHp = Math.Max(0, lostHp); + LostMp = Math.Max(0, lostMp); + } + + public (bool wolf, bool pengXu, int hpBonus, int mpBonus) BeginBattle(bool hasLiaoRiSecondForm) + { + var result = (NextNanGongHuangTransform, NextWangPengXuTransform, + PreserveLosses && hasLiaoRiSecondForm ? LostHp : 0, + PreserveLosses && hasLiaoRiSecondForm ? LostMp : 0); + NextNanGongHuangTransform = NextWangPengXuTransform = false; + if (!PreserveLosses) + LostHp = LostMp = 0; + if (hasLiaoRiSecondForm) + PreserveLosses = false; + return result; + } + + public void RecordAttributeChange(int playerActorId, ActorAttributeType attribute, int delta) + { + if (playerActorId < 0 || playerActorId >= 5 || delta >= 0) + return; + int loss = (int)Math.Min(int.MaxValue, -(long)delta); + if (attribute == ActorAttributeType.Hp) + LostHp = (int)Math.Min(int.MaxValue, (long)LostHp + loss); + if (attribute == ActorAttributeType.Mp) + LostMp = (int)Math.Min(int.MaxValue, (long)LostMp + loss); + } + + public void Reset() => Restore(0, 0, 0); + } +} +#endif diff --git a/Assets/Scripts/Pal3.Core/Contract/Pal3ACombatScriptState.cs.meta b/Assets/Scripts/Pal3.Core/Contract/Pal3ACombatScriptState.cs.meta new file mode 100644 index 00000000..3fb6e240 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/Contract/Pal3ACombatScriptState.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 6e93af18735d44dc850703b505249d5b diff --git a/Assets/Scripts/Pal3.Core/DataReader/Bmp/BmpFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Bmp/BmpFile.cs index 09f6d6a9..457e5efe 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Bmp/BmpFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Bmp/BmpFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Bmp { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkArchive.cs b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkArchive.cs index cba8bca3..c486fe29 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkArchive.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkArchive.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cpk { @@ -23,7 +23,6 @@ public sealed class CpkArchive { private const uint CPK_VERSION = 1; private const uint CPK_HEADER_MAGIC = 0x_1A_54_53_52; // CPK header magic label - private const int CPK_DEFAULT_MAX_NUM_OF_FILE = 32768; // Max number of files per archive private readonly string _filePath; private readonly Crc32Hash _crcHash; @@ -70,14 +69,18 @@ public void Init() } int cpkTableEntitySize = Marshal.SizeOf(typeof(CpkTableEntity)); - int indexTableSize = cpkTableEntitySize * CPK_DEFAULT_MAX_NUM_OF_FILE; + if (header.TableStart < Marshal.SizeOf() || header.TableStart > stream.Length || + header.MaxFileCount > (stream.Length - header.TableStart) / cpkTableEntitySize) + throw new InvalidDataException("CPK index table is outside the archive"); + int indexTableSize = checked(cpkTableEntitySize * (int)header.MaxFileCount); byte[] indexTableBuffer = ArrayPool.Shared.Rent(indexTableSize); try { // Read the whole index table into memory before processing // to avoid I/O overhead - _ = stream.Read(indexTableBuffer, 0, indexTableSize); + stream.Seek(header.TableStart, SeekOrigin.Begin); + CoreUtility.ReadExactly(stream, indexTableBuffer.AsSpan(0, indexTableSize)); uint numOfFiles = header.NumberOfFiles; int filesFound = 0; @@ -144,9 +147,10 @@ private IDictionary GenerateFileNameMap() { long extraInfoOffset = entity.StartPos + entity.PackedSize; stream.Seek(extraInfoOffset, SeekOrigin.Begin); - _ = stream.Read(extraInfoBuffer, 0, extraInfoSize); - string fileName = Encoding.GetEncoding(_codepage) - .GetString(extraInfoBuffer, 0, Array.IndexOf(extraInfoBuffer, (byte)0)); + CoreUtility.ReadExactly(stream, extraInfoBuffer.AsSpan(0, extraInfoSize)); + int terminator = Array.IndexOf(extraInfoBuffer, (byte)0, 0, extraInfoSize); + if (terminator < 0) throw new InvalidDataException("CPK filename has no terminator"); + string fileName = Encoding.GetEncoding(_codepage).GetString(extraInfoBuffer, 0, terminator); crcToFileNameMap[crc] = fileName; } finally @@ -170,7 +174,7 @@ public bool FileExists(string fileVirtualPath, out uint filePathCrcHash) { throw new InvalidOperationException("Initialize the archive before accessing its content"); } - filePathCrcHash = _crcHash.Compute(fileVirtualPath.ToLower(), _codepage); + filePathCrcHash = _crcHash.Compute(fileVirtualPath.Replace('/', CpkConstants.DirectorySeparatorChar).ToLowerInvariant(), _codepage); return _crcToTableEntityMap.ContainsKey(filePathCrcHash); } @@ -211,7 +215,7 @@ public byte[] ReadAllBytes(uint fileVirtualPathCrcHash) using FileStream stream = new(_filePath, FileMode.Open, FileAccess.Read); stream.Seek(entity.StartPos, SeekOrigin.Begin); byte[] buffer = new byte[entity.PackedSize]; - _ = stream.Read(buffer.AsSpan()); + CoreUtility.ReadExactly(stream, buffer); return entity.IsCompressed() ? DecompressDataInArchive(buffer.AsSpan(), entity.OriginSize) : buffer; diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkConstants.cs b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkConstants.cs index 846c409b..4a798dbf 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkConstants.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cpk { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkEntry.cs b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkEntry.cs index 39258656..da5d6706 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkEntry.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkEntry.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cpk { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkHeader.cs b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkHeader.cs index f69b5041..6c444604 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkHeader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkHeader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cpk { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkTableEntity.cs b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkTableEntity.cs index 9d620c02..6b4bb33e 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkTableEntity.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cpk/CpkTableEntity.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cpk { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cpk/Crc32Hash.cs b/Assets/Scripts/Pal3.Core/DataReader/Cpk/Crc32Hash.cs index a5ab65d8..8c82724a 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cpk/Crc32Hash.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cpk/Crc32Hash.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cpk { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cpk/Lzo/MiniLzo.cs b/Assets/Scripts/Pal3.Core/DataReader/Cpk/Lzo/MiniLzo.cs index fc542146..34174996 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cpk/Lzo/MiniLzo.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cpk/Lzo/MiniLzo.cs @@ -60,6 +60,7 @@ public static class MiniLzo public static unsafe void Decompress(Span src, byte[] dst) { + if (src.Length < 3) throw new OverflowException("Input Overrun"); uint t = 0; fixed (byte* input = src, output = dst) { @@ -319,6 +320,7 @@ public static unsafe void Decompress(Span src, byte[] dst) throw new OverflowException("EOF Marker Not Found"); else { + if (op != op_end) throw new OverflowException("Output Length Mismatch"); //Debug.Assert(t == 1); if (ip > ip_end) throw new OverflowException("Input Overrun"); diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFile.cs index 45bfae36..670a0550 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cvd { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFileReader.cs index 81a58e08..769f1c65 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Cvd/CvdFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Cvd { @@ -322,9 +322,10 @@ private static CvdMesh ReadMesh(IBinaryReader reader, float version, int codepag } float[] animationTimeKeys = reader.ReadSingles(numberOfFrames); + float firstTime = numberOfFrames == 0 ? 0 : animationTimeKeys[0]; for (int i = 0; i < numberOfFrames; i++) { - animationTimeKeys[i] -= animationTimeKeys[0]; + animationTimeKeys[i] -= firstTime; } int numberOfMeshes = reader.ReadInt32(); @@ -376,9 +377,10 @@ private static CvdMeshSection ReadMeshSection(IBinaryReader reader, int numberOfFrames = reader.ReadInt32(); animationTimeKeys = reader.ReadSingles(numberOfFrames); + float firstTime = numberOfFrames == 0 ? 0 : animationTimeKeys[0]; for (int i = 0; i < numberOfFrames; i++) { - animationTimeKeys[i] -= animationTimeKeys[0]; + animationTimeKeys[i] -= firstTime; } animationMaterials = new GameBoxMaterial[numberOfFrames]; diff --git a/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFile.cs index c6f39bc1..e5039853 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Dat { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFileReader.cs index 0e5cffba..d575a1fb 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Dat/EffectLinkerFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Dat { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFile.cs index c4209c21..b993d5f2 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Data { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFileReader.cs index 39889d9b..87a008f1 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Data/EffectDefinitionFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Data { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt1Decoder.cs b/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt1Decoder.cs index 7c25331c..3e076f37 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt1Decoder.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt1Decoder.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Dxt { @@ -25,14 +25,18 @@ public static byte[] ToRgba32(byte[] data, int width, int height) return buffer; } - public static unsafe void ToRgba32(byte[] data, int width, int height, byte[] buffer) + public static unsafe void ToRgba32(byte[] data, int width, int height, byte[] buffer, int sourceOffset = DDS_FILE_HEADER_SIZE) { - if (buffer == null || buffer.Length < width * height * 4) + if (width <= 0 || height <= 0 || buffer == null || (long)buffer.Length < (long)width * height * 4) { throw new ArgumentException("buffer is null or too small"); } - fixed (byte* srcStart = &data[DDS_FILE_HEADER_SIZE], dstStart = buffer) + if (sourceOffset < 0 || data == null || + (long)sourceOffset + ((width + 3L) / 4) * ((height + 3L) / 4) * 8 > data.Length) + throw new ArgumentException("DXT source data is too small"); + + fixed (byte* srcStart = &data[sourceOffset], dstStart = buffer) { byte* src = srcStart; byte* dst = dstStart; diff --git a/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt3Decoder.cs b/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt3Decoder.cs index cca87d25..1aeb66c9 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt3Decoder.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Dxt/Dxt3Decoder.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Dxt { @@ -25,14 +25,18 @@ public static byte[] ToRgba32(byte[] data, int width, int height) return buffer; } - public static unsafe void ToRgba32(byte[] data, int width, int height, byte[] buffer) + public static unsafe void ToRgba32(byte[] data, int width, int height, byte[] buffer, int sourceOffset = DDS_FILE_HEADER_SIZE) { - if (buffer == null || buffer.Length < width * height * 4) + if (width <= 0 || height <= 0 || buffer == null || (long)buffer.Length < (long)width * height * 4) { throw new ArgumentException("buffer is null or too small"); } - fixed (byte* srcStart = &data[DDS_FILE_HEADER_SIZE], dstStart = buffer) + if (sourceOffset < 0 || data == null || + (long)sourceOffset + ((width + 3L) / 4) * ((height + 3L) / 4) * 16 > data.Length) + throw new ArgumentException("DXT source data is too small"); + + fixed (byte* srcStart = &data[sourceOffset], dstStart = buffer) { byte* src = srcStart; byte* dst = dstStart; diff --git a/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtHeader.cs b/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtHeader.cs index 94805733..1098e640 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtHeader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtHeader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Dxt { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtImage.cs b/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtImage.cs new file mode 100644 index 00000000..6b75c343 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtImage.cs @@ -0,0 +1,96 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Pal3.Core.DataReader.Dxt +{ + using System; + using System.IO; + + /// A validated, two-dimensional DXT1/DXT3 DDS and its mip layout. + public sealed class DxtImage + { + public byte[] Data { get; } + public int Width { get; } + public int Height { get; } + public int MipCount { get; } + public bool HasAlphaChannel { get; } + public bool HasTransparency { get; } + private readonly int[] _offsets; + + public DxtImage(byte[] data) + { + if (data == null || data.Length < 128) throw new InvalidDataException("Truncated DDS header"); + using var reader = new BinaryReader(new MemoryStream(data)); + if (reader.ReadUInt32() != 0x20534444) throw new InvalidDataException("Invalid DDS magic"); + DxtHeader header = DxtHeader.ReadHeader(reader); + if (header.Size != 124 || header.DxtPixelFormat.Size != 32 || + (header.DxtPixelFormat.Flags & 4) == 0 || header.Caps2 != 0 || header.Depth > 1 || + header.Width <= 0 || header.Height <= 0) + throw new InvalidDataException("Unsupported DDS header or dimensions"); + if (header.DxtPixelFormat.Format is not ("DXT1" or "DXT3")) + throw new InvalidDataException($"Unsupported DDS format: {header.DxtPixelFormat.Format}"); + Width = header.Width; + Height = header.Height; + HasAlphaChannel = header.DxtPixelFormat.Format == "DXT3"; + MipCount = Math.Max(1, header.MipMapCount); + int maximumMips = 1; + for (int size = Math.Max(Width, Height); size > 1; size >>= 1) maximumMips++; + if (MipCount > maximumMips || header.MipMapCount < 0) + throw new InvalidDataException("Invalid DDS mip count"); + // Also bound the decoded allocation before entering the unsafe block decoders. + if ((long)Width * Height * 4 > int.MaxValue) + throw new InvalidDataException("DDS dimensions are too large"); + _offsets = new int[MipCount]; + long offset = 128; + for (int mip = 0; mip < MipCount; mip++) + { + _offsets[mip] = checked((int)offset); + offset += ((GetWidth(mip) + 3L) / 4) * ((GetHeight(mip) + 3L) / 4) * (HasAlphaChannel ? 16 : 8); + if (offset > data.Length) throw new InvalidDataException("Truncated DDS mip data"); + } + Data = data; + // DXT1 also has a one-bit transparent palette entry. Preserve its coverage even + // though the loader's legacy hasAlphaChannel flag only identifies DXT3 textures. + HasTransparency = HasAlphaChannel || HasTransparentDxt1Block(); + } + + private bool HasTransparentDxt1Block() + { + int blocks = checked(((Width + 3) / 4) * ((Height + 3) / 4)); + for (int block = 0; block < blocks; block++) + { + int offset = 128 + block * 8; + if (BitConverter.ToUInt16(Data, offset) > BitConverter.ToUInt16(Data, offset + 2)) continue; + uint indices = BitConverter.ToUInt32(Data, offset + 4); + if ((indices & (indices >> 1) & 0x55555555u) != 0) return true; + } + return false; + } + + public int GetWidth(int mip) => Math.Max(1, Width >> mip); + public int GetHeight(int mip) => Math.Max(1, Height >> mip); + public int GetOffset(int mip) => _offsets[mip]; + + public void Decode(int mip, byte[] destination) + { + if (HasAlphaChannel) Dxt3Decoder.ToRgba32(Data, GetWidth(mip), GetHeight(mip), destination, _offsets[mip]); + else Dxt1Decoder.ToRgba32(Data, GetWidth(mip), GetHeight(mip), destination, _offsets[mip]); + } + + /// Read a base-level pixel without keeping an uncompressed CPU texture copy. + public (byte r, byte g, byte b, byte a) GetPixel(int x, int y) + { + if ((uint)x >= (uint)Width || (uint)y >= (uint)Height) + throw new ArgumentOutOfRangeException(nameof(x), "DDS pixel is outside the base level"); + int block = (y / 4) * ((Width + 3) / 4) + x / 4; + var pixels = new byte[64]; + int offset = 128 + block * (HasAlphaChannel ? 16 : 8); + if (HasAlphaChannel) Dxt3Decoder.ToRgba32(Data, 4, 4, pixels, offset); + else Dxt1Decoder.ToRgba32(Data, 4, 4, pixels, offset); + int index = ((y % 4) * 4 + x % 4) * 4; + return (pixels[index], pixels[index + 1], pixels[index + 2], pixels[index + 3]); + } + } +} diff --git a/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtImage.cs.meta b/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtImage.cs.meta new file mode 100644 index 00000000..d0e7c559 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/DataReader/Dxt/DxtImage.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: a82951fed2f4427489fbf6711a6cfad1 diff --git a/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFile.cs index 61cd0346..2ea44962 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Gdb { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFileReader.cs index 0777c128..763d65bc 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Gdb/GdbFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Gdb { diff --git a/Assets/Scripts/Pal3.Core/DataReader/IBinaryReader.cs b/Assets/Scripts/Pal3.Core/DataReader/IBinaryReader.cs index fbca878d..c4ccd6e0 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/IBinaryReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/IBinaryReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader { @@ -33,6 +33,15 @@ public interface IBinaryReader : IDisposable public byte[] ReadBytes(int count); #region Helper Extensions (Default Implementation) + public byte[] ReadExactly(int count) + { + if (count < 0) throw new ArgumentOutOfRangeException(nameof(count)); + if (count > Length - Position) throw new EndOfStreamException(); + byte[] bytes = ReadBytes(count); + if (bytes.Length != count) throw new EndOfStreamException(); + return bytes; + } + [MethodImpl(MethodImplOptions.AggressiveInlining)] public float[] ReadSingles(int count) { @@ -135,7 +144,7 @@ public T[] ReadEnums(int count) where T : Enum [MethodImpl(MethodImplOptions.AggressiveInlining)] public char[] ReadChars(int count) { - return Encoding.ASCII.GetChars(ReadBytes(count)); + return Encoding.ASCII.GetChars(ReadExactly(count)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -144,7 +153,7 @@ public char[] ReadChars(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public string ReadString(int count, int codepage) { - var strBytes = ReadBytes(count); + var strBytes = ReadExactly(count); int length = Array.IndexOf(strBytes, (byte)0); if (length == -1) length = strBytes.Length; // If no null byte is found, use the full length return Encoding.GetEncoding(codepage).GetString(strBytes, 0, length); diff --git a/Assets/Scripts/Pal3.Core/DataReader/IFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/IFileReader.cs index ca25685d..e2b91ad4 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/IFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/IFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Ini/ActorConfigFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Ini/ActorConfigFile.cs index 2bea5713..5d9b8fa0 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Ini/ActorConfigFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Ini/ActorConfigFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Ini { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFile.cs index 1928aca1..bf529220 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Ini { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFileReader.cs index 20583f82..69fe4657 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatCameraConfigFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Ini { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFile.cs index eb8809c1..278ec0e4 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Ini { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFileReader.cs index 59323f23..d99d0043 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Ini/CombatConfigFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Ini { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Ini/MovConfigFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Ini/MovConfigFileReader.cs index f4459c4f..ae9282c1 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Ini/MovConfigFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Ini/MovConfigFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Ini { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Ini/Mv3ConfigFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Ini/Mv3ConfigFileReader.cs index 95f9a249..c367f134 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Ini/Mv3ConfigFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Ini/Mv3ConfigFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Ini { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFile.cs index 6e28e9bf..6e697590 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Lgt { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFileReader.cs index 3357d8b8..c87c4681 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Lgt/LgtFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Lgt { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFile.cs index d0df68d1..cf2fab84 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Mov { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFileReader.cs index da9ae9a9..85c86364 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Mov/MovFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Mov { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFile.cs index d48c3557..aa0a7186 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Msh { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFileReader.cs index ee6f157f..e09c55e8 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Msh/MshFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Msh { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFile.cs index 894217ee..cdd93376 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Mtl { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFileReader.cs index 00dc967d..4b69cdf2 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Mtl/MtlFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Mtl { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3File.cs b/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3File.cs index b7761855..020091ad 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3File.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3File.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Mv3 { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3FileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3FileReader.cs index 5ffb0b38..71190378 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3FileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Mv3/Mv3FileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Mv3 { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFile.cs index ef383dfc..bb3aa752 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Nav { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFileReader.cs index 1f811074..1a7f4fea 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Nav/NavFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Nav { @@ -24,6 +24,8 @@ public NavFile Read(IBinaryReader reader, int codepage) } byte version = reader.ReadByte(); + if (version != 1 && version != 2) + throw new InvalidDataException($"Invalid NAV version: {version}"); byte numberOfLayers = reader.ReadByte(); uint tileOffset = reader.ReadUInt32(); uint faceOffset = reader.ReadUInt32(); @@ -70,11 +72,10 @@ private static NavLayer ReadLayerData(IBinaryReader reader, byte version) int width = reader.ReadInt32(); int height = reader.ReadInt32(); - int navMapSize = width * height; - if (navMapSize <= 0) - { - throw new Exception($"Invalid NAV(.nav) file: Map size is in valid: {navMapSize}"); - } + long mapSize = (long)width * height; + if (width <= 0 || height <= 0 || mapSize > int.MaxValue || mapSize > (reader.Length - reader.Position) / 8) + throw new InvalidDataException($"Invalid NAV dimensions: {width}x{height}"); + int navMapSize = (int)mapSize; NavTile[] tiles = new NavTile[navMapSize]; for (int i = 0; i < navMapSize; i++) diff --git a/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFile.cs index 23edd9cd..3457fc97 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Pol { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFileReader.cs index 6998e34f..df8c7055 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Pol { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Pol/PolMeshIndexMap.cs b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolMeshIndexMap.cs new file mode 100644 index 00000000..7d583914 --- /dev/null +++ b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolMeshIndexMap.cs @@ -0,0 +1,41 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Pal3.Core.DataReader.Pol +{ + using System; + using System.Collections.Generic; + + /// Remove unused vertices without welding UV seams or front/back normal groups. + public sealed class PolMeshIndexMap + { + public int[] SourceIndices { get; } + public int[] Triangles { get; } + + public PolMeshIndexMap(int vertexCount, int[] triangles) + { + if (vertexCount < 0) throw new ArgumentOutOfRangeException(nameof(vertexCount)); + if (triangles == null || triangles.Length % 3 != 0) + throw new ArgumentException("POL indices must contain complete triangles", nameof(triangles)); + var map = new Dictionary(); + var source = new List(); + Triangles = new int[triangles.Length]; + for (int i = 0; i < triangles.Length; i++) + { + int index = triangles[i]; + if ((uint)index >= (uint)vertexCount) + throw new ArgumentOutOfRangeException(nameof(triangles), "POL vertex index is out of range"); + if (!map.TryGetValue(index, out int compactIndex)) + { + compactIndex = source.Count; + map.Add(index, compactIndex); + source.Add(index); + } + Triangles[i] = compactIndex; + } + SourceIndices = source.ToArray(); + } + } +} diff --git a/Assets/Scripts/Pal3.Core/DataReader/Pol/PolMeshIndexMap.cs.meta b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolMeshIndexMap.cs.meta new file mode 100644 index 00000000..f10d7abd --- /dev/null +++ b/Assets/Scripts/Pal3.Core/DataReader/Pol/PolMeshIndexMap.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8dd0858552b14b66be057b4bce5de435 diff --git a/Assets/Scripts/Pal3.Core/DataReader/SafeBinaryReader.cs b/Assets/Scripts/Pal3.Core/DataReader/SafeBinaryReader.cs index 4c31918d..5e286edb 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/SafeBinaryReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/SafeBinaryReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFile.cs index 8ff58f32..78da9dc3 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Sce { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFileReader.cs index 8e5dd586..b9760eb0 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Sce/SceFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Sce { @@ -45,6 +45,7 @@ public SceFile Read(IBinaryReader reader, int codepage) private static SceScriptBlock ReadScriptBlock(IBinaryReader reader, SceIndex sceIndex, int codepage) { + if (sceIndex.Offset > reader.Length - 4) throw new InvalidDataException("SCE block offset is outside the file"); reader.Seek(sceIndex.Offset, SeekOrigin.Begin); uint id = reader.ReadUInt32(); @@ -59,7 +60,7 @@ private static SceScriptBlock ReadScriptBlock(IBinaryReader reader, SceIndex sce } uint scriptSize = reader.ReadUInt32(); - byte[] scriptData = reader.ReadBytes((int)scriptSize); + byte[] scriptData = reader.ReadExactly(checked((int)scriptSize)); return new SceScriptBlock() { @@ -74,7 +75,7 @@ private static SceUserVarInfo ReadUserVarInfo(IBinaryReader reader) { byte type = reader.ReadByte(); ushort length = reader.ReadUInt16(); - byte[] data = reader.ReadBytes(length); + byte[] data = reader.ReadExactly(length); return new SceUserVarInfo() { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFile.cs index 4e831c9f..c55b5bdb 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Scn { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFileReader.cs index 251fedaa..12ab3255 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Scn/ScnFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Scn { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Tga/TgaDecoder.cs b/Assets/Scripts/Pal3.Core/DataReader/Tga/TgaDecoder.cs index ce8ad0d4..abdabadb 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Tga/TgaDecoder.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Tga/TgaDecoder.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Tga { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFile.cs index f0d2b206..778cd785 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Txt { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFileReader.cs index 920c7dbf..524f30df 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Txt/CombatScnFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Txt { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFile.cs b/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFile.cs index 2e111917..4eea5b48 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFile.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFile.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Txt { diff --git a/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFileReader.cs b/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFileReader.cs index e8298b3c..eea25fda 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFileReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/Txt/TaskDefinitionFileReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader.Txt { diff --git a/Assets/Scripts/Pal3.Core/DataReader/UnsafeBinaryReader.cs b/Assets/Scripts/Pal3.Core/DataReader/UnsafeBinaryReader.cs index 4a0dcbe0..3331b217 100644 --- a/Assets/Scripts/Pal3.Core/DataReader/UnsafeBinaryReader.cs +++ b/Assets/Scripts/Pal3.Core/DataReader/UnsafeBinaryReader.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.DataReader { @@ -32,17 +32,23 @@ public UnsafeBinaryReader(Stream stream) throw new ArgumentException("Stream must be seekable", nameof(stream)); } - Length = stream.Length; - if (Length == 0) return; - - byte[] data = new byte[Length]; - _ = stream.Read(data, 0, (int)Length); - + long position = stream.Position; + byte[] data = new byte[checked((int)stream.Length)]; + stream.Seek(0, SeekOrigin.Begin); + int offset = 0; + while (offset < data.Length) + { + int read = stream.Read(data, offset, data.Length - offset); + if (read == 0) throw new EndOfStreamException(); + offset += read; + } Init(data); + Seek(position, SeekOrigin.Begin); } private void Init(byte[] data) { + if (data == null) throw new ArgumentNullException(nameof(data)); Length = data.Length; if (Length == 0) return; @@ -57,31 +63,39 @@ private void Init(byte[] data) public long Position { [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => Length == 0 ? 0 : _dataPtr - _startPtr; + get => _dataPtr - _startPtr; } public long Length { get; private set; } public void Seek(long offset, SeekOrigin seekOrigin) { - switch (seekOrigin) + if (_disposedValue) throw new ObjectDisposedException(nameof(UnsafeBinaryReader)); + long origin = seekOrigin switch { - case SeekOrigin.Begin: - _dataPtr = _startPtr + offset; - break; - case SeekOrigin.Current: - _dataPtr += offset; - break; - case SeekOrigin.End: - throw new NotSupportedException("SeekOrigin.End is not supported for UnsafeBinaryReader"); - default: - throw new ArgumentException("Invalid SeekOrigin", nameof(seekOrigin)); - } + SeekOrigin.Begin => 0, + SeekOrigin.Current => Position, + SeekOrigin.End => Length, + _ => throw new ArgumentException("Invalid SeekOrigin", nameof(seekOrigin)) + }; + long position = checked(origin + offset); + if (position < 0) throw new IOException("Cannot seek before the beginning of the stream"); + _dataPtr = _startPtr + position; + } + + [MethodImpl(MethodImplOptions.AggressiveInlining)] + private void EnsureAvailable(long count) + { + if (_disposedValue) throw new ObjectDisposedException(nameof(UnsafeBinaryReader)); + if (count < 0) throw new ArgumentOutOfRangeException(nameof(count)); + if (count == 0) return; + if (Position > Length || count > Length - Position) throw new EndOfStreamException(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public short ReadInt16() { + EnsureAvailable(sizeof(short)); short value = *(short*)_dataPtr; _dataPtr += sizeof(short); return value; @@ -90,6 +104,7 @@ public short ReadInt16() [MethodImpl(MethodImplOptions.AggressiveInlining)] public int ReadInt32() { + EnsureAvailable(sizeof(int)); int value = *(int*)_dataPtr; _dataPtr += sizeof(int); return value; @@ -98,6 +113,7 @@ public int ReadInt32() [MethodImpl(MethodImplOptions.AggressiveInlining)] public long ReadInt64() { + EnsureAvailable(sizeof(long)); long value = *(long*)_dataPtr; _dataPtr += sizeof(long); return value; @@ -106,6 +122,7 @@ public long ReadInt64() [MethodImpl(MethodImplOptions.AggressiveInlining)] public ushort ReadUInt16() { + EnsureAvailable(sizeof(ushort)); ushort value = *(ushort*)_dataPtr; _dataPtr += sizeof(ushort); return value; @@ -114,6 +131,7 @@ public ushort ReadUInt16() [MethodImpl(MethodImplOptions.AggressiveInlining)] public uint ReadUInt32() { + EnsureAvailable(sizeof(uint)); uint value = *(uint*)_dataPtr; _dataPtr += sizeof(uint); return value; @@ -122,6 +140,7 @@ public uint ReadUInt32() [MethodImpl(MethodImplOptions.AggressiveInlining)] public ulong ReadUInt64() { + EnsureAvailable(sizeof(ulong)); ulong value = *(ulong*)_dataPtr; _dataPtr += sizeof(ulong); return value; @@ -130,6 +149,7 @@ public ulong ReadUInt64() [MethodImpl(MethodImplOptions.AggressiveInlining)] public float ReadSingle() { + EnsureAvailable(sizeof(float)); float value = *(float*)_dataPtr; _dataPtr += sizeof(float); return value; @@ -138,22 +158,19 @@ public float ReadSingle() [MethodImpl(MethodImplOptions.AggressiveInlining)] public double ReadDouble() { + EnsureAvailable(sizeof(double)); double value = *(double*)_dataPtr; _dataPtr += sizeof(double); return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] - public bool ReadBoolean() - { - bool value = *(bool*)_dataPtr; - _dataPtr += sizeof(bool); - return value; - } + public bool ReadBoolean() => ReadByte() != 0; [MethodImpl(MethodImplOptions.AggressiveInlining)] public byte ReadByte() { + EnsureAvailable(sizeof(byte)); byte value = *_dataPtr; _dataPtr += sizeof(byte); return value; @@ -162,6 +179,9 @@ public byte ReadByte() [MethodImpl(MethodImplOptions.AggressiveInlining)] public byte[] ReadBytes(int count) { + if (count < 0) throw new ArgumentOutOfRangeException(nameof(count)); + EnsureAvailable(0); + count = (int)Math.Min(count, Math.Max(0, Length - Position)); byte[] values = new byte[count]; fixed (byte* dst = values) { @@ -177,6 +197,7 @@ public byte[] ReadBytes(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public float[] ReadSingles(int count) { + EnsureAvailable((long)count * sizeof(float)); float[] values = new float[count]; fixed (float* dst = values) { @@ -192,6 +213,7 @@ public float[] ReadSingles(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public double[] ReadDoubles(int count) { + EnsureAvailable((long)count * sizeof(double)); double[] values = new double[count]; fixed (double* dst = values) { @@ -207,6 +229,7 @@ public double[] ReadDoubles(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public short[] ReadInt16s(int count) { + EnsureAvailable((long)count * sizeof(short)); short[] values = new short[count]; fixed (short* dst = values) { @@ -222,6 +245,7 @@ public short[] ReadInt16s(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public int[] ReadInt32s(int count) { + EnsureAvailable((long)count * sizeof(int)); int[] values = new int[count]; fixed (int* dst = values) { @@ -237,6 +261,7 @@ public int[] ReadInt32s(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public long[] ReadInt64s(int count) { + EnsureAvailable((long)count * sizeof(long)); long[] values = new long[count]; fixed (long* dst = values) { @@ -252,6 +277,7 @@ public long[] ReadInt64s(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public GameBoxVector2 ReadGameBoxVector2() { + EnsureAvailable(sizeof(GameBoxVector2)); GameBoxVector2 value = *(GameBoxVector2*)_dataPtr; _dataPtr += sizeof(GameBoxVector2); return value; @@ -260,6 +286,7 @@ public GameBoxVector2 ReadGameBoxVector2() [MethodImpl(MethodImplOptions.AggressiveInlining)] public GameBoxVector2[] ReadGameBoxVector2s(int count) { + EnsureAvailable((long)count * sizeof(GameBoxVector2)); GameBoxVector2[] values = new GameBoxVector2[count]; fixed (GameBoxVector2* ptr = values) { @@ -275,6 +302,7 @@ public GameBoxVector2[] ReadGameBoxVector2s(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public GameBoxVector3 ReadGameBoxVector3() { + EnsureAvailable(sizeof(GameBoxVector3)); GameBoxVector3 value = *(GameBoxVector3*)_dataPtr; _dataPtr += sizeof(GameBoxVector3); return value; @@ -283,6 +311,7 @@ public GameBoxVector3 ReadGameBoxVector3() [MethodImpl(MethodImplOptions.AggressiveInlining)] public GameBoxVector3[] ReadGameBoxVector3s(int count) { + EnsureAvailable((long)count * sizeof(GameBoxVector3)); GameBoxVector3[] values = new GameBoxVector3[count]; fixed (GameBoxVector3* ptr = values) { @@ -298,6 +327,7 @@ public GameBoxVector3[] ReadGameBoxVector3s(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public Color32 ReadColor32() { + EnsureAvailable(sizeof(Color32)); Color32 value = *(Color32*)_dataPtr; _dataPtr += sizeof(Color32); return value; @@ -306,6 +336,7 @@ public Color32 ReadColor32() [MethodImpl(MethodImplOptions.AggressiveInlining)] public Color32[] ReadColor32s(int count) { + EnsureAvailable((long)count * sizeof(Color32)); Color32[] values = new Color32[count]; fixed (Color32* ptr = values) { @@ -321,6 +352,7 @@ public Color32[] ReadColor32s(int count) [MethodImpl(MethodImplOptions.AggressiveInlining)] public Color ReadColor() { + EnsureAvailable(sizeof(Color)); Color value = *(Color*)_dataPtr; _dataPtr += sizeof(Color); return value; @@ -329,6 +361,7 @@ public Color ReadColor() [MethodImpl(MethodImplOptions.AggressiveInlining)] public Color[] ReadColors(int count) { + EnsureAvailable((long)count * sizeof(Color)); Color[] values = new Color[count]; fixed (Color* ptr = values) { @@ -351,10 +384,9 @@ private void Dispose(bool disposing) GC.SuppressFinalize(this); } - if (Length != 0) - { - _handle.Free(); - } + if (_handle.IsAllocated) _handle.Free(); + _startPtr = null; + _dataPtr = null; _disposedValue = true; } diff --git a/Assets/Scripts/Pal3.Core/Extensions/DictionaryExtensions.cs b/Assets/Scripts/Pal3.Core/Extensions/DictionaryExtensions.cs index af901054..e808831d 100644 --- a/Assets/Scripts/Pal3.Core/Extensions/DictionaryExtensions.cs +++ b/Assets/Scripts/Pal3.Core/Extensions/DictionaryExtensions.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Extensions { diff --git a/Assets/Scripts/Pal3.Core/FileSystem/CpkFileSystem.cs b/Assets/Scripts/Pal3.Core/FileSystem/CpkFileSystem.cs index fc2474a0..d8ae4e60 100644 --- a/Assets/Scripts/Pal3.Core/FileSystem/CpkFileSystem.cs +++ b/Assets/Scripts/Pal3.Core/FileSystem/CpkFileSystem.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.FileSystem { @@ -53,7 +53,8 @@ public string GetRootPath() /// Codepage CPK file uses for encoding text info public void Mount(string cpkFileRelativePath, int codepage) { - string cpkFileName = CoreUtility.GetFileName(cpkFileRelativePath, Path.DirectorySeparatorChar).ToLower(); + cpkFileRelativePath = cpkFileRelativePath.Replace('\\', Path.DirectorySeparatorChar).Replace('/', Path.DirectorySeparatorChar); + string cpkFileName = CoreUtility.GetFileName(cpkFileRelativePath, Path.DirectorySeparatorChar).ToLowerInvariant(); if (_cpkArchives.ContainsKey(cpkFileName)) { @@ -224,7 +225,7 @@ private void ExtractToInternal(CpkArchive archive, IEnumerable nodes, } else { - uint crcHash = _crcHash.Compute(node.VirtualPath.ToLower(), _codepage); + uint crcHash = _crcHash.Compute(node.VirtualPath.ToLowerInvariant(), _codepage); File.WriteAllBytes(outputFolder + relativePath, archive.ReadAllBytes(crcHash)); } } @@ -356,13 +357,14 @@ private IDictionary> SearchInternal(IEnumerableFile relative path inside archive in lower cases private void ParseFileVirtualPath(string fullVirtualPath, out string cpkFileName, out string relativeVirtualPath) { + fullVirtualPath = fullVirtualPath.Replace('/', CpkConstants.DirectorySeparatorChar); if (!fullVirtualPath.Contains(CpkConstants.DirectorySeparatorChar)) { throw new ArgumentException($"File virtual path is invalid: {fullVirtualPath}"); } - cpkFileName = fullVirtualPath[..fullVirtualPath.IndexOf(CpkConstants.DirectorySeparatorChar)].ToLower(); - relativeVirtualPath = fullVirtualPath[(fullVirtualPath.IndexOf(CpkConstants.DirectorySeparatorChar) + 1)..].ToLower(); + cpkFileName = fullVirtualPath[..fullVirtualPath.IndexOf(CpkConstants.DirectorySeparatorChar)].ToLowerInvariant(); + relativeVirtualPath = fullVirtualPath[(fullVirtualPath.IndexOf(CpkConstants.DirectorySeparatorChar) + 1)..].ToLowerInvariant(); } } } \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Core/FileSystem/ICpkFileSystem.cs b/Assets/Scripts/Pal3.Core/FileSystem/ICpkFileSystem.cs index 95ce7b67..1090ef36 100644 --- a/Assets/Scripts/Pal3.Core/FileSystem/ICpkFileSystem.cs +++ b/Assets/Scripts/Pal3.Core/FileSystem/ICpkFileSystem.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.FileSystem { diff --git a/Assets/Scripts/Pal3.Core/Primitives/Color.cs b/Assets/Scripts/Pal3.Core/Primitives/Color.cs index 999b27da..8ae7adbf 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/Color.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/Color.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/Color32.cs b/Assets/Scripts/Pal3.Core/Primitives/Color32.cs index 1b803857..9d497f09 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/Color32.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/Color32.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxBlendFlag.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxBlendFlag.cs index e752bb9f..50e7b04e 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxBlendFlag.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxBlendFlag.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightDecayType.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightDecayType.cs index a9a62b75..55904b70 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightDecayType.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightDecayType.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightShapeType.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightShapeType.cs index 79f98f86..823efda0 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightShapeType.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightShapeType.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightType.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightType.cs index 46a7a95a..3438093c 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightType.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxLightType.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxMaterial.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxMaterial.cs index b95148ad..bd942da7 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxMaterial.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxMaterial.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxMatrix4x4.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxMatrix4x4.cs index 2271ef5b..6e9ace33 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxMatrix4x4.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxMatrix4x4.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxQuaternion.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxQuaternion.cs index dc23aebc..a75aeecf 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxQuaternion.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxQuaternion.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxRect.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxRect.cs index e8ce7450..3186745c 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxRect.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxRect.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2.cs index 13e0d63d..45f92025 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2Int.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2Int.cs index 55c02381..00016176 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2Int.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector2Int.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector3.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector3.cs index 960903d9..3437b073 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector3.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVector3.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVertexType.cs b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVertexType.cs index 18b7dc86..4a4d1031 100644 --- a/Assets/Scripts/Pal3.Core/Primitives/GameBoxVertexType.cs +++ b/Assets/Scripts/Pal3.Core/Primitives/GameBoxVertexType.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Primitives { diff --git a/Assets/Scripts/Pal3.Core/Utilities/CoreUtility.cs b/Assets/Scripts/Pal3.Core/Utilities/CoreUtility.cs index 9e388139..3a97c8a1 100644 --- a/Assets/Scripts/Pal3.Core/Utilities/CoreUtility.cs +++ b/Assets/Scripts/Pal3.Core/Utilities/CoreUtility.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Utilities { @@ -18,7 +18,7 @@ public static T ReadStruct(Stream stream) where T : struct { int structSize = Marshal.SizeOf(typeof(T)); byte[] buffer = new byte[structSize]; - _ = stream.Read(buffer); + ReadExactly(stream, buffer); return ReadStructInternal(buffer); } @@ -27,8 +27,21 @@ public static T ReadStruct(Span bytes, int offset = 0) where T : struct return ReadStructInternal(bytes, offset); } + internal static void ReadExactly(Stream stream, Span buffer) + { + int offset = 0; + while (offset < buffer.Length) + { + int read = stream.Read(buffer[offset..]); + if (read == 0) throw new EndOfStreamException(); + offset += read; + } + } + private static unsafe T ReadStructInternal(Span bytes, int offset = 0) where T : struct { + if (offset < 0 || offset > bytes.Length - Marshal.SizeOf(typeof(T))) + throw new EndOfStreamException("Truncated binary structure"); fixed (byte* ptr = &bytes[offset]) { return (T) (Marshal.PtrToStructure((IntPtr) ptr, typeof(T)) ?? default(T)); @@ -264,7 +277,7 @@ public static string GetDirectoryName(string filePath, char directorySeparatorCh public static string GetFileName(string filePath, char directorySeparatorChar) { return !filePath.Contains(directorySeparatorChar) ? - string.Empty : + filePath : filePath[(filePath.LastIndexOf(directorySeparatorChar)+1)..]; } diff --git a/Assets/Scripts/Pal3.Core/Utilities/ITransactionalKeyValueStore.cs b/Assets/Scripts/Pal3.Core/Utilities/ITransactionalKeyValueStore.cs index 1bf90e2f..89d88e9f 100644 --- a/Assets/Scripts/Pal3.Core/Utilities/ITransactionalKeyValueStore.cs +++ b/Assets/Scripts/Pal3.Core/Utilities/ITransactionalKeyValueStore.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Utilities { diff --git a/Assets/Scripts/Pal3.Core/Utilities/InMemoryKeyValueStore.cs b/Assets/Scripts/Pal3.Core/Utilities/InMemoryKeyValueStore.cs index bf72b678..52ef3eee 100644 --- a/Assets/Scripts/Pal3.Core/Utilities/InMemoryKeyValueStore.cs +++ b/Assets/Scripts/Pal3.Core/Utilities/InMemoryKeyValueStore.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Utilities { diff --git a/Assets/Scripts/Pal3.Core/Utilities/RandomGenerator.cs b/Assets/Scripts/Pal3.Core/Utilities/RandomGenerator.cs index 5e887629..cc15443e 100644 --- a/Assets/Scripts/Pal3.Core/Utilities/RandomGenerator.cs +++ b/Assets/Scripts/Pal3.Core/Utilities/RandomGenerator.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Utilities { diff --git a/Assets/Scripts/Pal3.Core/Utilities/Requires.cs b/Assets/Scripts/Pal3.Core/Utilities/Requires.cs index 9b46f8ba..fc7ef215 100644 --- a/Assets/Scripts/Pal3.Core/Utilities/Requires.cs +++ b/Assets/Scripts/Pal3.Core/Utilities/Requires.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Core.Utilities { diff --git a/Assets/Scripts/Pal3.Game/Actor/ActorBase.cs b/Assets/Scripts/Pal3.Game/Actor/ActorBase.cs index 841e247b..149913f2 100644 --- a/Assets/Scripts/Pal3.Game/Actor/ActorBase.cs +++ b/Assets/Scripts/Pal3.Game/Actor/ActorBase.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor { diff --git a/Assets/Scripts/Pal3.Game/Actor/ActorFactory.cs b/Assets/Scripts/Pal3.Game/Actor/ActorFactory.cs index 8bf97951..1d55ac0d 100644 --- a/Assets/Scripts/Pal3.Game/Actor/ActorFactory.cs +++ b/Assets/Scripts/Pal3.Game/Actor/ActorFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor { diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorActionController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorActionController.cs index 083f65bc..21c500e7 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorActionController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorActionController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor.Controllers { @@ -32,6 +32,7 @@ public abstract class ActorActionController : GameEntityScript, ICommandExecutor, #if PAL3A ICommandExecutor, + ICommandExecutor, #endif ICommandExecutor, ICommandExecutor @@ -48,6 +49,7 @@ public abstract class ActorActionController : GameEntityScript, private SpriteRenderer _shadowSpriteRenderer; private string _currentAction = string.Empty; + public int CurrentActionLoopCount { get; private set; } private bool _hasColliderAndRigidBody; private Rigidbody _rigidbody; @@ -110,6 +112,7 @@ public virtual void PerformAction(string actionName, WaitUntilCanceled waiter = null) { _currentAction = actionName.ToLower(); + CurrentActionLoopCount = loopCount; if (_isDropShadowEnabled) { @@ -144,6 +147,7 @@ public IEnumerator PerformActionAsync(string actionName) internal virtual void DisposeCurrentAction() { _currentAction = string.Empty; + CurrentActionLoopCount = 0; } internal virtual void DeActivate() @@ -320,6 +324,25 @@ public void Execute(ActorPerformActionCommand command) } } + #if PAL3A + public void Execute(ActorPerformAttackCommand command) + { + if (_actor.Id != command.ActorId || !_actor.IsMainActor() || command.LoopCount == 0 || + !ActorConstants.MainActorCombatActorIdMap.ContainsKey((PlayerActorId)command.ActorId)) return; + int weaponType = ServiceLocator.Instance.Get().GetWeaponType(command.ActorId); + string action = weaponType switch + { + 1 or 3 or 5 or 7 or 8 => "z01", + 2 or 4 or 6 or 9 or 10 => "z02", + _ => null + }; + if (action != null && _actor.HasAction(action)) + Execute(new ActorPerformActionCommand(command.ActorId, action, command.LoopCount)); + else if (action != null) + EngineLogger.LogWarning($"Attack action {action} is not available for actor {_actor.Id} ({_actor.Name})"); + } + #endif + public void Execute(ActorStopActionAndStandCommand command) { if (_actor.Id != command.ActorId) return; diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorController.cs index ca440119..6324bcd7 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor.Controllers { @@ -31,6 +31,9 @@ public sealed class ActorController : GameEntityScript, ICommandExecutor, ICommandExecutor, ICommandExecutor, + #if PAL3A + ICommandExecutor, + #endif ICommandExecutor, ICommandExecutor, ICommandExecutor @@ -84,6 +87,13 @@ public ActorBehaviourType GetCurrentBehaviour() return _currentBehaviour; } + #if PAL3A + public void Execute(ActorSetNoTurnCommand command) + { + if (_actor.Id == command.ActorId) _actor.SetNoTurn(command.NoTurn); + } + #endif + public bool IsDirectlyInteractable(float distance) { if (distance > _actor.GetInteractionMaxDistance()) return false; diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorMovementController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorMovementController.cs index f3682aa9..43f7cfc9 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorMovementController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/ActorMovementController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor.Controllers { @@ -125,7 +125,7 @@ public void Init(GameActor actor, { // If the actor is initially placed on a walkable tile, snap to the tile // Same for the case when actor is configured to not facing the player actor during dialogue - if (tile.IsWalkable() || actor.Info.NoTurn == 1) + if (tile.IsWalkable() || actor.NoTurn != 0) { Transform.Position = new Vector3(initPosition.x, tile.GameBoxYPosition.ToUnityYPosition(), diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/FlyingActorController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/FlyingActorController.cs index 476ea8ab..80b6b5e9 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/FlyingActorController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/FlyingActorController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor.Controllers { diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/HuaYingController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/HuaYingController.cs index b44b69ae..1e63497d 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/HuaYingController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/HuaYingController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if PAL3 diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/LongKuiController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/LongKuiController.cs index e04e948b..3df734e1 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/LongKuiController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/LongKuiController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if PAL3 diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/SkeletalAnimationActorActionController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/SkeletalAnimationActorActionController.cs index 70e68482..5e1a56d6 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/SkeletalAnimationActorActionController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/SkeletalAnimationActorActionController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor.Controllers { diff --git a/Assets/Scripts/Pal3.Game/Actor/Controllers/VertexAnimationActorActionController.cs b/Assets/Scripts/Pal3.Game/Actor/Controllers/VertexAnimationActorActionController.cs index 5bfee9dc..c8375d01 100644 --- a/Assets/Scripts/Pal3.Game/Actor/Controllers/VertexAnimationActorActionController.cs +++ b/Assets/Scripts/Pal3.Game/Actor/Controllers/VertexAnimationActorActionController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor.Controllers { diff --git a/Assets/Scripts/Pal3.Game/Actor/GameActor.cs b/Assets/Scripts/Pal3.Game/Actor/GameActor.cs index b01ad531..8fab20bd 100644 --- a/Assets/Scripts/Pal3.Game/Actor/GameActor.cs +++ b/Assets/Scripts/Pal3.Game/Actor/GameActor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor { @@ -17,6 +17,11 @@ public sealed class GameActor : ActorBase public ScnNpcInfo Info { get; } + private int? _noTurnOverride; + public int NoTurn => _noTurnOverride ?? (int)Info.NoTurn; + public bool IsNoTurnChanged => _noTurnOverride.HasValue; + public void SetNoTurn(int noTurn) => _noTurnOverride = noTurn; + private uint? _overwrittenScriptId; private uint? _overwrittenMoveSpeed; diff --git a/Assets/Scripts/Pal3.Game/Actor/NpcInfoFactory.cs b/Assets/Scripts/Pal3.Game/Actor/NpcInfoFactory.cs index 2cff6b9f..f56b2dc2 100644 --- a/Assets/Scripts/Pal3.Game/Actor/NpcInfoFactory.cs +++ b/Assets/Scripts/Pal3.Game/Actor/NpcInfoFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Actor { diff --git a/Assets/Scripts/Pal3.Game/AssemblyInfo.cs b/Assets/Scripts/Pal3.Game/AssemblyInfo.cs new file mode 100644 index 00000000..3d07eb72 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/AssemblyInfo.cs @@ -0,0 +1,6 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("Pal3.Game.Tests")] diff --git a/Assets/Scripts/Pal3.Game/AssemblyInfo.cs.meta b/Assets/Scripts/Pal3.Game/AssemblyInfo.cs.meta new file mode 100644 index 00000000..681ab8fd --- /dev/null +++ b/Assets/Scripts/Pal3.Game/AssemblyInfo.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 824532675e9644775968d4868895a939 \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Game/Audio/AudioManager.cs b/Assets/Scripts/Pal3.Game/Audio/AudioManager.cs index b33195f2..276a5b60 100644 --- a/Assets/Scripts/Pal3.Game/Audio/AudioManager.cs +++ b/Assets/Scripts/Pal3.Game/Audio/AudioManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Audio { diff --git a/Assets/Scripts/Pal3.Game/Camera/CameraManager.cs b/Assets/Scripts/Pal3.Game/Camera/CameraManager.cs index 03f5c0cc..0f0dbd11 100644 --- a/Assets/Scripts/Pal3.Game/Camera/CameraManager.cs +++ b/Assets/Scripts/Pal3.Game/Camera/CameraManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Camera { @@ -43,6 +43,8 @@ public sealed class CameraManager : IDisposable, ICommandExecutor, ICommandExecutor, #if PAL3A + ICommandExecutor, + ICommandExecutor, ICommandExecutor, ICommandExecutor, #endif @@ -94,6 +96,10 @@ public sealed class CameraManager : IDisposable, private Vector3 _cameraOffset = Vector3.zero; private float _lookAtPointYOffset; + #if PAL3A + public Vector3? HorizontalDirectionConstraint { get; private set; } + private bool _restoreLookDirectionAfterConstraint; + #endif private bool _freeToRotate; private bool _cameraFollowPlayer = true; private bool _shouldResetVelocity = false; @@ -108,7 +114,7 @@ public sealed class CameraManager : IDisposable, private readonly float _joyStickMovementRange; private readonly bool _isTouchEnabled; - private bool _cameraAnimationInProgress; + private int _cameraAnimationsInProgress; private CancellationTokenSource _asyncCameraAnimationCts = new (); private CancellationTokenSource _cameraFadeAnimationCts = new (); @@ -164,7 +170,19 @@ public void LateUpdate(float deltaTime) return; } - if (_cameraAnimationInProgress) return; + if (_cameraAnimationsInProgress > 0) return; + Vector3 followOffset = _cameraOffset; + #if PAL3A + if (HorizontalDirectionConstraint.HasValue) + { + // The original replaces the normalized view direction's horizontal + // components, then normalizes again. This slightly changes pitch. + Vector3 direction = -_cameraOffset.normalized; + direction.x = HorizontalDirectionConstraint.Value.x; + direction.z = HorizontalDirectionConstraint.Value.z; + followOffset = -direction.normalized * _cameraOffset.magnitude; + } + #endif if (!_lookAtGameEntity.IsNullOrDisposed()) { @@ -176,7 +194,7 @@ public void LateUpdate(float deltaTime) } Vector3 yOffset = new (0f, _lookAtPointYOffset, 0f); - Vector3 targetPosition = _lastLookAtPoint + _cameraOffset; + Vector3 targetPosition = _lastLookAtPoint + followOffset; Vector3 currentPosition = _cameraTransform.Position; Vector3 previousLookAtPoint = _lastLookAtPoint + (currentPosition - targetPosition); @@ -201,9 +219,23 @@ public void LateUpdate(float deltaTime) _cameraTransform.Position = _actualPosition; + #if PAL3A + if (_restoreLookDirectionAfterConstraint) + { + // Restore orientation after the unconstrained position is applied, + // including free-rotation scenes with no camera input this frame. + _cameraTransform.LookAt(_actualLookAtPoint + yOffset); + _restoreLookDirectionAfterConstraint = false; + } + #endif + if (!_lookAtGameEntity.IsNullOrDisposed()) return; - if (!_freeToRotate) + if (!_freeToRotate + #if PAL3A + || HorizontalDirectionConstraint.HasValue + #endif + ) { _cameraTransform.LookAt(_actualLookAtPoint + yOffset); return; @@ -287,15 +319,19 @@ private static float HorizontalToVerticalFov(float horizontalFov, float aspect) private IEnumerator ShakeAsync(float duration, float amplitude, Action onFinished = null) { - _cameraAnimationInProgress = true; - - yield return _cameraTransform.ShakeAsync(duration, - amplitude / 5f, - amplitude, // More amplitude on y-axis - amplitude / 5f); - - _cameraAnimationInProgress = false; - onFinished?.Invoke(); + _cameraAnimationsInProgress++; + try + { + yield return _cameraTransform.ShakeAsync(duration, + amplitude / 5f, + amplitude, // More amplitude on y-axis + amplitude / 5f); + } + finally + { + _cameraAnimationsInProgress--; + onFinished?.Invoke(); + } } private IEnumerator MoveAsync(Vector3 position, @@ -304,21 +340,27 @@ private IEnumerator MoveAsync(Vector3 position, Action onFinished = null, CancellationToken cancellationToken = default) { - _cameraAnimationInProgress = true; - Vector3 oldPosition = _cameraTransform.Position; + _cameraAnimationsInProgress++; + try + { + Vector3 oldPosition = _cameraTransform.Position; - yield return _cameraTransform.MoveAsync(position, - duration, - curveType, - cancellationToken); + yield return _cameraTransform.MoveAsync(position, + duration, + curveType, + cancellationToken); - if (!cancellationToken.IsCancellationRequested) + if (!cancellationToken.IsCancellationRequested) + { + _lastLookAtPoint += position - oldPosition; + _cameraOffset = _cameraTransform.Position - _lastLookAtPoint; + } + } + finally { - _lastLookAtPoint += position - oldPosition; - _cameraOffset = _cameraTransform.Position - _lastLookAtPoint; + _cameraAnimationsInProgress--; + onFinished?.Invoke(); } - _cameraAnimationInProgress = false; - onFinished?.Invoke(); } private IEnumerator OrbitAsync(Quaternion toRotation, @@ -328,21 +370,27 @@ private IEnumerator OrbitAsync(Quaternion toRotation, Action onFinished = null, CancellationToken cancellationToken = default) { - _cameraAnimationInProgress = true; - Vector3 lookAtPoint = _lastLookAtPoint; - yield return _cameraTransform.OrbitAroundCenterPointAsync(toRotation, - lookAtPoint, - duration, - curveType, - distanceDelta, - cancellationToken); + _cameraAnimationsInProgress++; + try + { + Vector3 lookAtPoint = _lastLookAtPoint; + yield return _cameraTransform.OrbitAroundCenterPointAsync(toRotation, + lookAtPoint, + duration, + curveType, + distanceDelta, + cancellationToken); - if (!cancellationToken.IsCancellationRequested) + if (!cancellationToken.IsCancellationRequested) + { + _cameraOffset = _cameraTransform.Position - lookAtPoint; + } + } + finally { - _cameraOffset = _cameraTransform.Position - lookAtPoint; + _cameraAnimationsInProgress--; + onFinished?.Invoke(); } - _cameraAnimationInProgress = false; - onFinished?.Invoke(); } private IEnumerator RotateAsync(Quaternion toRotation, @@ -351,13 +399,19 @@ private IEnumerator RotateAsync(Quaternion toRotation, Action onFinished = null, CancellationToken cancellationToken = default) { - _cameraAnimationInProgress = true; - yield return _cameraTransform.RotateAsync(toRotation, - duration, - curveType, - cancellationToken); - _cameraAnimationInProgress = false; - onFinished?.Invoke(); + _cameraAnimationsInProgress++; + try + { + yield return _cameraTransform.RotateAsync(toRotation, + duration, + curveType, + cancellationToken); + } + finally + { + _cameraAnimationsInProgress--; + onFinished?.Invoke(); + } } public IEnumerator PushAsync(float distance, @@ -366,23 +420,29 @@ public IEnumerator PushAsync(float distance, Action onFinished = null, CancellationToken cancellationToken = default) { - _cameraAnimationInProgress = true; - Vector3 oldPosition = _cameraTransform.Position; - float oldDistance = Vector3.Distance(oldPosition, _lastLookAtPoint); - Vector3 cameraFacingDirection = (oldPosition - _lastLookAtPoint).normalized; - Vector3 newPosition = oldPosition + cameraFacingDirection * (distance - oldDistance); + _cameraAnimationsInProgress++; + try + { + Vector3 oldPosition = _cameraTransform.Position; + float oldDistance = Vector3.Distance(oldPosition, _lastLookAtPoint); + Vector3 cameraFacingDirection = (oldPosition - _lastLookAtPoint).normalized; + Vector3 newPosition = oldPosition + cameraFacingDirection * (distance - oldDistance); - yield return _cameraTransform.MoveAsync(newPosition, - duration, - curveType, - cancellationToken); + yield return _cameraTransform.MoveAsync(newPosition, + duration, + curveType, + cancellationToken); - if (!cancellationToken.IsCancellationRequested) + if (!cancellationToken.IsCancellationRequested) + { + _cameraOffset = _cameraTransform.Position - _lastLookAtPoint; + } + } + finally { - _cameraOffset = _cameraTransform.Position - _lastLookAtPoint; + _cameraAnimationsInProgress--; + onFinished?.Invoke(); } - _cameraAnimationInProgress = false; - onFinished?.Invoke(); } private IEnumerator FadeAsync(bool fadeIn, @@ -563,18 +623,49 @@ public void Execute(CameraShakeEffectCommand command) public void Execute(CameraOrbitCommand command) { - if (!_asyncCameraAnimationCts.IsCancellationRequested) _asyncCameraAnimationCts.Cancel(); - - WaitUntilCanceled waiter = new(); - Pal3.Instance.Execute(new ScriptRunnerAddWaiterRequest(waiter)); + _asyncCameraAnimationCts.Cancel(); + _asyncCameraAnimationCts.Dispose(); + _asyncCameraAnimationCts = new CancellationTokenSource(); + WaitUntilCanceled waiter = null; + #if PAL3 + bool synchronous = true; + #else + bool synchronous = command.Synchronous > 0; + #endif + if (synchronous) + { + waiter = new WaitUntilCanceled(); + Pal3.Instance.Execute(new ScriptRunnerAddWaiterRequest(waiter)); + } Quaternion rotation = UnityPrimitivesConvertor.ToUnityQuaternion(command.Pitch, command.Yaw, 0f); - Pal3.Instance.StartCoroutine(OrbitAsync(rotation, - command.Duration, - (AnimationCurveType)command.CurveType, - 0f, - () => waiter.CancelWait())); + Pal3.Instance.StartCoroutine(OrbitAsync(rotation, command.Duration, + (AnimationCurveType)command.CurveType, 0f, () => waiter?.CancelWait(), + synchronous ? default : _asyncCameraAnimationCts.Token)); + } + + #if PAL3A + public void Execute(CameraSetHorizontalDirectionCommand command) + { + Vector3 direction = new GameBoxVector3(command.X2 - command.X1, 0, command.Z2 - command.Z1).ToUnityPosition(); + if (direction.sqrMagnitude > 0.000001f) HorizontalDirectionConstraint = direction.normalized; + _shouldResetVelocity = true; + } + public void Execute(CameraResetHorizontalDirectionCommand command) + { + _restoreLookDirectionAfterConstraint |= HorizontalDirectionConstraint.HasValue; + HorizontalDirectionConstraint = null; + _shouldResetVelocity = true; } + public Vector3 GetUnconstrainedCameraEulerAngles() + { + Vector3 direction = new Vector3(0, _lookAtPointYOffset, 0) - _cameraOffset; + return direction.sqrMagnitude > 0.000001f + ? Quaternion.LookRotation(direction).eulerAngles + : _cameraTransform.EulerAngles; + } + #endif + public void Execute(CameraRotateCommand command) { if (!_asyncCameraAnimationCts.IsCancellationRequested) _asyncCameraAnimationCts.Cancel(); @@ -763,6 +854,10 @@ public void Execute(CameraSetInitialStateOnNextSceneLoadCommand command) public void Execute(ScenePreLoadingNotification notification) { + #if PAL3A + HorizontalDirectionConstraint = null; + _restoreLookDirectionAfterConstraint = false; + #endif Quaternion? initRotation = _initRotationOnSceneLoad; int? initTransformOption = _initTransformOptionOnSceneLoad; @@ -817,6 +912,10 @@ public void Execute(GameStateChangedNotification command) public void Execute(ResetGameStateCommand command) { + #if PAL3A + HorizontalDirectionConstraint = null; + _restoreLookDirectionAfterConstraint = false; + #endif if (!_asyncCameraAnimationCts.IsCancellationRequested) _asyncCameraAnimationCts.Cancel(); _curtainImage.color = Color.black; diff --git a/Assets/Scripts/Pal3.Game/Command/CommandDispatcher.cs b/Assets/Scripts/Pal3.Game/Command/CommandDispatcher.cs index 897483b6..1411fd21 100644 --- a/Assets/Scripts/Pal3.Game/Command/CommandDispatcher.cs +++ b/Assets/Scripts/Pal3.Game/Command/CommandDispatcher.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command { diff --git a/Assets/Scripts/Pal3.Game/Command/CommandExecutorRegistry.cs b/Assets/Scripts/Pal3.Game/Command/CommandExecutorRegistry.cs index 98cdf97a..0494a67d 100644 --- a/Assets/Scripts/Pal3.Game/Command/CommandExecutorRegistry.cs +++ b/Assets/Scripts/Pal3.Game/Command/CommandExecutorRegistry.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command { diff --git a/Assets/Scripts/Pal3.Game/Command/CommandExtensions.cs b/Assets/Scripts/Pal3.Game/Command/CommandExtensions.cs index 8b7bccb4..02e5b4bc 100644 --- a/Assets/Scripts/Pal3.Game/Command/CommandExtensions.cs +++ b/Assets/Scripts/Pal3.Game/Command/CommandExtensions.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command { diff --git a/Assets/Scripts/Pal3.Game/Command/ConsoleAttribute.cs b/Assets/Scripts/Pal3.Game/Command/ConsoleAttribute.cs index 4b9eda80..7065d40d 100644 --- a/Assets/Scripts/Pal3.Game/Command/ConsoleAttribute.cs +++ b/Assets/Scripts/Pal3.Game/Command/ConsoleAttribute.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command { diff --git a/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3.g.cs b/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3.g.cs index 7704ec90..d44f6513 100644 --- a/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3.g.cs +++ b/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3.g.cs @@ -1,10 +1,15 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + #if PAL3 -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ // // This code was auto-generated by ConsoleCommandsAutoGen`1 // -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command { @@ -1184,6 +1189,13 @@ public static void WorldMapEnableRegion(System.Int32 region, System.Int32 enable { Pal3.Instance.Execute(new WorldMapEnableRegionCommand(region, enablementFlag)); } + + // + [ConsoleMethodAttribute("PlayerSetProgress", "Execute PlayerSetProgressCommand.")] + public static void PlayerSetProgress(System.Int32 actorId, System.Int32 level, System.Int32 weaponItemId) + { + Pal3.Instance.Execute(new PlayerSetProgressCommand(actorId, level, weaponItemId)); + } } } diff --git a/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3A.g.cs b/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3A.g.cs index d920380c..9b0d5159 100644 --- a/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3A.g.cs +++ b/Assets/Scripts/Pal3.Game/Command/ConsoleCommands.PAL3A.g.cs @@ -1,10 +1,15 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + #if PAL3A -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ // // This code was auto-generated by ConsoleCommandsAutoGen`1 // -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command { @@ -438,9 +443,9 @@ public static void CameraMoveToLookAtPoint(System.Single gameBoxXPosition, Syste // [ConsoleMethodAttribute("CameraOrbit", "镜头环绕LookAt位置旋转(LookAt点固定),参数:目标Yaw,Pitch,运动时间,插值类型(0:Linear,1:Sine)")] - public static void CameraOrbit(System.Single yaw, System.Single pitch, System.Single duration, System.Int32 curveType) + public static void CameraOrbit(System.Single yaw, System.Single pitch, System.Single duration, System.Int32 curveType, System.Int32 synchronous) { - Pal3.Instance.Execute(new CameraOrbitCommand(yaw, pitch, duration, curveType)); + Pal3.Instance.Execute(new CameraOrbitCommand(yaw, pitch, duration, curveType, synchronous)); } // @@ -528,10 +533,10 @@ public static void CombatEnterBossFightUsingMusic(System.UInt32 monster1Id, Syst } // - [ConsoleMethodAttribute("CombatEnterBossFightUsingMusicWithSpecialActor", "南宫煌以变身状态下进入Boss战斗")] - public static void CombatEnterBossFightUsingMusicWithSpecialActor(System.UInt32 monster1Id, System.UInt32 monster2Id, System.UInt32 monster3Id, System.UInt32 monster4Id, System.UInt32 monster5Id, System.UInt32 monster6Id, System.String combatMusicName, System.Int32 combatCommandId) + [ConsoleMethodAttribute("CombatPrepareNanGongHuangTransform", "下一场战斗让南宫煌以狼形态参战")] + public static void CombatPrepareNanGongHuangTransform() { - Pal3.Instance.Execute(new CombatEnterBossFightUsingMusicWithSpecialActorCommand(monster1Id, monster2Id, monster3Id, monster4Id, monster5Id, monster6Id, combatMusicName, combatCommandId)); + Pal3.Instance.Execute(new CombatPrepareNanGongHuangTransformCommand()); } // @@ -759,10 +764,10 @@ public static void PlayerLearnCompose(System.Int32 objectId) } // - [ConsoleMethodAttribute("PlayerSetActorLevel", "设置目标角色等级(所有当前角色等级的平均值+增加值),参数:角色ID,等级增加值")] - public static void PlayerSetActorLevel(System.Int32 actorId, System.Int32 unknown1, System.Int32 unknown2, System.Int32 levelIncrease) + [ConsoleMethodAttribute("PlayerSetActorLevel", "将角色等级提升到其他在队角色的平均等级,不降低原等级")] + public static void PlayerSetActorLevel(System.Int32 actorId) { - Pal3.Instance.Execute(new PlayerSetActorLevelCommand(actorId, unknown1, unknown2, levelIncrease)); + Pal3.Instance.Execute(new PlayerSetActorLevelCommand(actorId)); } // @@ -1158,73 +1163,73 @@ public static void UIShowSmeltingMenu(System.Int32 smeltingScriptId) } // - [ConsoleMethodAttribute("Unknown166", "???")] - public static void Unknown166(System.Int32 unknown1, System.Int32 unknown2) + [ConsoleMethodAttribute("ActorPerformAttack", "按装备武器类别播放攻击动作")] + public static void ActorPerformAttack(System.Int32 actorId, System.Int32 loopCount) { - Pal3.Instance.Execute(new UnknownCommand166(unknown1, unknown2)); + Pal3.Instance.Execute(new ActorPerformAttackCommand(actorId, loopCount)); } // - [ConsoleMethodAttribute("Unknown167", "在场景固定位置处播放特效(蜀山雷电特效)")] - public static void Unknown167(System.String unknown1, System.Int32 unknown2, System.Single unknown3, System.Single unknown4, System.Single unknown5, System.Single unknown6, System.Single unknown7, System.Single unknown8) + [ConsoleMethodAttribute("SkyboxAddEffect", "在天空盒面添加循环序列帧特效")] + public static void SkyboxAddEffect(System.String sequence, System.Int32 face, System.Single x, System.Single y, System.Single scale, System.Single fps, System.Single interval, System.Single initialDelay) { - Pal3.Instance.Execute(new UnknownCommand167(unknown1, unknown2, unknown3, unknown4, unknown5, unknown6, unknown7, unknown8)); + Pal3.Instance.Execute(new SkyboxAddEffectCommand(sequence, face, x, y, scale, fps, interval, initialDelay)); } // - [ConsoleMethodAttribute("Unknown176", "南宫煌开启摄灵法阵")] - public static void Unknown176(System.Int32 unknown1, System.Int32 unknown2, System.Int32 unknown3) + [ConsoleMethodAttribute("NanGongHuangEnableCombatAbilities", "开启或关闭南宫煌特殊战斗能力")] + public static void NanGongHuangEnableCombatAbilities(System.Int32 enable) { - Pal3.Instance.Execute(new UnknownCommand176(unknown1, unknown2, unknown3)); + Pal3.Instance.Execute(new NanGongHuangEnableCombatAbilitiesCommand(enable)); } // - [ConsoleMethodAttribute("Unknown181", "???")] - public static void Unknown181(System.Single unknown1, System.Single unknown2, System.Single unknown3, System.Single unknown4) + [ConsoleMethodAttribute("CameraSetHorizontalDirection", "用两点设置相机水平朝向约束")] + public static void CameraSetHorizontalDirection(System.Single x1, System.Single z1, System.Single x2, System.Single z2) { - Pal3.Instance.Execute(new UnknownCommand181(unknown1, unknown2, unknown3, unknown4)); + Pal3.Instance.Execute(new CameraSetHorizontalDirectionCommand(x1, z1, x2, z2)); } // - [ConsoleMethodAttribute("Unknown185", "PAL3A打开算命小游戏UI")] - public static void Unknown185(System.Int32 unknown1, System.Int32 unknown2, System.Int32 unknown3, System.Int32 unknown4, System.Int32 unknown5, System.Int32 unknown6, System.Int32 unknown7, System.Int32 unknown8) + [ConsoleMethodAttribute("MiniGameStartFortuneTelling", "显示算命界面并等待结果")] + public static void MiniGameStartFortuneTelling(System.Int32 symbol1, System.Int32 symbol2) { - Pal3.Instance.Execute(new UnknownCommand185(unknown1, unknown2, unknown3, unknown4, unknown5, unknown6, unknown7, unknown8)); + Pal3.Instance.Execute(new MiniGameStartFortuneTellingCommand(symbol1, symbol2)); } // - [ConsoleMethodAttribute("Unknown193", "???")] - public static void Unknown193(System.Int32 unknown1, System.Int32 unknown2) + [ConsoleMethodAttribute("TeamAddOrRemoveActorSilently", "静默加入或离开队伍")] + public static void TeamAddOrRemoveActorSilently(System.Int32 actorId, System.Int32 isIn) { - Pal3.Instance.Execute(new UnknownCommand193(unknown1, unknown2)); + Pal3.Instance.Execute(new TeamAddOrRemoveActorSilentlyCommand(actorId, isIn)); } // - [ConsoleMethodAttribute("Unknown196", "???")] - public static void Unknown196() + [ConsoleMethodAttribute("CombatPrepareWangPengXuTransform", "下一场战斗让王蓬絮以特殊形态参战")] + public static void CombatPrepareWangPengXuTransform() { - Pal3.Instance.Execute(new UnknownCommand196()); + Pal3.Instance.Execute(new CombatPrepareWangPengXuTransformCommand()); } // - [ConsoleMethodAttribute("Unknown197", "设置风雅颂宿主角色ID?")] - public static void Unknown197(System.Int32 actorId, System.Int32 enable) + [ConsoleMethodAttribute("ActorSetNoTurn", "设置角色对话时是否保留动作和朝向")] + public static void ActorSetNoTurn(System.Int32 actorId, System.Int32 noTurn) { - Pal3.Instance.Execute(new UnknownCommand197(actorId, enable)); + Pal3.Instance.Execute(new ActorSetNoTurnCommand(actorId, noTurn)); } // - [ConsoleMethodAttribute("Unknown198", "???")] - public static void Unknown198(System.Int32 unknown1, System.Int32 unknown2) + [ConsoleMethodAttribute("CameraResetHorizontalDirection", "解除相机水平朝向约束")] + public static void CameraResetHorizontalDirection() { - Pal3.Instance.Execute(new UnknownCommand198(unknown1, unknown2)); + Pal3.Instance.Execute(new CameraResetHorizontalDirectionCommand()); } // - [ConsoleMethodAttribute("Unknown216", "???")] - public static void Unknown216() + [ConsoleMethodAttribute("CombatPreserveDamageForLiaoRi", "保留我方精和神的损失累计量以强化燎日后续形态")] + public static void CombatPreserveDamageForLiaoRi() { - Pal3.Instance.Execute(new UnknownCommand216()); + Pal3.Instance.Execute(new CombatPreserveDamageForLiaoRiCommand()); } // @@ -1240,6 +1245,34 @@ public static void WorldMapEnableRegion(System.Int32 region, System.Int32 enable { Pal3.Instance.Execute(new WorldMapEnableRegionCommand(region, enablementFlag)); } + + // + [ConsoleMethodAttribute("Pal3ARestoreCombatScriptState", "Execute Pal3ARestoreCombatScriptStateCommand.")] + public static void Pal3ARestoreCombatScriptState(System.Int32 flags, System.Int32 lostHp, System.Int32 lostMp) + { + Pal3.Instance.Execute(new Pal3ARestoreCombatScriptStateCommand(flags, lostHp, lostMp)); + } + + // + [ConsoleMethodAttribute("PlayerSetProgress", "Execute PlayerSetProgressCommand.")] + public static void PlayerSetProgress(System.Int32 actorId, System.Int32 level, System.Int32 weaponItemId) + { + Pal3.Instance.Execute(new PlayerSetProgressCommand(actorId, level, weaponItemId)); + } + + // + [ConsoleMethodAttribute("ScriptVarSetFortuneTellingResult", "将算命结果写入脚本变量")] + public static void ScriptVarSetFortuneTellingResult(System.UInt16 variable) + { + Pal3.Instance.Execute(new ScriptVarSetFortuneTellingResultCommand(variable)); + } + + // + [ConsoleMethodAttribute("SkyboxRemoveEffect", "按序列名称移除天空盒特效")] + public static void SkyboxRemoveEffect(System.String sequence) + { + Pal3.Instance.Execute(new SkyboxRemoveEffectCommand(sequence)); + } } } diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ActiveInputDeviceChangedNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ActiveInputDeviceChangedNotification.cs index 57435ce9..dee8a820 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ActiveInputDeviceChangedNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ActiveInputDeviceChangedNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetFacingCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetFacingCommand.cs index 87f864bc..d2b4bc3d 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetFacingCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetFacingCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetWorldPositionCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetWorldPositionCommand.cs index faa5b574..7e35338d 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetWorldPositionCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ActorSetWorldPositionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/AttachSfxToGameEntityRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/AttachSfxToGameEntityRequest.cs index 9ba88023..86d93a1a 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/AttachSfxToGameEntityRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/AttachSfxToGameEntityRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetFieldOfViewCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetFieldOfViewCommand.cs index f42ff66e..8512df9b 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetFieldOfViewCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetFieldOfViewCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetInitialStateOnNextSceneLoadCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetInitialStateOnNextSceneLoadCommand.cs index 9a076496..25423cdb 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetInitialStateOnNextSceneLoadCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/CameraSetInitialStateOnNextSceneLoadCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/CombatActorCollideWithPlayerActorNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/CombatActorCollideWithPlayerActorNotification.cs index 085e834c..b84a5ea5 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/CombatActorCollideWithPlayerActorNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/CombatActorCollideWithPlayerActorNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/DialogueRenderingStartedNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/DialogueRenderingStartedNotification.cs index dbdeade7..a91957fa 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/DialogueRenderingStartedNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/DialogueRenderingStartedNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangeRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangeRequest.cs index 87c056f1..248f4887 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangeRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangeRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangedNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangedNotification.cs index a52bc9b1..b17c63b2 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangedNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/GameStateChangedNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/Pal3ARestoreCombatScriptStateCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/Pal3ARestoreCombatScriptStateCommand.cs new file mode 100644 index 00000000..9ec44be7 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/Pal3ARestoreCombatScriptStateCommand.cs @@ -0,0 +1,27 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Game.Command.Extensions +{ + using Core.Command; + [AvailableInConsole] + public sealed class Pal3ARestoreCombatScriptStateCommand : ICommand + { + public Pal3ARestoreCombatScriptStateCommand(int flags, int lostHp, int lostMp) + { + Flags = flags; + LostHp = lostHp; + LostMp = lostMp; + } + + public int Flags { get; } + + public int LostHp { get; } + + public int LostMp { get; } + } +} +#endif diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/Pal3ARestoreCombatScriptStateCommand.cs.meta b/Assets/Scripts/Pal3.Game/Command/Extensions/Pal3ARestoreCombatScriptStateCommand.cs.meta new file mode 100644 index 00000000..4099986d --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/Pal3ARestoreCombatScriptStateCommand.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 8bf4c14a2e014e3ca38437755117fcb4 diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorLookAtSceneObjectCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorLookAtSceneObjectCommand.cs index e4f1c9cb..3f3a25f7 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorLookAtSceneObjectCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorLookAtSceneObjectCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorTilePositionUpdatedNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorTilePositionUpdatedNotification.cs index d167cf30..af646a58 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorTilePositionUpdatedNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerActorTilePositionUpdatedNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerInteractionRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerInteractionRequest.cs index 7beb7823..285fe60d 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerInteractionRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerInteractionRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerSetProgressCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerSetProgressCommand.cs new file mode 100644 index 00000000..7e9e5151 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerSetProgressCommand.cs @@ -0,0 +1,25 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Pal3.Game.Command.Extensions +{ + using Core.Command; + [AvailableInConsole] + public sealed class PlayerSetProgressCommand : ICommand + { + public PlayerSetProgressCommand(int actorId, int level, int weaponItemId) + { + ActorId = actorId; + Level = level; + WeaponItemId = weaponItemId; + } + + public int ActorId { get; } + + public int Level { get; } + + public int WeaponItemId { get; } + } +} diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerSetProgressCommand.cs.meta b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerSetProgressCommand.cs.meta new file mode 100644 index 00000000..15fc15f4 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/PlayerSetProgressCommand.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: de92728c6018427b9bde6de5bf026e80 diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ResetGameStateCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ResetGameStateCommand.cs index 1880c061..dd178233 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ResetGameStateCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ResetGameStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneLeavingCurrentSceneNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneLeavingCurrentSceneNotification.cs index f1a9ce15..c58dd0f3 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneLeavingCurrentSceneNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneLeavingCurrentSceneNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePostLoadingNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePostLoadingNotification.cs index 2582e4e3..c51dccc8 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePostLoadingNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePostLoadingNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePreLoadingNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePreLoadingNotification.cs index 33581cdc..4a50e6ad 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePreLoadingNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ScenePreLoadingNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalBidirectionalPushableObjectStateCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalBidirectionalPushableObjectStateCommand.cs index 725d5490..c246a64d 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalBidirectionalPushableObjectStateCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalBidirectionalPushableObjectStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectActivationStateCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectActivationStateCommand.cs index 8e811964..a495e0ed 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectActivationStateCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectActivationStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectLayerIndexCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectLayerIndexCommand.cs index d3f2fb65..9c58a610 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectLayerIndexCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectLayerIndexCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectPositionCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectPositionCommand.cs index c6b2442f..1beb29be 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectPositionCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectPositionCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectSwitchStateCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectSwitchStateCommand.cs index d1d019b7..0825e939 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectSwitchStateCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectSwitchStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectTimesCountCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectTimesCountCommand.cs index 2956b560..6de62405 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectTimesCountCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectTimesCountCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectYRotationCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectYRotationCommand.cs index b8bc4e4e..01273b54 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectYRotationCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalObjectYRotationCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalThreePhaseSwitchStateCommand.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalThreePhaseSwitchStateCommand.cs index 047e7218..91c4aed2 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalThreePhaseSwitchStateCommand.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SceneSaveGlobalThreePhaseSwitchStateCommand.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFailedToRunNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFailedToRunNotification.cs index ddb3270d..7881fc94 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFailedToRunNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFailedToRunNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFinishedRunningNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFinishedRunningNotification.cs index f1cf4066..c34163b4 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFinishedRunningNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptFinishedRunningNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptRunnerAddWaiterRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptRunnerAddWaiterRequest.cs index 72af352b..db27ce4b 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptRunnerAddWaiterRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ScriptRunnerAddWaiterRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SettingChangedNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SettingChangedNotification.cs index daa38d16..a9464dbf 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SettingChangedNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SettingChangedNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/StopSfxPlayingAtGameEntityRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/StopSfxPlayingAtGameEntityRequest.cs index 4617b9c7..85620de5 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/StopSfxPlayingAtGameEntityRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/StopSfxPlayingAtGameEntityRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/SwitchPlayerActorRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/SwitchPlayerActorRequest.cs index 16c146af..59995aa5 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/SwitchPlayerActorRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/SwitchPlayerActorRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ThreePhaseSwitchStateChangedNotification.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ThreePhaseSwitchStateChangedNotification.cs index cf0e39db..54284593 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ThreePhaseSwitchStateChangedNotification.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ThreePhaseSwitchStateChangedNotification.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleMainMenuRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleMainMenuRequest.cs index 18dab020..7c6b5a97 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleMainMenuRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleMainMenuRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleWorldMapRequest.cs b/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleWorldMapRequest.cs index a122cb2e..b20caadc 100644 --- a/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleWorldMapRequest.cs +++ b/Assets/Scripts/Pal3.Game/Command/Extensions/ToggleWorldMapRequest.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Command.Extensions { diff --git a/Assets/Scripts/Pal3.Game/Constants/GameConstants.cs b/Assets/Scripts/Pal3.Game/Constants/GameConstants.cs index 771c6c92..3cecd26f 100644 --- a/Assets/Scripts/Pal3.Game/Constants/GameConstants.cs +++ b/Assets/Scripts/Pal3.Game/Constants/GameConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Constants { diff --git a/Assets/Scripts/Pal3.Game/Constants/LightingConstants.cs b/Assets/Scripts/Pal3.Game/Constants/LightingConstants.cs index 27b4c9e3..578c1de5 100644 --- a/Assets/Scripts/Pal3.Game/Constants/LightingConstants.cs +++ b/Assets/Scripts/Pal3.Game/Constants/LightingConstants.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Constants { diff --git a/Assets/Scripts/Pal3.Game/Data/FileSystemCacheManager.cs b/Assets/Scripts/Pal3.Game/Data/FileSystemCacheManager.cs index 76c92f37..ec98f52a 100644 --- a/Assets/Scripts/Pal3.Game/Data/FileSystemCacheManager.cs +++ b/Assets/Scripts/Pal3.Game/Data/FileSystemCacheManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Data { diff --git a/Assets/Scripts/Pal3.Game/Data/GameResourceProvider.cs b/Assets/Scripts/Pal3.Game/Data/GameResourceProvider.cs index 9dc243cf..199a889e 100644 --- a/Assets/Scripts/Pal3.Game/Data/GameResourceProvider.cs +++ b/Assets/Scripts/Pal3.Game/Data/GameResourceProvider.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Data { @@ -145,11 +145,11 @@ public ISprite GetShadowSprite() public IMaterialManager GetMaterialManager() => _materialManager; - public ITextureResourceProvider CreateTextureResourceProvider(string relativeDirectoryPath, bool useCache = true) + public ITextureResourceProvider CreateTextureResourceProvider(string relativeDirectoryPath, bool useCache = true, TextureUsage usage = TextureUsage.World) { return (_textureCache != null && useCache) ? - new TextureProvider(_fileSystem, _textureLoaderFactory, _textureFactory, relativeDirectoryPath, _textureCache) : - new TextureProvider(_fileSystem, _textureLoaderFactory, _textureFactory, relativeDirectoryPath); + new TextureProvider(_fileSystem, _textureLoaderFactory, _textureFactory, relativeDirectoryPath, _textureCache, usage) : + new TextureProvider(_fileSystem, _textureLoaderFactory, _textureFactory, relativeDirectoryPath, usage: usage); } public T GetGameResourceFile(string fileVirtualPath, bool useCache = true, byte[] data = null) @@ -301,7 +301,7 @@ public ISprite GetLogoSprite() Rect mainLogoSpriteRect = new Rect(0, 770, 500, 253); #endif - ITextureResourceProvider uiLibTextureProvider = CreateTextureResourceProvider(FileConstants.UILibFolderVirtualPath); + ITextureResourceProvider uiLibTextureProvider = CreateTextureResourceProvider(FileConstants.UILibFolderVirtualPath, usage: TextureUsage.Sprite); ITexture2D logoTexture = uiLibTextureProvider.GetTexture(mainLogoTextureFileName); return logoTexture.CreateSprite(mainLogoSpriteRect.x, mainLogoSpriteRect.y, mainLogoSpriteRect.width, mainLogoSpriteRect.height, @@ -311,7 +311,7 @@ public ISprite GetLogoSprite() private ITexture2D GetActorAvatarTexture(string actorName, string avatarTextureName) { string roleAvatarTextureRelativePath = FileConstants.GetActorFolderVirtualPath(actorName); - ITextureResourceProvider textureProvider = CreateTextureResourceProvider(roleAvatarTextureRelativePath); + ITextureResourceProvider textureProvider = CreateTextureResourceProvider(roleAvatarTextureRelativePath, usage: TextureUsage.Sprite); return textureProvider.GetTexture($"{avatarTextureName}.tga"); } @@ -342,7 +342,7 @@ public ISprite GetActorAvatarSprite(string actorName, string avatarName) private ITexture2D GetEmojiSpriteSheetTexture(ActorEmojiType emojiType) { string emojiSpriteSheetRelativePath = FileConstants.EmojiSpriteSheetFolderVirtualPath; - ITextureResourceProvider textureProvider = CreateTextureResourceProvider(emojiSpriteSheetRelativePath); + ITextureResourceProvider textureProvider = CreateTextureResourceProvider(emojiSpriteSheetRelativePath, usage: TextureUsage.Sprite); return textureProvider.GetTexture($"EM_{(int)emojiType:00}.tga"); } @@ -350,7 +350,7 @@ public ITexture2D GetCaptionTexture(string name) { string captionTextureRelativePath = FileConstants.CaptionFolderVirtualPath; // No need to cache caption texture since it is a one time thing - ITextureResourceProvider textureProvider = CreateTextureResourceProvider(captionTextureRelativePath, useCache: false); + ITextureResourceProvider textureProvider = CreateTextureResourceProvider(captionTextureRelativePath, useCache: false, usage: TextureUsage.Sprite); return textureProvider.GetTexture($"{name}.tga"); } @@ -359,7 +359,7 @@ public ITexture2D[] GetSkyBoxTextures(int skyBoxId) string relativeFilePath = string.Format(FileConstants.SkyBoxTexturePathFormat.First(), skyBoxId); ITextureResourceProvider textureProvider = CreateTextureResourceProvider( - CoreUtility.GetDirectoryName(relativeFilePath, DIR_SEPARATOR)); + CoreUtility.GetDirectoryName(relativeFilePath, DIR_SEPARATOR), usage: TextureUsage.Skybox); ITexture2D[] textures = new ITexture2D[FileConstants.SkyBoxTexturePathFormat.Length]; for (int i = 0; i < FileConstants.SkyBoxTexturePathFormat.Length; i++) @@ -378,7 +378,7 @@ public ITexture2D[] GetSkyBoxTextures(int skyBoxId) public ITexture2D GetEffectTexture(string name, out bool hasAlphaChannel) { string effectFolderRelativePath = FileConstants.EffectFolderVirtualPath; - ITextureResourceProvider textureProvider = CreateTextureResourceProvider(effectFolderRelativePath); + ITextureResourceProvider textureProvider = CreateTextureResourceProvider(effectFolderRelativePath, usage: TextureUsage.Sprite); return textureProvider.GetTexture(name, out hasAlphaChannel); } @@ -419,7 +419,7 @@ public ISprite[] GetEmojiSprites(ActorEmojiType emojiType) public ISprite[] GetJumpIndicatorSprites() { string relativePath = FileConstants.UISceneFolderVirtualPath; - ITextureResourceProvider textureProvider = CreateTextureResourceProvider(relativePath); + ITextureResourceProvider textureProvider = CreateTextureResourceProvider(relativePath, usage: TextureUsage.Sprite); ISprite[] sprites = new ISprite[4]; @@ -499,7 +499,7 @@ public string GetVideoFilePath(string videoName) public (ITexture2D texture, bool hasAlphaChannel)[] GetEffectTextures(GraphicsEffectType effect, string texturePathFormat) { ITextureResourceProvider textureProvider = CreateTextureResourceProvider( - CoreUtility.GetDirectoryName(texturePathFormat, DIR_SEPARATOR)); + CoreUtility.GetDirectoryName(texturePathFormat, DIR_SEPARATOR), usage: TextureUsage.Sprite); if (effect == GraphicsEffectType.Fire) { @@ -521,7 +521,7 @@ public string GetVideoFilePath(string videoName) public ITexture2D GetCursorTexture() { string cursorSpriteRelativePath = FileConstants.CursorSpriteFolderVirtualPath; - ITextureResourceProvider textureProvider = CreateTextureResourceProvider(cursorSpriteRelativePath); + ITextureResourceProvider textureProvider = CreateTextureResourceProvider(cursorSpriteRelativePath, usage: TextureUsage.Sprite); ITexture2D cursorTexture = textureProvider.GetTexture($"jt.tga"); return cursorTexture; } diff --git a/Assets/Scripts/Pal3.Game/Data/ITextureLoaderFactory.cs b/Assets/Scripts/Pal3.Game/Data/ITextureLoaderFactory.cs index b79fe90b..5a6950a1 100644 --- a/Assets/Scripts/Pal3.Game/Data/ITextureLoaderFactory.cs +++ b/Assets/Scripts/Pal3.Game/Data/ITextureLoaderFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Data { diff --git a/Assets/Scripts/Pal3.Game/Data/TextureCreationPolicy.cs b/Assets/Scripts/Pal3.Game/Data/TextureCreationPolicy.cs new file mode 100644 index 00000000..b0e91742 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Data/TextureCreationPolicy.cs @@ -0,0 +1,46 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +namespace Pal3.Game.Data +{ + using System; + using Engine.Core.Abstraction; + + public enum TextureUsage + { + World, + Sprite, + Skybox, + } + + internal static class TextureCreationPolicy + { + private const int MinimumGeneratedMipSize = 64; + + public static TextureCreateOptions Resolve(ITextureDataSource source, TextureUsage usage) + { + if (usage == TextureUsage.Sprite) return TextureCreateOptions.Readable; + // Six independently authored sky faces retain their original base-level sampling. + if (usage == TextureUsage.Skybox) + return new TextureCreateOptions(TextureMipMode.BaseOnly, + preferNativeCompression: true, keepCpuReadable: false); + // BMP/TGA world textures retain their original readable, base-only sampling for now. + if (source.Format == TextureDataFormat.Rgba32) return TextureCreateOptions.Readable; + + // Alpha textures use complementary cutout/blend passes. Preserve base coverage + // until coverage-preserving mipmaps are validated against both cutoffs. + TextureMipMode mipmaps = TextureMipMode.BaseOnly; + if (!source.HasTransparency) + { + if (source.MipCount > 1) mipmaps = TextureMipMode.Preserve; + // Small baked-light tiles gain little from generated chains; authored mips stay. + else if (Math.Max(source.Width, source.Height) >= MinimumGeneratedMipSize) + mipmaps = TextureMipMode.GenerateIfMissing; + } + + return new TextureCreateOptions(mipmaps, preferNativeCompression: true, keepCpuReadable: false); + } + } +} diff --git a/Assets/Scripts/Pal3.Game/Data/TextureCreationPolicy.cs.meta b/Assets/Scripts/Pal3.Game/Data/TextureCreationPolicy.cs.meta new file mode 100644 index 00000000..1c2975e1 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Data/TextureCreationPolicy.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 7d0599c42f3f4f4b9f19e7e86efe3f9b diff --git a/Assets/Scripts/Pal3.Game/Data/TextureLoaderFactory.cs b/Assets/Scripts/Pal3.Game/Data/TextureLoaderFactory.cs index 80fbe6ee..d7658992 100644 --- a/Assets/Scripts/Pal3.Game/Data/TextureLoaderFactory.cs +++ b/Assets/Scripts/Pal3.Game/Data/TextureLoaderFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Data { @@ -15,11 +15,11 @@ public sealed class TextureLoaderFactory : ITextureLoaderFactory private readonly ITextureLoader _tgaTextureLoader; private readonly ITextureLoader _bmpTextureLoader; - public TextureLoaderFactory(ITextureFactory textureFactory) + public TextureLoaderFactory() { - _dxtTextureLoader = new DxtTextureLoader(textureFactory); - _tgaTextureLoader = new TgaTextureLoader(textureFactory); - _bmpTextureLoader = new BmpTextureLoader(textureFactory); + _dxtTextureLoader = new DxtTextureLoader(); + _tgaTextureLoader = new TgaTextureLoader(); + _bmpTextureLoader = new BmpTextureLoader(); } public ITextureLoader GetTextureLoader(string fileExtension) diff --git a/Assets/Scripts/Pal3.Game/Data/TextureProvider.cs b/Assets/Scripts/Pal3.Game/Data/TextureProvider.cs index 2a88a167..c5de932b 100644 --- a/Assets/Scripts/Pal3.Game/Data/TextureProvider.cs +++ b/Assets/Scripts/Pal3.Game/Data/TextureProvider.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Data { @@ -20,12 +20,13 @@ public sealed class TextureProvider : TextureProviderBase, ITextureResourceProvi private readonly ITextureFactory _textureFactory; private readonly ITextureCache _textureCache; private readonly string _relativeDirectoryPath; + private readonly TextureUsage _usage; public TextureProvider(ICpkFileSystem fileSystem, ITextureLoaderFactory textureLoaderFactory, ITextureFactory textureFactory, string relativeDirectoryPath, - ITextureCache textureCache = null) + ITextureCache textureCache = null, TextureUsage usage = TextureUsage.World) { if (!relativeDirectoryPath.EndsWith(CpkConstants.DirectorySeparatorChar)) { @@ -37,6 +38,7 @@ public TextureProvider(ICpkFileSystem fileSystem, _textureFactory = textureFactory; _relativeDirectoryPath = relativeDirectoryPath.ToLower(); // Texture path is case insensitive _textureCache = textureCache; + _usage = usage; } private bool TryGetTextureFromCache(string textureFullPath, @@ -44,13 +46,21 @@ private bool TryGetTextureFromCache(string textureFullPath, { if (_textureCache != null) { - return _textureCache.TryGet(textureFullPath, out texture); + return _textureCache.TryGet(CacheKey(textureFullPath), out texture); } texture = default; return false; } + private string CacheKey(string path) => path + (_usage switch + { + TextureUsage.World => "|world", + TextureUsage.Sprite => "|sprite", + TextureUsage.Skybox => "|skybox", + _ => throw new ArgumentOutOfRangeException(nameof(_usage)), + }); + public string GetTexturePath(string name) { return _relativeDirectoryPath + name; @@ -108,17 +118,17 @@ public ITexture2D GetTexture(string name, out bool hasAlphaChannel) // Get dds texture ITextureLoader textureLoader = _textureLoaderFactory.GetTextureLoader(".dds"); - ITexture2D texture = base.GetTexture(_fileSystem, ddsTexturePath, textureLoader, out hasAlphaChannel); + ITexture2D texture = base.GetTexture(_fileSystem, ddsTexturePath, textureLoader, _textureFactory, _usage, out hasAlphaChannel); if (texture != null) { - _textureCache?.Add(ddsTexturePath, texture, hasAlphaChannel); + _textureCache?.Add(CacheKey(ddsTexturePath), texture, hasAlphaChannel); } else // If dds texture does not exist, try original extension { textureLoader = _textureLoaderFactory.GetTextureLoader(Path.GetExtension(name)); - texture = base.GetTexture(_fileSystem, texturePath, textureLoader, out hasAlphaChannel); + texture = base.GetTexture(_fileSystem, texturePath, textureLoader, _textureFactory, _usage, out hasAlphaChannel); if (texture == null) EngineLogger.LogWarning($"Texture not found: {texturePath}"); - else _textureCache?.Add(texturePath, texture, hasAlphaChannel); + else _textureCache?.Add(CacheKey(texturePath), texture, hasAlphaChannel); } return texture; diff --git a/Assets/Scripts/Pal3.Game/Data/TextureProviderBase.cs b/Assets/Scripts/Pal3.Game/Data/TextureProviderBase.cs index 0ac5813c..b23abbf6 100644 --- a/Assets/Scripts/Pal3.Game/Data/TextureProviderBase.cs +++ b/Assets/Scripts/Pal3.Game/Data/TextureProviderBase.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Data { @@ -14,10 +14,11 @@ public abstract class TextureProviderBase protected ITexture2D GetTexture(ICpkFileSystem fileSystem, string texturePath, ITextureLoader textureLoader, + ITextureFactory textureFactory, + TextureUsage usage, out bool hasAlphaChannel) { byte[] data; - try { data = fileSystem.ReadAllBytes(texturePath); @@ -28,8 +29,8 @@ protected ITexture2D GetTexture(ICpkFileSystem fileSystem, return null; } - textureLoader.Load(data, out hasAlphaChannel); - return textureLoader.ToTexture(); + using ITextureDataSource source = textureLoader.Load(data, out hasAlphaChannel); + return textureFactory.CreateTexture(source, TextureCreationPolicy.Resolve(source, usage)); } } -} \ No newline at end of file +} diff --git a/Assets/Scripts/Pal3.Game/Dev/DevCommands.cs b/Assets/Scripts/Pal3.Game/Dev/DevCommands.cs index 46116962..d33325cb 100644 --- a/Assets/Scripts/Pal3.Game/Dev/DevCommands.cs +++ b/Assets/Scripts/Pal3.Game/Dev/DevCommands.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev { @@ -704,7 +704,7 @@ SceneLoad Q01 Q01 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 190 20 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 0 1 TaskOpen 077 CameraFadeIn"}, {"蜀山\n\n第一次回家", @" @@ -715,7 +715,7 @@ SceneLoad q02 qH PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 91 114 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 0 1 TaskOpen 083 CameraFadeIn"}, {"蜀山\n\n绿萝嶂", @" @@ -730,8 +730,8 @@ SceneLoad Q02 HH PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 342 137 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 TaskOpen 086 CameraFadeIn"}, {"地脉门户\n\n少阳三焦", @" @@ -746,8 +746,8 @@ SceneLoad m02 2 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 29 66 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 0 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -767,9 +767,9 @@ SceneLoad q04 wb PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 321 102 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 0 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -790,9 +790,9 @@ SceneLoad q04 wn PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 346 180 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 0 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -813,9 +813,9 @@ SceneLoad M05 4 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 127 15 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 0 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -836,9 +836,9 @@ SceneLoad q02 qY PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 335 157 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 4 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 4 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -861,8 +861,8 @@ SceneLoad m02 2 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 55 18 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -885,7 +885,7 @@ SceneLoad q06 q06 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 13 192 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 0 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -909,9 +909,9 @@ SceneLoad m07 3 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 14 90 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 2 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 2 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -936,10 +936,10 @@ SceneLoad q04 wb PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 311 124 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 3 1 - TeamAddOrRemoveActor 2 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 3 1 + TeamAddOrRemoveActorSilently 2 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -964,10 +964,10 @@ SceneLoad q04 wn PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 41 428 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 3 1 - TeamAddOrRemoveActor 2 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 3 1 + TeamAddOrRemoveActorSilently 2 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -992,8 +992,8 @@ SceneLoad m10 1 PlayerEnableInput 1 ActorSetNavLayer -1 1 ActorSetTilePosition -1 265 400 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1018,9 +1018,9 @@ SceneLoad q02 qTY PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 89 116 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 4 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 4 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1046,9 +1046,9 @@ SceneLoad q02 hn01 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 25 17 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 4 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 4 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1075,9 +1075,9 @@ SceneLoad q09 d PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 50 21 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 4 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 4 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1105,7 +1105,7 @@ SceneLoad m12 1 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 123 226 - TeamAddOrRemoveActor 0 1 + TeamAddOrRemoveActorSilently 0 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1132,8 +1132,8 @@ SceneLoad q04 wn PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 112 160 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 2 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 2 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1160,9 +1160,9 @@ SceneLoad q04 wn PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 195 394 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 3 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 3 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1189,9 +1189,9 @@ SceneLoad m14 1 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 122 111 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 3 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 3 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1218,10 +1218,10 @@ SceneLoad q10 q10 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 383 310 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 4 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 4 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1248,10 +1248,10 @@ SceneLoad q10 q10y PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 144 53 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 4 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 4 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1278,9 +1278,9 @@ SceneLoad Q02 HS PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 343 140 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 4 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 4 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1308,8 +1308,8 @@ SceneLoad m02 2 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 76 45 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1337,9 +1337,9 @@ SceneLoad q04 wn PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 115 173 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 2 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 2 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1367,10 +1367,10 @@ SceneLoad Q04 N PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 403 116 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 - TeamAddOrRemoveActor 2 1 - TeamAddOrRemoveActor 3 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 + TeamAddOrRemoveActorSilently 2 1 + TeamAddOrRemoveActorSilently 3 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1398,8 +1398,8 @@ SceneLoad m02 1 PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 132 155 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1427,8 +1427,8 @@ SceneLoad q02 q PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 353 98 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 @@ -1458,8 +1458,8 @@ SceneLoad q02 q PlayerEnableInput 1 ActorSetNavLayer -1 0 ActorSetTilePosition -1 353 98 - TeamAddOrRemoveActor 0 1 - TeamAddOrRemoveActor 1 1 + TeamAddOrRemoveActorSilently 0 1 + TeamAddOrRemoveActorSilently 1 1 WorldMapEnableRegion 0 2 WorldMapEnableRegion 1 2 WorldMapEnableRegion 2 2 diff --git a/Assets/Scripts/Pal3.Game/Dev/GithubReleaseVersionFetcher.cs b/Assets/Scripts/Pal3.Game/Dev/GithubReleaseVersionFetcher.cs index 291ad138..174a9113 100644 --- a/Assets/Scripts/Pal3.Game/Dev/GithubReleaseVersionFetcher.cs +++ b/Assets/Scripts/Pal3.Game/Dev/GithubReleaseVersionFetcher.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev { diff --git a/Assets/Scripts/Pal3.Game/Dev/MainMenu.cs b/Assets/Scripts/Pal3.Game/Dev/MainMenu.cs index 94c0819c..e8bbe230 100644 --- a/Assets/Scripts/Pal3.Game/Dev/MainMenu.cs +++ b/Assets/Scripts/Pal3.Game/Dev/MainMenu.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev { @@ -844,6 +844,11 @@ private void ExecuteCommandsFromSaveFile(string saveFileContent) arguments[0] + "Command" == nameof(ActorSetYPositionCommand) || arguments[0] + "Command" == nameof(ActorSetFacingCommand) || arguments[0] + "Command" == nameof(ActorSetScriptCommand) || + #if PAL3A + arguments[0] + "Command" == nameof(ActorSetNoTurnCommand) || + arguments[0] + "Command" == nameof(CameraSetHorizontalDirectionCommand) || + arguments[0] + "Command" == nameof(CameraResetHorizontalDirectionCommand) || + #endif arguments[0] + "Command" == nameof(CameraFadeInCommand)) { _deferredExecutionCommands.Add(command); @@ -901,7 +906,11 @@ public void Execute(ScenePostLoadingNotification command) private IEnumerator ExecuteDeferredCommandsAfterSceneScriptFinishedAsync(uint scriptId) { - yield return new WaitUntilScriptFinished(PalScriptType.Scene, scriptId); + using (var completion = new WaitUntilScriptFinished(PalScriptType.Scene, scriptId)) + { + yield return completion; + if (completion.IsCanceled) yield break; + } if (_deferredExecutionCommands.Count > 0) { diff --git a/Assets/Scripts/Pal3.Game/Dev/MazeSkipper.cs b/Assets/Scripts/Pal3.Game/Dev/MazeSkipper.cs index 84f3029d..bf3f43eb 100644 --- a/Assets/Scripts/Pal3.Game/Dev/MazeSkipper.cs +++ b/Assets/Scripts/Pal3.Game/Dev/MazeSkipper.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev { diff --git a/Assets/Scripts/Pal3.Game/Dev/Presenters/CombatActorInfoPresenter.cs b/Assets/Scripts/Pal3.Game/Dev/Presenters/CombatActorInfoPresenter.cs index 8e697171..89fe1489 100644 --- a/Assets/Scripts/Pal3.Game/Dev/Presenters/CombatActorInfoPresenter.cs +++ b/Assets/Scripts/Pal3.Game/Dev/Presenters/CombatActorInfoPresenter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev.Presenters { diff --git a/Assets/Scripts/Pal3.Game/Dev/Presenters/LightSourceInfoPresenter.cs b/Assets/Scripts/Pal3.Game/Dev/Presenters/LightSourceInfoPresenter.cs index ae9f071d..08a0f3ff 100644 --- a/Assets/Scripts/Pal3.Game/Dev/Presenters/LightSourceInfoPresenter.cs +++ b/Assets/Scripts/Pal3.Game/Dev/Presenters/LightSourceInfoPresenter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev.Presenters { diff --git a/Assets/Scripts/Pal3.Game/Dev/Presenters/MaterialInfoPresenter.cs b/Assets/Scripts/Pal3.Game/Dev/Presenters/MaterialInfoPresenter.cs index ff392952..46a9fd0b 100644 --- a/Assets/Scripts/Pal3.Game/Dev/Presenters/MaterialInfoPresenter.cs +++ b/Assets/Scripts/Pal3.Game/Dev/Presenters/MaterialInfoPresenter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev.Presenters { diff --git a/Assets/Scripts/Pal3.Game/Dev/Presenters/NpcInfoPresenter.cs b/Assets/Scripts/Pal3.Game/Dev/Presenters/NpcInfoPresenter.cs index 2940a878..02e7601f 100644 --- a/Assets/Scripts/Pal3.Game/Dev/Presenters/NpcInfoPresenter.cs +++ b/Assets/Scripts/Pal3.Game/Dev/Presenters/NpcInfoPresenter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev.Presenters { diff --git a/Assets/Scripts/Pal3.Game/Dev/Presenters/PolMeshBatchInfoPresenter.cs b/Assets/Scripts/Pal3.Game/Dev/Presenters/PolMeshBatchInfoPresenter.cs new file mode 100644 index 00000000..463e0a06 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Dev/Presenters/PolMeshBatchInfoPresenter.cs @@ -0,0 +1,31 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if UNITY_EDITOR +namespace Pal3.Game.Dev.Presenters +{ + using System; + using Core.Primitives; + using Engine.Core.Implementation; + + /// Editor-only provenance for the source groups in one POL render mesh. + public sealed class PolMeshBatchInfoPresenter : GameEntityScript + { + [Serializable] + public sealed class SourceGroup + { + public string nodeName; + public int materialGroupIndex; + public GameBoxBlendFlag blendFlag; + public GameBoxMaterial material; + // Zero-based, contiguous vertex range [vertexStart, vertexStart + vertexCount). + public int vertexStart; + public int vertexCount; + } + + public SourceGroup[] sources; + } +} +#endif diff --git a/Assets/Scripts/Pal3.Game/Dev/Presenters/PolMeshBatchInfoPresenter.cs.meta b/Assets/Scripts/Pal3.Game/Dev/Presenters/PolMeshBatchInfoPresenter.cs.meta new file mode 100644 index 00000000..fbc1546f --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Dev/Presenters/PolMeshBatchInfoPresenter.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 5e61e63ecc624fc2a8d6b55e6e0b01f7 diff --git a/Assets/Scripts/Pal3.Game/Dev/Presenters/SceneObjectInfoPresenter.cs b/Assets/Scripts/Pal3.Game/Dev/Presenters/SceneObjectInfoPresenter.cs index 248b519a..3f8e1d80 100644 --- a/Assets/Scripts/Pal3.Game/Dev/Presenters/SceneObjectInfoPresenter.cs +++ b/Assets/Scripts/Pal3.Game/Dev/Presenters/SceneObjectInfoPresenter.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Dev.Presenters { diff --git a/Assets/Scripts/Pal3.Game/Dev/TexturePatcher.cs b/Assets/Scripts/Pal3.Game/Dev/TexturePatcher.cs index fff0ba5f..a77945a4 100644 --- a/Assets/Scripts/Pal3.Game/Dev/TexturePatcher.cs +++ b/Assets/Scripts/Pal3.Game/Dev/TexturePatcher.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if PAL3A diff --git a/Assets/Scripts/Pal3.Game/Effect/CombatEffect.cs b/Assets/Scripts/Pal3.Game/Effect/CombatEffect.cs index 2ec48fca..4bf6918d 100644 --- a/Assets/Scripts/Pal3.Game/Effect/CombatEffect.cs +++ b/Assets/Scripts/Pal3.Game/Effect/CombatEffect.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/EffectManager.cs b/Assets/Scripts/Pal3.Game/Effect/EffectManager.cs index a1439b96..ba0b5eb3 100644 --- a/Assets/Scripts/Pal3.Game/Effect/EffectManager.cs +++ b/Assets/Scripts/Pal3.Game/Effect/EffectManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/EffectTypeResolver.cs b/Assets/Scripts/Pal3.Game/Effect/EffectTypeResolver.cs index 54a979dc..dfe53690 100644 --- a/Assets/Scripts/Pal3.Game/Effect/EffectTypeResolver.cs +++ b/Assets/Scripts/Pal3.Game/Effect/EffectTypeResolver.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/FireEffect.cs b/Assets/Scripts/Pal3.Game/Effect/FireEffect.cs index e4272136..3e0773a8 100644 --- a/Assets/Scripts/Pal3.Game/Effect/FireEffect.cs +++ b/Assets/Scripts/Pal3.Game/Effect/FireEffect.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/IEffect.cs b/Assets/Scripts/Pal3.Game/Effect/IEffect.cs index 212b8fe9..981a11e4 100644 --- a/Assets/Scripts/Pal3.Game/Effect/IEffect.cs +++ b/Assets/Scripts/Pal3.Game/Effect/IEffect.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/OptionalVfxPlayer.cs b/Assets/Scripts/Pal3.Game/Effect/OptionalVfxPlayer.cs index 0ffe4a5e..2aabf275 100644 --- a/Assets/Scripts/Pal3.Game/Effect/OptionalVfxPlayer.cs +++ b/Assets/Scripts/Pal3.Game/Effect/OptionalVfxPlayer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/PortalEffect.cs b/Assets/Scripts/Pal3.Game/Effect/PortalEffect.cs index 66960217..b6c5a78f 100644 --- a/Assets/Scripts/Pal3.Game/Effect/PortalEffect.cs +++ b/Assets/Scripts/Pal3.Game/Effect/PortalEffect.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/PostProcessing/PostProcessManager.cs b/Assets/Scripts/Pal3.Game/Effect/PostProcessing/PostProcessManager.cs index 2006bcbc..18642ab1 100644 --- a/Assets/Scripts/Pal3.Game/Effect/PostProcessing/PostProcessManager.cs +++ b/Assets/Scripts/Pal3.Game/Effect/PostProcessing/PostProcessManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect.PostProcessing { diff --git a/Assets/Scripts/Pal3.Game/Effect/RotatingSpriteEffect.cs b/Assets/Scripts/Pal3.Game/Effect/RotatingSpriteEffect.cs index 768bb659..c74a7612 100644 --- a/Assets/Scripts/Pal3.Game/Effect/RotatingSpriteEffect.cs +++ b/Assets/Scripts/Pal3.Game/Effect/RotatingSpriteEffect.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.Effect { diff --git a/Assets/Scripts/Pal3.Game/Effect/SkyboxEffectManager.cs b/Assets/Scripts/Pal3.Game/Effect/SkyboxEffectManager.cs new file mode 100644 index 00000000..6239b3e8 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Effect/SkyboxEffectManager.cs @@ -0,0 +1,201 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Game.Effect +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using Command; + using Command.Extensions; + using Core.Command; + using Core.Command.SceCommands; + using Core.Contract.Constants; + using Core.Primitives; + using Data; + using Engine.Core.Abstraction; + using Engine.Extensions; + using State; + using UnityEngine; + using UnityEngine.Rendering; + + public sealed class SkyboxEffectManager : IDisposable, + ICommandExecutor, ICommandExecutor, + ICommandExecutor, + ICommandExecutor, + ICommandExecutor + { + private const float BoxSize = 4500f; // Original SkyBox initialization at 0x5272AD. + private readonly GameResourceProvider _resources; + private readonly Transform _camera; + private readonly Dictionary _sequences = new(StringComparer.OrdinalIgnoreCase); + private readonly List _effects = new(); + private readonly Material _material; + private readonly MaterialPropertyBlock _properties = new(); + private GameState _state = GameState.UI; + private readonly int _textureId = Shader.PropertyToID("_MainTex"); + private sealed class Effect + { + public string Sequence; + public ITexture2D[] Frames; + public GameObject Object; + public Mesh Mesh; + public MeshRenderer Renderer; + public float Time, Fps, Interval, Delay; + public int Frame = -1; + } + + public int EffectCount => _effects.Count; + public SkyboxEffectManager(GameResourceProvider resources, Transform camera) + { + _resources = resources; + _camera = camera; + _material = new Material(Resources.Load("Shaders/SkyboxEffect")); + CommandExecutorRegistry.Instance.Register(this); + } + + public void Dispose() + { + Clear(); + UnityEngine.Object.Destroy(_material); + CommandExecutorRegistry.Instance.UnRegister(this); + } + + public void Execute(SkyboxAddEffectCommand command) + { + int face = command.Face < 0 ? UnityEngine.Random.Range(0, 6) : command.Face; + if (face > 5 || string.IsNullOrWhiteSpace(command.Sequence) || + !float.IsFinite(command.X) || !float.IsFinite(command.Y) || + !float.IsFinite(command.Scale) || !float.IsFinite(command.Interval) || + !float.IsFinite(command.InitialDelay) || !float.IsFinite(command.Fps) || command.Fps <= 0) + throw new ArgumentException("Invalid skybox effect parameters"); + string sequence = command.Sequence; + if (!_sequences.TryGetValue(sequence, out var frames)) + { + int separator = sequence.LastIndexOf('_'); + if (separator < 1 || !int.TryParse(sequence[(separator + 1)..], out int count) || count < 1 || count > 1024) + throw new ArgumentException("Invalid skybox sequence name"); + var provider = _resources.CreateTextureResourceProvider( + FileConstants.EffectScnFolderVirtualPath + "skybox\\effect\\" + sequence, useCache: false); + frames = new ITexture2D[count]; + try + { + for (int i = 0; i < count; i++) + { + string name = sequence[..separator] + (i + 1).ToString("D4") + ".tga"; + frames[i] = provider.GetTexture(name) ?? throw new FileNotFoundException(name); + } + } + catch { foreach (var frame in frames) frame?.Destroy(); throw; } + _sequences.Add(sequence, frames); + } + float scale = command.Scale > 0 ? command.Scale : 1; + float width = Mathf.Min(BoxSize, frames[0].Width * scale), height = Mathf.Min(BoxSize, frames[0].Height * scale); + var go = new GameObject("SkyboxEffect_" + sequence); + var filter = go.AddComponent(); + var renderer = go.AddComponent(); + var mesh = new Mesh { name = "SkyboxEffectQuad" }; + mesh.vertices = Vertices(face, command.X, command.Y, width, height); + mesh.uv = new[] { new Vector2(0, 0), new Vector2(1, 0), new Vector2(1, 1), new Vector2(0, 1) }; + mesh.triangles = new[] { 0, 1, 2, 0, 2, 3 }; + mesh.RecalculateBounds(); + filter.sharedMesh = mesh; + renderer.sharedMaterial = _material; + renderer.shadowCastingMode = ShadowCastingMode.Off; + renderer.receiveShadows = false; + renderer.enabled = false; + _effects.Add(new Effect + { + Sequence = sequence, + Frames = frames, + Object = go, + Mesh = mesh, + Renderer = renderer, + Fps = command.Fps, + Interval = Mathf.Max(0, command.Interval), + Delay = Mathf.Max(0, command.InitialDelay) + }); + } + + // Vertex order follows original 0x527E5C. Coordinates are relative to the camera. + internal static Vector3[] Vertices(int face, float x, float y, float width, float height) + { + float h = BoxSize * 0.5f, a = h + x, b = h + y; + GameBoxVector3[] points = face switch + { + 0 => new[] { new GameBoxVector3(-h, b - height, a), new(-h, b - height, a - width), new(-h, b, a - width), new(-h, b, a) }, + 1 => new[] { new GameBoxVector3(a, b - height, h), new(a - width, b - height, h), new(a - width, b, h), new(a, b, h) }, + 2 => new[] { new GameBoxVector3(h, b - height, a - width), new(h, b - height, a), new(h, b, a), new(h, b, a - width) }, + 3 => new[] { new GameBoxVector3(a - width, b - height, -h), new(a, b - height, -h), new(a, b, -h), new(a - width, b, -h) }, + 4 => new[] { new GameBoxVector3(a, h, b - height), new(a, h, b), new(a - width, h, b), new(a - width, h, b - height) }, + _ => new[] { new GameBoxVector3(a - width, -h, b - height), new(a - width, -h, b), new(a, -h, b), new(a, -h, b - height) } + }; + return points.Select(p => p.ToUnityPosition()).ToArray(); + } + + public void Update(float deltaTime) + { + foreach (var effect in _effects) + { + effect.Object.transform.position = _camera.position; + bool visible = _state != GameState.Combat && _state != GameState.VideoPlaying; + if (_state == GameState.Gameplay || _state == GameState.Cutscene) + effect.Time += deltaTime; + float elapsed = effect.Time - effect.Delay; + float duration = effect.Frames.Length / effect.Fps; + float phase = elapsed >= 0 ? elapsed % (duration + effect.Interval) : -1; + int frame = phase >= 0 && phase < duration ? Mathf.Min(effect.Frames.Length - 1, (int)(phase * effect.Fps)) : -1; + effect.Renderer.enabled = visible && frame >= 0; + if (effect.Frame == frame) + continue; + effect.Frame = frame; + if (frame < 0) + continue; + _properties.SetTexture(_textureId, effect.Frames[frame].NativeObject as Texture); + effect.Renderer.SetPropertyBlock(_properties); + } + } + + public void Execute(SkyboxRemoveEffectCommand command) + { + foreach (var effect in _effects.Where(e => string.Equals(e.Sequence, command.Sequence, StringComparison.OrdinalIgnoreCase)).ToArray()) + { + UnityEngine.Object.Destroy(effect.Object); + UnityEngine.Object.Destroy(effect.Mesh); + _effects.Remove(effect); + } + if (_sequences.Remove(command.Sequence, out var frames)) + { + foreach (var frame in frames) frame.Destroy(); + } + } + + private void Clear() + { + foreach (var effect in _effects) + { + UnityEngine.Object.Destroy(effect.Object); + UnityEngine.Object.Destroy(effect.Mesh); + } + _effects.Clear(); + foreach (var frames in _sequences.Values) + { + foreach (var frame in frames) frame.Destroy(); + } + _sequences.Clear(); + } + + public void Execute(GameStateChangedNotification command) + { + _state = command.NewState; + } + + public void Execute(SceneLeavingCurrentSceneNotification command) => Clear(); + public void Execute(ResetGameStateCommand command) => Clear(); + } +} +#endif diff --git a/Assets/Scripts/Pal3.Game/Effect/SkyboxEffectManager.cs.meta b/Assets/Scripts/Pal3.Game/Effect/SkyboxEffectManager.cs.meta new file mode 100644 index 00000000..7bdd6450 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/Effect/SkyboxEffectManager.cs.meta @@ -0,0 +1,2 @@ +fileFormatVersion: 2 +guid: 4f5ee8482add416eb9d9729dcf2a9ed0 diff --git a/Assets/Scripts/Pal3.Game/GamePlay/PlayerActorManager.cs b/Assets/Scripts/Pal3.Game/GamePlay/PlayerActorManager.cs index 9185c2d0..fee6945f 100644 --- a/Assets/Scripts/Pal3.Game/GamePlay/PlayerActorManager.cs +++ b/Assets/Scripts/Pal3.Game/GamePlay/PlayerActorManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GamePlay { diff --git a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.ActorSwitch.cs b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.ActorSwitch.cs index ee364c0c..599f4d6d 100644 --- a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.ActorSwitch.cs +++ b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.ActorSwitch.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GamePlay { diff --git a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Climb.cs b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Climb.cs index 868b9c88..25de9eed 100644 --- a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Climb.cs +++ b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Climb.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GamePlay { diff --git a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Interaction.cs b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Interaction.cs index 8d3ab9e0..5aafe12e 100644 --- a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Interaction.cs +++ b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Interaction.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GamePlay { @@ -34,12 +34,53 @@ public partial class PlayerGamePlayManager : ICommandExecutor, ICommandExecutor { + private int _interactionGeneration; + + private void StartInteraction(IEnumerator routine) + { + int generation = _interactionGeneration; + Pal3.Instance.StartCoroutine(RunInteractionAsync(routine, () => generation != _interactionGeneration)); + } + + // Unwind the entire linked-object chain on reset, including nested script + // waits. Resuming just the innermost waiter could run an old parent's actions. + internal static IEnumerator RunInteractionAsync(IEnumerator routine, Func isCanceled) + { + var stack = new Stack(); + stack.Push(routine); + try + { + while (stack.Count > 0 && !isCanceled()) + { + IEnumerator current = stack.Peek(); + if (!current.MoveNext()) + { + stack.Pop(); + (current as IDisposable)?.Dispose(); + } + else if (current.Current is IEnumerator nested) + { + stack.Push(nested); + } + else + { + if (isCanceled()) yield break; + yield return current.Current; + } + } + } + finally + { + while (stack.Count > 0) (stack.Pop() as IDisposable)?.Dispose(); + } + } + public void Execute(PlayerInteractWithObjectCommand command) { GameScene currentScene = _sceneManager.GetCurrentScene(); if (currentScene.GetAllActivatedSceneObjects().Contains(command.SceneObjectId)) { - Pal3.Instance.StartCoroutine(InteractWithSceneObjectAsync( + StartInteraction(InteractWithSceneObjectAsync( currentScene.GetSceneObject(command.SceneObjectId), startedByPlayer: false)); } else @@ -140,7 +181,7 @@ private void InteractWithFacingInteractable() if (interactionRoutine != null) { - Pal3.Instance.StartCoroutine(interactionRoutine); + StartInteraction(interactionRoutine); } } @@ -181,11 +222,16 @@ private IEnumerator InteractWithActorAsync(int actorId, IGameEntity actorGameEnt ActorController actorController = actorGameEntity.GetComponent(); ActorMovementController movementController = actorGameEntity.GetComponent(); + ActorActionController actionController = actorGameEntity.GetComponent(); + ActorBehaviourType behaviourBeforeInteraction = actorController?.GetCurrentBehaviour() ?? targetActor.Info.InitBehaviour; + string actionBeforeInteraction = actionController?.GetCurrentAction(); + bool restoreLoopingAction = actionController?.CurrentActionLoopCount == -1; // Pause current path follow movement of the interacting actor - if (actorController != null && + bool pausedMovement = targetActor.NoTurn == 0 && actorController != null && movementController != null && - actorController.GetCurrentBehaviour() == ActorBehaviourType.PathFollow) + actorController.GetCurrentBehaviour() == ActorBehaviourType.PathFollow; + if (pausedMovement) { movementController.PauseMovement(); } @@ -196,18 +242,18 @@ private IEnumerator InteractWithActorAsync(int actorId, IGameEntity actorGameEnt bool shouldResetFacingAfterInteraction = false; // Only let target actor look at player actor when NoTurn is set to false - // and InitBehaviour is not set to Hold - if (targetActor.Info.NoTurn == 0 && targetActor.Info.InitBehaviour != ActorBehaviourType.Hold) + // and the current behaviour is not Hold. + if (targetActor.NoTurn == 0 && behaviourBeforeInteraction != ActorBehaviourType.Hold) { + actionController?.PerformAction(targetActor.GetIdleAction()); Pal3.Instance.Execute(new ActorLookAtActorCommand(targetActor.Id, _playerActor.Id)); shouldResetFacingAfterInteraction = true; } // Resume animation of the target actor if it is set to hold and loop action is set to 0 - if (targetActor.Info.InitBehaviour == ActorBehaviourType.Hold && + if (targetActor.NoTurn == 0 && behaviourBeforeInteraction == ActorBehaviourType.Hold && targetActor.Info.LoopAction == 0) { - ActorActionController actionController = actorGameEntity.GetComponent(); // PerformAction internally checks if the target actor is already performing the action actionController.PerformAction(actionController.GetCurrentAction(), false, 1); } @@ -216,20 +262,29 @@ private IEnumerator InteractWithActorAsync(int actorId, IGameEntity actorGameEnt Pal3.Instance.Execute(new ScriptExecuteCommand((int)targetActor.GetScriptId())); // Wait until the dialogue script is finished - yield return new WaitUntilScriptFinished(PalScriptType.Scene, targetActor.GetScriptId()); + using (var completion = new WaitUntilScriptFinished(PalScriptType.Scene, targetActor.GetScriptId())) + { + yield return completion; + if (completion.IsCanceled || actorGameEntity.IsNullOrDisposed()) yield break; + } // Resume current path follow movement of the interacting actor - if (actorController != null && - movementController != null && - actorController.GetCurrentBehaviour() == ActorBehaviourType.PathFollow) + if (pausedMovement) { movementController.ResumeMovement(); } // Reset facing rotation of the interacting actor if needed - if (shouldResetFacingAfterInteraction && !actorGameEntity.IsNullOrDisposed()) + if (shouldResetFacingAfterInteraction && targetActor.NoTurn == 0 && + !actorGameEntity.IsNullOrDisposed() && actorController?.GetCurrentBehaviour() != ActorBehaviourType.Hold) { actorGameEntity.Transform.Rotation = rotationBeforeInteraction; + // Finite/hold actions were interrupted by dialogue; replaying them + // with the default loop count would turn them into endless loops. + if (restoreLoopingAction && !string.IsNullOrEmpty(actionBeforeInteraction)) + { + actionController?.PerformAction(actionBeforeInteraction); + } } } } diff --git a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Jump.cs b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Jump.cs index 5e276abe..fbece1ee 100644 --- a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Jump.cs +++ b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Jump.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GamePlay { diff --git a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Movement.cs b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Movement.cs index 34e04636..03839c96 100644 --- a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Movement.cs +++ b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.Movement.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GamePlay { diff --git a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.cs b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.cs index 48e164c9..411b649d 100644 --- a/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.cs +++ b/Assets/Scripts/Pal3.Game/GamePlay/PlayerGamePlayManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GamePlay { @@ -452,6 +452,7 @@ public void Execute(ScenePostLoadingNotification notification) public void Execute(ResetGameStateCommand command) { + _interactionGeneration++; ResetAndDisposeJumpIndicators(); _playerActorLastKnownSceneState.Clear(); diff --git a/Assets/Scripts/Pal3.Game/GameResourceInitializer.cs b/Assets/Scripts/Pal3.Game/GameResourceInitializer.cs index 213affbd..9db531f4 100644 --- a/Assets/Scripts/Pal3.Game/GameResourceInitializer.cs +++ b/Assets/Scripts/Pal3.Game/GameResourceInitializer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game { @@ -166,7 +166,7 @@ private IEnumerator InitResourceAsync() ServiceLocator.Instance.Register(textureFactory); // Init TextureLoaderFactory - TextureLoaderFactory textureLoaderFactory = new (textureFactory); + TextureLoaderFactory textureLoaderFactory = new (); ServiceLocator.Instance.Register(textureLoaderFactory); // Init MaterialFactory diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Caption/CaptionRenderer.cs b/Assets/Scripts/Pal3.Game/GameSystems/Caption/CaptionRenderer.cs index 54a48921..57adcb05 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Caption/CaptionRenderer.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Caption/CaptionRenderer.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Caption { diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActor.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActor.cs index 18cbbebc..d3470e57 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActor.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActor.cs @@ -1,10 +1,11 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat.Actor { + using System; using Core.Contract.Constants; using Core.Contract.Enums; using Core.DataReader.Gdb; @@ -17,7 +18,9 @@ public sealed class CombatActor : ActorBase public CombatActor(GameResourceProvider resourceProvider, CombatActorInfo actorInfo) : base(resourceProvider, (int)actorInfo.Id, - actorInfo.Type == CombatActorType.MainActor ? actorInfo.Id.ToString() : actorInfo.ModelId) + string.IsNullOrEmpty(actorInfo.ModelId) || + actorInfo.Type == CombatActorType.MainActor && string.Equals(actorInfo.ModelId, "Null", StringComparison.OrdinalIgnoreCase) + ? actorInfo.Id.ToString() : actorInfo.ModelId) { Info = actorInfo; } diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActorFactory.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActorFactory.cs index e235970e..76a940a3 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActorFactory.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/CombatActorFactory.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat.Actor { @@ -27,38 +27,46 @@ public static IGameEntity CreateCombatActorGameEntity(GameResourceProvider resou { IGameEntity actorGameEntity = GameEntityFactory.Create($"CombatActor_{actor.Id}_{actor.Name}"); - // Attach CombatActorInfo to the GameEntity for better debuggability - #if UNITY_EDITOR - CombatActorInfoPresenter combatActorInfoPresent = actorGameEntity.AddComponent(); - combatActorInfoPresent.combatActorInfo = actor.Info; - #endif - - ActorActionController actionController; - switch (actor.AnimationType) + try { - case ActorAnimationType.Vertex: + // Attach CombatActorInfo to the GameEntity for better debuggability + #if UNITY_EDITOR + CombatActorInfoPresenter combatActorInfoPresent = actorGameEntity.AddComponent(); + combatActorInfoPresent.combatActorInfo = actor.Info; + #endif + + ActorActionController actionController; + switch (actor.AnimationType) { - VertexAnimationActorActionController vertexActionController = - actorGameEntity.AddComponent(); - vertexActionController.Init(resourceProvider, - actor, - hasColliderAndRigidBody: false, // combat actor has no collider and rigidbody - isDropShadowEnabled, - autoStand: true, // combat actor always auto stand - canPerformHoldAnimation: false); // combat actor can't perform hold animation - actionController = vertexActionController; - break; + case ActorAnimationType.Vertex: + { + VertexAnimationActorActionController vertexActionController = + actorGameEntity.AddComponent(); + vertexActionController.Init(resourceProvider, + actor, + hasColliderAndRigidBody: false, // combat actor has no collider and rigidbody + isDropShadowEnabled, + autoStand: true, // combat actor always auto stand + canPerformHoldAnimation: false); // combat actor can't perform hold animation + actionController = vertexActionController; + break; + } + case ActorAnimationType.Skeletal: + default: + throw new NotSupportedException($"Unsupported actor animation type: {actor.AnimationType}"); } - case ActorAnimationType.Skeletal: - default: - throw new NotSupportedException($"Unsupported actor animation type: {actor.AnimationType}"); - } - CombatActorController actorController = actorGameEntity.AddComponent(); - actorController.Init(actor, actionController, elementPosition); - actorController.IsActive = true; // combat actor is always active + CombatActorController actorController = actorGameEntity.AddComponent(); + actorController.Init(actor, actionController, elementPosition); + actorController.IsActive = true; // combat actor is always active - return actorGameEntity; + return actorGameEntity; + } + catch + { + actorGameEntity.Destroy(); + throw; + } } } } \ No newline at end of file diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/Controllers/CombatActorController.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/Controllers/CombatActorController.cs index 28b0eefd..ebf4df41 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/Controllers/CombatActorController.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Actor/Controllers/CombatActorController.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat.Actor.Controllers { @@ -58,6 +58,22 @@ private void AnimationEventTriggered(object sender, string eventName) } } + // The combat resolver must route all vital changes through this method, including skill costs. + public void ChangeAttribute(Core.Contract.Enums.ActorAttributeType attribute, int delta) + { + var values = _actor.Info.AttributeValues; + values[attribute] = (int)Math.Clamp((long)values[attribute] + delta, 0, int.MaxValue); + #if PAL3A + if (_elementPosition <= ElementPosition.AllyCenter) + { + foreach (var mapping in Core.Contract.Constants.ActorConstants.MainActorCombatActorIdMap) + if (mapping.Value == _actor.Id) + Engine.Services.ServiceLocator.Instance.Get().ScriptState + .RecordAttributeChange((int)mapping.Key, attribute, delta); + } + #endif + } + public ElementPosition GetElementPosition() { return _elementPosition; @@ -97,6 +113,9 @@ private void DeActivate() public IEnumerator StartNormalAttackAsync(CombatActorController enemyActorController, CombatScene combatScene) { + // Some scripted forms (e.g. WangPengXu's beast form) have no normal attack. + if (!_actor.HasAction(_actor.GetAttackAction())) yield break; + Quaternion currentRotation = _actionController.Transform.Rotation; _actionController.PerformAction(_actor.GetMovementAction()); diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContext.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContext.cs index 633a5bea..0ec83fe8 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContext.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContext.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat { @@ -31,6 +31,15 @@ public sealed class CombatContext public bool IsNoGameOverWhenLose { get; set; } = false; public uint[] EnemyIds { get; set; } = new uint[6]; + #if PAL3A + public bool NanGongHuangAbilitiesEnabled { get; set; } + public bool WangPengXuTransformEnabled { get; set; } + public bool NanGongHuangStartsTransformed { get; set; } + public bool WangPengXuStartsTransformed { get; set; } + public int LiaoRiHpBonus { get; set; } + public int LiaoRiMpBonus { get; set; } + #endif + public override string ToString() { return $"CombatContext: " + diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContextBuilder.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContextBuilder.cs index 44444caa..47edd830 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContextBuilder.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatContextBuilder.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat { diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatCoordinator.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatCoordinator.cs index f8b541e9..c5691645 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatCoordinator.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatCoordinator.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat { @@ -43,7 +43,12 @@ public sealed class CombatCoordinator : IDisposable, ICommandExecutor, #if PAL3A ICommandExecutor, - ICommandExecutor, + ICommandExecutor, + ICommandExecutor, + ICommandExecutor, + ICommandExecutor, + ICommandExecutor, + ICommandExecutor, #endif ICommandExecutor, ICommandExecutor, @@ -52,6 +57,9 @@ public sealed class CombatCoordinator : IDisposable, { private const string COMBAT_SCN_FILE_NAME = "combatScn.txt"; + #if PAL3A + public Core.Contract.Pal3ACombatScriptState ScriptState { get; } = new(); + #endif private readonly GameSettings _gameSettings; private readonly CombatManager _combatManager; private readonly PlayerActorManager _playerActorManager; @@ -93,52 +101,87 @@ public void Dispose() private void StartCombat() { - if (!_gameSettings.IsTurnBasedCombatEnabled) return; - - GameScene currentScene = _sceneManager.GetCurrentScene(); - - // Figure out which combat scene to use - string combatSceneName = GetCombatSceneName(currentScene); - _combatContextBuilder.WithCombatSceneName(combatSceneName); - - // Figure out element property of the combat scene - if (_combatScnFile.CombatSceneElementTypeInfo.TryGetValue(combatSceneName, - out ElementType combatSceneElementType)) + if (!_gameSettings.IsTurnBasedCombatEnabled) { - _combatContextBuilder.WithCombatSceneElementType(combatSceneElementType); + // A skipped encounter must not leave its one-shot flags on an unrelated later fight. + #if PAL3A + ScriptState.BeginBattle(Array.IndexOf(_combatContextBuilder.CurrentContext.EnemyIds, 722u) >= 0); + #endif + _combatContextBuilder.ResetContext(); + return; } - // Figure out which combat music to play - if (string.IsNullOrEmpty(_combatContextBuilder.CurrentContext.CombatMusicName)) + GameState previousState = _gameStateManager.GetCurrentState(); + #if PAL3A + int flags = ScriptState.Flags, lostHp = ScriptState.LostHp, lostMp = ScriptState.LostMp; + #endif + try { - if (MusicConstants.CombatMusicInfo.TryGetValue( - currentScene.GetSceneInfo().CityName.ToLower(), - out string combatMusic)) + GameScene currentScene = _sceneManager.GetCurrentScene(); + + // Figure out which combat scene to use + string combatSceneName = GetCombatSceneName(currentScene); + _combatContextBuilder.WithCombatSceneName(combatSceneName); + + // Figure out element property of the combat scene + if (_combatScnFile.CombatSceneElementTypeInfo.TryGetValue(combatSceneName, + out ElementType combatSceneElementType)) { - // Set music only if it's not set yet or it's not a script triggered combat - if (string.IsNullOrEmpty(_audioManager.GetCurrentScriptMusic()) || - !_combatContextBuilder.CurrentContext.IsScriptTriggeredCombat) + _combatContextBuilder.WithCombatSceneElementType(combatSceneElementType); + } + + // Figure out which combat music to play + if (string.IsNullOrEmpty(_combatContextBuilder.CurrentContext.CombatMusicName)) + { + if (MusicConstants.CombatMusicInfo.TryGetValue( + currentScene.GetSceneInfo().CityName.ToLower(), + out string combatMusic)) { - _combatContextBuilder.WithCombatMusicName(combatMusic); + // Set music only if it's not set yet or it's not a script triggered combat + if (string.IsNullOrEmpty(_audioManager.GetCurrentScriptMusic()) || + !_combatContextBuilder.CurrentContext.IsScriptTriggeredCombat) + { + _combatContextBuilder.WithCombatMusicName(combatMusic); + } } } - } - // Check current state and add script waiter to pause script execution - // if we are in cutscene state. - if (_gameStateManager.GetCurrentState() == GameState.Cutscene) + // Check current state and add script waiter to pause script execution + // if we are in cutscene state. + if (_gameStateManager.GetCurrentState() == GameState.Cutscene) + { + WaitUntilCanceled combatWaiter = new(); + Pal3.Instance.Execute(new ScriptRunnerAddWaiterRequest(combatWaiter)); + _combatContextBuilder.WithScriptWaiter(combatWaiter); + } + + CombatContext combatContext = _combatContextBuilder.Build(); + + #if PAL3A + var options = ScriptState.BeginBattle(Array.IndexOf(combatContext.EnemyIds, 722u) >= 0); + combatContext.NanGongHuangAbilitiesEnabled = ScriptState.NanGongHuangAbilitiesEnabled; + combatContext.WangPengXuTransformEnabled = ScriptState.WangPengXuTransformEnabled; + combatContext.NanGongHuangStartsTransformed = options.wolf; + combatContext.WangPengXuStartsTransformed = options.pengXu; + combatContext.LiaoRiHpBonus = options.hpBonus; + combatContext.LiaoRiMpBonus = options.mpBonus; + #endif + + // Start combat + EngineLogger.LogWarning($"Starting combat with context: {combatContext}"); + _gameStateManager.TryGoToState(GameState.Combat); + _combatManager.EnterCombat(combatContext); + } + catch { - WaitUntilCanceled combatWaiter = new(); - Pal3.Instance.Execute(new ScriptRunnerAddWaiterRequest(combatWaiter)); - _combatContextBuilder.WithScriptWaiter(combatWaiter); + #if PAL3A + ScriptState.Restore(flags, lostHp, lostMp); + #endif + _combatContextBuilder.CurrentContext.ScriptWaiter?.CancelWait(); + _combatContextBuilder.ResetContext(); + if (!_gameStateManager.TryGoToState(previousState)) _gameStateManager.TryGoToState(GameState.Cutscene); + throw; } - - CombatContext combatContext = _combatContextBuilder.Build(); - - // Start combat - EngineLogger.LogWarning($"Starting combat with context: {combatContext}"); - _gameStateManager.TryGoToState(GameState.Combat); - _combatManager.EnterCombat(combatContext); } private void OnCombatFinished(object sender, CombatResult combatResult) @@ -273,21 +316,12 @@ public void Execute(CombatEnterBossFightUsingMusicCommand command) StartCombat(); } - public void Execute(CombatEnterBossFightUsingMusicWithSpecialActorCommand command) - { - _combatContextBuilder - .WithEnemyIds( - command.Monster1Id, - command.Monster2Id, - command.Monster3Id, - command.Monster4Id, - command.Monster5Id, - command.Monster6Id) - .WithIsScriptTriggeredCombat(true) - .WithCombatMusicName(command.CombatMusicName); - // TODO: NanGoongHuang enter fight using wolf state - StartCombat(); - } + public void Execute(CombatPrepareNanGongHuangTransformCommand command) => ScriptState.NextNanGongHuangTransform = true; + public void Execute(CombatPrepareWangPengXuTransformCommand command) => ScriptState.NextWangPengXuTransform = true; + public void Execute(NanGongHuangEnableCombatAbilitiesCommand command) => ScriptState.NanGongHuangAbilitiesEnabled = command.Enable > 0; + public void Execute(WangPengXuEnableCombatTransformCommand command) => ScriptState.WangPengXuTransformEnabled = command.Enabled > 0; + public void Execute(CombatPreserveDamageForLiaoRiCommand command) => ScriptState.PreserveLosses = true; + public void Execute(Pal3ARestoreCombatScriptStateCommand command) => ScriptState.Restore(command.Flags, command.LostHp, command.LostMp); #endif public void Execute(CombatSetUnbeatableCommand command) @@ -308,6 +342,9 @@ public void Execute(CombatSetNoGameOverWhenLoseCommand command) public void Execute(ResetGameStateCommand command) { _combatContextBuilder.ResetContext(); + #if PAL3A + ScriptState.Reset(); + #endif } // Player actor collides with combat NPC in maze diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatManager.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatManager.cs index 0c047e95..07013022 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatManager.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/CombatManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat { @@ -22,6 +22,7 @@ namespace Pal3.Game.GameSystems.Combat using Data; using Engine.Core.Abstraction; using Engine.Extensions; + using Engine.Services; using Game.Scene; using Scene; using State; @@ -83,45 +84,97 @@ public void EnterCombat(CombatContext combatContext) _cameraFovBeforeCombat = _cameraManager.GetFieldOfView(); - if (!string.IsNullOrEmpty(combatContext.CombatMusicName)) + string previousMusic = Engine.Services.ServiceLocator.Instance.Get().GetCurrentScriptMusic(); + try { - Pal3.Instance.Execute(new PlayScriptMusicCommand(combatContext.CombatMusicName, -1)); - } + if (!string.IsNullOrEmpty(combatContext.CombatMusicName)) + { + Pal3.Instance.Execute(new PlayScriptMusicCommand(combatContext.CombatMusicName, -1)); + } - _combatScene = _sceneManager.LoadCombatScene(combatContext.CombatSceneName); + _combatScene = _sceneManager.LoadCombatScene(combatContext.CombatSceneName); - Dictionary combatActors = new (); + Dictionary combatActors = new (); - int positionIndex = 0; - foreach (PlayerActorId playerActorId in _teamManager.GetActorsInTeam()) - { - int combatActorId = ActorConstants.MainActorCombatActorIdMap[playerActorId]; - combatActors[(ElementPosition)positionIndex++] = _combatActorInfos[combatActorId]; - } + int positionIndex = 0; + foreach (PlayerActorId playerActorId in _teamManager.GetActorsInTeam()) + { + int combatActorId = ActorConstants.MainActorCombatActorIdMap[playerActorId]; + CombatActorInfo info = CopyActorInfo(_combatActorInfos[combatActorId]); + info.Level = ServiceLocator.Instance.Get().GetLevel((int)playerActorId); + #if PAL3A + if (playerActorId == PlayerActorId.NanGongHuang && combatContext.NanGongHuangStartsTransformed) + info.ModelId = ActorConstants.NanGongHuangWolfModeActorName; + if (playerActorId == PlayerActorId.WangPengXu && combatContext.WangPengXuStartsTransformed) + { + info.ModelId = "106"; + info.AttributeValues[ActorAttributeType.Hp] = 400; + info.AttributeValues[ActorAttributeType.Defense] *= 2; + } + #endif + combatActors[(ElementPosition)positionIndex++] = info; + } - for (int i = 0; i < combatContext.EnemyIds.Length; i++) - { - uint enemyActorId = combatContext.EnemyIds[i]; - if (enemyActorId == 0) continue; - combatActors[(ElementPosition)((int)ElementPosition.EnemyWater + i)] = - _combatActorInfos[(int)enemyActorId]; - } + for (int i = 0; i < combatContext.EnemyIds.Length; i++) + { + uint enemyActorId = combatContext.EnemyIds[i]; + if (enemyActorId == 0) continue; + CombatActorInfo info = CopyActorInfo(_combatActorInfos[(int)enemyActorId]); + #if PAL3A + if (enemyActorId == 722) + { + info.AttributeValues[ActorAttributeType.Hp] = AddAttributeBonus( + info.AttributeValues[ActorAttributeType.Hp], combatContext.LiaoRiHpBonus); + info.AttributeValues[ActorAttributeType.Mp] = AddAttributeBonus( + info.AttributeValues[ActorAttributeType.Mp], combatContext.LiaoRiMpBonus); + } + #endif + combatActors[(ElementPosition)((int)ElementPosition.EnemyWater + i)] = info; + } - _combatScene.LoadActors(combatActors, combatContext.MeetType); + _combatScene.LoadActors(combatActors, combatContext.MeetType); - SetCameraPosition(_combatCameraConfigFile.DefaultCamConfigs[0]); + SetCameraPosition(_combatCameraConfigFile.DefaultCamConfigs[0]); - Pal3.Instance.Execute(new CameraFadeInCommand()); + Pal3.Instance.Execute(new CameraFadeInCommand()); - if (combatContext.MeetType != MeetType.RunningIntoEachOther) + if (combatContext.MeetType != MeetType.RunningIntoEachOther) + { + Pal3.Instance.Execute(new UIDisplayNoteCommand( + combatContext.MeetType == MeetType.PlayerChasingEnemy + ? "偷袭敌方成功!" + : "被敌人偷袭!")); + } + } + catch { - Pal3.Instance.Execute(new UIDisplayNoteCommand( - combatContext.MeetType == MeetType.PlayerChasingEnemy - ? "偷袭敌方成功!" - : "被敌人偷袭!")); + _sceneManager.UnloadCombatScene(); + ResetCameraPosition(); + if (!string.IsNullOrEmpty(combatContext.CombatMusicName)) + { + if (string.IsNullOrEmpty(previousMusic)) Pal3.Instance.Execute(new StopScriptMusicCommand()); + else Pal3.Instance.Execute(new PlayScriptMusicCommand(previousMusic, -1)); + } + _combatScene = null; + _currentCombatContext = null; + throw; } } + private static CombatActorInfo CopyActorInfo(CombatActorInfo info) + { + info.AttributeValues = new Dictionary(info.AttributeValues); + if (info.Type == CombatActorType.MainActor) info.ModelId = info.Id.ToString(); + return info; + } + + #if PAL3A + private static int AddAttributeBonus(int value, int bonus) + { + return (int)Math.Clamp((long)value + bonus, 0, int.MaxValue); + } + #endif + public void ExitCombat() { // Stop combat music diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/ElementPosition.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/ElementPosition.cs index 927ee8cb..b4769230 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/ElementPosition.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/ElementPosition.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat { diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Scene/CombatScene.cs b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Scene/CombatScene.cs index 250c83ae..14c902c8 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Combat/Scene/CombatScene.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Combat/Scene/CombatScene.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Combat.Scene { @@ -140,7 +140,8 @@ public void LoadActors(Dictionary combatActors { CombatActorInfo combatActorInfo = actorInfo; - if (combatActorInfo.Type == CombatActorType.MainActor) + if (combatActorInfo.Type == CombatActorType.MainActor && + (string.IsNullOrEmpty(combatActorInfo.ModelId) || combatActorInfo.ModelId == "Null")) { // Player actor's model id is not set in the file but it is equal // to its id in string format diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueManager.cs b/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueManager.cs index f258a2fa..8fe9958c 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueManager.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Dialogue { diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueTextProcessor.cs b/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueTextProcessor.cs index d607ac88..8791c095 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueTextProcessor.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Dialogue/DialogueTextProcessor.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Dialogue { diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Favor/FavorManager.cs b/Assets/Scripts/Pal3.Game/GameSystems/Favor/FavorManager.cs index 3da4ea73..7722049e 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Favor/FavorManager.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Favor/FavorManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Favor { diff --git a/Assets/Scripts/Pal3.Game/GameSystems/Inventory/InventoryManager.cs b/Assets/Scripts/Pal3.Game/GameSystems/Inventory/InventoryManager.cs index a7766f88..8a91c0a6 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/Inventory/InventoryManager.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/Inventory/InventoryManager.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ namespace Pal3.Game.GameSystems.Inventory { diff --git a/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/AppraisalsMiniGame.cs b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/AppraisalsMiniGame.cs index 058fe224..6bd6451b 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/AppraisalsMiniGame.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/AppraisalsMiniGame.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if PAL3 diff --git a/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/CaveExperienceMiniGame.cs b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/CaveExperienceMiniGame.cs index 1a84e3c4..7e048d97 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/CaveExperienceMiniGame.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/CaveExperienceMiniGame.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if PAL3 diff --git a/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/EncampMiniGame.cs b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/EncampMiniGame.cs index 477029c0..7225ec56 100644 --- a/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/EncampMiniGame.cs +++ b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/EncampMiniGame.cs @@ -1,7 +1,7 @@ -// --------------------------------------------------------------------------------------------- -// Copyright (c) 2021-2025, Jiaqi (0x7c13) Liu. All rights reserved. +// ------------------------------------------------------------------------ +// Copyright (c) 2021-2026, Jiaqi (0x7c13) Liu. All rights reserved. // See LICENSE file in the project root for license information. -// --------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------ #if PAL3 diff --git a/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/FortuneTellingMiniGame.cs b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/FortuneTellingMiniGame.cs new file mode 100644 index 00000000..6893e736 --- /dev/null +++ b/Assets/Scripts/Pal3.Game/GameSystems/MiniGames/FortuneTellingMiniGame.cs @@ -0,0 +1,208 @@ +// ------------------------------------------------------------------------ +// Copyright (c) 2026, Jiaqi (0x7c13) Liu. All rights reserved. +// See LICENSE file in the project root for license information. +// ------------------------------------------------------------------------ + +#if PAL3A +namespace Pal3.Game.GameSystems.MiniGames +{ + using System; + using System.Collections.Generic; + using System.IO; + using Command; + using Command.Extensions; + using Core.Command; + using Core.Command.SceCommands; + using Core.Contract.Constants; + using Data; + using Engine.Core.Abstraction; + using Engine.Extensions; + using Script.Waiter; + using State; + using TMPro; + using UnityEngine; + using UnityEngine.EventSystems; + using UnityEngine.UI; + + // The original two buttons (messages 104/105) return 1/2, not a random success value. + public sealed class FortuneTellingMiniGame : IDisposable, + ICommandExecutor, + ICommandExecutor, + ICommandExecutor, + ICommandExecutor + { + private static readonly string[] Symbols = { "DE", "JING", "NAI", "WEI", "XIE", "YOU", "YUE" }; + private readonly GameResourceProvider _resources; + private readonly GameStateManager _states; + private readonly Script.IUserVariableStore _variables; + private readonly TMP_FontAsset _font; + private readonly EventSystem _events; + private readonly List _textures = new(); + private readonly Guid _locker = Guid.NewGuid(); + private GameObject _canvas; + private GameObject _previousSelection; + private GameState _previousState; + private WaitUntilCanceled _waiter; + private int _result; + public bool IsOpen => _canvas != null; + public int Result => _result; + + public FortuneTellingMiniGame(GameResourceProvider resources, GameStateManager states, + Script.IUserVariableStore variables, + TMP_FontAsset font, EventSystem events) + { + _resources = resources; + _states = states; + _variables = variables; + _font = font; + _events = events; + CommandExecutorRegistry.Instance.Register(this); + } + + public void Dispose() + { + Close(_result, false); + CommandExecutorRegistry.Instance.UnRegister(this); + } + + public void Execute(MiniGameStartFortuneTellingCommand command) + { + if (IsOpen) + throw new InvalidOperationException("A fortune selection is already open"); + _result = 0; + _previousState = _states.GetCurrentState(); + _previousSelection = _events.currentSelectedGameObject; + _waiter = new WaitUntilCanceled(); + Pal3.Instance.Execute(new ScriptRunnerAddWaiterRequest(_waiter)); + _states.AddGamePlayStateLocker(_locker); + try + { + _canvas = new GameObject("FortuneTelling", typeof(Canvas), typeof(CanvasScaler), typeof(GraphicRaycaster)); + var canvas = _canvas.GetComponent(); + canvas.renderMode = RenderMode.ScreenSpaceOverlay; + canvas.sortingOrder = 100; + var scaler = _canvas.GetComponent(); + scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize; + scaler.referenceResolution = new Vector2(800, 600); + scaler.matchWidthOrHeight = 0.5f; + var background = Rect("Background", _canvas.transform, new Vector2(800, 600), Vector2.zero); + background.anchorMin = Vector2.zero; + background.anchorMax = Vector2.one; + background.sizeDelta = Vector2.zero; + var shade = background.gameObject.AddComponent(); + shade.color = new Color(0.08f, 0.04f, 0.12f, 0.96f); + Label("请选择你的回应", background, new Vector2(0, 160), 30); + var choices = Rect("Choices", background, new Vector2(0, 230), new Vector2(0, -10)); + choices.anchorMin = new Vector2(0.08f, 0.5f); + choices.anchorMax = new Vector2(0.92f, 0.5f); + var layout = choices.gameObject.AddComponent(); + layout.spacing = 40; + layout.childAlignment = TextAnchor.MiddleCenter; + layout.childControlWidth = true; + layout.childControlHeight = true; + layout.childForceExpandWidth = false; + layout.childForceExpandHeight = false; + Button first = Choice(choices, command.Symbol1, 1); + Button second = Choice(choices, command.Symbol2, 2); + var firstNav = first.navigation; + firstNav.mode = Navigation.Mode.Explicit; + firstNav.selectOnRight = second; + first.navigation = firstNav; + var secondNav = second.navigation; + secondNav.mode = Navigation.Mode.Explicit; + secondNav.selectOnLeft = first; + second.navigation = secondNav; + _states.TryGoToState(GameState.UI); + _events.SetSelectedGameObject(first.gameObject); + } + catch { Close(_result, true); throw; } + } + + private static RectTransform Rect(string name, Transform parent, Vector2 size, Vector2 position) + { + var go = new GameObject(name, typeof(RectTransform)); + var rect = go.GetComponent(); + rect.SetParent(parent, false); + rect.anchorMin = rect.anchorMax = rect.pivot = new Vector2(0.5f, 0.5f); + rect.sizeDelta = size; + rect.anchoredPosition = position; + return rect; + } + + private void Label(string text, Transform parent, Vector2 position, int size) + { + var label = Rect("Label", parent, new Vector2(700, 60), position).gameObject.AddComponent(); + label.font = _font; + label.text = text; + label.fontSize = size; + label.alignment = TextAlignmentOptions.Center; + label.raycastTarget = false; + } + + private Button Choice(Transform parent, int symbol, int result) + { + symbol = Mathf.Clamp(symbol, 0, 6); + var rect = Rect("Choice" + result, parent, new Vector2(230, 230), Vector2.zero); + var size = rect.gameObject.AddComponent(); + size.minWidth = 0; + size.preferredWidth = size.preferredHeight = 230; + var image = rect.gameObject.AddComponent(); + image.color = new Color(0.35f, 0.2f, 0.3f, 1); + var button = rect.gameObject.AddComponent