Advertisement
Guest User

Polytopia Beginner Python Project

a guest
Jul 7th, 2024
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.67 KB | Source Code | 0 0
  1. # Easily printable list of ALL tribes and their prices
  2. tribe_list = '''(Free Human Tribes)
  3. Xin-Xi
  4. Imperius
  5. Bardur
  6. Oumaji
  7. ($1 Human Tribes)
  8. Kickoo
  9. Hoodrick
  10. Vengir
  11. Zebasi
  12. Ai-Mo
  13. Quetzali
  14. Yadakk
  15. ($2 Special Tribes)
  16. Aquarion
  17. Elyrion
  18. Polaris
  19. Cymanti
  20. ($4 Human Tribe)
  21. Luxidoor'''
  22.  
  23. # Easily printable list of FREE tribes
  24.  
  25. free_tribe_list = '''(Free Human Tribes)
  26. Xin-Xi
  27. Imperius
  28. Bardur
  29. Oumaji'''
  30.  
  31. # Easily printable list of PAID tribes and their prices
  32. paid_tribe_list = '''($1 Human Tribes)
  33. Kickoo
  34. Hoodrick
  35. Vengir
  36. Zebasi
  37. Ai-Mo
  38. Quetzali
  39. Yadakk
  40. ($2 Special Tribes)
  41. Aquarion
  42. Elyrion
  43. Polaris
  44. Cymanti
  45. ($4 Human Tribe)
  46. Luxidoor'''
  47.  
  48. # Easily printable end messages
  49. xin_xi_msg = "Cut down your enemies with Xin-Xi!"
  50. imperius_msg = 'The Imperius would love you. Fight "Defensive" wars and spread "Civilization" today!'
  51. bardur_msg = "Plunder the square with Bardur!"
  52. oumaji_msg = "Roam the endless desert with Oumaji!"
  53. kickoo_msg = "Try the Kickoo! They have so much fish!"
  54. hoodrick_msg = "Pelt your enemies from the trees with the Hoodrick! Make them regret ever being born!"
  55. vengir_msg = "Vengir is for you. Fight back against the oppressors!"
  56. zebasi_msg = "You must prefer the scientific Zebasi"
  57. ai_mo_msg = "Try the Ai-Mo. They kinda look like Aang."
  58. quetzali_msg = "Show your devotion to the bird gods with Quetzali"
  59. yadakk_msg = "Overwhelm your foes with sheer numbers with the Yadakk nomads"
  60. aquarion_msg = "Explore the ocean with Aquarion!"
  61. elyrion_msg = "Raise polytuars and DRAGONS (Yes! DRAGONS!!!) with Elyrion!"
  62. polaris_msg = "Curse the entire square to a frigid paradise with Polaris!"
  63. cymanti_msg = "Show the true power of insects with Cymanti"
  64. luxidoor_msg = "Luxidoor seems up your alley. They have funny hats"
  65.  
  66. # Start of program
  67. print("Welcome to the Polytopia Tribe Reccomendation Program (PTRP)")
  68. print("I know this defeats the purpose of it, but...")
  69. tribe_decide = input("Do you have a tribe in mind? (yes/no): ")
  70. while tribe_decide.lower() != "yes" and tribe_decide.lower() != "no":
  71.     tribe_decide = input("Invalid option, try again: ")
  72. if tribe_decide.lower() == "yes":
  73.     funds = float(input("Cool, how much cash ($) you got: "))
  74.     while funds < 0:
  75.         funds = float(input("Invalid number, try again: "))
  76.     if funds < 1:
  77.         print("Sorry, you need at least $1")
  78.     purchasing = True
  79.     eastern_tribe = False
  80.     western_tribe = False
  81.     super_tribe = False
  82. else:
  83.     print("Good. We're gonna have fun!")
  84.     purchasing = False
  85.  
  86. ##############################################
  87.  
  88.  
  89. #Option 1, First sections off from Eastern, Western, or Super tribes
  90. if purchasing == False:
  91.     #Section off to 3 groups
  92.     tribe_style = input("(Eastern), (Western), or (Mythical) world? ")
  93.     while tribe_style.lower() != "eastern" and tribe_style.lower() != "western" and tribe_style.lower() != "mythical":
  94.         tribe_style = input("Invalid option, try again: ")
  95.     if tribe_style.lower() == "eastern":
  96.         eastern_tribe = True
  97.         western_tribe = False
  98.         super_tribe = False
  99.     elif tribe_style.lower() == "western":
  100.         western_tribe = True
  101.         super_tribe = False
  102.     else:
  103.         eastern_tribe = False
  104.         western_tribe = False
  105.         super_tribe = True
  106.  
  107.  
  108. #####
  109.  
  110. #Group 1 - Eastern Tribes
  111. #Xin-Xi, Oumaji, Kickoo, Luxidoor, Zebasi, Ai-Mo, Yadakk
  112. if eastern_tribe == True and purchasing == False:
  113.     print('"Eastern!" is incredibly broad so we have to narrow it down a bit')
  114.     farm_sword = input("Do you prefer to (stay) home and build up your resources, or (explore) and take them from others")
  115.     while farm_sword.lower() != "stay" and farm_sword.lower() != "explore":
  116.         farm_sword = input("Invalid option, try again: ")
  117.     if farm_sword.lower() == "stay":
  118.         stay_preference = "Do you prefer the company of (elephants), or the taste of fresh (wheat)? Perhaps (fish):"
  119.         while stay_preference.lower() != "elephants" and stay_preference.lower() != "wheat" and stay_preference.lower() != "fish":
  120.             stay_preference = input("Invalid option, try again: ")
  121.         if stay_preference.lower() == "fish":
  122.             print(kickoo_msg)
  123.         elif stay_preference.lower() == "wheat":
  124.             print(zebasi_msg)
  125.         elif stay_preference.lower() == "elephants":
  126.             print(luxidoor_msg)
  127.     else:
  128.         explore_preference = input("With (sword)s? On (horse)back? Or your bare (hands)" )
  129.         while explore_preference.lower() != "hands" and explore_preference.lower() != "sword" and explore_preference.lower() != "horse":
  130.             explore_preference = input("Invalid option, try again: ")
  131.         if explore_preference.lower() == "hands":
  132.             print(ai_mo_msg)
  133.         elif explore_preference.lower() == "sword":
  134.             print(xin_xi_msg)
  135.         elif explore_preference.lower() == "horse":
  136.             explore_terrain = input("Do you fight best in the (steppe) or the (desert): ")
  137.             while explore_terrain.lower() != "steppe" and explore_terrain.lower() != "desert":
  138.                 explore_terrain = input("Invalid option, try again: ")
  139.             if explore_terrain.lower() == "steppe":
  140.                 print(yadakk_msg)
  141.             else:
  142.                 print(oumaji_msg)
  143.  
  144.  
  145. #####
  146.  
  147. #Group 2 - Western Tribes
  148. #Imperius, Bardur, Hoodrick, Vengir, Quetzali
  149. elif western_tribe == True and purchasing == False:
  150.     print("So... 'Western' world... ")
  151.     input("... Are you white? ")
  152.     print("Just kidding, do you like birds (yes/no)?")
  153.     birds = input("They're nice right: ")
  154.     while birds.lower() != "yes" and birds.lower() != "no":
  155.         birds = input("Invalid option, try again: ")
  156.     if birds.lower() == "yes":
  157.         print("Either way, " + quetzali_msg)
  158.     else:
  159.         print("Oh...")
  160.         castle = input("Well, castles look nice right (yes/no): ")
  161.         while castle.lower() != "yes" and castle.lower() != "no":
  162.             castle = input("Invalid option, try again: ")
  163.         if castle.lower() == "yes":
  164.             castle_style = input("You like Old (English) or (Gothic) architecture? ")
  165.             while castle_style.lower() != "english" and castle_style.lower() != "gothic":
  166.                 castle_style = input("Invalid option, try again: ")
  167.             if castle_style.lower() == "english":
  168.                 print(hoodrick_msg)
  169.             else:
  170.                 print(vengir_msg)
  171.         else:
  172.             print("Wow! seriously!?")
  173.             print("You must really hate development and nature in general")
  174.             print("...")
  175.             print("There are TWO tribes that hate nature and development. Like you. But first:")
  176.             weather = input("Do you prefer the endless, frigid (winter) or so much (heat) you literally just melt away?")
  177.             while weather.lower() != "winter" and weather.lower() != "heat":
  178.                 weather = input("Invalid option, try again: ")
  179.             if weather.lower() == "heat":
  180.                 print(imperius_msg)
  181.             else:
  182.                 print(bardur_msg)
  183.  
  184.  
  185. #####
  186.  
  187. # Group 3 - Mythical Tribes
  188. # Polaris, Cymanti, Elyrion, Aquarion
  189. elif super_tribe == True and purchasing == False:
  190.     print("Wendigo, Dragons, fishmen, and 80 foot centipedes.")
  191.     print("We'll figure out what works for you!")
  192.     water_fight = input("Do you feel comfortable sending your army into the ocean (yes/no): ")
  193.     while water_fight.lower() != "yes" and water_fight.lower() != "no":
  194.         water_fight = input("Invalid option, try again: ")
  195.     if water_fight.lower() == "yes":
  196.         water_love = input("Okay, but do you actually LIKE fighting in water (yes/no)")
  197.         while water_love.lower() != "yes" and water_love.lower() != "no":
  198.             water_love = input("Invalid option, try again: ")
  199.         if water_love.lower() == "yes":
  200.             print(aquarion_msg)
  201.         else:
  202.             print("Luckily for you, Polaris are super effective against naval units")
  203.             print(polaris_msg)
  204.     else:
  205.         print("You may hate naval combat, but it's gonna bit you in the ass later")
  206.         print("Sorry")
  207.         creature_preference = input("Which do you like more? (Dragons) or (Centipedes)?")
  208.         while creature_preference.lower() != "dragons" and creature_preference.lower() != "centipedes":
  209.             creature_preference = input("Invalid option, try again: ")
  210.         if creature_preference.lower() == "dragons":
  211.             print(elyrion_msg)
  212.         else:
  213.             print(cymanti_msg)
  214.  
  215.  
  216. ##############################################
  217.  
  218.  
  219. #Option 2
  220. # Here, ask for how many tribes user wants to purchase, loop purchase screen until finished
  221. #Unsure how to loop back to purchase screen if user buys more than their funds allow
  222. elif purchasing == True:
  223.     cost = 0
  224.     if funds < 19:
  225.         print("You get the following for free:")
  226.         print("---------")
  227.         print(free_tribe_list)
  228.         print("---------")
  229.         print("Here are all the paid tribes")
  230.         print("---------")
  231.         print(paid_tribe_list)
  232.         print("---------")
  233.         bought_tribes = int(input("How many tribes do you plan on buying (Numbers only, 1234 etc.): "))
  234.         while bought_tribes <= 0 or bought_tribes >= 13:
  235.             if bought_tribes >= 13:
  236.                 print("There are only 12 tribes")
  237.                 bought_tribes = int(input("How many: "))
  238.             else:
  239.                 print("Invalid number")
  240.                 bought_tribes = int(input("How many: "))
  241.         print("---------")
  242.         print(paid_tribe_list)
  243.         print("---------")
  244.         for amount in range(bought_tribes):
  245.             item = input("Type the name of the tribe you want to buy: ")
  246.             if item.lower() == "elyrion" or item.lower() == "polaris" or item.lower() == "aquarion" or item.lower() == "cymanti":
  247.                 funds -= 2
  248.                 cost += 2
  249.                 if cost > funds:
  250.                     print("Whoops! You bought more than you can afford!")
  251.                     break
  252.             elif item.lower() == "luxidoor":
  253.                 funds -= 4
  254.                 cost += 4
  255.                 if cost > funds:
  256.                     print("Whoops! You bought more than you can afford!")
  257.                     break
  258.             else:
  259.                 funds -= 1
  260.                 cost += 1
  261.                 if cost > funds:
  262.                     print("Whoops! You bought more than you can afford!")
  263.                     break
  264.             print("You have purchased " + item + "!")
  265.         if cost > funds:
  266.             print("Whoops! You bought more than you can afford!")
  267.         else:
  268.             print("Thank you!")
  269.     else:
  270.         print("You can buy every tribe if you want!")
  271.         print("Just do that!")
  272.  
  273. print("Thanks for using the PTRP")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement