UI and other changes
This commit is contained in:
parent
87b5c11fcf
commit
215e24e246
79 changed files with 70023 additions and 2201 deletions
|
|
@ -81,15 +81,15 @@ func _zones(r: GameTestRunner, zones: FarmZones) -> void:
|
|||
r.check(not o.rect().intersects(z.rect()), "%s and %s don't overlap" % [o.display_name, z.display_name])
|
||||
|
||||
|
||||
## #13: 20 more crop units in two later-sprouting fields (lettuce/cabbage, corn), 10 each, ids
|
||||
## 31..40 and 41..50, continuing the original field's plot numbering (7..10). GameConfig.start_crops
|
||||
## #13: 60 more crop units in two later-sprouting fields (lettuce/cabbage, corn), 30 each, ids
|
||||
## 31..60 and 61..90, continuing the original field's plot numbering (7..18). GameConfig.start_crops
|
||||
## (30) only counts the original, always-grown field; the later fields grow FarmState.crops_total
|
||||
## when they sprout (LootSystem), so it's not part of this static count.
|
||||
func _crops(r: GameTestRunner, zones: FarmZones) -> void:
|
||||
var cfg := load("res://game/resources/game_config.tres") as GameConfig
|
||||
var units := zones.crop_units()
|
||||
var fields := zones.zones_of(FarmZone.Kind.CROP_FIELD)
|
||||
r.check(units.size() == cfg.start_crops + 20, "%d crop units: %d in the original field, 20 in the two later ones" % [units.size(), cfg.start_crops])
|
||||
r.check(units.size() == cfg.start_crops + 60, "%d crop units: %d in the original field, 60 in the two later ones" % [units.size(), cfg.start_crops])
|
||||
var ids := {}
|
||||
var per_plot := {}
|
||||
var fewest := 1 << 30
|
||||
|
|
@ -104,14 +104,14 @@ func _crops(r: GameTestRunner, zones: FarmZones) -> void:
|
|||
g["count"] = int(g["count"]) + 1
|
||||
by_crop[u.crop] = g
|
||||
r.check(ids.size() == units.size() and ids.has(1) and ids.has(units.size()), "crop unit ids are unique, 1..%d" % units.size())
|
||||
r.check(per_plot.size() == 10 and per_plot.values().all(func(n: int) -> bool: return n == 5), "10 plots of 5 units (%s)" % [per_plot])
|
||||
r.check(per_plot.size() == 18 and per_plot.values().all(func(n: int) -> bool: return n == 5), "18 plots of 5 units (%s)" % [per_plot])
|
||||
r.check(fewest >= 8, "every unit is a visible cluster (fewest plants: %d)" % fewest)
|
||||
r.check(by_crop.get("sunflower", {}).get("count", 0) == cfg.start_crops and by_crop["sunflower"]["sprout_night"] == 0,
|
||||
"the original field's %d units are sunflowers, already grown" % cfg.start_crops)
|
||||
r.check(by_crop.get("lettuce", {}).get("count", 0) == 10 and by_crop["lettuce"]["sprout_night"] == 2,
|
||||
"10 lettuce/cabbage units sprout after night 2")
|
||||
r.check(by_crop.get("corn", {}).get("count", 0) == 10 and by_crop["corn"]["sprout_night"] == 4,
|
||||
"10 corn units sprout after night 4")
|
||||
r.check(by_crop.get("lettuce", {}).get("count", 0) == 30 and by_crop["lettuce"]["sprout_night"] == 2,
|
||||
"30 lettuce/cabbage units sprout after night 2")
|
||||
r.check(by_crop.get("corn", {}).get("count", 0) == 30 and by_crop["corn"]["sprout_night"] == 4,
|
||||
"30 corn units sprout after night 4")
|
||||
|
||||
|
||||
## #20: the lettuce/cabbage and corn fields grow on the bare plowed soil south of the original map
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue