添加了一下种南瓜的时候直接铲坏南瓜的功能
This commit is contained in:
1 parent
811b2c43da
commit
1a06db7b06
1 file changed
+35
-4
+35
-4
@@ -1,8 +1,10 @@
|
|||||||
import config
|
import config
|
||||||
def Plant():
|
import tools
|
||||||
|
#def Plant():
|
||||||
|
while True:
|
||||||
dead_x = []
|
dead_x = []
|
||||||
dead_y = []
|
dead_y = []
|
||||||
for x in range(get_world_size()):
|
for x in range(get_world_size()): #第一轮种植南瓜
|
||||||
for y in range(get_world_size()):
|
for y in range(get_world_size()):
|
||||||
if get_entity_type() != None:
|
if get_entity_type() != None:
|
||||||
if can_harvest():
|
if can_harvest():
|
||||||
@@ -20,6 +22,35 @@ def Plant():
|
|||||||
plant(Entities.Pumpkin)
|
plant(Entities.Pumpkin)
|
||||||
if get_water() < config.waterpercent:
|
if get_water() < config.waterpercent:
|
||||||
use_item(Items.Water)
|
use_item(Items.Water)
|
||||||
for x in range(get_world_size()):
|
move(North)
|
||||||
|
move(East)
|
||||||
|
|
||||||
|
for x in range(get_world_size()): #第一轮检查
|
||||||
for y in range(get_world_size()):
|
for y in range(get_world_size()):
|
||||||
|
if get_entity_type() != Entities.Pumpkin:
|
||||||
|
dead_x.append(get_pos_x())
|
||||||
|
dead_y.append(get_pos_y())
|
||||||
|
#print(len(dead_x))
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Pumpkin)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
move(North)
|
||||||
|
move(East)
|
||||||
|
|
||||||
|
while len(dead_x) != 0: #多轮复查
|
||||||
|
#print("len(dead_x)=",len(dead_x))
|
||||||
|
#print(dead_x[0],dead_y[0])
|
||||||
|
tools.goto(dead_x[0],dead_y[0])
|
||||||
|
if get_entity_type() != Entities.Pumpkin:
|
||||||
|
if get_ground_type() != Grounds.Soil:
|
||||||
|
till()
|
||||||
|
plant(Entities.Pumpkin)
|
||||||
|
if get_water() < config.waterpercent:
|
||||||
|
use_item(Items.Water)
|
||||||
|
else:
|
||||||
|
dead_x.pop(0)
|
||||||
|
dead_y.pop(0)
|
||||||
|
tools.goto(0,0)
|
||||||
|
harvest()
|
||||||
Reference in new issue
Block a user