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

34 lines
1 KiB
Python

"""
Exits
Exits are connectors between Rooms. An exit always has a destination property
set and has a single command defined on itself with the same name as its key,
for allowing Characters to traverse the exit to its destination.
"""
from evennia.objects.objects import DefaultExit
from .objects import ObjectParent
from commands.misc import CmdSetKnock
class Exit(ObjectParent, DefaultExit):
"""
Exits are connectors between rooms. Exits are normal Objects except
they defines the `destination` property and overrides some hooks
and methods to represent the exits.
See mygame/typeclasses/objects.py for a list of
properties and methods available on all Objects child classes like this.
"""
def at_traverse(self, traveler, destination):
pre_check = traveler.at_pre_move(destination)
if pre_check:
if self.db.traverse_msg:
traveler.msg(f"\n{self.db.traverse_msg}\n")
return super().at_traverse(traveler, destination)
else:
return False