Implement TODO backlog: LATE phase fix, protester, CALL_SOMEONE, door lock, flashlight, persistence, navmesh, JSON localization, and release tooling
CI / headless-tests (push) Successful in 55s
CI / headless-tests (push) Successful in 55s
- Fix LATE shift phase (start 700s) so the violent-threat event is reachable - Add PROTESTER archetype (rules, profile, colors, events in public venues) - Add CALL_SOMEONE reaction (FSM -> ARGUING, influencer/trespasser/protester weights) - Door lock: DoorState core class, L binding, red/green visual indicator, locked doors thwart FORCE_ENTRY - Flashlight: G binding, SpotLight3D, perception radius bonus at evening/late - Persistence: save shift results via Save autoload, history + best score on review screen, round-trip test - Navigation: flat NavigationRegion3D navmesh, NavigationAgent3D path following with direct-movement fallback; steps made visual-only so NPCs reach entrance - Localization: strings moved to content/strings.en.json (loader keeps lookup/fmt signatures; coverage test over all keys) - Distribution: export_presets.cfg (Linux/Windows/macOS), tools/build_releases.sh, docs/RELEASING.md, prominent README Downloads section - Remove stale signal_bus.gd (invalid static-signal experiment) - Tests: 53 passing across 9 suites
This commit is contained in:
1 parent
c808165302
commit
1e972a7490
27 files changed
+1044
-340
No files matched your search
@@ -0,0 +1,46 @@
|
||||
extends RefCounted
|
||||
## Headless tests for the door lock mechanic and flashlight perception bonus.
|
||||
|
||||
const Rules := preload("res://src/core/rules.gd")
|
||||
const DoorState := preload("res://src/core/door_state.gd")
|
||||
const NpcProfile := preload("res://src/core/npc_profile.gd")
|
||||
const NPCController := preload("res://src/core/npc_controller.gd")
|
||||
|
||||
func test_door_toggle_transitions() -> bool:
|
||||
var door := DoorState.new()
|
||||
var a := TestUtils.check_eq(door.locked, false, "starts unlocked")
|
||||
var b := TestUtils.check_eq(door.toggle(), true, "toggle locks")
|
||||
var c := TestUtils.check_eq(door.toggle(), false, "toggle unlocks")
|
||||
return a and b and c
|
||||
|
||||
func test_locked_door_thwarts_force() -> bool:
|
||||
var door := DoorState.new()
|
||||
door.set_locked(true)
|
||||
var result := door.attempt_force()
|
||||
var a := TestUtils.check_eq(result["succeeded"], false, "locked door blocks forced entry")
|
||||
var b := TestUtils.check_eq(result["outcome"], "thwarted", "thwarted outcome")
|
||||
return a and b
|
||||
|
||||
func test_unlocked_door_admits_force() -> bool:
|
||||
var door := DoorState.new()
|
||||
var result := door.attempt_force()
|
||||
var a := TestUtils.check_eq(result["succeeded"], true, "open door lets forced entry through")
|
||||
var b := TestUtils.check_eq(result["outcome"], "entered", "entered outcome")
|
||||
return a and b
|
||||
|
||||
func test_flashlight_widens_perception() -> bool:
|
||||
## Without the flashlight, an NPC at AWARE_RADIUS + 3 m is unaware.
|
||||
## With the flashlight bonus (4 m), the same distance registers as aware.
|
||||
var p := NpcProfile.new()
|
||||
p.id = "nightwalker"
|
||||
p.npc_type = Rules.NpcType.TOURIST
|
||||
var dim := NPCController.new()
|
||||
dim.setup("d1", p, "wander", 1)
|
||||
var unlit: Dictionary = dim.perceive_guard(NPCController.AWARE_RADIUS + 3.0, 0.0)
|
||||
var a := TestUtils.check_eq(unlit["band"], "unaware", "unlit: too far to notice")
|
||||
|
||||
var lit := NPCController.new()
|
||||
lit.setup("l1", p, "wander", 2)
|
||||
var lit_result: Dictionary = lit.perceive_guard(NPCController.AWARE_RADIUS + 3.0, 4.0)
|
||||
var b := TestUtils.check_eq(lit_result["band"], "aware", "flashlight bonus makes NPC aware")
|
||||
return a and b
|
||||
Reference in new issue
Block a user