moss-n-puddles/typeclasses/rooms.py
Howard Abrams 245a1bb389 Refactored code
Cleaned up flake8 warnings
2025-03-05 21:54:41 -08:00

49 lines
1.3 KiB
Python

"""
Room
Rooms are simple containers that has no location of their own.
"""
from evennia import utils
from evennia.contrib.grid.extended_room import ExtendedRoom
from django.conf import settings
# from .objects import LightSource
from .pets import Hunger
from .objects import ObjectParent
_SEARCH_AT_RESULT = utils.object_from_module(settings.SEARCH_AT_RESULT)
class Room(ObjectParent, ExtendedRoom):
"""
Rooms are like any Object, except their location is None
(which is default). They also use basetype_setup() to
add locks so they cannot be puppeted or picked up.
(to change that, use at_object_creation instead)
See mygame/typeclasses/objects.py for a list of
properties and methods available on all Objects.
"""
is_dark = False
has_weather = False
class DabblersRoom(Room):
def get_display_desc(self, looker):
fire = self.search("fire")
full_desc = self.db.initial_desc
if fire.hunger() == Hunger.RAVENOUS:
full_desc += " " + self.db.fire_out
elif fire.hunger() == Hunger.HUNGRY:
full_desc += " " + self.db.fire_dim
elif fire.hunger() == Hunger.FULL:
full_desc += " " + self.db.fire_full
else:
full_desc += " " + self.db.fire_on
full_desc += " " + self.db.final_desc
return full_desc