77de740b63
Enum renamed in StatIds.cs (byte values unchanged - serialized definitions/saves never re-mean); all call sites + doc mentions swept (ClassTraits, PlayerAuthoring, CharacterStatsDefinition field type, menu/UI, tests). CharacterStatsDefinition SO CLASS name kept (asset-binding risk; deferred per plan). 390 green. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
71 lines
3.4 KiB
C#
71 lines
3.4 KiB
C#
using Unity.NetCode;
|
|
|
|
namespace ProjectM.Simulation
|
|
{
|
|
/// <summary>
|
|
/// One-shot dev-tools command from a client to the server (the DebugOverlay / execute_code). A scalar-only
|
|
/// <see cref="IRpcCommand"/> (byte opcode + two ints, the project's scalar-RPC convention) so a single wire
|
|
/// type covers every dev action via <see cref="DebugOp"/>. **Unconditional (no #if)** — the reflection-built
|
|
/// RpcCollection hash must match across release/dev peers, so only the SEND/RECEIVE systems + overlay are
|
|
/// #if-gated, never this type. The server applies it authoritatively in DebugCommandReceiveSystem, so the dev
|
|
/// buttons exercise the real paths and work over a live connection too.
|
|
/// </summary>
|
|
public struct DebugCommandRequest : IRpcCommand
|
|
{
|
|
/// <summary>Which action to perform (see <see cref="DebugOp"/>).</summary>
|
|
public byte Op;
|
|
|
|
/// <summary>First scalar argument (size / item id / region id / amount — per-op).</summary>
|
|
public int ArgA;
|
|
|
|
/// <summary>Second scalar argument (count — per-op).</summary>
|
|
public int ArgB;
|
|
}
|
|
|
|
/// <summary>Opcodes for <see cref="DebugCommandRequest.Op"/> (bytes — never an enum on the wire).</summary>
|
|
public static class DebugOp
|
|
{
|
|
/// <summary>Force the NEXT wave to start this tick (re-meant from the old arm-a-siege op; args unused).</summary>
|
|
public const byte SpawnWave = 0;
|
|
|
|
/// <summary>Quiet the arena: cull Husks + push the next wave ~1 h out (re-meant from the old end-siege op).</summary>
|
|
public const byte EndSiege = 1;
|
|
|
|
/// <summary>Cull every living Husk now (leaves wave state alone).</summary>
|
|
public const byte ClearEnemies = 2;
|
|
|
|
// RETIRED (LANTERN purge — keep the byte values reserved, never renumber a wire byte):
|
|
// 3 = SetCalm · 10 = AdvanceGoal · 11 = SetHeat
|
|
|
|
/// <summary>Deposit ArgB of resource ArgA (a <see cref="ResourceId"/>) into the shared ledger.</summary>
|
|
public const byte GrantResource = 4;
|
|
|
|
/// <summary>Grow the sender's damage upgrade by one tier (a debug StatModifier).</summary>
|
|
public const byte GrantUpgrade = 5;
|
|
|
|
/// <summary>Teleport the sender to region ArgA (a <see cref="RegionId"/>).</summary>
|
|
public const byte Teleport = 6;
|
|
|
|
/// <summary>Toggle the sender's <see cref="DebugGodMode"/> (damage immunity).</summary>
|
|
public const byte ToggleGod = 7;
|
|
|
|
/// <summary>Heal the sender to full.</summary>
|
|
public const byte Heal = 8;
|
|
|
|
/// <summary>Kill the sender (Health -> 0; the normal death/respawn loop takes over).</summary>
|
|
public const byte KillPlayer = 9;
|
|
|
|
|
|
/// <summary>Set the <see cref="TuningKnob"/> ArgA to ArgB/1000f (live dash/Charger feel-tuning; MC-0).</summary>
|
|
public const byte SetTuning = 12;
|
|
|
|
/// <summary>Swap the sender's class to ArgA (a <see cref="FrameKind"/> byte: Warrior=2 / Ranger=3).
|
|
/// Strips the old class trait seeds, re-seeds the new ones, swaps the Fire ability, and heals a living
|
|
/// player to the new class's max. Editor-only dev tool (class-switch); 0 / unknown -> Warrior.</summary>
|
|
public const byte SetClass = 13;
|
|
|
|
/// <summary>GYM (editor): spawn <see cref="GymEnemyKind"/> ArgA near the sender, ArgB times (default 1). Reads the baked GymEnemyRoster.</summary>
|
|
public const byte SpawnEnemy = 14;
|
|
}
|
|
}
|