Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # In Game Result
- """
- ------------------------------------------------------------------------------
- Name/key: a dimly lit hallway (#195)
- Typeclass: Room (typeclasses.rooms.Room)
- Location: None
- Home: Limbo (#2)
- Permissions: <None>
- Locks: call:true(); control:id(44) or perm(Admin); delete:id(44) or
- perm(Admin); edit:id(44) or perm(Admin); examine:perm(Builder);
- get:false(); puppet:false(); tell:perm(Admin); view:all()
- Exits: south(#197), west(#213)
- Characters: Tester(#6), Bob(#44)
- ------------------------------------------------------------------------------
- a dimly lit hallway updated its existing typeclass (typeclasses.rooms.Room).
- Only the at_object_creation hook was run (update mode). Attributes set before swap were not removed.
- ------------------------------------------------------------------------------
- Name/key: a dimly lit hallway (#195)
- Typeclass: Room (typeclasses.rooms.Room)
- Location: None
- Home: Limbo (#2)
- Permissions: <None>
- Locks: call:true(); control:id(44) or perm(Admin); delete:id(44) or
- perm(Admin); edit:id(44) or perm(Admin); examine:perm(Builder);
- get:false(); puppet:false(); tell:perm(Admin); view:all()
- Persistent attributes:
- short_desc = |rShort Description Not Set!|n
- crowd = False
- Exits: south(#197), west(#213)
- Characters: Tester(#6), Bob(#44)
- ------------------------------------------------------------------------------
- Modified attribute a dimly lit hallway/crowd = True
- You see a dimly lit hallway(#195).
- You see Hoff's Bar to the south(#197), and a door to the west(#213).
- Tester(#6) is here.
- You look over the crowd and spot a merchant, a priest, a soldier, a prostitute and a fisherman.
- """
- class CmdLook(Command):
- """
- look at location or object
- Usage:
- look
- look <obj>
- look *<account>
- Observes your location or objects in your vicinity.
- """
- key = "look"
- aliases = ["l", "ls"]
- locks = "cmd:all()"
- def func(self):
- """
- Handle the looking.
- """
- caller = self.caller
- if not self.args:
- target = caller.location
- if not target:
- caller.msg("You have no location to look at!")
- return
- else:
- args = self.args.strip()
- if args == 'crowd':
- self.caller.location.crowd(self.caller)
- return
- else:
- target = caller.search(args, location=[caller, caller.location])
- if not target:
- return
- self.msg((caller.at_look(target), {'type': 'look'}), options=None)
- class Room(DefaultRoom):
- """
- Rooms are like any Object, except their location is None
- (which is default). They also use basetype_setup() to
- add locks so they cannot be puppeted or picked up.
- (to change that, use at_object_creation instead)
- See examples/object.py for a list of
- properties and methods available on all Objects.
- """
- def at_object_creation(self):
- if not self.attributes.has('short_desc'):
- self.attributes.add('short_desc', '|rShort Description Not Set!|n')
- if not self.attributes.has('crowd'):
- self.attributes.add('crowd', False)
- def crowd(self, looker):
- people = ['a merchant', 'a priest', 'a soldier', 'a prostitute', 'a fisherman']
- if self.db.crowd:
- looker.msg(f"You look over the crowd and spot {list_to_string(people)}.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement