34 lines
2.0 KiB
C#
34 lines
2.0 KiB
C#
using Unity.Entities;
|
|
using Unity.Mathematics;
|
|
|
|
namespace ProjectM.Simulation
|
|
{
|
|
/// <summary>
|
|
/// MC-1 — server-only Charger lunge state (a KnockbackState SHAPE-twin). Component PRESENCE is the Charger
|
|
/// discriminator (no enum / brain byte — honours the Burst cross-assembly-enum rule; EnemyAISystem is Bursted):
|
|
/// a Husk variant baked with LungeState is driven by the Charger branch, every other Husk by the Grunt branch
|
|
/// (which excludes these via <c>.WithNone<LungeState>()</c>). On a wind-up commit the Charger LOCKS
|
|
/// <see cref="Dir"/> toward the target and travels at <see cref="Speed"/> until <see cref="UntilTick"/> — dealing
|
|
/// contact damage if it connects, or staggering into a punish window if it whiffs (wall-stop or overshoot).
|
|
/// NOT a <c>[GhostField]</c> (the lunged position replicates via the stock LocalTransform variant, like
|
|
/// KnockbackState). All ticks via <c>TickUtil.NonZero</c>; compared with <see cref="Unity.NetCode.NetworkTick"/> only.
|
|
/// </summary>
|
|
public struct LungeState : IComponentData
|
|
{
|
|
/// <summary>Fixed planar lunge heading, locked at commit (world XZ -> float2 x,y).</summary>
|
|
public float2 Dir;
|
|
|
|
/// <summary>Lunge speed (world units/s); only meaningful while <see cref="UntilTick"/> is active.</summary>
|
|
public float Speed;
|
|
|
|
/// <summary>Raw tick the lunge ends (NonZero). <c>0</c> = not lunging. Active while .IsNewerThan(serverTick).</summary>
|
|
public uint UntilTick;
|
|
|
|
/// <summary>Raw tick the whiff-stagger punish window ends (NonZero; set at BOTH whiff sites). 0 = not
|
|
/// staggered — or already punished: HealthApplyDamageSystem zeroes it when the first player-sourced hit
|
|
/// lands so a window counts ONCE in DevTelemetry.ChargerWhiffPunishesLanded. The attack lockout itself
|
|
/// rides EnemyAttackCooldown.NextAttackTick; this field only scores the punish.</summary>
|
|
public uint StaggerUntilTick;
|
|
}
|
|
}
|