This commit is contained in:
Forrest 2026-10-04 12:07:36 -04:00
parent 276d43613d
commit 4298caf5cb
552 changed files with 42990 additions and 776 deletions

View file

@ -94,14 +94,14 @@ func _early_night(r: GameTestRunner) -> void:
func _night_log(r: GameTestRunner) -> void:
var c := r.make_campaign()
GameTestRunner.run_until(c, P.NIGHT)
c.state.crops -= 3
GameTestRunner.lose_crops(c.state, 3)
GameTestRunner.run_until(c, P.DAWN)
c.state.crops -= 1 # loot escaping during the dawn grace still counts for that night
GameTestRunner.lose_crops(c.state, 1) # loot escaping during the dawn grace still counts for that night
GameTestRunner.run_until(c, P.MORNING)
var e: Dictionary = c.state.night_log[0]
r.check(e["night"] == 1 and e["crops_lost"] == 4, "night 1 records 4 crops lost, dawn included (got %s)" % [e])
r.check(c.state.crops == c.config.start_crops - 4, "losses persist into the next day")
c.state.crops -= 2 # lost during the day don't count against the next night
GameTestRunner.lose_crops(c.state, 2) # lost during the day don't count against the next night
c.begin_day()
GameTestRunner.run_until(c, P.MORNING)
r.check(c.state.night_log[1]["crops_lost"] == 0, "night 2 only counts losses after it started")
@ -110,14 +110,14 @@ func _night_log(r: GameTestRunner) -> void:
func _retry(r: GameTestRunner) -> void:
var c := r.make_campaign()
GameTestRunner.run_until(c, P.NIGHT)
c.state.crops -= 3
GameTestRunner.lose_crops(c.state, 3)
c.state.scarecrow_hp -= 4
GameTestRunner.run_until(c, P.MORNING)
var morning := c.state.to_dict()
c.begin_day()
GameTestRunner.run_until(c, P.NIGHT)
c.state.crops -= 5
GameTestRunner.lose_crops(c.state, 5)
c.state.scarecrow_hp = 0
c.tick(GameTestRunner.TICK)
r.check(c.state.phase == P.GAME_OVER, "the scarecrow falls on night 2")