Add final progression to tiny sword, fixes and tweeks required

This commit is contained in:
2026-05-15 00:47:38 +02:00
parent 66666defcb
commit 738381a16b
43 changed files with 1127 additions and 339 deletions

View File

@@ -6,7 +6,7 @@ var _game_root: Node = null
func _ready() -> void:
await run()
pass # run() is called by the test runner; avoid double-execution.
func run() -> void:
@@ -118,10 +118,17 @@ func _test_purchase_flow() -> void:
var scene: PackedScene = load("res://docs/gyms/tiny_sword/tiny_sword.tscn")
_game_root = scene.instantiate()
# Use a unique save path to avoid contamination from previous test runs.
var save_path: String = "user://test_ascension_%d.json" % randi()
DirAccess.remove_absolute(ProjectSettings.globalize_path(save_path))
var gs: LevelGameState = _game_root.get_node("LevelGameState")
gs.save_file_path = save_path
add_child(_game_root)
await _wait()
var gs: LevelGameState = _game_root.find_child("LevelGameState")
gs = _game_root.find_child("LevelGameState")
if gs == null:
print("[ERROR] LevelGameState not found")
return
@@ -142,9 +149,9 @@ func _test_purchase_flow() -> void:
TestUtils.assert_false(gs.is_prestige_buff_unlocked(&"gold_boost"), "gold_boost starts locked")
TestUtils.assert_false(gs.is_prestige_buff_unlocked(&"farm_boost"), "farm_boost starts locked")
# Check can_purchase (both are root nodes with no parents, should be purchaseable)
# gold_boost is a root node (no parents), farm_boost requires gold_boost as parent.
TestUtils.assert_true(gs.can_purchase_prestige_buff(&"gold_boost"), "gold_boost is purchasable")
TestUtils.assert_true(gs.can_purchase_prestige_buff(&"farm_boost"), "farm_boost is purchasable")
TestUtils.assert_false(gs.can_purchase_prestige_buff(&"farm_boost"), "farm_boost is NOT purchasable (parent gold_boost not yet unlocked)")
# Check cost
var cost: BigNumber = gs.get_prestige_buff_cost(&"gold_boost")