UI and other changes
This commit is contained in:
parent
87b5c11fcf
commit
215e24e246
79 changed files with 70023 additions and 2201 deletions
|
|
@ -189,7 +189,7 @@ func _sprint(r: GameTestRunner, sim: FarmSim, player: PlayerCharacter, hud: Scar
|
|||
var s := sim.campaign.state
|
||||
s.upgrades.erase("sprint")
|
||||
hud._process(0.0)
|
||||
r.check(not player.can_sprint() and not hud._sprint_label.visible, "no sprint (and no sprint line on the HUD) before the upgrade")
|
||||
r.check(not player.can_sprint() and not hud.stamina_shown(), "no sprint before the upgrade (and no stamina bar on the HUD)")
|
||||
# On the real body, over physics frames: the open ground south-west of the pen.
|
||||
player.global_position = Vector3(0.0, 0.0, 6.0)
|
||||
player.velocity = Vector3.ZERO
|
||||
|
|
@ -206,13 +206,12 @@ func _sprint(r: GameTestRunner, sim: FarmSim, player: PlayerCharacter, hud: Scar
|
|||
r.check(player.animation_player.current_animation == player.run_animation and player.animation_player.speed_scale > 1.5,
|
||||
"the run clip plays faster (x%.2f)" % player.animation_player.speed_scale)
|
||||
r.check(player.move_strength() > 1.5, "the partner's machine is told it's sprinting (strength %.2f)" % player.move_strength())
|
||||
hud._process(0.0)
|
||||
r.check(hud._sprint_label.visible and hud._sprint_label.text.begins_with("Sprinting"), "the HUD shows the sprint running: '%s'" % hud._sprint_label.text)
|
||||
r.check(hud.stamina_shown() and hud.stamina() < 1.0 and is_equal_approx(hud.stamina(), player.sprint_left / cfg.sprint_time),
|
||||
"the HUD's stamina bar appears, and drains while sprinting (%.2f)" % hud.stamina())
|
||||
Input.action_release("move_right")
|
||||
await _frames(r, 2)
|
||||
r.check(not player.sprinting and player.sprint_recharge > cfg.sprint_cooldown - 0.1, "stopping ends it, and the recharge starts")
|
||||
hud._process(0.0)
|
||||
r.check(hud._sprint_label.text == "Sprint %.0f s" % ceilf(player.sprint_recharge), "the HUD counts the recharge down: '%s'" % hud._sprint_label.text)
|
||||
r.check(hud.stamina() < 0.1, "and starts filling back as it recharges (%.2f)" % hud.stamina())
|
||||
Input.action_release("sprint")
|
||||
await _frames(r, 30)
|
||||
player.velocity = Vector3.ZERO
|
||||
|
|
@ -236,8 +235,7 @@ func _sprint(r: GameTestRunner, sim: FarmSim, player: PlayerCharacter, hud: Scar
|
|||
player.step_sprint(DT, true, false)
|
||||
r.check(not player.sprinting, "and it doesn't start standing still")
|
||||
sim.scarecrow.reset_for_morning()
|
||||
hud._process(0.0)
|
||||
r.check(player.sprint_recharge == 0.0 and hud._sprint_label.text == "Sprint hold Shift / L3", "a new morning has it ready: '%s'" % hud._sprint_label.text)
|
||||
r.check(player.sprint_recharge == 0.0 and hud.stamina() == 1.0, "a new morning has it ready (a full bar)")
|
||||
s.upgrades.erase("sprint")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue