Want more features on Pastebin? Sign Up, it's FREE!

Character Creator!

By: jomiscli on Jan 3rd, 2013  |  syntax: Python  |  size: 14.95 KB  |  views: 45  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. # Character Creator
  2.  
  3. print("""
  4. /------------------------------------------------------------\\
  5.  
  6.        Welcome to the Character Creator!
  7.  
  8.        Please follow the instructions and
  9.        distribute your stat points the
  10.        best that you can.  Your character
  11.        needs to be strong!
  12.  
  13.        Here are the main menu options:
  14.  
  15.        1 - Allocate or restore Strength stat points
  16.        2 - Allocate or restore Health stat points
  17.        3 - Allocate or restore Wisdom stat points
  18.        4 - Allocate or restore Dexterity stat points
  19.        5 - View your current stats
  20.        6 - Exit the Character Creator!
  21.  
  22. \------------------------------------------------------------/
  23. """)
  24.  
  25. stat_pool = ["|","|","|","|","|","|","|","|","|","|",
  26.              "|","|","|","|","|","|","|","|","|","|",
  27.              "|","|","|","|","|","|","|","|","|","|"]
  28. strength = []
  29. health = []
  30. wisdom = []
  31. dexterity = []
  32. stat_pool_length = len(stat_pool)
  33. strength_length = len(strength)
  34. health_length = len(health)
  35. wisdom_length = len(wisdom)
  36. dexterity_length = len(dexterity)
  37. choice = None
  38.  
  39. while choice != "6":
  40.     choice = input("(MAIN)Please choose an option: ")
  41.    
  42.     if choice == "1":
  43.         print("""
  44. /------------------------------------------------------------\\
  45.  
  46.        What would you like to do?
  47.  
  48.        1 - Allocate stat points to Strength
  49.        2 - Restore stat points to the Stat Pool
  50.  
  51. \------------------------------------------------------------/
  52.        """)
  53.         choice_1 = input("(SUB)Please choose an option: ")
  54.  
  55.         while choice_1 != "1" and choice_1 != "2":
  56.             choice_1 = input("\n(SUB)Please choose a valid option: ")
  57.             continue
  58.  
  59.         if choice_1 == "1":
  60.  
  61.             if stat_pool_length == 0:
  62.                 print("\nYou currently have",stat_pool_length,"stat points in your Stat Pool.\n")
  63.                 print("Returned to the MAIN.\n")
  64.                 continue
  65.            
  66.             allo_strength = int(input("\n(SUB)Choose amount to allocate: "))
  67.  
  68.             while allo_strength > stat_pool_length or allo_strength < 1:
  69.                 print("\nInvalid choice.")
  70.                 print("You have",stat_pool_length,"stat points in your Stat Pool.")
  71.                 allo_strength = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  72.                 if allo_strength > stat_pool_length or allo_strength < 1:
  73.                     continue
  74.                 else:
  75.                     break
  76.  
  77.             if allo_strength > 0:
  78.                 strength = stat_pool[:allo_strength] + strength
  79.                 strength_length = len(strength)
  80.                 del stat_pool[:allo_strength]
  81.                 stat_pool_length = len(stat_pool)
  82.                 print("""
  83. /------------------------------------------------------------\\
  84.  
  85.        Your Strength has been successfully increased.
  86.  
  87. \------------------------------------------------------------/
  88.                """)
  89.  
  90.         if choice_1 == "2":
  91.  
  92.             if strength_length == 0:
  93.                 print("\nYou currently have",strength_length,"stat points in your Strength.")
  94.                 print("Returned to the MAIN.\n")
  95.                 continue
  96.                
  97.             allo_stat_pool = int(input("\n(SUB)Choose amount to allocate: "))
  98.  
  99.             while allo_stat_pool > strength_length or allo_stat_pool < 1:
  100.                 print("\nInvalid choice.")
  101.                 print("You have",strength_length,"stat points in your Strength.")
  102.                 allo_stat_pool = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  103.                 if allo_stat_pool > strength_length or allo_stat_pool < 1:
  104.                     continue
  105.                 else:
  106.                     break
  107.  
  108.             if allo_stat_pool > 0:
  109.                 stat_pool = strength[:allo_stat_pool] + stat_pool
  110.                 stat_pool_length = len(stat_pool)
  111.                 del strength[:allo_stat_pool]
  112.                 strength_length = len(strength)
  113.                 print("""
  114. /------------------------------------------------------------\\
  115.  
  116.        Your Stat Pool has been successfully restored.
  117.  
  118. \------------------------------------------------------------/
  119.                """)
  120.  
  121.     elif choice == "2":
  122.         print("""
  123. /------------------------------------------------------------\\
  124.  
  125.        What would you like to do?
  126.  
  127.        1 - Allocate stat points to Health
  128.        2 - Restore stat points to the Stat Pool
  129.  
  130. \------------------------------------------------------------/
  131.        """)
  132.         choice_1 = input("(SUB)Please choose an option: ")
  133.  
  134.         while choice_1 != "1" and choice_1 != "2":
  135.             choice_1 = input("\n(SUB)Please choose a valid option: ")
  136.             continue
  137.  
  138.         if choice_1 == "1":
  139.  
  140.             if stat_pool_length == 0:
  141.                 print("\nYou currently have",stat_pool_length,"stat points in your Stat Pool.\n")
  142.                 print("Returned to the MAIN.\n")
  143.                 continue
  144.            
  145.             allo_health = int(input("\n(SUB)Choose amount to allocate: "))
  146.  
  147.             while allo_health > stat_pool_length or allo_health < 1:
  148.                 print("\nInvalid choice.")
  149.                 print("You have",stat_pool_length,"stat points in your Stat Pool.")
  150.                 allo_health = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  151.                 if allo_health > stat_pool_length or allo_health < 1:
  152.                     continue
  153.                 else:
  154.                     break
  155.  
  156.             if allo_health > 0:
  157.                 health = stat_pool[:allo_health] + health
  158.                 health_length = len(health)
  159.                 del stat_pool[:allo_health]
  160.                 stat_pool_length = len(stat_pool)
  161.                 print("""
  162. /------------------------------------------------------------\\
  163.  
  164.        Your Health has been successfully increased.
  165.  
  166. \------------------------------------------------------------/
  167.                """)
  168.  
  169.         if choice_1 == "2":
  170.  
  171.             if health_length == 0:
  172.                 print("\nYou currently have",health_length,"stat points in your Health.")
  173.                 print("Returned to the MAIN.\n")
  174.                 continue
  175.                
  176.             allo_stat_pool = int(input("\n(SUB)Choose amount to allocate: "))
  177.  
  178.             while allo_stat_pool > health_length or allo_stat_pool < 1:
  179.                 print("\nInvalid choice.")
  180.                 print("You have",health_length,"stat points in your Health.")
  181.                 allo_stat_pool = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  182.                 if allo_stat_pool > health_length or allo_stat_pool < 1:
  183.                     continue
  184.                 else:
  185.                     break
  186.  
  187.             if allo_stat_pool > 0:
  188.                 stat_pool = health[:allo_stat_pool] + stat_pool
  189.                 stat_pool_length = len(stat_pool)
  190.                 del health[:allo_stat_pool]
  191.                 health_length = len(health)
  192.                 print("""
  193. /------------------------------------------------------------\\
  194.  
  195.        Your Stat Pool has been successfully restored.
  196.  
  197. \------------------------------------------------------------/
  198.                """)
  199.  
  200.     elif choice == "3":
  201.         print("""
  202. /------------------------------------------------------------\\
  203.  
  204.        What would you like to do?
  205.  
  206.        1 - Allocate stat points to Wisdom
  207.        2 - Restore stat points to the Stat Pool
  208.  
  209. \------------------------------------------------------------/
  210.        """)
  211.         choice_1 = input("(SUB)Please choose an option: ")
  212.  
  213.         while choice_1 != "1" and choice_1 != "2":
  214.             choice_1 = input("\n(SUB)Please choose a valid option: ")
  215.             continue
  216.  
  217.         if choice_1 == "1":
  218.  
  219.             if stat_pool_length == 0:
  220.                 print("\nYou currently have",stat_pool_length,"stat points in your Stat Pool.\n")
  221.                 print("Returned to the MAIN.\n")
  222.                 continue
  223.            
  224.             allo_wisdom = int(input("\n(SUB)Choose amount to allocate: "))
  225.  
  226.             while allo_wisdom > stat_pool_length or allo_wisdom < 1:
  227.                 print("\nInvalid choice.")
  228.                 print("You have",stat_pool_length,"stat points in your Stat Pool.")
  229.                 allo_wisdom = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  230.                 if allo_wisdom > stat_pool_length or allo_wisdom < 1:
  231.                     continue
  232.                 else:
  233.                     break
  234.  
  235.             if allo_wisdom > 0:
  236.                 wisdom = stat_pool[:allo_wisdom] + wisdom
  237.                 wisdom_length = len(wisdom)
  238.                 del stat_pool[:allo_wisdom]
  239.                 stat_pool_length = len(stat_pool)
  240.                 print("""
  241. /------------------------------------------------------------\\
  242.  
  243.        Your Wisdom has been successfully increased.
  244.  
  245. \------------------------------------------------------------/
  246.                """)
  247.  
  248.         if choice_1 == "2":
  249.  
  250.             if wisdom_length == 0:
  251.                 print("\nYou currently have",wisdom_length,"stat points in your Wisdom.")
  252.                 print("Returned to the MAIN.\n")
  253.                 continue
  254.                
  255.             allo_stat_pool = int(input("\n(SUB)Choose amount to allocate: "))
  256.  
  257.             while allo_stat_pool > wisdom_length or allo_stat_pool < 1:
  258.                 print("\nInvalid choice.")
  259.                 print("You have",wisdom_length,"stat points in your Wisdom.")
  260.                 allo_stat_pool = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  261.                 if allo_stat_pool > wisdom_length or allo_stat_pool < 1:
  262.                     continue
  263.                 else:
  264.                     break
  265.  
  266.             if allo_stat_pool > 0:
  267.                 stat_pool = wisdom[:allo_stat_pool] + stat_pool
  268.                 stat_pool_length = len(stat_pool)
  269.                 del wisdom[:allo_stat_pool]
  270.                 wisdom_length = len(wisdom)
  271.                 print("""
  272. /------------------------------------------------------------\\
  273.  
  274.        Your Stat Pool has been successfully restored.
  275.  
  276. \------------------------------------------------------------/
  277.                """)
  278.  
  279.     elif choice == "4":
  280.         print("""
  281. /------------------------------------------------------------\\
  282.  
  283.        What would you like to do?
  284.  
  285.        1 - Allocate stat points to Dexterity
  286.        2 - Restore stat points to the Stat Pool
  287.  
  288. \------------------------------------------------------------/
  289.        """)
  290.         choice_1 = input("(SUB)Please choose an option: ")
  291.  
  292.         while choice_1 != "1" and choice_1 != "2":
  293.             choice_1 = input("\n(SUB)Please choose a valid option: ")
  294.             continue
  295.  
  296.         if choice_1 == "1":
  297.  
  298.             if stat_pool_length == 0:
  299.                 print("\nYou currently have",stat_pool_length,"stat points in your Stat Pool.\n")
  300.                 print("Returned to the MAIN.\n")
  301.                 continue
  302.            
  303.             allo_dexterity = int(input("\n(SUB)Choose amount to allocate: "))
  304.  
  305.             while allo_dexterity > stat_pool_length or allo_dexterity < 1:
  306.                 print("\nInvalid choice.")
  307.                 print("You have",stat_pool_length,"stat points in your Stat Pool.")
  308.                 allo_dexterity = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  309.                 if allo_dexterity > stat_pool_length or allo_dexterity < 1:
  310.                     continue
  311.                 else:
  312.                     break
  313.  
  314.             if allo_dexterity > 0:
  315.                 dexterity = stat_pool[:allo_dexterity] + dexterity
  316.                 dexterity_length = len(dexterity)
  317.                 del stat_pool[:allo_dexterity]
  318.                 stat_pool_length = len(stat_pool)
  319.                 print("""
  320. /------------------------------------------------------------\\
  321.  
  322.        Your Dexterity has been successfully increased.
  323.  
  324. \------------------------------------------------------------/
  325.                """)
  326.  
  327.         if choice_1 == "2":
  328.  
  329.             if dexterity_length == 0:
  330.                 print("\nYou currently have",dexterity_length,"stat points in your Dexterity.")
  331.                 print("Returned to the MAIN.\n")
  332.                 continue
  333.                
  334.             allo_stat_pool = int(input("\n(SUB)Choose amount to allocate: "))
  335.  
  336.             while allo_stat_pool > dexterity_length or allo_stat_pool < 1:
  337.                 print("\nInvalid choice.")
  338.                 print("You have",dexterity_length,"stat points in your Dexterity.")
  339.                 allo_stat_pool = int(input("\n(SUB)Please choose a valid amount to allocate: "))
  340.                 if allo_stat_pool > dexterity_length or allo_stat_pool < 1:
  341.                     continue
  342.                 else:
  343.                     break
  344.  
  345.             if allo_stat_pool > 0:
  346.                 stat_pool = dexterity[:allo_stat_pool] + stat_pool
  347.                 stat_pool_length = len(stat_pool)
  348.                 del dexterity[:allo_stat_pool]
  349.                 dexterity_length = len(dexterity)
  350.                 print("""
  351. /------------------------------------------------------------\\
  352.  
  353.        Your Stat Pool has been successfully restored.
  354.  
  355. \------------------------------------------------------------/
  356.                """)
  357.  
  358.     elif choice == "5":
  359.         print("""
  360. /------------------------------------------------------------\\
  361.        """)
  362.         print("\tYou have",stat_pool_length,"stat points left in your")
  363.         print("\tStat Pool to distribute.")
  364.         print("\tHere are your stats:\n")
  365.  
  366.         if stat_pool_length == 0:
  367.             print("\t[ STAT POOL -","EMPTY","]\n")
  368.         if stat_pool_length > 0:
  369.             print("\t[ STAT POOL -","".join(stat_pool),"]\n")
  370.  
  371.         if strength_length == 0:
  372.             print("\t[ STRENGTH  -","EMPTY","]")
  373.         if strength_length > 0:
  374.             print("\t[ STRENGTH  -","".join(strength),"]")
  375.  
  376.         if health_length == 0:
  377.             print("\t[ HEALTH    -","EMPTY","]")
  378.         if health_length > 0:
  379.             print("\t[ HEALTH    -","".join(health),"]")
  380.  
  381.         if wisdom_length == 0:
  382.             print("\t[ WISDOM    -","EMPTY","]")
  383.         if wisdom_length > 0:
  384.             print("\t[ WISDOM    -","".join(wisdom),"]")
  385.  
  386.         if dexterity_length == 0:
  387.             print("\t[ DEXTERITY -","EMPTY","]")
  388.             print("""
  389. \------------------------------------------------------------/
  390.        """)
  391.         if dexterity_length > 0:
  392.             print("\t[ DEXTERITY -","".join(dexterity),"]")
  393.             print("""
  394. \------------------------------------------------------------/
  395.        """)
  396.  
  397.     elif choice == "6":
  398.         print("""
  399. /------------------------------------------------------------\\
  400.  
  401.        Let's hope you've allocated your stats the best
  402.        way possible!  Good luck out there!
  403.  
  404. \------------------------------------------------------------/
  405.        """)
  406.        
  407.     else:
  408.         print("\nThat is not a valid option.\n")
  409.  
  410. input("\nPlease press ENTER to exit.")
clone this paste RAW Paste Data