Task #15: UFO enemy, a fast flying fighter

Adds a 4th enemy type (TYPE_UFO=3) that reuses the generic flying-nav
infrastructure (ignores fences, gates, and traps) and gets a new
FIGHT-capable behavior in ThiefBehavior: it skips SEEK/loot entirely and
goes straight to FIGHT, strafing the scarecrow in dive-and-pull-up passes
(diving to land_altitude while its attack is off cooldown, climbing to
cruise_altitude right after landing a hit) until it's hit for every pass.
All stats (speed 7.0, hp 2, damage 1, hit_interval 1.5s, aggro_range 10.0,
etc.) live in GameConfig.enemy_types["ufo"]. It renders through the same
shared flyer MultiMesh crows use (no new art) and is wired into
NightPlan/WaveDirector composition, the HUD/assessment roster lines, kill
log keys, and the arrival sound/toast, with a generic audio fallback since
it has no cue of its own.

Per a scope addition mid-task, night 5 now also sends in a wave of 4 UFOs
late in the night (game/resources/nights/night_5.tres), which shifts
test_nights' known-flaky "arrived" baseline line by one new {3: N} entry
(the UFO counts agree between plan and arrival) and required updating its
hardcoded "all three types" check to four. A debug-only "UFOs only"
scenario is added (game/resources/scenarios/ufos.tres) but deliberately
left out of CampaignDebug.SCENARIOS, since wiring it in would change
test_roster's hardcoded scenario count and that file's existing checks
were required to stay untouched.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Forrest 2026-10-05 14:43:46 -04:00
parent 30e64ebeec
commit 34358d0641
14 changed files with 147 additions and 17 deletions

View file

@ -8,7 +8,7 @@ extends Resource
## time seconds after nightfall when the group's first enemy arrives
## count how many arrive
## every seconds between them
## type enemy type: "thief", "crow", or "breaker"
## type enemy type: "thief", "crow", "breaker", or "ufo"
## target what they're after: "crops", "animals", "supplies", or "any" (GameConfig.target_weights)
## The plans are the nights' designs; GameConfig.wave_count_scale and wave_spacing_scale scale
## every group when the night is played (count_scale x the enemies, spacing_scale x the time
@ -66,7 +66,7 @@ func problems(length: float, count_scale: float = 1.0, spacing_scale: float = 1.
out.append("%s: unknown enemy type '%s'" % [where, type])
continue
var target := String(g.get("target", "any"))
var allowed := {"crow": ["crops", "any"], "thief": ["animals", "supplies", "any"], "breaker": ["any"]}
var allowed := {"crow": ["crops", "any"], "thief": ["animals", "supplies", "any"], "breaker": ["any"], "ufo": ["any"]}
if not (allowed[type] as Array).has(target):
out.append("%s: a %s doesn't go for '%s'" % [where, type, target])
if int(g.get("count", 0)) < 1 or float(g.get("every", 0.0)) <= 0.0: