33 lines
1,016 B
Python
33 lines
1,016 B
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
|
|
|
|
|
|
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\n")
|
|
return super().at_traverse(traveler, destination)
|
|
else:
|
|
return False
|