Complete lab, quest, garrison, and energy tickets
This commit is contained in:
parent
d413d1da9f
commit
0f7edff15a
20 changed files with 238 additions and 45 deletions
|
|
@ -25,6 +25,7 @@ var scene: Node
|
|||
var fleet: Node
|
||||
var field: Node
|
||||
var controller: Node
|
||||
var lab_id: int = 0
|
||||
var crafter_id: int = 0
|
||||
var stage: int = 0
|
||||
var elapsed: float = 0.0
|
||||
|
|
@ -83,6 +84,7 @@ func _process(delta: float) -> bool:
|
|||
game_state.unlocked = ["shipyards", "vessel_science", "coordination", "wing", "squadron"]
|
||||
game_state.research_points = 10
|
||||
field.place(GameState.BUILDING_SHIP_LAB, Vector2(-700.0, 0.0))
|
||||
lab_id = int(game_state.buildings[-1].id)
|
||||
field.place(GameState.BUILDING_SHIP_CRAFTER, Vector2(700.0, 0.0))
|
||||
crafter_id = int(game_state.buildings[-1].id)
|
||||
elapsed = 0.0
|
||||
|
|
@ -130,6 +132,29 @@ func _process(delta: float) -> bool:
|
|||
return true
|
||||
print("lab cards are vessel-specific and selectable")
|
||||
|
||||
# #184: a queued research uses the bar as its changing value. The
|
||||
# status names the state but never repeats it as a percentage.
|
||||
var lab_progress: ProgressBar = controller.get_node(
|
||||
"../UI/LabMenu/ResearchProgress")
|
||||
var lab_status: Label = controller.get_node("../UI/LabMenu/StatusLabel")
|
||||
controller.lab_building_id = lab_id
|
||||
if not game_state.queue_lab_research(lab_id, "int_rate"):
|
||||
return _fail("could not queue research for the progress-bar check")
|
||||
controller.call("_refresh_lab")
|
||||
if not lab_progress.visible or lab_progress.show_percentage:
|
||||
return _fail("pending research did not show a percentage-free progress bar")
|
||||
if "%" in lab_status.text:
|
||||
return _fail("pending research still prints a percentage: '%s'" % lab_status.text)
|
||||
game_state.deposit_resource_to_building(lab_id, GameState.RESOURCE_ORE,
|
||||
game_state.upgrade_cost("int_rate"))
|
||||
game_state.call("_advance_lab_research", game_state.lab_research_time() * 0.25)
|
||||
controller.call("_refresh_lab")
|
||||
if lab_progress.value < 0.2 or lab_progress.value > 0.3 \
|
||||
or lab_status.text != "Researching":
|
||||
return _fail("research bar did not track active work (value %.2f, status '%s')" \
|
||||
% [lab_progress.value, lab_status.text])
|
||||
print("pending lab research is shown by a live progress bar, without percentage text")
|
||||
|
||||
# --- 3. buying raises the level and charges ------------------
|
||||
var before_rocks: int = game_state.rocks
|
||||
var first_cost: int = game_state.upgrade_cost("int_damage")
|
||||
|
|
@ -225,3 +250,9 @@ func _process(delta: float) -> bool:
|
|||
quit(0)
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
func _fail(message: String) -> bool:
|
||||
print("TEST_SHIP_LAB: FAIL (%s)" % message)
|
||||
quit(1)
|
||||
return true
|
||||
|
|
|
|||
Loading…
Reference in a new issue