def auto_attack(self): if self.current_target: if self.current_target.env == self.env: basic_hit(self, self.current_target) else: self.current_target = None self.unregister(self.combat_pulse)
def kill(source, target, target_method, **ignored): if source == target: source.display_line("You cannot kill yourself. This is a happy place.") return source.rec_violence(target) target_method(source) basic_hit(source, target)
def mob_attack(self): if self.current_target.env == self.env: self.env.rec_broadcast(basic_hit(self, self.current_target)) else: self.target_memory -= 1 if self.target_memory <= 0: self.unregister(self.combat_pulse) self.current_target = None