2024-03-22 22:14:05 +01:00
|
|
|
import random
|
|
|
|
|
|
|
|
|
2024-03-07 18:01:12 +01:00
|
|
|
class Dirt:
|
2024-03-22 22:14:05 +01:00
|
|
|
def __init__(self, water_level, nutrients_level):
|
|
|
|
self.water_level = water_level
|
|
|
|
self.nutrients_level = nutrients_level
|
|
|
|
self.pest = False
|
|
|
|
self.weed = False
|
|
|
|
self.obstacle = False
|
|
|
|
self.pests_and_weeds()
|
2024-03-07 18:01:12 +01:00
|
|
|
# add a couple new properties
|
|
|
|
|
2024-03-22 22:14:05 +01:00
|
|
|
def pests_and_weeds(self):
|
2024-05-12 19:20:33 +02:00
|
|
|
i = random.randint(1, 20) # 5% szans na szkodniki, 10% na chwasty, 5 na obydwa 5 na kamien
|
2024-03-22 22:14:05 +01:00
|
|
|
if i == 1:
|
|
|
|
self.pest = True
|
|
|
|
elif i == 2 or i == 3:
|
|
|
|
self.weed = True
|
|
|
|
elif i == 4:
|
|
|
|
self.weed = True
|
|
|
|
self.pest = True
|
2024-06-09 11:29:17 +02:00
|
|
|
'''elif i == 5:
|
|
|
|
self.obstacle = True'''
|
|
|
|
|
|
|
|
def set_ocstacle(self, obstacle_status):
|
|
|
|
self.obstacle = obstacle_status
|
2024-03-07 18:01:12 +01:00
|
|
|
|
2024-03-22 22:14:05 +01:00
|
|
|
# add init, getters,setters
|