Further fixes to the tag lockfunc as well as handling of the changes to at_look to not include calling execute_cmd(look) but to use the at_look hook. This should finally resolve #889.

This commit is contained in:
Griatch 2015-12-15 20:17:41 +01:00
parent 03d415beb1
commit c1e4b1fe07
3 changed files with 16 additions and 6 deletions

View file

@ -354,7 +354,7 @@ start
# Lock exit from view/traverse until we climbed that tree (which is
# when tutorial_climbed_tree Tag gets assigned to us).
#
@lock north = view:tag(tutorial_climbed_tree) ; traverse:tag(tutorial_climbed_tree)
@lock north = view:tag(tutorial_climbed_tree, tutorial_world) ; traverse:tag(tutorial_climbed_tree, tutorial_world)
#
@desc north =
This is a hardly visible footpath leading off through the rain-beaten
@ -364,11 +364,12 @@ start
@set north/tutorial_info =
This exit is locked with a lock string that looks like this:
view:tag(tutorial_climbed_tree) ; traverse:tag(tutorial_climbed_tree)
view:tag(tutorial_climbed_tree, tutorial_world) ; traverse:tag(tutorial_climbed_tree, tutorial_world)
This checks if Character has a Tag tutorial_climbed_tree set before it
allows itself to be displayed. This Tag is set by the tree object when
the 'climb' command is used.
This checks if Character has a Tag named "tutorial_climbed_tree" and
of the category "tutorial_world" set before it allows itself to be
displayed. This Tag is set by the tree object when the 'climb' command
is used.
#
# Now that the exit is prepared, move to outside inn to continue building.
#

View file

@ -627,6 +627,12 @@ class BridgeRoom(WeatherRoom):
self.db.fall_exit = "cliffledge"
# add the cmdset on the room.
self.cmdset.add_default(BridgeCmdSet)
# since the default Character's at_look() will access the room's
# return_description (this skips the cmdset) when
# first entering it, we need to explicitly turn off the room
# as a normal view target - once inside, our own look will
# handle all return messages.
self.locks.add("view:false()")
def update_weather(self, *args, **kwargs):
"""
@ -659,6 +665,7 @@ class BridgeRoom(WeatherRoom):
else:
# if not from the east, then from the west!
character.db.tutorial_bridge_position = 0
character.execute_cmd("look")
def at_object_leave(self, character, target_location):
"""

View file

@ -474,7 +474,9 @@ def tag(accessing_obj, accessed_obj, *args, **kwargs):
"""
if hasattr(accessing_obj, "obj"):
accessing_obj = accessing_obj.obj
return accessing_obj.tags.get(*args)
tagkey = args[0] if args else None
category = args[1] if len(args) > 1 else None
return accessing_obj.tags.get(tagkey, category=category)
def objtag(accessing_obj, accessed_obj, *args, **kwargs):
"""