|
|
|
@ -403,6 +403,7 @@ class GatherWoodStates: |
|
|
|
|
print('Unable to get to tree', self.tree) |
|
|
|
|
if self.tree not in self.good_trees: |
|
|
|
|
self.bad_trees.append(self.tree) |
|
|
|
|
print('Added to bad trees list') |
|
|
|
|
self.state = self.cleanup |
|
|
|
|
return |
|
|
|
|
|
|
|
|
@ -507,7 +508,6 @@ class GatherWoodStates: |
|
|
|
|
# never gets ran, placeholder |
|
|
|
|
return None |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, global_state): |
|
|
|
|
self.g = global_state |
|
|
|
|
self.state = self.idle |
|
|
|
@ -1288,19 +1288,23 @@ class ClearLeavesStates: |
|
|
|
|
return None |
|
|
|
|
|
|
|
|
|
def init(self): |
|
|
|
|
if self.g.chopped_tree: |
|
|
|
|
sapling_type = self.g.chopped_tree + '_sapling' |
|
|
|
|
sapling_item = items.get_id(sapling_type) |
|
|
|
|
num_saplings = self.g.game.count_items([sapling_item]) |
|
|
|
|
print('Have', num_saplings, sapling_type, 'in inventory') |
|
|
|
|
|
|
|
|
|
if num_saplings > 8: |
|
|
|
|
print('Aborting clearing leaves') |
|
|
|
|
self.state = self.cleanup |
|
|
|
|
return |
|
|
|
|
if not self.g.chopped_tree: |
|
|
|
|
print('Didnt chop tree, clearing leaves') |
|
|
|
|
self.state = self.cleanup |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
sapling_type = self.g.chopped_tree + '_sapling' |
|
|
|
|
sapling_item = items.get_id(sapling_type) |
|
|
|
|
num_saplings = self.g.game.count_items([sapling_item]) |
|
|
|
|
print('Have', num_saplings, sapling_type, 'in inventory') |
|
|
|
|
|
|
|
|
|
if num_saplings > 8: |
|
|
|
|
print('Have enough saplings, aborting clearing leaves') |
|
|
|
|
self.state = self.cleanup |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
self.state = self.select_log |
|
|
|
|
print('Clearing leaves...') |
|
|
|
|
self.state = self.select_log |
|
|
|
|
print('Clearing leaves...') |
|
|
|
|
|
|
|
|
|
def select_log(self): |
|
|
|
|
# select a log to avoid using tools |
|
|
|
|