Fix feeding pets

This commit is contained in:
Howard Abrams 2025-04-07 23:14:13 -07:00
parent 43956fa818
commit 588ffcdab8
2 changed files with 4 additions and 38 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/env python
from evennia.utils import logger
from evennia.utils import delay, logger
"""
Object
@ -246,8 +246,8 @@ class Object(ObjectParent, DefaultObject):
def at_post_move(self, source_location, move_type="move", **kwargs):
"""
Delete ourselves if we are living in the fireplace.
Delete ourselves if we are living inside a pet.
"""
logger.log_info("Can we delete?")
super().at_post_move(source_location, move_type)
if self.location.is_typeclass("typeclasses.pets.Pet"):
self.delete()
delay(5, self.delete)

View file

@ -194,7 +194,6 @@ class Fire(Pet):
giver.msg(f"You throw {moved_obj.name} in the fireplace, destroying it.")
return True
# def at_post_move(self, source_location, move_type, **kwargs):
# ----------------------------------------------------------------------
# Friendly
@ -402,36 +401,3 @@ class Friendly(Pet):
)
self.location.msg_contents(sub("<[Yy]ou>", focus.name.title(), msg),
exclude=focus)
class Imp(Friendly):
def action(self):
# Do something based on the highest friendly level is the same area!
# Need a ticker ..
# (state, chars) = self.highest_friendly_level()
pass
def update_state(self, *args, **kwargs):
pass
class BHB(Friendly):
"The Big Hairy Beast object."
def action(self):
# Do something based on the highest friendly level is the same area!
# Need a ticker ..
# (state, chars) = self.highest_friendly_level()
pass
# - < 10 : Attempts to hide
# - < 20 : Steers clear but doesnt hide
# - < 50 : Wags it tail/butt
# - > 50 : Follows you
# level = self.friendly_level(looker)
# if level == 0:
# return f"You see a massive shadow lurking "
# if level < 10:
# return f"{self.db.desc} {self.hunger_appearance()}"
def given(self, giver, thing):
# if obj.is_typeclass("typeclasses.things.Wood"):
return True