Advertisement
Kovitikus

Inhand Command

Dec 30th, 2019
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.31 KB | None | 0 0
  1. class CmdInhand(Command):
  2.     key = 'inhand'
  3.     aliases = 'inh'
  4.    
  5.     def func(self):
  6.         caller = self.caller
  7.  
  8.         left_wield, right_wield, both_wield  = caller.db.wielding.values()
  9.  
  10.         left_hand, right_hand = caller.db.hands.values()
  11.  
  12.         if left_hand:
  13.             left_item = left_hand.name
  14.         else:
  15.             left_item = 'nothing'
  16.  
  17.         if right_hand:
  18.             right_item = right_hand.name
  19.         else:
  20.             right_item = 'nothing'
  21.  
  22.         if not left_hand and not right_hand:
  23.             caller.msg(f"Your hands are empty.")
  24.             return
  25.        
  26.        
  27.         if left_wield and not right_wield:
  28.             caller.msg(f"You are wielding {left_item} in your left hand and holding {right_item} in your right hand.")
  29.         elif right_wield and not left_wield:
  30.             caller.msg(f"You are holding {left_item} in your left hand and wielding {right_item} in your right hand.")
  31.         elif left_wield and right_wield:
  32.             caller.msg(f"You are wielding {left_item} in your left hand and {right_item} in your right hand.")
  33.         elif both_wield:
  34.             caller.msg(f"You are wielding {right_item} in both hands.")
  35.         else:
  36.             caller.msg(f"You are holding {left_item} in your left hand and {right_item} in your right hand.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement