diff --git a/tools/AetherDb/Program.cs b/tools/AetherDb/Program.cs index 99963e8dd..50f97c019 100644 --- a/tools/AetherDb/Program.cs +++ b/tools/AetherDb/Program.cs @@ -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().OrderBy(i => i.Name, StringComparer.Ordinal)) + foreach (var w in item.Behaviors.OfType()) + 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(w.AmmoType.Key)?.Name ?? w.AmmoType.Key.Value : "-")); + return 0; + } + private static int RangeFalloff(string[] args) { var apply = args.Contains("apply");