AetherDb: weapon-ammo lists every weapon's energy, magazine, reload and ammunition type

Read-only audit command, so ammunition rulings are checked against the catalog and not against names.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Nibu 2026-11-11 01:58:59 +00:00
commit 9135360beb

View file

@ -36,6 +36,7 @@ public static class Program
case "brownout-migrate": return BrownoutMigrate(args.Contains("apply"));
case "roles-migrate": return RolesMigrate(args.Contains("apply"));
case "firing-arc-migrate": return FiringArcMigrate(args.Contains("apply"));
case "weapon-ammo": return WeaponAmmo();
case "range-falloff": return RangeFalloff(args.Skip(1).ToArray());
case "targeting-catalog": return TargetingCatalog(args.Contains("apply"));
case "targeting-catalog-6c": return TargetingCatalog6c(args.Contains("apply"));
@ -1109,6 +1110,19 @@ public static class Program
// and a damage multiplier at maximum range. Guided weapons, lock weapons and mine layers keep the unauthored
// defaults (no falloff). The command upserts every weapon design, which is also what drops the retired damage curve
// (key 7) from the stored records. Idempotent: the values are functions of Range alone. Dry run unless "apply".
// Read-only: what every weapon design draws per shot (reactor energy, magazine, rounds), so ammunition rulings are audited
// against the catalog and not against names.
private static int WeaponAmmo()
{
var db = AetherDb.Open();
Console.WriteLine($"{"weapon",-28} {"behaviour",-20} {"energy",-11} {"mag",5} {"reload",6} ammo");
foreach (var item in db.Cache.GetAll<WeaponItemData>().OrderBy(i => i.Name, StringComparer.Ordinal))
foreach (var w in item.Behaviors.OfType<WeaponData>())
Console.WriteLine($"{item.Name,-28} {w.GetType().Name,-20} {w.Energy.Min}-{w.Energy.Max,-6} {w.MagazineSize,5} {w.ReloadTime,6} " +
(w.AmmoType.IsSet() ? db.Cache.Get<SimpleCommodityData>(w.AmmoType.Key)?.Name ?? w.AmmoType.Key.Value : "-"));
return 0;
}
private static int RangeFalloff(string[] args)
{
var apply = args.Contains("apply");