Posted By

jacobaa1031 on 10/17/12


Tagged


Versions (?)

rpg v0.0.7b


 / Published in: Python
 

hi

  1. #RPG
  2. rpg = True
  3. hp = {'whp' : 100, 'mahp' : 100, 'hhp' : 100, 'MHP' : 10}
  4. whp = 100
  5. mahp = 100
  6. hhp = 100
  7. MHP = 10
  8.  
  9. def dgrnd () :
  10. wa = raw_input ("What does Warrior do?")
  11. ma = raw_input ("What does Mage do?")
  12. ha = raw_input ("What does Healer do?")
  13. if wa == "flame slash" :
  14. print ("Warrior uses Flame Slash!")
  15. hp['MHP']-=20
  16. elif wa == "Dragon Slash" and M == "Dragon" :
  17. print ("Warrior used Dragon Slash!")
  18. hp['MHP']-=80
  19. if wa == "Dragon" and M == "Troll" or M == "Goblin" :
  20. print ("Warrior's attack did no damage!")
  21. if ma == "icicle drop" :
  22. print ("Mage used Icicle Drop")
  23. hp['MHP']-=15
  24. hp['mahp']-=10
  25. hp['whp']-=10
  26. hp['hhp']-=10
  27. if ma == "flames of heck" :
  28. hp['MHP']-=75
  29. hp['mahp']-=50
  30. hp['whp']-=50
  31. hp['hhp']-=50
  32. if ha == "heal warrior" :
  33. print ("Healer Heals Warrior!")
  34. hp['whp']+=20
  35. if ha == "heal mage" :
  36. print ("Healer Heals Mage!")
  37. hp['mahp']+=20
  38. if ha == "heal healer" :
  39. print ("Healer Heals Healer!")
  40. hp['hhp']+=20
  41. if ha == "attack" :
  42. print ("Healer Attacks!")
  43. hp['MHP']-=5
  44. print (M+"attacks!")
  45. if M == "dragon" :
  46. hp['whp']-=40
  47. hp['mahp']-=40
  48. hp['hhp']-=40
  49. if M == "Troll" :
  50. hp['whp']-=30
  51. hp['mahp']-=30
  52. hp['hhp']-=30
  53. if M == "Goblin" :
  54. hp['whp']-=20
  55. hp['mahp']-=20
  56. hp['hhp']-=20
  57. print ("Warrior has %d HP left, Mage has %d HP left, and Healer has %d HP left!" %(whp, mahp, hhp))
  58. if MHP == 0 :
  59. print ("You defeated the "+M+" !")
  60. print ("That is all I have built so far. Eventually, there will be more!")
  61. print ("Thank You for Playing!!")
  62. dgrnd ()
  63.  
  64. if rpg == True :
  65. print ("This mode is not yet complete. It only contains a dungeon so far. I'm still working on the rest.")
  66. #Dungeon
  67. hp = {'whp' : 100, 'mahp' : 100, 'hhp' : 100, 'MHP' : 10}
  68. whp = 100
  69. mahp = 100
  70. hhp = 100
  71. MHP = 10
  72. M = "fail"
  73. print ("You enter the dungeon")
  74. rm = raw_input ("There are three passages. Do you take the first one, the second one, or the third one?")
  75. if rm == 'one' :
  76. M = 'Troll'
  77. MHP = 80
  78. print ("A "+M+" appears!")
  79. if rm == 'two' :
  80. M = 'Goblin'
  81. MHP = 35
  82. print ("A "+M+" appears!")
  83. if rm == 'three' :
  84. M = 'Dragon'
  85. MHP = 120
  86. print ("A "+M+" appears!")
  87.  
  88. while MHP > 0 :
  89. dgrnd ()

Report this snippet  

You need to login to post a comment.