From ffb64ccbc0077f5387661f35d7b7219bab4ced4e Mon Sep 17 00:00:00 2001 From: Marek Date: Mon, 25 Mar 2024 01:02:03 +0100 Subject: [PATCH] small bug fixes --- source/area/tractor.py | 22 +++++++++++++--------- source/plant.py | 3 +++ 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/source/area/tractor.py b/source/area/tractor.py index cc76559..dc27ee8 100644 --- a/source/area/tractor.py +++ b/source/area/tractor.py @@ -22,14 +22,16 @@ class Tractor: if plant1 is None: tile.randomizeContent() # sprobuj zasadzic cos + print("Tarctor planted something") elif plant1.growth_level == 100: tile.plant = None - ground.nutrients -= 40 - ground.water -= 40 + ground.nutrients_level -= 40 + ground.water_level -= 40 + print("Tractor collected something") else: - plant1.try_to_grow() - ground.nutrients -= 11 - ground.water -= 11 + plant1.try_to_grow(50,50) #mozna dostosowac jeszcze + ground.nutrients_level -= 11 + ground.water_level -= 11 if ground.pest: # traktor pozbywa sie szkodnikow if plant1.plant_type == self.cypermetryna.plant_type: @@ -50,7 +52,9 @@ class Tractor: t = "Tractor used Metazachlor" print(t) ground.weed = False - if ground.water < plant1.water_requirements: - ground.water += 20 - if ground.nutrients < plant1.nutrients_requirements: - ground.nutrients += 20 + if ground.water_level < plant1.water_requirements: + ground.water_level += 20 + print("Tractor watered the plant") + if ground.nutrients_level < plant1.nutrients_requirements: + ground.nutrients_level += 20 + print("Tractor added some nutrients") diff --git a/source/plant.py b/source/plant.py index 30deb91..0072b54 100644 --- a/source/plant.py +++ b/source/plant.py @@ -15,6 +15,9 @@ class Plant: if self.growth_level+i > 100: i = 100 - self.growth_level self.growth_level += i + print("The plant is growing") + else: + print("Unable to grow due to bad condition of the ground") # more properties