Fixed bug in dark room. The mob currently has issues accepting exit locks
This commit is contained in:
parent
56104d9a1d
commit
4e11b2b5b5
3 changed files with 2 additions and 6 deletions
|
|
@ -301,14 +301,9 @@ class Mob(tut_objects.TutorialObject):
|
||||||
# no target found, look for an exit.
|
# no target found, look for an exit.
|
||||||
exits = [exi for exi in self.location.exits
|
exits = [exi for exi in self.location.exits
|
||||||
if exi.access(self, "traverse")]
|
if exi.access(self, "traverse")]
|
||||||
last_location = self.ndb.last_location
|
|
||||||
if exits:
|
if exits:
|
||||||
# randomly pick an exit
|
# randomly pick an exit
|
||||||
exit = random.choice(self.location.exits)
|
exit = random.choice(self.location.exits)
|
||||||
if len(exits) > 1 and exit.destination == last_location:
|
|
||||||
# don't go back the same way we came if we
|
|
||||||
# can avoid it.
|
|
||||||
return
|
|
||||||
# move there.
|
# move there.
|
||||||
self.move_to(exit.destination)
|
self.move_to(exit.destination)
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
|
|
@ -473,7 +473,7 @@ class DarkRoom(TutorialRoom):
|
||||||
self.db.tutorial_info = "This is a room with custom command sets on itself."
|
self.db.tutorial_info = "This is a room with custom command sets on itself."
|
||||||
# the room starts dark.
|
# the room starts dark.
|
||||||
self.db.is_lit = False
|
self.db.is_lit = False
|
||||||
self.cmdsets.add(DarkCmdSet, permanent=True)
|
self.cmdset.add(DarkCmdSet, permanent=True)
|
||||||
|
|
||||||
def at_init(self):
|
def at_init(self):
|
||||||
"""
|
"""
|
||||||
|
|
|
||||||
|
|
@ -540,6 +540,7 @@ def has_player(accessing_obj, accessed_obj, *args, **kwargs):
|
||||||
This is a useful lock for traverse-locking Exits to restrain NPC
|
This is a useful lock for traverse-locking Exits to restrain NPC
|
||||||
mobiles from moving outside their areas.
|
mobiles from moving outside their areas.
|
||||||
"""
|
"""
|
||||||
|
print "lock:", accessing_obj, accessed_obj, accessing_obj.has_player
|
||||||
return hasattr(accessing_obj, "has_player") and accessing_obj.has_player
|
return hasattr(accessing_obj, "has_player") and accessing_obj.has_player
|
||||||
|
|
||||||
def serversetting(accessing_obj, accessed_obj, *args, **kwargs):
|
def serversetting(accessing_obj, accessed_obj, *args, **kwargs):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue