Advertisement
Guest User

Polytopia Beginner Python Project (V2)

a guest
Jul 7th, 2024
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 11.56 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. enter = int(input("enter 1 to start, 2 to quit: "))
  69. while enter == 1:
  70.     print("I know this defeats the purpose of it, but...")
  71.     tribe_decide = input("Do you have a tribe in mind? (yes/no): ")
  72.     while tribe_decide.lower() != "yes" and tribe_decide.lower() != "no":
  73.         tribe_decide = input("Invalid option, try again: ")
  74.     if tribe_decide.lower() == "yes":
  75.         funds = float(input("Cool, how much cash ($) you got: "))
  76.         while funds < 0:
  77.             funds = float(input("Invalid number, try again: "))
  78.         if funds < 1:
  79.             print("Sorry, you need at least $1")
  80.         purchasing = True
  81.         eastern_tribe = False
  82.         western_tribe = False
  83.         super_tribe = False
  84.     else:
  85.         print("Good. We're gonna have fun!")
  86.         purchasing = False
  87.  
  88.     ##############################################
  89.  
  90.  
  91.     #Option 1, First sections off from Eastern, Western, or Super tribes
  92.     if purchasing == False:
  93.         #Section off to 3 groups
  94.         tribe_style = input("(Eastern), (Western), or (Mythical) world? ")
  95.         while tribe_style.lower() != "eastern" and tribe_style.lower() != "western" and tribe_style.lower() != "mythical":
  96.             tribe_style = input("Invalid option, try again: ")
  97.         if tribe_style.lower() == "eastern":
  98.             eastern_tribe = True
  99.             western_tribe = False
  100.             super_tribe = False
  101.         elif tribe_style.lower() == "western":
  102.             western_tribe = True
  103.             eastern_tribe = False
  104.             super_tribe = False
  105.         else:
  106.             eastern_tribe = False
  107.             western_tribe = False
  108.             super_tribe = True
  109.  
  110.  
  111.     #####
  112.  
  113.     #Group 1 - Eastern Tribes
  114.     #Xin-Xi, Oumaji, Kickoo, Luxidoor, Zebasi, Ai-Mo, Yadakk
  115.     if eastern_tribe == True and purchasing == False:
  116.         print('"Eastern!" is incredibly broad so we have to narrow it down a bit')
  117.         farm_sword = input("Do you prefer to (stay) home and build up your resources, or (explore) and take them from others")
  118.         while farm_sword.lower() != "stay" and farm_sword.lower() != "explore":
  119.             farm_sword = input("Invalid option, try again: ")
  120.         if farm_sword.lower() == "stay":
  121.             stay_preference = "Do you prefer the company of (elephants), or the taste of fresh (wheat)? Perhaps (fish):"
  122.             while stay_preference.lower() != "elephants" and stay_preference.lower() != "wheat" and stay_preference.lower() != "fish":
  123.                 stay_preference = input("Invalid option, try again: ")
  124.             if stay_preference.lower() == "fish":
  125.                 print(kickoo_msg)
  126.             elif stay_preference.lower() == "wheat":
  127.                 print(zebasi_msg)
  128.             elif stay_preference.lower() == "elephants":
  129.                 print(luxidoor_msg)
  130.         else:
  131.             explore_preference = input("With (sword)s? On (horse)back? Or your bare (hands)" )
  132.             while explore_preference.lower() != "hands" and explore_preference.lower() != "sword" and explore_preference.lower() != "horse":
  133.                 explore_preference = input("Invalid option, try again: ")
  134.             if explore_preference.lower() == "hands":
  135.                 print(ai_mo_msg)
  136.             elif explore_preference.lower() == "sword":
  137.                 print(xin_xi_msg)
  138.             elif explore_preference.lower() == "horse":
  139.                 explore_terrain = input("Do you fight best in the (steppe) or the (desert): ")
  140.                 while explore_terrain.lower() != "steppe" and explore_terrain.lower() != "desert":
  141.                     explore_terrain = input("Invalid option, try again: ")
  142.                 if explore_terrain.lower() == "steppe":
  143.                     print(yadakk_msg)
  144.                 else:
  145.                     print(oumaji_msg)
  146.  
  147.  
  148.     #####
  149.  
  150.     #Group 2 - Western Tribes
  151.     #Imperius, Bardur, Hoodrick, Vengir, Quetzali
  152.     elif western_tribe == True and purchasing == False:
  153.         print("So... 'Western' world... ")
  154.         input("... Are you white? ")
  155.         print("Just kidding, do you like birds (yes/no)?")
  156.         birds = input("They're nice right: ")
  157.         while birds.lower() != "yes" and birds.lower() != "no":
  158.             birds = input("Invalid option, try again: ")
  159.         if birds.lower() == "yes":
  160.             print("Either way, " + quetzali_msg)
  161.         else:
  162.             print("Oh...")
  163.             castle = input("Well, castles look nice right (yes/no): ")
  164.             while castle.lower() != "yes" and castle.lower() != "no":
  165.                 castle = input("Invalid option, try again: ")
  166.             if castle.lower() == "yes":
  167.                 castle_style = input("You like Old (English) or (Gothic) architecture? ")
  168.                 while castle_style.lower() != "english" and castle_style.lower() != "gothic":
  169.                     castle_style = input("Invalid option, try again: ")
  170.                 if castle_style.lower() == "english":
  171.                     print(hoodrick_msg)
  172.                 else:
  173.                     print(vengir_msg)
  174.             else:
  175.                 print("Wow! seriously!?")
  176.                 print("You must really hate development and nature in general")
  177.                 print("...")
  178.                 print("There are TWO tribes that hate nature and development. Like you. But first:")
  179.                 weather = input("Do you prefer the endless, frigid (winter) or so much (heat) you literally just melt away?")
  180.                 while weather.lower() != "winter" and weather.lower() != "heat":
  181.                     weather = input("Invalid option, try again: ")
  182.                 if weather.lower() == "heat":
  183.                     print(imperius_msg)
  184.                 else:
  185.                     print(bardur_msg)
  186.  
  187.  
  188.     #####
  189.  
  190.     # Group 3 - Mythical Tribes
  191.     # Polaris, Cymanti, Elyrion, Aquarion
  192.     elif super_tribe == True and purchasing == False:
  193.         print("Wendigo, Dragons, fishmen, and 80 foot centipedes.")
  194.         print("We'll figure out what works for you!")
  195.         water_fight = input("Do you feel comfortable sending your army into the ocean (yes/no): ")
  196.         while water_fight.lower() != "yes" and water_fight.lower() != "no":
  197.             water_fight = input("Invalid option, try again: ")
  198.         if water_fight.lower() == "yes":
  199.             water_love = input("Okay, but do you actually LIKE fighting in water (yes/no)")
  200.             while water_love.lower() != "yes" and water_love.lower() != "no":
  201.                 water_love = input("Invalid option, try again: ")
  202.             if water_love.lower() == "yes":
  203.                 print(aquarion_msg)
  204.             else:
  205.                 print("Luckily for you, Polaris are super effective against naval units")
  206.                 print(polaris_msg)
  207.         else:
  208.             print("You may hate naval combat, but it's gonna bit you in the ass later")
  209.             print("Sorry")
  210.             creature_preference = input("Which do you like more? (Dragons) or (Centipedes)?")
  211.             while creature_preference.lower() != "dragons" and creature_preference.lower() != "centipedes":
  212.                 creature_preference = input("Invalid option, try again: ")
  213.             if creature_preference.lower() == "dragons":
  214.                 print(elyrion_msg)
  215.             else:
  216.                 print(cymanti_msg)
  217.  
  218.  
  219.     ##############################################
  220.  
  221.  
  222.     #Option 2
  223.     # Here, ask for how many tribes user wants to purchase, loop purchase screen until finished
  224.     #Unsure how to loop back to purchase screen if user buys more than their funds allow
  225.     elif purchasing == True:
  226.         cost = 0
  227.         if funds < 19:
  228.             print("You get the following for free:")
  229.             print("---------")
  230.             print(free_tribe_list)
  231.             print("---------")
  232.             print("Here are all the paid tribes")
  233.             print("---------")
  234.             print(paid_tribe_list)
  235.             print("---------")
  236.             bought_tribes = int(input("How many tribes do you plan on buying (Numbers only, 1234 etc.): "))
  237.             while bought_tribes <= 0 or bought_tribes >= 13:
  238.                 if bought_tribes >= 13:
  239.                     print("There are only 12 tribes")
  240.                     bought_tribes = int(input("How many: "))
  241.                 else:
  242.                     print("Invalid number")
  243.                     bought_tribes = int(input("How many: "))
  244.             print("---------")
  245.             print(paid_tribe_list)
  246.             print("---------")
  247.             for amount in range(bought_tribes):
  248.                 item = input("Type the name of the tribe you want to buy: ")
  249.                 if item.lower() == "elyrion" or item.lower() == "polaris" or item.lower() == "aquarion" or item.lower() == "cymanti":
  250.                     funds -= 2
  251.                     cost += 2
  252.                     if cost > funds:
  253.                         print("Whoops! You bought more than you can afford!")
  254.                         break
  255.                 elif item.lower() == "luxidoor":
  256.                     funds -= 4
  257.                     cost += 4
  258.                     if cost > funds:
  259.                         print("Whoops! You bought more than you can afford!")
  260.                         break
  261.                 else:
  262.                     funds -= 1
  263.                     cost += 1
  264.                     if cost > funds:
  265.                         print("Whoops! You bought more than you can afford!")
  266.                         break
  267.                 print("You have purchased " + item + "!")
  268.             if cost > funds:
  269.                 print("Whoops! You bought more than you can afford!")
  270.             else:
  271.                 print("Thank you!")
  272.         else:
  273.             print("You can buy every tribe if you want!")
  274.             print("Just do that!")
  275.     enter = int(input("enter 1 to start, 2 to quit: "))
  276.  
  277. print("Thanks for using the PTRP")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement