feat(client): Luck (deterministic gen/drift/descriptor) + GameState store
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
30
client/tests/unit/test_game_state.gd
Normal file
30
client/tests/unit/test_game_state.gd
Normal file
@@ -0,0 +1,30 @@
|
||||
extends "res://addons/gut/test.gd"
|
||||
|
||||
const GameState = preload("res://scripts/state/game_state.gd")
|
||||
|
||||
|
||||
func test_add_item_accumulates():
|
||||
var s = GameState.new()
|
||||
s.add_item("coin", 3)
|
||||
s.add_item("coin", 2)
|
||||
assert_eq(s.inventory["coin"], 5)
|
||||
|
||||
|
||||
func test_npc_disposition_clamps():
|
||||
var s = GameState.new()
|
||||
s.set_npc_disposition("oda_fenn", 250)
|
||||
assert_eq(s.npc_dispositions["oda_fenn"], 100)
|
||||
|
||||
|
||||
func test_drift_luck_respects_base():
|
||||
var s = GameState.new()
|
||||
s.luck_base = 10
|
||||
s.luck = 10
|
||||
s.drift_luck(100)
|
||||
assert_eq(s.luck, 13)
|
||||
|
||||
|
||||
func test_luck_descriptor_delegates():
|
||||
var s = GameState.new()
|
||||
s.luck = 4
|
||||
assert_eq(s.luck_descriptor(), "Fortune spits on you")
|
||||
Reference in New Issue
Block a user