Fuse batch 5: agents fire per weapon, Solve owns the burst, refusal is free, arming is the blast radius
Operator rulings 2026-09-30. * Combat and TurretController ask FireControl.AgentFires for each weapon. A fused weapon fires whenever its target is designated (Designated, the one visible / in-range / locked predicate PFire already used), whatever the arc; an agent never fires one at nothing. A direct-hit weapon keeps the AgentMinHitProbability threshold. The group's first weapon no longer speaks for the group, and the turret's own range test is gone. * FireControl.Solve is the one decision about what a round does, extracted from Fire: Direct, Burst at a reach, or Refused. Fire, Inspect and the weapons' refusal check all read it. Inspect gains Outcome and BurstReach and the debug HUD prints them for fused weapons. * A refused round costs nothing. InstantWeapon asks before its ammo and energy spend (at the trigger and at each round), ConstantWeapon folds the refusal into the gate its power request and Execute already share, so a refused beam draws no power, wear, heat or visibility and stops. * The arming distance is BlastRadius, measured from the shooter's position and blind to hull size. HullAhead's exit, ArmingDistance and PendingShot.ArmingDistance are deleted; HullAhead survives as HullEntry for the contact fuse. A round fired at a valid target inside the radius is pushed out along its line but keeps its target, so a departed target cancels it. * Step settles a shot's queue state before publishing about it, so a throwing presentation observer costs its own notification and cannot re-commit or re-resolve the shot on every later tick. Tests: FireControlPerWeaponTests (new; includes a fused-beam fixture), the arming tests in FireControlCut124Tests rewritten to the literal distance, the hull-inclusive probe premises deleted. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
14f666347c
commit
a193853d34
8 changed files with 787 additions and 160 deletions
|
|
@ -91,7 +91,13 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerC
|
|||
// Cut 5 (docs/fire-control-cut.md, 5.3, Soul finding 9): StanceAllowsFire alone let a side-mounted beam
|
||||
// fire forward -- ArcAllowsFire joins it here, matching InstantWeapon.cs's player arc gate (Q2: manual and
|
||||
// programmatic are one truth, and a continuous weapon is no exception).
|
||||
public float PowerRequest(float dt) => _firing && StanceAllowsFire && ArcAllowsFire ? EvaluateNominalPower(_data.Energy) * dt : 0f;
|
||||
// Operator ruling 2026-09-30: a refused round is free, and a beam is a stream of rounds, so a fused beam whose
|
||||
// arming distance exceeds its Range fires nothing and draws nothing -- no power, ammo, wear, heat or
|
||||
// visibility. FireControl.Refuses is the one arming test; it reads the Range Execute last refreshed, the same
|
||||
// one-tick lag every PowerRequest reads its stats with.
|
||||
private bool MayFire => StanceAllowsFire && ArcAllowsFire && !FireControl.Refuses(this, Entity);
|
||||
|
||||
public float PowerRequest(float dt) => _firing && MayFire ? EvaluateNominalPower(_data.Energy) * dt : 0f;
|
||||
|
||||
// Cut 5 (docs/stats-and-power-cut.md §1.3, PowerTiers.cs): Low -- offense, same as InstantWeapon.
|
||||
public int DefaultPowerTier => PowerTiers.Low;
|
||||
|
|
@ -99,10 +105,11 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerC
|
|||
public override bool Execute(float dt)
|
||||
{
|
||||
base.Execute(dt);
|
||||
if (_firing && !(StanceAllowsFire && ArcAllowsFire))
|
||||
if (_firing && !MayFire)
|
||||
{
|
||||
// Safed: shooter has a target and hasn't declared hostility toward it, or the target no longer
|
||||
// bears (5.3: a beam obeys its arc exactly as InstantWeapon's trigger does).
|
||||
// bears (5.3: a beam obeys its arc exactly as InstantWeapon's trigger does), or a fused round is
|
||||
// refused.
|
||||
_firing = false;
|
||||
OnStopFiring?.Invoke();
|
||||
return false;
|
||||
|
|
@ -179,7 +186,7 @@ public class ConstantWeapon : Weapon, IProgressBehavior, IEventBehavior, IPowerC
|
|||
// argument included, when OnBeamShot has no subscriber (true today, R9's "no design uses it
|
||||
// yet"), so the roll would silently never happen. Evaluate it into a local first.
|
||||
var shotId = FireControl.Fire(this, Item, Entity, Damage * interval);
|
||||
if (shotId != 0) OnBeamShot?.Invoke(shotId);
|
||||
OnBeamShot?.Invoke(shotId);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Reference in a new issue