Publish semantic shot presentation profiles
This commit is contained in:
parent
9a338045d2
commit
ce1ee8a664
4 changed files with 30 additions and 4 deletions
|
|
@ -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");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -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<AetheriaRuntimeBehaviorField>())
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
|
|
|
|||
Loading…
Reference in a new issue