Traktor/source/ground.py

30 lines
837 B
Python

import random
class Dirt:
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()
# add a couple new properties
def pests_and_weeds(self):
i = random.randint(1, 20) # 5% szans na szkodniki, 10% na chwasty, 5 na obydwa 5 na kamien
if i == 1:
self.pest = True
elif i == 2 or i == 3:
self.weed = True
elif i == 4:
self.weed = True
self.pest = True
'''elif i == 5:
self.obstacle = True'''
def set_ocstacle(self, obstacle_status):
self.obstacle = obstacle_status
# add init, getters,setters