small bug fixes

This commit is contained in:
Marek 2024-03-25 01:02:03 +01:00
parent 1d713864f3
commit ffb64ccbc0
2 changed files with 16 additions and 9 deletions

View File

@ -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")

View File

@ -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