Add combat job with safe target filtering

This commit is contained in:
Tanner committed 2026-11-17 22:37:12 +00:00
1 parent 2ecaa9a30a
commit 1b9f973db3
12 files changed
+486 -7

No files matched your search

+8
View File
@@ -18,6 +18,7 @@ from mosfet.info import mobs
from mosfet.jobs import (
cache_items,
clear_leaves,
combat,
eat_food,
fill_blocks,
find_gapple,
@@ -35,6 +36,7 @@ from mosfet.jobs import (
for module in [
cache_items,
clear_leaves,
combat,
eat_food,
fill_blocks,
find_gapple,
@@ -263,6 +265,7 @@ class JobStates(LegacyJobStates):
"""26.3 facade for migrated gathering and farming workflows."""
def __init__(self, global_state):
self.g = global_state
self.combat_states = combat.CombatStates(global_state)
self.gather_wood_states = gather_wood.GatherWoodStates(global_state)
self.gather_crop_states = gather_crop.GatherCropStates(global_state)
self.gather_wart_states = gather_wart.GatherWartStates(global_state)
@@ -327,6 +330,9 @@ class JobStates(LegacyJobStates):
self.cache_items_states
]
def combat(self):
return [self.combat_states]
def eat(self):
return [self.eat_food_states]
@@ -354,6 +360,8 @@ class JobStates(LegacyJobStates):
self.g.yaw_target_override = None
if self.sleep_with_bed_states.state == self.sleep_with_bed_states.sleep_bed:
self.g.game.leave_bed()
self.combat_states.state = self.combat_states.idle
self.combat_states.target_id = None
self.gather_wood_states.state = self.gather_wood_states.idle
self.gather_crop_states.state = self.gather_crop_states.idle
self.gather_sand_states.state = self.gather_sand_states.idle