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

@ -159,11 +159,16 @@ def handle(cdat):
pobject = session.get_pobject()
exit_matches = match_exits(pobject, ' '.join(parsed_input['splitted']))
if exit_matches:
exit = exit_matches[0]
if exit.get_home():
targ_exit = exit_matches[0]
if targ_exit.get_home():
cdat['uinput'] = parsed_input
pobject.move_to(exit.get_home())
session.execute_cmd("look")
# SCRIPT: See if the player can traverse the exit
if not targ_exit.get_scriptlink().default_lock(pobject):
session.msg("You can't traverse that exit.")
else:
pobject.move_to(targ_exit.get_home())
session.execute_cmd("look")
else:
session.msg("That exit leads to nowhere.")
return