Moved the last hard-wired emits from objects/models.py into scriptparent hooks. This allows the admin to customize this without having to mess with the engine.

Other small bugfixes, fixes to @dig to properly call creation hooks of all newly created objects (it was not setting anything before). Also fixed some of the annoying bugs around using several of the building commands that didn't properly handle spaces around the separator = symbol.
/Griatch
This commit is contained in:
Griatch 2009-09-19 15:18:42 +00:00
parent b95d45e251
commit 8fbeea99dc
5 changed files with 73 additions and 17 deletions

View file

@ -83,13 +83,35 @@ class EvenniaBasicObject(object):
"""
pass
def announce_move_from(self):
"""
Called when announcing to leave a destination.
"""
obj = self.scripted_obj
loc = obj.get_location()
if loc:
loc.emit_to_contents("%s has left." % (obj.get_name(),), exclude=self)
if loc.is_player():
loc.emit_to("%s has left your inventory." % (obj.get_name()))
def announce_move_to(self):
"""
Called when announcing one's arrival at a destination.
"""
obj = self.scripted_obj
loc = obj.get_location()
if loc:
loc.emit_to_contents("%s has arrived." % obj.get_name())
if loc.is_player():
loc.emit_to("%s is now in your inventory." % self.get_name())
def at_after_move(self):
"""
This hook is called just after the object was successfully moved.
No return values.
"""
pass
def at_drop(self, pobject):
"""
Perform this action when someone uses the DROP command on the object.