Briefs, comments and tests name current gear; generic-designs lands only its own records and rewrites the last flavour and brand design texts
Scenario Briefs (Crossing, Duel, FusedRounds, LauncherAngles, StarvedReactor, WeaponFeel), scenario and test comments and test locals say the design names (Lightning Projector, Light Laser, Cell Blaster, Guided Missile Launcher, Swarm Rocket Pod, Muon Fusion Reactor, Cluster Cannon, Charged Scatter Blaster, Rugged Drive, Racing Drive) instead of the retired brand names; Crossing.PlightRange is ProjectorRange. generic-designs: the batch carries ExpectUnchanged so every record it does not author keeps its bytes (the plain commit re-encoded four records, dropping SensorData key 7). DesignTexts rewrites Large Drive, Tractor Beam, Smoke Proximity, Smoke Delayed, Smoke Refused and Smoke Refused Charge as tech-node text; the Tractor Beam's old line moves to its product Space Tractor. smoke-rounds' authored text names Light Laser and Charged Scatter Blaster to match. Tests: NoScenarioBriefNamesRetiredGear, TheCapacitorDesignCarriesItsRoleMap, NoDesignTextNamesAProduct, and a command test that widens every payload and checks apply changes only the three records it authors and restores the rewritten texts. Not built or run at this commit; GameData/Aetheria.cc is regenerated in the next commit, so NoDesignTextNamesAProduct and the command test fail here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
9b5eaa45d6
commit
205c9f5205
20 changed files with 180 additions and 55 deletions
|
|
@ -607,10 +607,14 @@ public static class Program
|
|||
// Validate comment) -- so it calls the same validation directly, right before the identity-preserving
|
||||
// write, instead of writing raw and unvalidated the way this line used to.
|
||||
foreach (var (document, _) in changed) CultRecordRefs.Validate(document);
|
||||
db.Cache.Commit(batch =>
|
||||
// ExpectUnchanged lands the batch onto the file as it is: every record the command did not author keeps the bytes it has,
|
||||
// where a plain commit would re-encode the whole catalog through today's types.
|
||||
if (!db.Cache.Commit(batch =>
|
||||
{
|
||||
batch.ExpectUnchanged();
|
||||
foreach (var (document, key) in changed) batch.Upsert(document.GetType(), document, key);
|
||||
});
|
||||
}))
|
||||
throw new InvalidOperationException("The catalog changed while the generic designs were being authored; nothing was written. Run it again.");
|
||||
Console.WriteLine($"Landed {changed.Count} changed records in Aetheria.cc");
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1714,10 +1718,10 @@ public static class Program
|
|||
}
|
||||
static PerformanceStat Fixed(float value) => new PerformanceStat { Min = value, Max = value, Terms = new List<StatTerm>() };
|
||||
|
||||
var proximity = Copy("Light Laser", names[0], "A Spectra that bursts by proximity, blast 8. For scenarios; no one builds it.", WeaponFuse.Proximity, 8f);
|
||||
var delayed = Copy("Light Laser", names[1], "A Spectra that bursts after two cells of metal, blast 4. For scenarios; no one builds it.", WeaponFuse.Delayed, 4f);
|
||||
var refused = Copy("Light Laser", names[2], "A Spectra whose blast is wider than its reach, so it never fires. For scenarios; no one builds it.", WeaponFuse.Proximity, 30f);
|
||||
var charge = Copy("Charged Scatter Blaster", names[4], "A ChargeBlast SG whose blast is wider than its reach, so it never charges. For scenarios; no one builds it.", WeaponFuse.Proximity, 30f);
|
||||
var proximity = Copy("Light Laser", names[0], "A Light Laser that bursts by proximity, blast 8. For scenarios; no one builds it.", WeaponFuse.Proximity, 8f);
|
||||
var delayed = Copy("Light Laser", names[1], "A Light Laser that bursts after two cells of metal, blast 4. For scenarios; no one builds it.", WeaponFuse.Delayed, 4f);
|
||||
var refused = Copy("Light Laser", names[2], "A Light Laser whose blast is wider than its reach, so it never fires. For scenarios; no one builds it.", WeaponFuse.Proximity, 30f);
|
||||
var charge = Copy("Charged Scatter Blaster", names[4], "A Charged Scatter Blaster whose blast is wider than its reach, so it never charges. For scenarios; no one builds it.", WeaponFuse.Proximity, 30f);
|
||||
var beam = Copy("Light Laser", names[3], "A constant beam whose blast is wider than its reach, so it never starts. For scenarios; no one builds it.", WeaponFuse.Proximity, 30f);
|
||||
|
||||
// The Smoke Test Hull carries one 2x2 reactor. A Spectra's 20-40 energy a shot at its cadence is more than that reactor makes,
|
||||
|
|
@ -2361,6 +2365,20 @@ public static class Program
|
|||
"Holds the charge until the drop, then lets it all go at once."),
|
||||
("not if i see you first", "DME",
|
||||
"eyes in the dark/ you were seen before you looked/ say goodnight"),
|
||||
("Space Tractor", "Ewan Hart",
|
||||
"It's a tractor. In space. Trap your enemies in gravity wells. Haul thousands of tons of hay through space!"),
|
||||
};
|
||||
|
||||
// Designs whose text was flavour or named a brand, rewritten as tech-node text without a rename (ruling designs-are-tech-nodes).
|
||||
// The Large Drive's old line ships as Steady Haul's text; the Tractor Beam's moves to its product, Space Tractor (ProductTexts).
|
||||
public static readonly (string Design, string Text)[] DesignTexts =
|
||||
{
|
||||
("Large Drive", "Large working drive."),
|
||||
("Tractor Beam", "Holds a target in a gravity well and hauls it in."),
|
||||
("Smoke Proximity", "A Light Laser that bursts by proximity, blast 8. For scenarios; no one builds it."),
|
||||
("Smoke Delayed", "A Light Laser that bursts after two cells of metal, blast 4. For scenarios; no one builds it."),
|
||||
("Smoke Refused", "A Light Laser whose blast is wider than its reach, so it never fires. For scenarios; no one builds it."),
|
||||
("Smoke Refused Charge", "A Charged Scatter Blaster whose blast is wider than its reach, so it never charges. For scenarios; no one builds it."),
|
||||
};
|
||||
|
||||
// generic-designs: a design is named and described like a node on a tech tree, and the brand lives in the product it
|
||||
|
|
@ -2417,6 +2435,15 @@ public static class Program
|
|||
design.Description = designText;
|
||||
}
|
||||
|
||||
foreach (var (designName, text) in DesignTexts)
|
||||
{
|
||||
var found = designs.Where(d => d.Name == designName).ToArray();
|
||||
if (found.Length != 1) throw new InvalidOperationException($"Design text row \"{designName}\": {found.Length} designs carry the name.");
|
||||
if (found[0].Description == text) continue;
|
||||
Write(found[0], $"design \"{designName}\" text", found[0].Description, text);
|
||||
found[0].Description = text;
|
||||
}
|
||||
|
||||
foreach (var (name, maker, text) in ProductTexts)
|
||||
{
|
||||
var found = products.Where(p => p.Name == name && MakerOf(p) == maker).ToArray();
|
||||
|
|
|
|||
Loading…
Reference in a new issue