Added new SCRIPT_ROOT variable to settings.py, you'll need to copy this over from settings.py.dist if you're running a test game. We also now have rudimentary support for default, enter, and use locks per the basicobject.py file. Take a look at the example locks in there. A returned boolean value determines whether the player passes. Make sure you emit an error message within the lock if you're going to return false. We will have simple in-game attribute or dbref locks via an @lock command similar to MUX/MUSH that override scripted behaviors.

This commit is contained in:
Greg Taylor 2007-07-12 13:45:23 +00:00
parent 679ef8dc74
commit 94779a86a5
4 changed files with 54 additions and 14 deletions

View file

@ -41,6 +41,39 @@ class BasicObject:
# Un-comment the line below for an example
#print "SCRIPT TEST: %s got %s." % (actor, self.source_obj)
pass
def default_lock(self, actor):
"""
This method returns a True or False boolean value to determine whether
the actor passes the lock. This is generally used for picking up
objects or traversing exits.
actor: (Object) Reference to the person attempting an action
"""
# Assume everyone passes the default lock by default.
return True
def use_lock(self, actor):
"""
This method returns a True or False boolean value to determine whether
the actor passes the lock. This is generally used for seeing whether
a player can use an object or any of its commands.
actor: (Object) Reference to the person attempting an action
"""
# Assume everyone passes the use lock by default.
return True
def enter_lock(self, actor):
"""
This method returns a True or False boolean value to determine whether
the actor passes the lock. This is generally used for seeing whether
a player can enter another object.
actor: (Object) Reference to the person attempting an action
"""
# Assume everyone passes the enter lock by default.
return True
def class_factory(source_obj):
"""