Port loiter and harden 26.3 bed updates
This commit is contained in:
+11
-1
@@ -265,7 +265,7 @@ class LegacyJobStates:
|
||||
|
||||
|
||||
class JobStates(LegacyJobStates):
|
||||
"""26.3 job facade; crop gathering is the currently migrated job."""
|
||||
"""26.3 facade for crop, inventory, sleeping, and loiter workflows."""
|
||||
def __init__(self, global_state):
|
||||
self.g = global_state
|
||||
self.gather_crop_states = gather_crop.GatherCropStates(global_state)
|
||||
@@ -273,6 +273,8 @@ class JobStates(LegacyJobStates):
|
||||
self.sleep_with_bed_states = sleep_with_bed.SleepWithBedStates(
|
||||
global_state)
|
||||
self.eat_food_states = eat_food.EatFoodStates(global_state)
|
||||
self.check_threats_states = check_threats.CheckThreatsStates(
|
||||
global_state)
|
||||
self.state = self.idle
|
||||
|
||||
def farm_crop(self):
|
||||
@@ -295,6 +297,11 @@ class JobStates(LegacyJobStates):
|
||||
self.sleep_with_bed_states.silent = False
|
||||
return [self.sleep_with_bed_states]
|
||||
|
||||
def loiter(self):
|
||||
self.sleep_with_bed_states.silent = True
|
||||
return [self.check_threats_states, self.sleep_with_bed_states,
|
||||
self.eat_food_states]
|
||||
|
||||
def stop(self):
|
||||
if self.g.get('breaking'):
|
||||
self.g.game.cancel_break()
|
||||
@@ -309,5 +316,8 @@ class JobStates(LegacyJobStates):
|
||||
self.sleep_with_bed_states.state = self.sleep_with_bed_states.idle
|
||||
self.sleep_with_bed_states.force_new_bed = False
|
||||
self.eat_food_states.state = self.eat_food_states.idle
|
||||
self.check_threats_states.state = self.check_threats_states.idle
|
||||
self.check_threats_states.safety = None
|
||||
self.check_threats_states.external_safety = False
|
||||
self.gather_crop_states.active_section_anchor = None
|
||||
self.state = self.idle
|
||||
|
||||
Reference in New Issue
Block a user