Advertisement
Kovitikus

Untitled

Aug 18th, 2019
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.62 KB | None | 0 0
  1. class CmdUnwield(Command):
  2.     """
  3.    Unwield a weapon.
  4.    Usage: unwield
  5.    """
  6.  
  7.     key = 'unwield'
  8.  
  9.     def func(self):
  10.         caller = self.caller
  11.         wielded_obj = caller.db.wielding['obj']
  12.         wielded_hands = caller.db.wielding['hands']
  13.  
  14.         left_hand, right_hand = get_hands(caller)
  15.         obj = caller.search(wielded_obj, location=[left_hand, right_hand])
  16.  
  17.         if obj:
  18.             caller.msg(f"You stop wielding {obj.key}.")
  19.             caller.location.msg_contents(f"{caller.name} stops wielding {obj.key}.", exclude=caller)
  20.             caller.db.wielding = {'obj': None, 'hands': None}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement