diff --git a/Aetheria.State.Daemon.Smoke/Program.cs b/Aetheria.State.Daemon.Smoke/Program.cs index 642b7f6ef..c122cb709 100644 --- a/Aetheria.State.Daemon.Smoke/Program.cs +++ b/Aetheria.State.Daemon.Smoke/Program.cs @@ -201,6 +201,8 @@ internal sealed class AetheriaDaemonYmirSmokeChecks var missDz = miss.EndpointZ - target.PositionZ; Require(!miss.Hit && miss.AppliedDamage == 0 && miss.HitRoll > miss.HitProbability, "extreme authored dispersion must deterministically resolve a miss without damage"); + RequireEqual("none", miss.ImpactKind, "a miss must not advertise a fabricated impact response"); + RequireEqual("bolt", miss.PresentationKind, "instant weapon receipts must advertise a runtime-neutral travelling effect"); Require(Math.Sqrt(missDx * missDx + missDz * missDz) > 20 && miss.ImpactAngleRoll >= 0 && miss.ImpactAngleRoll < 1 && miss.ImpactRadiusRoll >= 0 && miss.ImpactRadiusRoll < 1, @@ -968,7 +970,10 @@ internal sealed class AetheriaDaemonYmirSmokeChecks new AetheriaRuntimeDaemonHealthDocument(), AetheriaRuntimeDaemonCommandBoundaryDocument.Create("daemon")); Require(Flatten(shotSurface.Surface.Root).Any(node => node.Kind == "shot.receipt" && - node.Props["itemKey"] == "test-lock-cannon" && node.Props["outcome"] == "hit"), + node.Props["itemKey"] == "test-lock-cannon" && node.Props["outcome"] == "hit" && + node.Props["presentationKind"] == "bolt" && + node.Props.ContainsKey("presentationIntensity") && + node.Props.ContainsKey("impactKind")), "Eve must project inspectable deterministic shot receipts without reconstructing combat"); } diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs index fac23e5db..ed22db9a5 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonGameSurfaceBuilder.cs @@ -332,6 +332,8 @@ namespace GameCult.Aetheria.State.Verse ("endpoint", string.Join(",", FormatNumber(value.EndpointX), FormatNumber(value.EndpointZ))), ("presentationDuration", FormatNumber(value.PresentationDurationSeconds)), ("presentationKind", value.PresentationKind), + ("presentationIntensity", FormatNumber(value.PresentationIntensity)), + ("impactKind", value.ImpactKind), ("impactAngleRoll", FormatNumber(value.ImpactAngleRoll)), ("impactRadiusRoll", FormatNumber(value.ImpactRadiusRoll)) })) diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs index e35890622..37f4f38b2 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeDaemonSimulation.cs @@ -912,7 +912,9 @@ namespace GameCult.Aetheria.State.Verse : targetRadius + (0.25 + radiusRoll) * Math.Max(targetRadius, weapon.Spread * distance); var endpointX = target.PositionX + Math.Cos(angle) * impactRadius; var endpointZ = target.PositionZ + Math.Sin(angle) * impactRadius; + var presentationKind = ResolveShotPresentationKind(weapon.State.BehaviorKind); var appliedDamage = hit ? weapon.Damage : 0; + var shieldBefore = Math.Max(0, GetStat(target, Shield)); var aliveBefore = IsAlive(target); if (hit) Damage(target, appliedDamage); @@ -928,9 +930,13 @@ namespace GameCult.Aetheria.State.Verse Outcome = hit ? "hit" : "miss", OriginX = attacker.PositionX, OriginZ = attacker.PositionZ, EndpointX = endpointX, EndpointZ = endpointZ, - PresentationDurationSeconds = distance / Math.Max(1, weapon.ProjectileSpeed), - PresentationKind = weapon.ItemKey, - ImpactAngleRoll = angleRoll, ImpactRadiusRoll = radiusRoll + PresentationDurationSeconds = presentationKind == "stream" + ? 0.12 + : distance / Math.Max(1, weapon.ProjectileSpeed), + PresentationKind = presentationKind, + ImpactAngleRoll = angleRoll, ImpactRadiusRoll = radiusRoll, + ImpactKind = !hit ? "none" : shieldBefore > 0 ? "shield" : "hull", + PresentationIntensity = Math.Max(0.1, weapon.Damage) }); AetheriaRuntimeGameEvents.Append(run, new AetheriaRuntimeGameEventCommit { @@ -1121,6 +1127,17 @@ namespace GameCult.Aetheria.State.Verse private static double PositiveOr(double value, double fallback) => double.IsFinite(value) && value > 0 ? value : fallback; + private static string ResolveShotPresentationKind(string behaviorKind) + { + if (string.Equals(behaviorKind, AetheriaRuntimeBehaviorKinds.GuidedWeapon, StringComparison.Ordinal)) + return "guided"; + if (string.Equals(behaviorKind, AetheriaRuntimeBehaviorKinds.ConstantWeapon, StringComparison.Ordinal)) + return "stream"; + if (string.Equals(behaviorKind, AetheriaRuntimeBehaviorKinds.Launcher, StringComparison.Ordinal)) + return "bolt"; + return "bolt"; + } + private static string ReadItemKey(AetheriaRuntimeBehaviorPayload payload, int key) { var value = (payload.Fields ?? Array.Empty()) diff --git a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs index c33ff701a..8ef2e6eb8 100644 --- a/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs +++ b/Packages/org.gamecult.aetheria.state/Runtime/AetheriaRuntimeSnapshotDocuments.cs @@ -482,6 +482,8 @@ namespace GameCult.Aetheria.State.Verse [Key(24)] public string PresentationKind { get; set; } = ""; [Key(25)] public double ImpactAngleRoll { get; set; } [Key(26)] public double ImpactRadiusRoll { get; set; } + [Key(27)] public string ImpactKind { get; set; } = "none"; + [Key(28)] public double PresentationIntensity { get; set; } = 1; } [MessagePackObject]