mirror of
https://github.com/0x7c13/Pal3.Unity.git
synced 2026-11-26 09:28:07 +08:00
* build: migrate C# formatting and add offscreen editor test support Host IMGUI tests on a detached panel without creating a native editor window. * feat(core): decode native battle records, geometry and animation metadata Read the two game variants’ battle tables and model data, with binary-reader and original-resource coverage. * feat(battle): implement deterministic combat rules and action settlement Implement actors, inventory, formation, action timing, status interruption, AI, stage ownership and deterministic replay. Keep the domain and its regression suite independent of Unity. * feat(battle): project native HUD state and input commands Add the presentation assembly and tests for command routing, lineup selection, floating numbers and stage messages. * feat(rendering): add battle lighting, actor appearance and native shadows Support baked and toon lighting, actor and weapon rendering, display refresh rate and resource ownership. * feat(effects): drive battle effects through shared resource previews Bind battle control nodes to action owners. Share preview lighting, geometry and effect resources with the existing Unity editors. * refactor(game): isolate story battle targeting and actor lifetimes Preserve scene ownership, bound story battle targeting and stop debug attacks when their actor leaves the scene. * feat(editor): compile original game data into battle scenarios Build per-variant animation and ability catalogs, encounter music, scene lighting profiles, random parties, equipment and test inventory from the original resources. * feat(editor): play battle sessions with animated previews and synced media Drive the preview scene, camera, effects, hit feedback, result choreography, music and movies from simulation snapshots and events. * feat(editor): add the battle workbench, native HUD and input controls Expose scenario authoring, replay, diagnostics, responsive command menus and mouse, touch and gamepad targeting. Include the editor workflow and HUD integration tests.
122 lines
2.8 KiB
C#
122 lines
2.8 KiB
C#
// ------------------------------------------------------------------------
|
|
// 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
|
|
{
|
|
using Primitives;
|
|
|
|
public struct Mv3AnimationEvent
|
|
{
|
|
public uint GameBoxTick;
|
|
public string Name; // 16 chars max
|
|
}
|
|
|
|
public struct Mv3TagFrame
|
|
{
|
|
public uint GameBoxTick;
|
|
public GameBoxVector3 GameBoxPosition;
|
|
public GameBoxQuaternion GameBoxRotation;
|
|
public float[][] Scale; // 3x3
|
|
}
|
|
|
|
public struct Mv3TagNode
|
|
{
|
|
public string Name; // 64 chars max
|
|
public Mv3TagFrame[] TagFrames;
|
|
public float FlipScale;
|
|
}
|
|
|
|
public struct Mv3IndexBuffer
|
|
{
|
|
public ushort[] TriangleIndex; // 3
|
|
public ushort[] TexCoordIndex; // 3
|
|
}
|
|
|
|
public struct Mv3Attribute
|
|
{
|
|
public int MaterialId;
|
|
public Mv3IndexBuffer[] IndexBuffers;
|
|
public int[] Commands;
|
|
}
|
|
|
|
public struct Mv3Vert
|
|
{
|
|
public short X;
|
|
public short Y;
|
|
public short Z;
|
|
public ushort N;
|
|
}
|
|
|
|
public struct Mv3VertFrame
|
|
{
|
|
public uint GameBoxTick;
|
|
public Mv3Vert[] Vertices;
|
|
}
|
|
|
|
public struct Mv3Mesh
|
|
{
|
|
public string Name; // 64 chars max
|
|
public GameBoxVector3 GameBoxBoundsMin;
|
|
public GameBoxVector3 GameBoxBoundsMax;
|
|
public Mv3Attribute[] Attributes;
|
|
public int[] GameBoxTriangles;
|
|
public int[] NormalIndices;
|
|
public int NormalCount;
|
|
public GameBoxVector2[] Uvs;
|
|
public Mv3AnimationKeyFrame[] KeyFrames;
|
|
}
|
|
|
|
public struct Mv3AnimationKeyFrame
|
|
{
|
|
public uint GameBoxTick;
|
|
public GameBoxVector3[] GameBoxVertices;
|
|
public ushort[] NativeNormals;
|
|
}
|
|
|
|
/// <summary>
|
|
/// MV3 (.mv3) file model
|
|
/// </summary>
|
|
public sealed class Mv3File
|
|
{
|
|
public uint TotalGameBoxTicks
|
|
{
|
|
get;
|
|
}
|
|
|
|
public Mv3AnimationEvent[] AnimationEvents
|
|
{
|
|
get;
|
|
}
|
|
|
|
public Mv3TagNode[] TagNodes
|
|
{
|
|
get;
|
|
}
|
|
|
|
public Mv3Mesh[] Meshes
|
|
{
|
|
get;
|
|
}
|
|
|
|
public GameBoxMaterial[] Materials
|
|
{
|
|
get;
|
|
}
|
|
|
|
public Mv3File(uint totalGameBoxTicks,
|
|
Mv3AnimationEvent[] animationEvents,
|
|
Mv3TagNode[] tagNodes,
|
|
Mv3Mesh[] meshes,
|
|
GameBoxMaterial[] materials)
|
|
{
|
|
TotalGameBoxTicks = totalGameBoxTicks;
|
|
AnimationEvents = animationEvents;
|
|
TagNodes = tagNodes;
|
|
Meshes = meshes;
|
|
Materials = materials;
|
|
}
|
|
}
|
|
}
|