34 lines
926 B
Python
34 lines
926 B
Python
import config
|
|||
|
|
def Plant():
|
||
|
|
while True:
|
||
|
|
dead = 0
|
||
|
|
for x in range(get_world_size()):
|
||
|
|
for y in range(get_world_size()):
|
||
|
|
if get_entity_type() != None:
|
||
|
|
if get_entity_type() != Entities.Pumpkin:
|
||
|
|
dead += 1
|
||
|
|
if can_harvest():
|
||
|
|
harvest()
|
||
|
|
if num_items(Items.Carrot) > config.pumpkintimes * get_world_size():
|
||
|
|
if get_ground_type() != Grounds.Soil:
|
||
|
|
till()
|
||
|
|
plant(Entities.Pumpkin)
|
||
|
|
if get_water() < config.waterpercent:
|
||
|
|
use_item(Items.Water)
|
||
|
|
else:
|
||
|
|
dead += 1
|
||
|
|
if num_items(Items.Carrot) > config.pumpkintimes * get_world_size():
|
||
|
|
if get_ground_type() != Grounds.Soil:
|
||
|
|
till()
|
||
|
|
plant(Entities.Pumpkin)
|
||
|
|
if get_water() < config.waterpercent:
|
||
|
|
use_item(Items.Water)
|
||
|
|
move(North)
|
||
|
|
move(East)
|
||
|
|
if dead == 0:
|
||
|
|
for a in range(get_pos_x()):
|
||
|
|
move(West)
|
||
|
|
for b in range(get_pos_y()):
|
||
|
|
move(South)
|
||
|
|
harvest()
|
||
|
|
break
|