Aetheria/Assets/Scripts/ServerShared/Scenarios/Pursuit.cs

70 lines
4.4 KiB
C#
Raw Permalink Normal View History

using System.Linq;
using static CultMath.math;
using static ItemRotation;
public sealed class Pursuit : Scenario
{
// The pursuer starts astern, inside the 400 at which VapourCloudTests.ACloudBreaksALockAtRange shows a fresh vent
// cloud breaking a sensor's lock, and well outside the 40 at which AStrongCloseSensorBurnsThrough shows a close
// sensor burning through.
private const float Astern = 300;
// Crates each shooter's hold is stocked with: the measured draw over the 600 s run of ScenarioAmmunitionRunTests (a hull conducts heat from
// construction, so a shooter holding every gun down no longer dies of heat at ~250-270 s and fires the whole window) plus half again, capped at
// what the hold carries. Measured draws: pursuer 199 Ammo and 14 Missiles; player 42 Mines and 195 Ammo. Neither hold carries its draw
// (the pursuer's hold fills at 75 Ammo and 5 Missiles, the player's after five consumables at 10 Mines, 40 Ammo and 3 Missiles; crates differ in size), so each is
// stocked full and runs dry. A launcher that drew under a reload carries the default three crates.
public const int MineCrates = 10, PlayerAmmoCrates = 40, PlayerMissileCrates = 3, PursuerAmmoCrates = 75, PursuerMissileCrates = 5;
public override string Name => "Pursuit";
public override string Id => "pursuit";
public override string Brief => "A hostile Longinus on your tail; a Mine Launcher fitted, three Coolant Vents and two Thruster " +
"Overdrives aboard. Verify: lay mines in its path, the mine pulses slowly after 2 s, fast when " +
"the hostile is near, explodes 2 s later; vent and coast to lose it; overdrive away.";
public override uint Seed => 111;
public override bool Ambient => false;
public override Galaxy Generate(GalaxyStage stage) => stage.Cast(DemoTerminus.Cast);
public override void Stage(ScenarioStage stage)
{
var layer = stage.Fit("Longinus",
("Cockpit 2x2", int2(2, 6), None),
("Large Drive", int2(1, 0), Reversed),
("Large Drive", int2(3, 0), Reversed),
("Rugged Drive", int2(2, 14), CounterClockwise),
("Rugged Drive", int2(3, 14), Clockwise),
("Compact Reactor", int2(2, 4), None),
("parting gift", int2(0, 5), None), // Mine Launcher
("Leonid", int2(5, 5), None), // Swarm Rocket Pod
("FastBlast+-", int2(1, 8), None), // Cell Blaster
("FastBlast+-", int2(4, 8), None), // Cell Blaster
("Radiator", int2(2, 2), CounterClockwise),
("Radiator", int2(3, 2), Clockwise),
("not if i see you first", int2(3, 10), None), // Compact Sensor
("Panopticon Prime", int2(1, 6), Clockwise), // Fire Control Array
("Store-All Plus", int2(2, 8), None)); // Cargo Bay
var pursuer = stage.Fit("Longinus",
("Cockpit 2x2", int2(2, 6), None),
("Large Drive", int2(1, 0), Reversed),
("Large Drive", int2(3, 0), Reversed),
("Rugged Drive", int2(2, 14), CounterClockwise),
("Rugged Drive", int2(3, 14), Clockwise),
("Compact Reactor", int2(2, 4), None),
("GT 3K", int2(0, 5), None), // Guided Missile Launcher
("GT 3K", int2(5, 5), None), // Guided Missile Launcher
("FastBlast+-", int2(1, 8), None), // Cell Blaster
("FastBlast+-", int2(4, 8), None), // Cell Blaster
("Radiator", int2(2, 2), CounterClockwise),
("Radiator", int2(3, 2), Clockwise),
("not if i see you first", int2(3, 10), None), // Compact Sensor
("Capacitor", int2(1, 5), None),
("Panopticon Prime", int2(1, 6), Clockwise), // Fire Control Array
("Store-All Plus", int2(2, 8), None)); // Cargo Bay
var player = stage.Player(layer, float2(0, 0), facing: float2(0, 1));
stage.Cargo(player, new[] { "Morning Fog", "Morning Fog", "Morning Fog", "send it", "send it" }
.Concat(Enumerable.Repeat("Mines", MineCrates)).Concat(Enumerable.Repeat("Ammo", PlayerAmmoCrates)).Concat(Enumerable.Repeat("Missiles", PlayerMissileCrates)).ToArray());
var hostile = stage.Place(pursuer, float2(0, -Astern), facing: float2(0, 1), stance: ScenarioStance.Hostile, piloted: true);
stage.Cargo(hostile, Enumerable.Repeat("Ammo", PursuerAmmoCrates).Concat(Enumerable.Repeat("Missiles", PursuerMissileCrates)).ToArray());
}
}