Merge origin/master (594d3477) into eureka/aetheria-release-gear-without-presence
Brings gear-without-presence up to master ahead of landing it, with eureka/aetheria-release-retire-longinusx following. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
commit
2403a5f393
46 changed files with 2609 additions and 103 deletions
|
|
@ -38,8 +38,9 @@ public static class Program
|
|||
case "targeting-catalog-6d": return TargetingCatalog6d(args.Contains("apply"));
|
||||
case "ship-authoring": return ShipAuthoringCommands.Run(args.Skip(1).ToArray());
|
||||
case "field-kinds": return FieldKindsCatalog(args.Contains("apply"));
|
||||
case "mine-launcher": return MineLauncherCatalog(args.Contains("apply"));
|
||||
default:
|
||||
Console.WriteLine("commands: census, factions, station-fit, hardpoint-fit, loadout [seed], save, settings, settings-dump, dangling [clear <Type.Member>]... [apply], shield-migrate [apply], brownout-migrate [apply], roles-migrate [apply], firing-arc-migrate [apply], targeting-catalog [apply], targeting-catalog-6c [apply], targeting-catalog-6d [apply], ship-authoring create|inspect|validate|compose, field-kinds [apply]");
|
||||
Console.WriteLine("commands: census, factions, station-fit, hardpoint-fit, loadout [seed], save, settings, settings-dump, dangling [clear <Type.Member>]... [apply], shield-migrate [apply], brownout-migrate [apply], roles-migrate [apply], firing-arc-migrate [apply], targeting-catalog [apply], targeting-catalog-6c [apply], targeting-catalog-6d [apply], ship-authoring create|inspect|validate|compose, field-kinds [apply], mine-launcher [apply]");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
|
@ -1457,4 +1458,115 @@ public static class Program
|
|||
Console.WriteLine("\nAuthored \"Asteroid\" in Aetheria.cc");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// sim-mines-presenter: the Mine Launcher item, so a ship can be fitted with the sim's mine layer. Its numbers
|
||||
// are the 2021 record's (GameData/Legacy/AetherDB.2021-03-05.msgpack, recovered in 8c71a637: mass 75, price
|
||||
// 125000, damage 50, range 2000, energy 15, heat 500, visibility 10, magazine 6, reload 5, spread 5, velocity
|
||||
// 50, cooldown 2, thermal limits 173.15..473.15 K, kelvin like every shipped item); BlastRadius 25, the delays
|
||||
// 2 and 2 and the 30 s lifetime are the retired prefab's. The optimum and plateau are the 2021 record's
|
||||
// sibling weapon's (it carries 173.15..473.15 K too), because that record sets neither. An already authored
|
||||
// Mine Launcher has its thermal envelope brought to these values. Dry run unless passed "apply".
|
||||
private static int MineLauncherCatalog(bool apply)
|
||||
{
|
||||
const string name = "Mine Launcher";
|
||||
var db = AetherDb.Open(catalogWritable: apply);
|
||||
const float minimumTemperature = 173.15f, maximumTemperature = 473.15f, optimalTemperature = 249.65f, plateauWidth = 36f;
|
||||
if (db.Cache.GetAll<GearData>().SingleOrDefault(gear => gear.Name == name) is { } authored)
|
||||
{
|
||||
if (authored is not WeaponItemData existing) throw new InvalidOperationException($"\"{name}\" exists and is not a weapon.");
|
||||
if (existing.MinimumTemperature == minimumTemperature && existing.MaximumTemperature == maximumTemperature &&
|
||||
existing.OptimalTemperature == optimalTemperature && existing.PlateauWidth == plateauWidth)
|
||||
{
|
||||
Console.WriteLine($"\"{name}\" is already authored; nothing to do.");
|
||||
return 0;
|
||||
}
|
||||
Console.WriteLine($"\"{name}\" thermal envelope {existing.MinimumTemperature}..{existing.MaximumTemperature} (optimum {existing.OptimalTemperature}, plateau {existing.PlateauWidth}) -> {minimumTemperature}..{maximumTemperature} K (optimum {optimalTemperature}, plateau {plateauWidth}).");
|
||||
if (!apply)
|
||||
{
|
||||
Console.WriteLine("\nDry run. Pass \"apply\" to correct it.");
|
||||
return 0;
|
||||
}
|
||||
existing.MinimumTemperature = minimumTemperature;
|
||||
existing.MaximumTemperature = maximumTemperature;
|
||||
existing.OptimalTemperature = optimalTemperature;
|
||||
existing.PlateauWidth = plateauWidth;
|
||||
CultRecordRefs.Validate(existing);
|
||||
db.Cache.Commit(batch => batch.Upsert(typeof(GearData), existing, db.Cache.RefOf(existing).Key));
|
||||
Console.WriteLine($"\nCorrected \"{name}\" in Aetheria.cc");
|
||||
return 0;
|
||||
}
|
||||
|
||||
PerformanceStat Constant(float v) => new PerformanceStat { Min = v, Max = v };
|
||||
var launcher = new WeaponItemData
|
||||
{
|
||||
Name = name,
|
||||
Hardpoint = HardpointType.Launcher,
|
||||
Shape = new Shape(),
|
||||
WeaponType = WeaponType.Mine,
|
||||
WeaponRange = WeaponRange.Medium,
|
||||
WeaponCaliber = WeaponCaliber.Medium,
|
||||
Fuse = WeaponFuse.Proximity,
|
||||
BlastRadius = 25f,
|
||||
Mass = 75f,
|
||||
Price = 125000,
|
||||
Durability = 100f,
|
||||
MinimumTemperature = minimumTemperature,
|
||||
MaximumTemperature = maximumTemperature,
|
||||
OptimalTemperature = optimalTemperature,
|
||||
PlateauWidth = plateauWidth,
|
||||
Behaviors =
|
||||
{
|
||||
new MineLayerData
|
||||
{
|
||||
DamageType = DamageType.Kinetic,
|
||||
DamageCurve = new BezierCurve { Keys = new[] { new float4(0f, 1f, 0f, 0f), new float4(1f, 1f, 0f, 0f) } },
|
||||
Damage = Constant(50f),
|
||||
Range = Constant(2000f),
|
||||
MinRange = Constant(0f),
|
||||
Energy = Constant(15f),
|
||||
Heat = Constant(500f),
|
||||
Visibility = Constant(10f),
|
||||
MagazineSize = 6,
|
||||
ReloadTime = 5f,
|
||||
Spread = Constant(5f),
|
||||
Velocity = Constant(50f),
|
||||
Count = Constant(1f),
|
||||
Cooldown = Constant(2f),
|
||||
ArmingDelay = 2f,
|
||||
FuseDelay = 2f,
|
||||
Lifetime = 30f
|
||||
}
|
||||
}
|
||||
};
|
||||
Console.WriteLine($"Adds \"{name}\": Launcher, Mine, Proximity fuse, blast radius 25, one MineLayerData (arming 2, fuse 2, lifetime 30).");
|
||||
if (!apply)
|
||||
{
|
||||
Console.WriteLine("\nDry run. Pass \"apply\" to author it.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
// A design no product sells cannot spawn, and the shipped catalog holds none: sell it as the first
|
||||
// shipped launcher is sold, by the same maker.
|
||||
var launcherProducts = db.Cache.GetAll<FactionProductData>()
|
||||
.Where(p => db.Cache.Get(p.Design) is WeaponItemData weapon && weapon.Hardpoint == HardpointType.Launcher)
|
||||
.OrderBy(p => db.Cache.RefOf(p).Key.Value, StringComparer.Ordinal).ToArray();
|
||||
if (launcherProducts.Length == 0) throw new InvalidOperationException("No shipped launcher product names a maker for the Mine Launcher.");
|
||||
var maker = launcherProducts[0].Manufacturer;
|
||||
Console.WriteLine($"Sold by {db.Cache.Get(maker)?.ShortName ?? "(none)"}, as the first shipped launcher product is.");
|
||||
|
||||
CultRecordRefs.Validate(launcher);
|
||||
db.Cache.Commit(batch =>
|
||||
{
|
||||
var design = batch.Upsert(typeof(GearData), launcher);
|
||||
batch.Upsert(typeof(FactionProductData), new FactionProductData
|
||||
{
|
||||
Name = name,
|
||||
Description = "Lays a drifting proximity mine that arms after two seconds.",
|
||||
Design = new CultRecordRef<CraftedItemData>(design),
|
||||
Manufacturer = maker
|
||||
});
|
||||
});
|
||||
Console.WriteLine($"\nAuthored \"{name}\" in Aetheria.cc");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue