diff --git a/Assets/Scripts/ServerShared/Scenarios/FusedRounds.cs b/Assets/Scripts/ServerShared/Scenarios/FusedRounds.cs index e0a8c029f..fff51a745 100644 --- a/Assets/Scripts/ServerShared/Scenarios/FusedRounds.cs +++ b/Assets/Scripts/ServerShared/Scenarios/FusedRounds.cs @@ -7,8 +7,8 @@ public sealed class FusedRounds : Scenario public override string Brief => "The Smoke Test Hull with Smoke Proximity, Smoke Delayed and a DeathCluster; a hostile bare Longinus at mid range, a bare " + "hull dead ahead, a fragile one to starboard, a close one inside the proximity blast radius, and one astern. " + "Verify with nothing selected: aim past every hull and the round bursts at max range along the aim; aim at the hull " + - "ahead and it stops and bursts on it; fire at the fragile hull and kill it with the DeathCluster before the round " + - "lands: no burst. Select the astern hull: the round fires and bursts at its range along the arc edge. Select the " + + "ahead and it stops and bursts on it; fire the DeathCluster at the fragile hull and, once it is hurt, a Smoke " + + "Proximity round at it: the hull dies before the round lands, no burst. Select the astern hull: the round fires and bursts at its range along the arc edge. Select the " + "close hull: the burst is pushed out to the blast radius from your centre. A Smoke Proximity burst beside the " + "Longinus damages where the model shows the blast; a Smoke Delayed round into its nose bursts inside. The HUD " + "reads Direct, Burst at N m or Refused for the fused weapons and a percentage for the DeathCluster, and the " + @@ -17,9 +17,9 @@ public sealed class FusedRounds : Scenario public override bool Ambient => false; // Where everything sits: the player is at the origin facing +z. Ahead lies on the initial aim line, inside every forward - // mount's arc. Fragile is a bare Longinus inside the DeathCluster's range; Close is inside Smoke Proximity's blast radius + // mount's arc. Fragile is a bare Longinus inside the DeathCluster's effective range (full damage; the scenario test reads the bound from the weapon); Close is inside Smoke Proximity's blast radius // (8 m from the ship's centre) and beside the aim line, not across it; Stern is outside every mount's arc. - public static readonly CultMath.float2 Mid = float2(-200, 600), Ahead = float2(0, 300), Fragile = float2(140, 420), + public static readonly CultMath.float2 Mid = float2(-200, 600), Ahead = float2(0, 300), Fragile = float2(80, 240), Close = float2(6.4f, 4f), Stern = float2(0, -400); public override Galaxy Generate(GalaxyStage stage) => stage.Prelude(DemoTerminus.Cast); diff --git a/tests/Aetheria.Shared.Tests/SmokeRoundsScenarioTests.cs b/tests/Aetheria.Shared.Tests/SmokeRoundsScenarioTests.cs index bfd412452..1dafbe3b4 100644 --- a/tests/Aetheria.Shared.Tests/SmokeRoundsScenarioTests.cs +++ b/tests/Aetheria.Shared.Tests/SmokeRoundsScenarioTests.cs @@ -61,7 +61,7 @@ public sealed partial class RunStartTests } var directWeapon = WeaponOf(direct); Assert.True(Bears(direct, player, fragile), "the direct weapon cannot bear on the fragile hull"); - Assert.True(length((fragile.Position - player.Position).xz) <= directWeapon.Range, "the fragile hull lies beyond the direct weapon's range"); + Assert.True(length((fragile.Position - player.Position).xz) <= directWeapon.EffectiveRange, "the fragile hull lies beyond the direct weapon's effective range, where its damage falls off"); var magazine = direct.Data.Behaviors.OfType().Single().MagazineSize; var burst = ((InstantWeapon) directWeapon).BurstCount; Assert.True(magazine > 0 && directWeapon.Damage * burst * magazine > ((HullData) _items.GetData(fragile.Hull)).Durability, diff --git a/tests/Aetheria.Shared.Tests/SmokeRoundsSteppedTests.cs b/tests/Aetheria.Shared.Tests/SmokeRoundsSteppedTests.cs index fcacfd43d..44cc8f6fb 100644 --- a/tests/Aetheria.Shared.Tests/SmokeRoundsSteppedTests.cs +++ b/tests/Aetheria.Shared.Tests/SmokeRoundsSteppedTests.cs @@ -51,8 +51,9 @@ public sealed partial class RunStartTests Assert.InRange(at + burst.ArrivalIn - fired[0], 1f, 5f); // in the air for seconds: not resolved in its firing tick, not minutes of flight } - // Check A.3 flown: the fragile hull is selected, a Smoke Proximity round is fired at it and the DeathCluster kills it - // before the round lands, so the round never bursts. + // Check A.3 flown: the fragile hull is selected and the DeathCluster, at full damage inside its effective range, starts + // killing it; once half its hull is gone a Smoke Proximity round is fired at it, and the hull dies before the round + // lands, so the round never bursts. [Fact] public void TheDirectWeaponKillsTheFragileHullWhileASmokeRoundIsStillInTheAir() { @@ -70,15 +71,18 @@ public sealed partial class RunStartTests if (landed == null && outcome.Weapon == proximity) landed = (arena.Time, outcome.Result); }); - WeaponOf(proximity).Activate(); + var hullDurability = ((HullData) _items.GetData(fragile.Hull)).Durability; WeaponOf(Carried(player, "DeathCluster")).Activate(); float? deadAt = null; + var fired = false; for (var i = 0; i < 120 && landed == null; i++) { + if (!fired && fragile.Hull.Durability < hullDurability / 2f) { WeaponOf(proximity).Activate(); fired = true; } arena.Update(SteppedDt); if (deadAt == null && !arena.Entities.Contains(fragile)) deadAt = arena.Time; } + Assert.True(fired, "the DeathCluster never hurt the fragile hull"); Assert.NotNull(deadAt); Assert.NotNull(landed); Assert.True(deadAt <= landed.Value.At, $"the round landed at {landed.Value.At:F2} s, before the fragile hull died at {deadAt:F2} s");