Renamed at_pre_destroy() to at_object_destruction() to be consistent with at_object_creation() and at_player_creation(). Added additional documentation as well.

This commit is contained in:
Greg Taylor 2009-04-17 01:43:45 +00:00
parent 4bcbfd855a
commit ee8bd34bb3
2 changed files with 9 additions and 7 deletions

View file

@ -753,7 +753,7 @@ def cmd_destroy(command):
return return
# Run any scripted things that happen before destruction. # Run any scripted things that happen before destruction.
target_obj.scriptlink.at_pre_destroy(pobject=source_object) target_obj.scriptlink.at_object_destruction(pobject=source_object)
# Notify destroyer and do the deed. # Notify destroyer and do the deed.
source_object.emit_to("You destroy %s." % target_obj.get_name()) source_object.emit_to("You destroy %s." % target_obj.get_name())

View file

@ -34,9 +34,11 @@ class EvenniaBasicObject(object):
""" """
pass pass
def at_desc(self, pobject=None): def at_object_destruction(self, pobject=None):
""" """
Perform this action when someone uses the LOOK command on the object. This is triggered when an object is about to be destroyed via
@destroy ONLY. If an object is deleted via delete(), it is assumed
that this method is to be skipped.
values: values:
* pobject: (Object) The object requesting the action. * pobject: (Object) The object requesting the action.
@ -45,9 +47,9 @@ class EvenniaBasicObject(object):
#print "SCRIPT TEST: %s looked at %s." % (pobject, self.scripted_obj) #print "SCRIPT TEST: %s looked at %s." % (pobject, self.scripted_obj)
pass pass
def at_pre_destroy(self, pobject=None): def at_desc(self, pobject=None):
""" """
Performed right before an object is destroyed. Perform this action when someone uses the LOOK command on the object.
values: values:
* pobject: (Object) The object requesting the action. * pobject: (Object) The object requesting the action.