Task #17: Propane Torch sprays a band of fire

Hit test: _band_hit replaces the torch's cone. It hits the enemies in a
torch_width (1.6 m) wide band along the gun's line, from the scarecrow's
center out to torch_range (4.5 m) past the muzzle, each enemy's hit radius
added. The nearest torch_targets with a clear line are hit; _cone_hit and
_band_hit share _hit_nearest. torch_arc is gone, and the torch joins
MUZZLE_WEAPONS so scripted aim matches the mouse.

Flame: TorchFlame (CPUParticles3D jet plus a flickering light) is sized to
the band. WeaponModels gains a reusable held-effect pattern for #18:
- add_held_effect / lit / douse / advance.
- attack() lights the effect for HOLD_TICKS (1.5) tick intervals instead
  of replaying the kick.
- douse() puts it out the moment fire is let go; it then fades for the
  particle lifetime.
- Timers run on the sim clock (ScarecrowCombat.tick), or on physics frames
  when nothing advances them. That covers the other scarecrow on the
  partner's machine, which the existing "attack" events light, so there is
  no protocol change.

Sound: a new burned signal and a "burn" cue (synth torch_roar.wav,
generated by synth_audio.gd with its own seed) replace the pitchfork's
stab sound.

Tests (test_weapons): band in, beside, behind and beyond; a melee hugger
is burned; held fire over 5 intervals ticks 5 times and stops on release;
the flame is lit at every step while held and hidden after release; the
replica and attack-event paths; the flame follows the model's yaw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-06 13:04:54 -04:00
parent 26b735d3e6
commit ca8601029e
12 changed files with 483 additions and 37 deletions

View file

@ -152,7 +152,7 @@ extends Resource
"pumpkin_bomb": {"name": "Pumpkin bombs", "text": "Throw a pumpkin that bursts, hurting everything within 3 m (one every 4 s)", "track": "Weapon", "shop": "shed"},
"potato_cannon": {"name": "Potato cannon", "text": "A slow heavy potato shot that hits hard from afar", "track": "Weapon", "shop": "shed"},
"shurikens": {"name": "Shurikens", "text": "Fast, cheap throws for a quick hit", "track": "Weapon", "shop": "shed"},
"propane_torch": {"name": "Propane torch", "text": "A short-range jet of flame that burns everything in its cone while held", "track": "Weapon", "shop": "shed"},
"propane_torch": {"name": "Propane torch", "text": "A jet of flame that burns everything in a band ahead of you while held", "track": "Weapon", "shop": "shed"},
"alien_ray": {"name": "Alien ray", "text": "A salvaged alien weapon: a fast, powerful beam", "track": "Weapon", "shop": "shed", "hidden": true},
"radar": {"name": "Radar", "text": "A minimap showing nearby enemy positions", "track": "Item", "shop": "shed", "hidden": true},
"wide_fear": {"name": "Wide fear", "text": "Fear reaches 30% farther", "track": "Fear", "stat": "fear_radius", "mult": 1.3},
@ -286,12 +286,13 @@ extends Resource
@export var shuriken_speed: float = 34.0
@export var shuriken_lifetime: float = 1.0
@export_range(1, 6) var shuriken_count: int = 1
## Propane Torch (the Propane torch upgrade, bought at the supply shed): a sustained cone while
## held, a tick every torch_tick_interval s, torch_damage each to every enemy within torch_range m
## and torch_arc degrees of the aim (the nearest torch_targets), with a clear line (ScarecrowCombat,
## the same cone test as the pitchfork's).
@export var torch_range: float = 3.5
@export var torch_arc: float = 55.0
## Propane Torch (the Propane torch upgrade, bought at the supply shed): a band of fire while held
## (#17), a tick every torch_tick_interval s, torch_damage each to the enemies in a torch_width m
## wide band along the gun's line, from the scarecrow out to torch_range m past the muzzle (the
## nearest torch_targets), with a clear line (ScarecrowCombat._band_hit). Its flame (TorchFlame)
## is sized to the band.
@export var torch_range: float = 4.5
@export var torch_width: float = 1.6
@export_range(1, 20) var torch_damage: int = 1
@export_range(1, 20) var torch_targets: int = 5
@export var torch_tick_interval: float = 0.2