Damage falloff: effective range and damage at max range replace DamageCurve

WeaponData.RangeFactor is the one function of damage over range: 0 outside
[MinRange, Range], 1 up to EffectiveRange, one lerp to DamageAtMaxRange.
DamageCurve (key 7, retired) and its formula parameters, CurveField's
BezierCurve path, and every fixture curve line are deleted. Fire freezes
damage times the factor at BurstReach; the AI's DPS reads, Combat's optimum
sampling and the properties panel chart read the same function. AetherDb
gains range-falloff (command only; the catalog is re-saved in a later commit).
Cut and wiring land in one commit rather than two; this commit has not been
built yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Meta Vens 2026-10-14 02:16:04 +02:00
commit 5e0ec92509
33 changed files with 282 additions and 127 deletions

View file

@ -32,7 +32,7 @@ public class CombatState : BaseState
_availableLockingWeapons.Clear();
var toTarget = target.Position - _agent.Ship.Position;
var targetDistance = length(toTarget);
var targetDistance = length(toTarget.xz);
// Cut 2 (docs/fire-control-cut.md): aim at whichever revealed weapon on the target hits hardest at
// this range, or clear the aim point when nothing qualifies -- the same predicate
@ -139,8 +139,8 @@ public class CombatState : BaseState
var maxRange = Single.MinValue;
foreach (var weapon in _agent.Ship.Weapons)
{
if (weapon.Range < minRange)
minRange = weapon.Range;
if (weapon.MinRange < minRange)
minRange = weapon.MinRange;
if (weapon.Range > maxRange)
maxRange = weapon.Range;
}
@ -153,7 +153,7 @@ public class CombatState : BaseState
float dps = 0;
foreach (var weapon in _agent.Ship.Weapons)
{
if (weapon.Item.Online.Value && weapon.MinRange < range && range < weapon.Range)
if (weapon.Item.Online.Value)
dps += weapon.RangeDamagePerSecond(range);
}