Advertisement
Guest User

Untitled

a guest
Nov 13th, 2013
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.38 KB | None | 0 0
  1. import time
  2. import base64
  3. invCount = 0
  4. up = False
  5. up2 = False
  6. down = False
  7. down2 = False
  8. left = False
  9. right = False
  10. left2 = False
  11. right2 = False
  12. abutton = False
  13. bbutton = False
  14.  
  15.  
  16.  
  17. inventory = []
  18. # -- PREDEF FUNCTIONS
  19.  
  20. # -- PREDEF ITEM PROPERTIES
  21. # DEFAULT
  22.  
  23.  
  24.  
  25. canConsume = False
  26. canShoot = False
  27. canEquip = False
  28. canUse = False
  29. hp1 = 100
  30. heal = 0
  31. messageUponUseNormal = "..."
  32. messageuponUseSpecial = "...!"
  33.  
  34.  
  35. # BREAD
  36. canGo = False
  37. def bread():
  38.     global canConsume, canShoot, canEquip, canUse, heal
  39.  
  40.     canConsume = True
  41.        
  42.     canShoot = False
  43.        
  44.     canEquip = True
  45.        
  46.     canUse = False
  47.  
  48.     heal = 25
  49.  
  50. # APPLE
  51. def apple():
  52.     global canConsume, canShoot, canEquip, canUse, heal
  53.     canConsume = True
  54.    
  55.     canShoot = False
  56.    
  57.     canEquip = False
  58.    
  59.     canUse = False
  60.    
  61.     heal = 15
  62.  
  63. # FLUTE
  64. def flute():
  65.     global canConsume, canShoot, canEquip, canUse
  66.     canConsume = False
  67.    
  68.     canShoot = False
  69.    
  70.     canEquip = False
  71.    
  72.     canUse = True
  73.    
  74.     messageUponUseNormal = ("You play the flute. It didn't seem to have any effect")
  75.    
  76.     messageUponUseSpecial = ("You play the flute...")
  77.      
  78.  
  79.  
  80.  
  81.  
  82. # INVENTORY MAIN
  83. def inventoryFunction():
  84.     global hp1
  85.     hp = hp1
  86.     print(inventory)
  87.     use = input("Use an item? ").lower()
  88.     if use == "yes":
  89.             which = input("Which? ").title()
  90.             for item in inventory:
  91.                     if item == which:
  92.                             isFound = True
  93.                             func = item.lower() + "()"
  94.                             print(func)
  95.                             eval(func) # load the properties of the item
  96.                             hpFunc()
  97.                             print("Do what with",item + "?")
  98.                             action = input("Action? ").lower()
  99.                             if action == "eat" or action == "drink":
  100.                                     doHeal = heal # How much it will heal -- use a seperate variable so I can abruptly change this to 0, stopping the process, without modifying the data of the item.
  101.                                     if canConsume == True:
  102.                                             for x in range(doHeal):
  103.                                                     hp += 1
  104.                                                     if hp == 150:
  105.                                                             doHeal = 0
  106.                                                     else:
  107.                                                             doNothing = True
  108.                                                     hp1 = hp
  109.                                                    
  110.                                                    
  111.                                     else:
  112.                                             print("Eww. That looks disgusting.")
  113.                             if action == "use" or action == "play":
  114.                                     if canUse == True:
  115.                                             print(messageUponUseNormal)
  116.                                     else:
  117.                                             print("What am I supposed to operate?")
  118.                                    
  119.                             print("Item found.")
  120.                            
  121.                             if isFound == True:
  122.                                     doNothing = True
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement