Remove invented scenario cargo authority
This commit is contained in:
parent
879f6deb9c
commit
c2a4bd46f0
7 changed files with 84 additions and 172 deletions
|
|
@ -2422,137 +2422,6 @@ static async Task<bool> ApplyRequestedTerminusSessionAsync(
|
|||
return true;
|
||||
}
|
||||
|
||||
static async Task EnsureStarbridgeSessionDocumentsAsync(
|
||||
AetheriaStateNode node,
|
||||
AetheriaDaemonHostOptions options)
|
||||
{
|
||||
var existingScenario = await node.MutableDocument<AetheriaRuntimeStarbridgeScenarioDocument>(AetheriaRuntimeVerseRecordKeys.StarbridgeScenarioLatest).ReadAsync().ConfigureAwait(false);
|
||||
var existingSession = await node.MutableDocument<AetheriaRuntimeStarbridgeSessionDocument>(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionLatest).ReadAsync().ConfigureAwait(false);
|
||||
if (existingScenario != null &&
|
||||
string.Equals(existingScenario.Schema, AetheriaRuntimeDaemonSchemas.StarbridgeScenario, StringComparison.Ordinal) &&
|
||||
existingSession != null &&
|
||||
string.Equals(existingSession.Schema, AetheriaRuntimeDaemonSchemas.StarbridgeSession, StringComparison.Ordinal))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const string runId = "local-starbridge";
|
||||
var baseEntityKey = EntityKey(runId, 0, 0);
|
||||
var pilotOneKey = EntityKey(runId, 0, 1);
|
||||
var pilotTwoKey = EntityKey(runId, 0, 2);
|
||||
var pilotThreeKey = EntityKey(runId, 0, 3);
|
||||
var scenario = new AetheriaRuntimeStarbridgeScenarioDocument
|
||||
{
|
||||
ScenarioId = "starbridge.frontier-fabricator",
|
||||
DisplayName = "Frontier Fabricator Defense",
|
||||
StartingBaseKey = baseEntityKey,
|
||||
StationStock =
|
||||
[
|
||||
new AetheriaRuntimeStarbridgeStationStockItem
|
||||
{
|
||||
ItemKey = "repair-parts",
|
||||
Quantity = 4,
|
||||
Quality = 1,
|
||||
Durability = 1
|
||||
},
|
||||
new AetheriaRuntimeStarbridgeStationStockItem
|
||||
{
|
||||
ItemKey = "drone-core",
|
||||
Quantity = 2,
|
||||
Quality = 0.9,
|
||||
Durability = 1
|
||||
},
|
||||
new AetheriaRuntimeStarbridgeStationStockItem
|
||||
{
|
||||
ItemKey = "coolant-pack",
|
||||
Quantity = 3,
|
||||
Quality = 0.85,
|
||||
Durability = 1
|
||||
},
|
||||
new AetheriaRuntimeStarbridgeStationStockItem
|
||||
{
|
||||
ItemKey = "shield-cell",
|
||||
Quantity = 2,
|
||||
Quality = 0.95,
|
||||
Durability = 1
|
||||
}
|
||||
],
|
||||
AvailableShipKeys = [pilotOneKey, pilotTwoKey, pilotThreeKey],
|
||||
AttackerMixKeys = ["scout", "skirmisher", "bomber", "siege-craft", "breach-drone"],
|
||||
RecoveredTechnologyPoolKeys =
|
||||
[
|
||||
"sensor-calibration",
|
||||
"missile-rack-burst",
|
||||
"coolant-chain",
|
||||
"repair-drone-armor"
|
||||
],
|
||||
Waves =
|
||||
[
|
||||
new AetheriaRuntimeStarbridgeWaveDefinition
|
||||
{
|
||||
WaveIndex = 0,
|
||||
DisplayName = "Scout Probe",
|
||||
AttackerKeys = ["scout"],
|
||||
StartsAfterSeconds = 30,
|
||||
BossKey = "scout-captain",
|
||||
RecoveredTechnologyKeys = ["sensor-calibration"]
|
||||
},
|
||||
new AetheriaRuntimeStarbridgeWaveDefinition
|
||||
{
|
||||
WaveIndex = 1,
|
||||
DisplayName = "Bomber Line",
|
||||
AttackerKeys = ["bomber", "skirmisher"],
|
||||
StartsAfterSeconds = 150,
|
||||
BossKey = "bomber-frame",
|
||||
RecoveredTechnologyKeys = ["missile-rack-burst", "coolant-chain"]
|
||||
},
|
||||
new AetheriaRuntimeStarbridgeWaveDefinition
|
||||
{
|
||||
WaveIndex = 2,
|
||||
DisplayName = "Breach Mother",
|
||||
AttackerKeys = ["breach-drone", "siege-craft"],
|
||||
StartsAfterSeconds = 300,
|
||||
BossKey = "breach-mother",
|
||||
RecoveredTechnologyKeys = ["repair-drone-armor"]
|
||||
}
|
||||
],
|
||||
RuntimeRoles =
|
||||
[
|
||||
new AetheriaRuntimeStarbridgeRuntimeRole
|
||||
{
|
||||
RuntimeId = "starbridge.commander",
|
||||
Role = "commander"
|
||||
},
|
||||
new AetheriaRuntimeStarbridgeRuntimeRole
|
||||
{
|
||||
RuntimeId = "starbridge.pilot.0",
|
||||
Role = "pilot",
|
||||
EntityKey = pilotOneKey
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
var session = new AetheriaRuntimeStarbridgeSessionDocument
|
||||
{
|
||||
SessionId = options.SessionId,
|
||||
ScenarioId = scenario.ScenarioId,
|
||||
RunId = runId,
|
||||
BaseEntityKey = baseEntityKey,
|
||||
StationEntityKey = baseEntityKey,
|
||||
Phase = "pre-wave",
|
||||
CurrentWaveIndex = 0,
|
||||
RuntimeRoles = scenario.RuntimeRoles
|
||||
};
|
||||
|
||||
await node.MutableDocument<AetheriaRuntimeStarbridgeScenarioDocument>(AetheriaRuntimeVerseRecordKeys.StarbridgeScenarioLatest)
|
||||
.ReplaceAsync(scenario)
|
||||
.ConfigureAwait(false);
|
||||
await node.MutableDocument<AetheriaRuntimeStarbridgeSessionDocument>(AetheriaRuntimeVerseRecordKeys.StarbridgeSessionLatest)
|
||||
.ReplaceAsync(session)
|
||||
.ConfigureAwait(false);
|
||||
await node.FlushAsync().ConfigureAwait(false);
|
||||
}
|
||||
|
||||
static async Task EnsureVerseAuthorityPolicyAsync(
|
||||
AetheriaStateNode node,
|
||||
AetheriaDaemonHostOptions options)
|
||||
|
|
@ -2935,11 +2804,6 @@ static bool HasTerminusRun(AetheriaRuntimeRunCheckpointCommit? run)
|
|||
bodies.Length >= 10;
|
||||
}
|
||||
|
||||
static string EntityKey(string runId, int zoneIndex, int entityIndex)
|
||||
{
|
||||
return $"global:aetheria.run_state.{runId}.zone.{zoneIndex}.entity.{entityIndex}.v1";
|
||||
}
|
||||
|
||||
static AetheriaRuntimeLoadoutItemSlotCommit[] ToEntitySlotCommits(
|
||||
IReadOnlyList<AetheriaEntityItemSlot>? slots)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue