uccjshrimpton

Dungeon Cleaner WIP

Mar 7th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 12.70 KB | None | 0 0
  1. #ASCII Text from http://patorjk.com/software/taag/#p=display&f=Doom&t=Type%20Something%20
  2.  
  3. def Clear():
  4.     for i in range(25):
  5.         print("\n")
  6.  
  7. def TitleText():
  8.     print("""
  9. ______                                      _____ _                            
  10. |  _  \                                   /  __ \ |                          
  11. | | | |_   _ _ __   __ _  ___  ___  _ __   | /  \/ | ___  __ _ _ __   ___ _ __
  12. | | | | | | | '_ \ / _` |/ _ \/ _ \| '_ \ | |   | |/ _ \/ _` | '_ \ / _ \ '__|
  13. | |/ /| |_| | | | | (_| |  __/ (_) | | | | | \__/\ |  __/ (_| | | | |  __/ |  
  14. |___/  \__,_|_| |_|\__, |\___|\___/|_| |_|  \____/_|\___|\__,_|_| |_|\___|_|  
  15.                    __/ |                                                      
  16.                   |___/                                                      
  17.    """)
  18.  
  19. def FightText():
  20.     print("""
  21. ______ _       _     _  
  22. |  ___(_)     | |   | |  
  23. | |_   _  __ _| |__ | |_
  24. |  _| | |/ _` | '_ \| __|
  25. | |   | | (_| | | | | |_
  26. \_|   |_|\__, |_| |_|\__|
  27.          __/ |          
  28.         |___/          
  29.    """)
  30.  
  31. def LevelUpText():
  32.     print("""
  33. _                    _   _   _      
  34. | |                  | | | | | |      
  35. | |     _____   _____| | | | | |_ __  
  36. | |    / _ \ \ / / _ \ | | | | | '_ \
  37. | |___|  __/\ V /  __/ | | |_| | |_) |
  38. \_____/\___| \_/ \___|_|  \___/| .__/
  39.                               | |    
  40.                               |_|    
  41.    """)
  42.    
  43.  
  44. def HitText():
  45.     print("""
  46. _   _ _ _  
  47. | | | (_) |  
  48. | |_| |_| |_
  49. |  _  | | __|
  50. | | | | | |_
  51. \_| |_/_|\__|                          
  52.    """)
  53.  
  54. def VictoryText():
  55.     print("""
  56. _   _ _      _                  
  57. | | | (_)    | |                  
  58. | | | |_  ___| |_ ___  _ __ _   _
  59. | | | | |/ __| __/ _ \| '__| | | |
  60. \ \_/ / | (__| || (_) | |  | |_| |
  61. \___/|_|\___|\__\___/|_|   \__, |
  62.                             __/ |
  63.                            |___/
  64.    """)
  65.  
  66. def DefeatText():
  67.     print("""
  68. ______      __           _  
  69. |  _  \   / _|         | |  
  70. | | | |___| |_ ___  __ _| |_
  71. | | | / _ \ _/ _ \/ _` | __|
  72. | |/ /  __/ ||  __/ (_| | |_
  73. |___/ \___|_| \___|\__,_|\__|                                                          
  74.    """)
  75.  
  76. def RandomFoe(level):
  77.     species = ["Swiper","Chickadee","Juan-juan","Bhatman","Zongoloid","Dangleflange","Dipppydock","Frangipan"]
  78.     gender = ["Male","Female","Unknown"]
  79.     attack = randint(40,100)
  80.     defence = randint(25,40)
  81.     hp = randint(80,100)
  82.     if level >= 3:
  83.         attack *= 3
  84.         defence *= 3
  85.         hp *= 3
  86.     elif level >= 2:
  87.         attack *= 2
  88.         defence *= 2
  89.         hp *= 3
  90.     return (choice(species),choice(gender),attack,defence,hp,level)
  91.        
  92. def Introduction():
  93.     print("Welcome to Dungeon Cleaner. I am the great wizard Evignon.")
  94.     sleep(2)
  95.     print("Your people have chosen you to help rid our dungeon of this plague of feral beasts.")
  96.     sleep(4)
  97.     print("\nAre you prepared to fulfil your people's desire?")
  98.     sleep(4)
  99.     print("(Y)es! Are you kidding? Of course I am... HUZZAH!")
  100.     print("(N)ay, you derange old man.")
  101.     start = input()
  102.  
  103.    
  104.     if (start.upper() != "Y") and (start.upper() != "N"):
  105.         while (start.upper() != "Y") and (start.upper() != "N"):
  106.             sleep(2)
  107.             print("My dear warrior, you have yet to tell me how you wish to proceed.")
  108.             sleep(2)
  109.             print("\nAre you prepared to fulfil your people's desire?")
  110.             sleep(2)
  111.             print("(Y)es! Are you kidding? Of course I am... HUZZAH!")
  112.             print("(N)ay, you derange old man.")
  113.             start = input()
  114.  
  115.            
  116.     if start.upper() == "N":
  117.         sleep(1)
  118.         print("We are terribly sorry that you have chosen not to help us. May that Gods have mercy on your cowardly soul.")
  119.         sleep(4)
  120.         quit()
  121.  
  122.     sleep(2)
  123.     print("We are in your debt soldier, many thanks.\n")
  124.     player = CharacterCreator()
  125.     return player
  126.  
  127. def CharacterCreator():
  128.     schools = ["Fighter","Magician","Bandit"]
  129.    
  130.     player = {"Level":1,"Experience":0,"Fightstyle":choice(schools),"Name":NameCreator(),"Health":100,"Attack":randint(50,80),"Defence":randint(25,50)}
  131.  
  132.     print("\nSuperb. It is important you know that now you find yourself in Borrower's Down, you will need a new name to suit.")
  133.     sleep(4)
  134.     print("Based on what you've told me, I feel a more appropriate name would be "+player["Name"]+".")
  135.     sleep(4)
  136.     print("\nUsing my Eye of Kil'rogg I have assessed that you posses the following attributes:\n")
  137.     sleep(4)
  138.     print("-------------------------------------------------")
  139.     print("Player's stat breakdown:")
  140.     print("Level:        "+str(player["Level"]))
  141.     print("Experience:   "+str(player["Experience"]))
  142.     print("Name:         "+player["Name"])
  143.     print("Fight Style:  "+player["Fightstyle"])
  144.     print("Hit Points:   "+str(player["Health"]))
  145.     print("Attack:       "+str(player["Attack"]))
  146.     print("Defence:      "+str(player["Defence"]))
  147.     print("-------------------------------------------------")
  148.     return player
  149.    
  150.  
  151. def NameCreator():
  152.     sleep(4)
  153.     print("Before we go any further, it's important that we know your name.\n")
  154.     sleep(4)
  155.     print("We ask that you kindly share with us the names that people from your realm know you as.")
  156.     sleep(4)
  157.     firstname = input("What is your first name?\n")
  158.     sleep(2)
  159.     while firstname.isalpha() == False:
  160.         firstname = input("Apologies, your name can only contain characters")
  161.         sleep(2)
  162.     lastname = input("Well met. And what is your last name?\n")
  163.     sleep(2)
  164.     while lastname.isalpha() == False:
  165.         firstname = input("Apologies, your name can only contain characters")
  166.         sleep(2)
  167.  
  168.     padding = ["oot","car","ow","eed","an","un","am","ob"]
  169.     prefixes = ["El'","La'","Los'","De'","Mc'","Sir ","Duke ","Captain ","King ","Lorde ","Champion ","Disgraceful Peasant ","Servant of GabeN ","Servant ","Magic "]
  170.     suffixes = [" Baggins"," of the Great County of Shropshire"," Son of Something"," Son of Mother"," Dovakiinh"]
  171.  
  172.     firstname = (firstname[1:]+firstname[:2]).lower()
  173.     firstname = firstname[0].upper()+firstname[2:]
  174.     lastname = lastname[::-1].lower()
  175.     lastname = lastname[0].upper()+firstname[3:].lower()+lastname[4:]
  176.     if len(lastname) < 5:
  177.         lastname += choice(padding)
  178.     if len(firstname) < 5:
  179.         firstname += choice(padding)
  180.     return (choice(prefixes)+firstname+" "+lastname+choice(suffixes))
  181.  
  182. def Battle(foelevel,player):
  183.         Clear()
  184.         FightText()
  185.         sleep(1)
  186.         stats = RandomFoe(foelevel)
  187.         Foe = {"Level":stats[5],"Species":stats[0],"Gender":stats[1],"Attack":stats[2],"Defence":stats[3],"Hit Points":stats[4]}
  188.         print("A wild "+Foe["Species"]+" appears from the darkness.\n")
  189.         sleep(1)
  190.        
  191.         print("-------------------------------------------------")
  192.         print("Foe's stat breakdown:")
  193.         sleep(3)
  194.         print("Level:        "+str(Foe["Level"]))
  195.         print("Species:      "+Foe["Species"])
  196.         print("Gender:       "+Foe["Gender"])
  197.         print("Attack:       "+str(Foe["Attack"]))
  198.         print("Defence:      "+str(Foe["Defence"]))
  199.         print("Hit Points:   "+str(Foe["Hit Points"]))
  200.         print("-------------------------------------------------\n")
  201.         sleep(3)
  202.        
  203.         print("-------------------------------------------------")
  204.         print("Player's stat breakdown:")
  205.         print("Level:        "+str(player["Level"]))
  206.         print("Experience:   "+str(player["Experience"]))
  207.         print("Name:         "+player["Name"])
  208.         print("Fight Style:  "+player["Fightstyle"])
  209.         print("Hit Points:   "+str(player["Health"]))
  210.         print("Attack:       "+str(player["Attack"]))
  211.         print("Defence:      "+str(player["Defence"]))
  212.         print("-------------------------------------------------")
  213.         sleep(3)
  214.  
  215.         while player["Health"] > 0 and Foe["Hit Points"] > 0:
  216.             print("What will you do?")
  217.             print("-(A)ttack")
  218.             print("-(R)un")
  219.             move = input()
  220.             sleep(2)
  221.  
  222.             while move.upper() != "A" and move.upper() != "R":
  223.                 print("You cannot do that.\n")
  224.                 sleep(2)
  225.                 print("What will you do?")
  226.                 print("-(A)ttack")
  227.                 print("-(R)un")
  228.                 move = input()
  229.                 sleep(2)
  230.  
  231.             if move.upper() ==  "A":
  232.                 if player["Health"] > 0:
  233.                     print("You attack "+Foe["Species"]+("."))
  234.                     sleep(1)
  235.                     print("You have "+str(player["Attack"])+" attack points.")
  236.                     sleep(1)
  237.                     print(Foe["Species"]+" has "+str(Foe["Defence"])+" defence points.")
  238.                     sleep(1)
  239.                     HitText()
  240.                     print("You hit for "+str(player["Attack"]-Foe["Defence"])+".")
  241.                     sleep(1)
  242.                     Foe["Hit Points"] -= (player["Attack"]-Foe["Defence"])
  243.                    
  244.                     if Foe["Hit Points"] > 0:
  245.                         print("-------------------------------------------------")
  246.                         print("Foe's stat breakdown:")
  247.                         sleep(3)
  248.                         print("Level:        "+str(Foe["Level"]))
  249.                         print("Species:      "+Foe["Species"])
  250.                         print("Gender:       "+Foe["Gender"])
  251.                         print("Attack:       "+str(Foe["Attack"]))
  252.                         print("Defence:      "+str(Foe["Defence"]))
  253.                         print("Hit Points:   "+str(Foe["Hit Points"]))
  254.                         print("-------------------------------------------------\n")
  255.                         sleep(4)
  256.                     else:
  257.                         VictoryText()
  258.                         print("This is a work in progress, something will happen here later.")
  259.                         sleep(10)
  260.  
  261.                 if Foe["Hit Points"] > 0:
  262.                     print(Foe["Species"]+" attacks you.")
  263.                     sleep(1)
  264.                     print(Foe["Species"]+" has "+str(Foe["Attack"])+" attack points.")
  265.                     sleep(1)
  266.                     print("You have "+str(player["Defence"])+" defence points.")
  267.                     sleep(1)
  268.                     HitText()
  269.                     print(Foe["Species"]+" hits you for "+str(Foe["Attack"]-player["Defence"])+".")
  270.                     sleep(1)
  271.                     player["Health"] -= (Foe["Attack"]-player["Defence"])
  272.                    
  273.                     if player["Health"] > 0:
  274.                         print("-------------------------------------------------")
  275.                         print("Player's stat breakdown:")
  276.                         print("Level:        "+str(player["Level"]))
  277.                         print("Experience:   "+str(player["Experience"]))
  278.                         print("Name:         "+player["Name"])
  279.                         print("Fight Style:  "+player["Fightstyle"])
  280.                         print("Hit Points:   "+str(player["Health"]))
  281.                         print("Attack:       "+str(player["Attack"]))
  282.                         print("Defence:      "+str(player["Defence"]))
  283.                         print("-------------------------------------------------")
  284.                         sleep(4)
  285.                     else:
  286.                         DefeatText()
  287.                         print("This is a work in progress, something will happen here later.")
  288.                         sleep(10)
  289.  
  290.             elif move.upper() == "R":
  291.                 sleep(2)
  292.                 DefeatText()
  293.                 print("You flee from battle, afraid for your life")
  294.                 sleep(4)
  295.                 quit()
  296.                
  297.             Clear()
  298.  
  299. def Quest():
  300.     TitleText()
  301.     sleep(1)
  302.  
  303.     player = Introduction()
  304.     sleep(4)
  305.     print("\nIt's now time for you to begin the cleansing. Make your way down the stairs to your left to get started.")
  306.     sleep(4)
  307.     print("\nYou begin to make your way downstairs...")
  308.     sleep(2)
  309.     for i in range(3):
  310.         print("Step...")
  311.         sleep(1)
  312.         print("...")
  313.         sleep(1)
  314.         Clear()
  315.     print("You find yourself in the first room of the dark and dingy stone dungeon.")
  316.     sleep(2)
  317.     print("You sense that you are not alone. You can hear clattering and smell warm, wet fur.")
  318.     sleep(4)
  319.     print("Suddenly there is a sharp sound, something is running your way...")
  320.     sleep(4)
  321.    
  322.     for i in range(4):
  323.         Battle(1,player)
  324.        
  325.        
  326. from random import choice
  327. from time import sleep
  328. from random import randint
  329.  
  330.    
  331. Quest()
Advertisement
Add Comment
Please, Sign In to add comment