FireControl.RoundEnd and RoundAt leave FireControl (RoundEnd to DrawAhead verbatim, RoundAt as DrawAhead's private Line); DrawAhead.Round takes the published outcome, steers a hit or burst from its frozen line at the commit tick onto its end (burst point, else the impact cell on the target's drawn pose), and RoundStop is deleted. Projectile caches the last published ShotOutcome and calls DrawAhead only. BallisticFlightTests move to the new signatures; the frozen-line moving-target test is replaced by impact-cell, steer and no-drawing-function tests. Unverified: not yet built or run. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
17 lines
753 B
C#
17 lines
753 B
C#
using UnityEngine;
|
|
|
|
public class ProjectileManager : InstantWeaponEffectManager
|
|
{
|
|
public Prototype ProjectilePrototype;
|
|
|
|
// The round is drawn by DrawAhead from what the simulation publishes, so there is nothing to aim, jitter
|
|
// or inherit here: spread is priced by FireControl, and the sim's round inherits nothing from its shooter.
|
|
public override void Fire(InstantWeapon weapon, EquippedItem item, EntityInstance source, EntityInstance target, int shotId)
|
|
{
|
|
var zone = source.Entity.Zone;
|
|
if (!zone.TryGetShot(shotId, out var shot)) return;
|
|
var p = ProjectilePrototype.Instantiate<Projectile>();
|
|
p.Launch(zone, shot, source.GetBarrel(item.Hardpoint).position);
|
|
p.Trail.Clear();
|
|
}
|
|
}
|