mirror of
https://github.com/evennia/evennia.git
synced 2026-03-27 18:26:32 +01:00
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:
parent
679ef8dc74
commit
94779a86a5
4 changed files with 54 additions and 14 deletions
|
|
@ -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):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue