Use interceptor energy for residual fuse chance
Co-authored-by: Codex <codex@openai.com>
This commit is contained in:
@@ -3089,8 +3089,9 @@ impl Sim {
|
||||
let delta = rel1 - rel0;
|
||||
let k = (-rel0.dot(delta) / delta.length_squared().max(1e-9)).clamp(0.0, 1.0);
|
||||
if (rel0 + delta * k).length() < spec.fuse && world.map(|w| w.0).or(waiting).is_none_or(|w| k <= w) {
|
||||
// A target faster than the interceptor is hard to hit.
|
||||
let ratio = (speed / t.vel.length().max(0.1)).min(1.0).powf(1.5);
|
||||
// Geometry is already resolved by the swept fuse; only the interceptor's
|
||||
// remaining speed modifies the single residual kill chance.
|
||||
let ratio = (speed / spec.speed).clamp(0.0, 1.0).powf(1.5);
|
||||
let fit = sams_fit.get(&m.sam).copied().unwrap_or(1.0) * launchers.get(&m.sam).map_or(1.0, |(at, max)| why::reach_fit(*max, at.distance(m.pos)));
|
||||
let kill = self.rng.chance(spec.pk * fit * ratio);
|
||||
// The same swept closest approach determines the physical impact, not the
|
||||
|
||||
Reference in New Issue
Block a user