MAKS_Enjoyer

My car concatenated with yours (Honorable Discharge)

Oct 31st, 2022 (edited)
390
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 72.66 KB | Source Code | 0 0
  1. from asyncio import wait
  2. import os
  3. import subprocess
  4. import sys
  5. import random
  6. import string
  7. from time import sleep
  8. import webbrowser
  9. import pygame
  10. from pygame.rect import Rect
  11.  
  12. pygame.init()
  13.        
  14. width, height = 1000, 600
  15. clock = pygame.time.Clock()
  16. screen = pygame.display.set_mode((width, height))
  17. font = pygame.font.Font('freesansbold.ttf', 32)
  18. Blue = (0,0,255)
  19. White = (255,255,255)
  20. Light_Blue = (180, 221, 255)
  21. Gray = (200, 200, 200)
  22. lilDarkerGray = (165, 165, 165)
  23. Dark_Gray = (20, 20, 20)
  24. Black = (0,0,0)
  25. def rsg():
  26.     pass
  27. def reg():
  28.     class DropDown():
  29.         def __init__(self, color_menu, color_option, x, y, w, h, font, main, options):
  30.             self.color_menu = color_menu
  31.             self.color_option = color_option
  32.             self.rect = pygame.Rect(x, y, w, h)
  33.             self.font = font
  34.             self.main = main
  35.             self.options = options
  36.             self.draw_menu = False
  37.             self.menu_active = False
  38.             self.active_option = -1
  39.  
  40.         def draw(self, surf):
  41.             pygame.draw.rect(surf, self.color_menu[self.menu_active], self.rect, 0)
  42.             msg = self.font.render(self.main, 1, (0, 0, 0))
  43.             surf.blit(msg, msg.get_rect(center = self.rect.center))
  44.  
  45.             if self.draw_menu:
  46.                 for i, text in enumerate(self.options):
  47.                     rect = self.rect.copy()
  48.                     rect.y += (i+1) * self.rect.height
  49.                     pygame.draw.rect(surf, self.color_option[1 if i == self.active_option else 0], rect, 0)
  50.                     msg = self.font.render(text, 1, (0, 0, 0))
  51.                     surf.blit(msg, msg.get_rect(center = rect.center))
  52.  
  53.         def update(self, events):
  54.             mpos = pygame.mouse.get_pos()
  55.             self.menu_active = self.rect.collidepoint(mpos)
  56.            
  57.             self.active_option = -1
  58.             for i in range(len(self.options)):
  59.                 rect = self.rect.copy()
  60.                 rect.y += (i+1) * self.rect.height
  61.                 if rect.collidepoint(mpos):
  62.                     self.active_option = i
  63.                     break
  64.  
  65.             if not self.menu_active and self.active_option == -1:
  66.                 self.draw_menu = False
  67.  
  68.             for event in events:
  69.                 if event.type == pygame.MOUSEBUTTONDOWN and event.button == 1:
  70.                     if self.menu_active:
  71.                         self.draw_menu = not self.draw_menu
  72.                     elif self.draw_menu and self.active_option >= 0:
  73.                         self.draw_menu = False
  74.                         return self.active_option
  75.             return -1
  76.     #------------------------------------------------------------------
  77.     Btn_sps = 10
  78.     cntrx = (width/6)
  79.     main_y = 212
  80.  
  81.     # main button
  82.     btnw1, btnh1 = 210, 75
  83.     xs1 = cntrx - (btnw1/2)
  84.     ys1 = main_y
  85.     neil1 = [xs1, ys1, btnw1, btnh1]
  86.     jim_bob1 = tuple(neil1)
  87.     random_gen = pygame.Rect(jim_bob1)
  88.     #------------------------------------------------------------------
  89.     btnw2, btnh2 = 210, 75
  90.     xs2 = cntrx - (btnw2/2)
  91.     ys2 = ys1 + 85
  92.     neil2 = [xs2, ys2, btnw2, btnh2]
  93.     jim_bob2 = tuple(neil2)
  94.     basic_gen = pygame.Rect(jim_bob2)
  95.     #------------------------------------------------------------------
  96.     btnw3, btnh3 = 210, 75
  97.     xs3 = cntrx - (btnw3/2)
  98.     ys3 = ys2 + 85
  99.     neil3 = [xs3, ys3, btnw3, btnh3]
  100.     jim_bob3 = tuple(neil3)
  101.     advanced_gen = pygame.Rect(jim_bob3)
  102.  
  103.     # credits + guide
  104.     btnw4, btnh4 = 98, 38
  105.     xs4 = (cntrx - 53) - (btnw4/2)
  106.     ys4 = ys3 + 85
  107.     neil4 = [xs4, ys4, btnw4, btnh4]
  108.     jim_bob4 = tuple(neil4)
  109.     guide = pygame.Rect(jim_bob4)
  110.     #------------------------------------------------------------------
  111.     btnw5, btnh5 = 98, 38
  112.     xs5 = (cntrx + 53) - (btnw5/2)
  113.     ys5 = ys3 + 85
  114.     neil5 = [xs5, ys5, btnw5, btnh5]
  115.     jim_bob5 = tuple(neil5)
  116.     credits = pygame.Rect(jim_bob5)
  117.  
  118.     # exit
  119.     btnw6, btnh6 = 50, 20
  120.     xs6 = 10
  121.     ys6 = 572
  122.     neil6 = [xs6, ys6, btnw6, btnh6]
  123.     jim_bob6 = tuple(neil6)
  124.     exit_btn = pygame.Rect(jim_bob6)
  125.  
  126.     # social media
  127.     imp1 = pygame.image.load("C:\\Users\\Public\\Operational_Functional_Block\\Python_Projects\\Assets\\reddit.png")
  128.     btnw8, btnh8 = 40, 40
  129.     imp1 = pygame.transform.scale(imp1, (btnw8, btnh8))
  130.     xs8 = 882 - (btnw8)
  131.     ys8 = 590 - (btnh8)
  132.     neil8 = [xs8, ys8, btnw8, btnh8]
  133.     jim_bob8 = tuple(neil8)
  134.     #------------------------------------------------------------------
  135.     imp2 = pygame.image.load("C:\\Users\\Public\\Operational_Functional_Block\\Python_Projects\\Assets\\discord.png")
  136.     btnw9, btnh9 = 40, 40
  137.     imp2 = pygame.transform.scale(imp2, (btnw9, btnh9))
  138.     xs9 = (xs8 + (btnw9+Btn_sps))
  139.     ys9 = 590 - (btnh9)
  140.     neil9 = [xs9, ys9, btnw9, btnh9]
  141.     jim_bob9 = tuple(neil9)
  142.     #------------------------------------------------------------------
  143.     imp3 = pygame.image.load("C:\\Users\\Public\\Operational_Functional_Block\\Python_Projects\\Assets\\website.png")
  144.     btnw10, btnh10 = 40, 40
  145.     imp3 = pygame.transform.scale(imp3, (btnw10, btnh10))
  146.     xs10 = (xs9 + (btnw10+Btn_sps))
  147.     ys10 = 590 - (btnh10)
  148.     neil10 = [xs10, ys10, btnw10, btnh10]
  149.     jim_bob10 = tuple(neil10)
  150.  
  151.     #Back Button
  152.     ggg = pygame.image.load("C:\\Users\\Public\\Operational_Functional_Block\\Python_Projects\\Assets\\reload.png")
  153.     gge = ggg.copy()
  154.     imp4 = pygame.transform.flip(gge, True, False)
  155.     btnw11, btnh11 = 30, 30
  156.     imp4 = pygame.transform.scale(imp4, (btnw11, btnh11))
  157.     xs11 = 365
  158.     ys11 = 507
  159.     neil11 = [xs11, ys11, btnw11, btnh11]
  160.     jim_bob11 = tuple(neil11)
  161.  
  162.     #Reload Button
  163.     imp5 = pygame.image.load("C:\\Users\\Public\\Operational_Functional_Block\\Python_Projects\\Assets\\reload.png")
  164.     btnw12, btnh12 = 30, 30
  165.     imp5 = pygame.transform.scale(imp5, (btnw12, btnh12))
  166.     xs12 = 400
  167.     ys12 = 507
  168.     neil12 = [xs12, ys12, btnw12, btnh12]
  169.     jim_bob12 = tuple(neil12)
  170.     #------------------------------------------------------------------
  171.     reddit_btn = screen.blit(imp1, jim_bob8)
  172.     discord_btn = screen.blit(imp2, jim_bob9)
  173.     web_btn = screen.blit(imp3, jim_bob10)
  174.     back_btn = screen.blit(imp4, jim_bob11)
  175.     reload_btn = screen.blit(imp5, jim_bob12)
  176.     def search_str(file_path, word):
  177.         with open(file_path, 'r') as file:
  178.             content = file.read()
  179.             if word in content:
  180.                 return True
  181.             else:
  182.                 return False
  183.     def guide_code():
  184.         info = ["The Random Engine Generator App does exactly as you would thing it would ",
  185.         "does, it generates rocket engines with a degree of randomness depending ",
  186.         "on the option chosen by the user with settings such as Basic Generation, ",
  187.         "Random Generation and Advanced generation which adjusts to the user's ",
  188.         "knowledge of rocket science and rocket engine mechanics.",
  189.         ""]
  190.         button_info = ["",
  191.         "Here is what the buttons do: ",
  192.         " ---> Random Generation - randomly generates an engine with in-depth data like ",
  193.         "      the propellant flow cycle and nozzle geometry. We recomend that new users to use ",
  194.         "      this setting to learn and generate rocket engines.",
  195.         " ---> Basic Generation - Makes use of simple prompts to generate ",
  196.         "      the engine of your dreams. We recomend this option to users that ",
  197.         "     are a bit more familiar with rocket science terms and the app.",
  198.         " ---> Advanced Generation - Uses prompts that will ask for more ",
  199.         "      in-depth questions to the user like the nozzle geometry and engine ",
  200.         "      gimbal range. We only recomend this option for the most experienced ",
  201.         "      users out there.",
  202.         ""]
  203.         source_code_access = ["", "Here is the link to the source code: http://pastebin.com/u/MAKS_Enjoyer",
  204.         "(Btw if you choose to edit my code, give me some credit please)"]
  205.         text = [info, button_info, source_code_access]
  206.         list(text)
  207.         jake = 173
  208.         for i in text:
  209.             for y in i:
  210.                 if i.index(y) == 0:
  211.                     jimy = [380,jake]
  212.                     font = pygame.font.SysFont("Segoe UI", 13)
  213.                     textsurface = font.render(y, True, Gray)
  214.                     screen.blit(textsurface, jimy)
  215.                 else:
  216.                     jake = jake + 19
  217.                     jimy = [380,jake]
  218.                     font = pygame.font.SysFont("Segoe UI", 13)
  219.                     textsurface = font.render(y, True, Gray)
  220.                     screen.blit(textsurface, jimy)
  221.             jimy = [380, (jake + 19)]
  222.             font = pygame.font.SysFont("Segoe UI", 13)
  223.             textsurface = font.render("", True, Gray)
  224.             screen.blit(textsurface, jimy)
  225.     def random_code():
  226.         def bussy(altitude_Of_Operation_Chosen):
  227.             match (altitude_Of_Operation_Chosen):
  228.                 case "0-10 km (Sea Level)":
  229.                     nozzle_Type_List_SL = ["De Laval Cone (Without Nozzle Extension)", "De Laval Bell (Without Nozzle Extension)"]
  230.                     random.shuffle(nozzle_Type_List_SL)
  231.                     nozzle_Type_Chosen = random.choice(nozzle_Type_List_SL)
  232.                 case "20-30 km (Medium Atmosphere)":
  233.                     nozzle_Type_List_HA = ["De Laval Bell (Without Nozzle Extension)", "De Laval Cone (With Nozzle Extension)",
  234.                         "De Laval Bell (With Nozzle Extension)", "Dual Bell Nozzle"]
  235.                     random.shuffle(nozzle_Type_List_HA)
  236.                     nozzle_Type_Chosen = random.choice(nozzle_Type_List_HA)
  237.                 case "30-80 km (High Atmosphere)":
  238.                     nozzle_Type_List_HAi = ["De Laval Cone (With Nozzle Extension)", "De Laval Bell (With Nozzle Extension)",
  239.                         "Dual Bell Nozzle"]
  240.                     random.shuffle(nozzle_Type_List_HAi)
  241.                     nozzle_Type_Chosen = random.choice(nozzle_Type_List_HAi)
  242.                 case "80 km+ (Vacuum)":
  243.                     nozzle_Type_List_VA = ["De Laval Cone (With Nozzle Extension)", "De Laval Bell (With Nozzle Extension)",
  244.                         "Expanding Nozzle"]
  245.                     random.shuffle(nozzle_Type_List_VA)
  246.                     nozzle_Type_Chosen = random.choice(nozzle_Type_List_VA)
  247.                 case "Any Altitude (0-80 km+)":
  248.                     nozzle_Type_List_Aero = ["Linear Aerospike Nozzle", "Toroidal Aerospike Nozzle", "Expansion-Deflection Nozzle"]
  249.                     random.shuffle(nozzle_Type_List_Aero)
  250.                     nozzle_Type_Chosen = random.choice(nozzle_Type_List_Aero)
  251.             return nozzle_Type_Chosen
  252.  
  253.         def assCrack(engineName, firstP):
  254.             random.shuffle(engineName)
  255.             random.shuffle(firstP)
  256.             engNameFinalf = " " + random.choice(engineName)
  257.             firstPart_f = random.choice(firstP) + "-"
  258.             finalNumber = random.randint(12, 1110)
  259.             if finalNumber % 8 == 0:
  260.                 engine_Name = str(firstPart_f) + str(finalNumber) + str(engNameFinalf)
  261.             else:
  262.                 uio93 = random.randint(1, 1000)
  263.                 uio94 = random.randint(1, 12)
  264.                 if uio93 % uio94 == 0:
  265.                     randomizedCharacter = random.choice(string.ascii_lowercase)
  266.                     while (randomizedCharacter == 'l') or (randomizedCharacter == 'o') or (randomizedCharacter == 'i') or \
  267.                             (randomizedCharacter == 'q') or (randomizedCharacter == 'e') or (randomizedCharacter == 'h') or \
  268.                             (randomizedCharacter == 'g') or (randomizedCharacter == 'c') or (randomizedCharacter == 'j'):
  269.                         randomizedCharacter = random.choice(string.ascii_lowercase)
  270.                         if (randomizedCharacter != 'l') and (randomizedCharacter != 'o') and (randomizedCharacter != 'i') and \
  271.                                 (randomizedCharacter != 'q') and (randomizedCharacter != 'e') and (randomizedCharacter != 'h') \
  272.                                 and (randomizedCharacter != 'g') and (randomizedCharacter != 'c') and (
  273.                                 randomizedCharacter != 'j'):
  274.                             break
  275.                 else:
  276.                     randomizedCharacter = random.choice(string.ascii_uppercase)
  277.                     while (randomizedCharacter == 'O') or (randomizedCharacter == 'I') or (randomizedCharacter == 'Q'):
  278.                         randomizedCharacter = random.choice(string.ascii_uppercase)
  279.                         if (randomizedCharacter != 'O') and (randomizedCharacter != 'I') and (randomizedCharacter != 'Q'):
  280.                             break
  281.                 engine_Name = str(firstPart_f) + str(finalNumber) + str(randomizedCharacter) + str(engNameFinalf)
  282.             return engine_Name
  283.  
  284.         def outputMonod(ENN, AOOC, PLC, NTLC, CMC, CCC):
  285.             outputEOD = "Engine Designation: " + ENN
  286.             outputTP = "Propellant: " + PLC
  287.             outputAOC = "Altitude Of Operation: " + AOOC
  288.             outputENG = "Exhaust Nozzle Geometry: " + NTLC
  289.             outputNCM = "Nozzle Cooling Mechanism: " + CMC
  290.             outputEPC = "Propellant catalyst: " + CCC
  291.  
  292.             MonoD = [outputEOD, outputTP, outputAOC, outputENG, outputNCM, outputEPC]
  293.             return MonoD
  294.  
  295.         def outputMono(ENN, ECC, AOOC, PLC, NTLC, CMC):
  296.             outputEOD = "Engine Designation: " + ENN
  297.             outputEFC = "Flow Cycle: " + ECC
  298.             outputTP = "Propellant: " + PLC
  299.             outputAOC = "Altitude Of Operation: " + AOOC
  300.             outputENG = "Exhaust Nozzle Geometry: " + NTLC
  301.             outputNCM = "Nozzle Cooling Mechanism: " + CMC
  302.  
  303.             Mono = [outputEOD, outputEFC, outputTP, outputAOC, outputENG, outputNCM]
  304.             return Mono
  305.  
  306.         def outputEx(ENN, ECC, OCC, FCC, AOOC, NTC, TRR, CMC, isHyp):
  307.             isCryo = False
  308.             if OCC == "O3 (Ozone)" or OCC == "F2 (Fluorine)" or OCC == "F2 (Fluorine) + O2 (Oxygen)" or \
  309.                     OCC == "ClF3 (Chlorine Trifluoride)" or OCC == "ClF5 (Chlorine Pentafluoride)" or OCC == "O2 (Oxygen)":
  310.                 isCryo = True
  311.             if FCC == "CH3OH (Methanol)" or FCC == "C12H24 (Kerosene)" or FCC == "H2 (Hydrogen)" or FCC == "C2H5OH(Ethanol) 85%" or \
  312.                     FCC == "C2H5OH(Ethanol) 75%" or FCC == "B2H6 (Diborane)" or FCC == "B5H9 (Pentaborane)" or FCC == "NH3 (Ammonia)" or FCC == "CH4 (Methane)":
  313.                 isCryo = True
  314.             if isHyp:
  315.                 message = "Propellant properties: Hypergolic"
  316.             else:
  317.                 message = "Propellant properties: Not Hypergolic"
  318.             if isCryo is True and isHyp is True:
  319.                 message = message + " and cryogenic"
  320.             elif isCryo is True and isHyp is False:
  321.                 message = message + " but cryogenic"
  322.             elif isCryo is False and isHyp is True:
  323.                 message = message + " but not cryogenic"
  324.             else:
  325.                 message = message + " or cryogenic"
  326.             uio96 = random.randint(1, 1000)
  327.             uio97 = random.randint(1, 12)
  328.             if uio96 % uio97 == 0:
  329.                 Throttle_MinV = random.randint(1, 100)
  330.                 Throttle_MaxV = random.randint(100, 115)
  331.                 ThrottleRange = str(Throttle_MinV) + " - " + str(Throttle_MaxV) + "%"
  332.             else:
  333.                 ThrottleRange = "Not Throttleable"
  334.             gimbalangle = random.randint(0, 15)
  335.             if gimbalangle <= 0 or AOOC == "80 km+ (Vacuum)":
  336.                 piss = "None"
  337.             else:
  338.                 piss = str(gimbalangle) + " degrees"
  339.  
  340.             outputEOD = "Engine Designation: " + ENN
  341.             outputPFC = "Flow Cycle: " + ECC
  342.             outputEO = "Engine Oxidizer: " + OCC
  343.             outputEF = "Engine Fuel: " + FCC
  344.             outputAOC = "Altitude Of Operation: " + AOOC
  345.             outputNTC = "Exhaust Nozzle Geometry: " + NTC
  346.             outputHCC = message
  347.             outputEGR = "Engine Gimbal Range: " + piss
  348.             outputTRM = "Tank repressurisation Method: " + TRR
  349.             outputNCM = "Nozzle Cooling Mechanism: " + CMC
  350.             outputETR = "Engine Throttle Range: " + ThrottleRange
  351.  
  352.             EX = [outputEOD, outputPFC, outputEO, outputEF, outputAOC, outputNTC, outputHCC, outputEGR, outputTRM, outputNCM, outputETR]
  353.             return EX
  354.  
  355.         def outputNt(ENN, ECC, AOOC, NCC, PLC, RFC, NTLC, TRC, CMC, bi):
  356.             outputEOD = "Engine Designation: " + ENN
  357.             outputPFC = "Flow Cycle: " + NCC + " " + ECC
  358.             outputERP = "Propellant (Remass): " + PLC
  359.             outputERF = "Reactor Fuel: " + RFC
  360.             outputEBM = "Engine Bi-modality: " + str(bi)
  361.             outputAOP = "Altitude Of Operation: " + AOOC
  362.             outputENG = "Exhaust Nozzle Geometry: " + NTLC
  363.             outputTRM = "Tank repressurisation Method: " + TRC
  364.             outputNCM = "Nozzle Cooling Mechanism: " + CMC
  365.  
  366.             NT = [outputEOD, outputPFC, outputERP, outputERF, outputEBM, outputAOP, outputENG, outputTRM, outputNCM]
  367.             return NT
  368.  
  369.         def outputEt(ENN, ECC, AOOC, PLC, NTLC, pygameLC):
  370.             pwr = str(random.randint(20, 1000)) + " kW"
  371.             outputEOD = "Engine Designation: " + ENN
  372.             outputPFC = "Flow Cycle: " + ECC
  373.             outputERP = "Propellant(Remass): " + PLC
  374.             outputAOC = "Altitude Of Operation: " + AOOC
  375.             outputENG = "Exhaust Nozzle Geometry: " + NTLC
  376.             outputEPS = "Engine Power Source: " + pygameLC
  377.             outputRPL = "Rated Power Level: " + pwr
  378.  
  379.             ET = [outputEOD, outputPFC, outputERP, outputAOC, outputENG, outputEPS, outputRPL]
  380.             return ET
  381.  
  382.         def outputDef(ENN, ECC, OCC, FCC, AOOC, NTC, TRR, CMC, isHyp):
  383.             isCryo = False
  384.             if OCC == "O3 (Ozone)" or OCC == "F2 (Fluorine)" or OCC == "F2 (Fluorine) + O2 (Oxygen)" or \
  385.                     OCC == "ClF3 (Chlorine Trifluoride)" or OCC == "ClF5 (Chlorine Pentafluoride)" or OCC == "O2 (Oxygen)":
  386.                 isCryo = True
  387.             if FCC == "CH3OH (Methanol)" or FCC == "C12H24 (Kerosene)" or FCC == "H2 (Hydrogen)" or FCC == "C2H5OH(Ethanol) 85%" or \
  388.                     FCC == "C2H5OH(Ethanol) 75%" or FCC == "B2H6 (Diborane)" or FCC == "B5H9 (Pentaborane)" or FCC == "NH3 (Ammonia)" or FCC == "CH4 (Methane)":
  389.                 isCryo = True
  390.             if isHyp:
  391.                 message = "Propellant properties: Hypergolic"
  392.             else:
  393.                 message = "Propellant properties: Not Hypergolic"
  394.             if isCryo is True and isHyp is True:
  395.                 message = message + " and cryogenic"
  396.             elif isCryo is True and isHyp is False:
  397.                 message = message + " but cryogenic"
  398.             elif isCryo is False and isHyp is True:
  399.                 message = message + " but not cryogenic"
  400.             else:
  401.                 message = message + " or cryogenic"
  402.             uio96 = random.randint(1, 1000)
  403.             uio97 = random.randint(1, 12)
  404.             if uio96 % uio97 == 0:
  405.                 Throttle_MinV = random.randint(1, 100)
  406.                 Throttle_MaxV = random.randint(100, 115)
  407.                 ThrottleRange = str(Throttle_MinV) + " - " + str(Throttle_MaxV) + "%"
  408.             else:
  409.                 ThrottleRange = "Not Throttleable"
  410.             gimbalangle = random.randint(0, 15)
  411.             if gimbalangle <= 0 or AOOC == "80 km+ (Vacuum)":
  412.                 piss = "None"
  413.             else:
  414.                 piss = str(gimbalangle) + " degrees"
  415.             outputEOD = "Engine Designation: " + ENN
  416.             outputPFC = "Flow Cycle: " + ECC
  417.             outputEO = "Engine Oxidizer: " + OCC
  418.             outputEF = "Engine Fuel: " + FCC
  419.             outputAOC = "Altitude Of Operation: " + AOOC
  420.             outputNTC = "Exhaust Nozzle Geometry: " + NTC
  421.             outputHCC = message
  422.             outputEGR = "Engine Gimbal Range: " + piss
  423.             outputTRM = "Tank repressurisation Method: " + TRR
  424.             outputNCM = "Nozzle Cooling Mechanism: " + CMC
  425.             outputETR = "Engine Throttle Range: " + ThrottleRange
  426.  
  427.             DEF = [outputEOD, outputPFC, outputEO, outputEF, outputAOC, outputNTC, outputHCC, outputEGR, outputTRM, outputNCM, outputETR]
  428.             return DEF
  429.  
  430.         def isHypergolic(OCC, FCC):
  431.             isHyper = False
  432.             if OCC == "N2O4 (Nitrogen Tetroxide)":
  433.                 if FCC == "50% CH6N2 + 50% N2H4 (Aerosine-50)" or FCC == "75% CH6N2 + 25% N2H4 (UH-25)" or FCC == "C6H5NH2 (Aniline)" or \
  434.                         FCC == "C2H8N2 (UnsymmetricalDimethylHydrazine)" or FCC == "CH6N2 (MonomethylHydrazine)" or FCC == "N2H4 (Hydrazine)":
  435.                     isHyper = True
  436.             elif OCC == "H2O2 (Hydrogen Peroxide) 95%" or OCC == "H2O2 (Hydrogen Peroxide) 85%" or OCC == "O2 (Oxygen)":
  437.                 isHyper = False
  438.             elif OCC == "O3 (Ozone)" or OCC == "F2 (Fluorine)" or OCC == "F2 (Fluorine) + O2 (Oxygen)" or \
  439.                     OCC == "ClF3 (Chlorine Trifluoride)" or OCC == "ClF5 (Chlorine Pentafluoride)":
  440.                 isHyper = True
  441.             elif OCC == "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)" or OCC == "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)" or \
  442.                     OCC == "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)" or OCC == "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)" or \
  443.                     OCC == "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)":
  444.                 if FCC == "CH6N2 (MonomethylHydrazine)" or OCC == "N2H4 (Hydrazine)":
  445.                     isHyper = True
  446.                 else:
  447.                     isHyper = False
  448.             return isHyper
  449.  
  450.         engine_Name1 = ["\"Argosy\"", "\"Galileo\"", "\"Callisto\"", "\"Nauka\"", "\"Insider\"", "\"Granis\"", "\"Rassvet\"",
  451.                         "\"Zvezda\"", "\"Zarya\"", "\"Orion\"", "\"Ares\"", "\"Delta\"", "\"Atlas\"", "\"Dreadnought\"",
  452.                         "\"Daedalus\"", "\"Baltia\"", "\"Dizhou\"", "\"Hermes\"", "\"Icarus\"", "\"Connestoga\"", "\"Yupiter\"",
  453.                         "\"Emphasis\"", "\"Olympus\"", "\"Kronos\"", "\"Helios\"", "\"Alabaster\"", "\"Falcon\"", "\"Saturn\"",
  454.                         "\"Eagle\"", "\"Endeavour\"", "\"Atlantis\"", "\"Cygnus\"", "\"Apollo\"", "\"Horizon\"", "\"Bulava\"",
  455.                         "\"Pioneer\"", "\"Voyager\"", "\"Exploration\"", "\"Expedition\"", "\"Vulcan\"", "\"Vysota\"",
  456.                         "\"Federation\"", "\"Sojourner\"", "\"Nautilus\"", "\"Jubilance\"", "\"Lagrange\"", "\"Volna\"",
  457.                         "\"Prometheus\"", "\"Tellus\"", "\"Alpha\"", "\"Delta\"", "\"Proton\"", "\"Neutron\"", "\"Topol\"",
  458.                         "\"Electron\"", "\"Pluton\"", "\"Poodle\"", "\"Skipper\"", "\"Convair\"", "\"Nexus\"", "\"Oko\"",
  459.                         "\"Vector\"", "\"Terrier\"", "\"Rhino\"", "\"Panther\"", "\"Goliath\"", "\"Juno\"", "\"Shrimp\"",
  460.                         "\"Thumper\"", "\"Mainsail\"", "\"Dart\"", "\"Twitch\"", "\"Stratus\"", "\"Oscar\"", "\"Kosmos\"",
  461.                         "\"Sentinel\"", "\"Pegasus\"", "\"Kelus\"", "\"Starshot\"", "\"Vernor\"", "\"Mammoth\"", "\"Liberty\"",
  462.                         "\"Douglas\"", "\"Heimdall\"", "\"Dynetics\"", "\"Pathfinder\"", "\"Horizon\"", "\"Poisk\"", "\"Pirs\"",
  463.                         "\"Philae\"", "\"Mariner\"", "\"Centaur\"", "\"Orel\"", "\"Pratt\"", "\"Hyperion\"", "\"Sagittarius\"",
  464.                         "\"Apollo\"", "\"Bryton\"", "\"Volga\"", "\"Harmony\"", "\"Cassini\"", "\"Contour\"", "\"Altair\"",
  465.                         "\"Dream\"", "\"Baikal\"", "\"Zenith\"", "\"Urpinod\"", "\"Bernal\"", "\"Condor\"", "\"Athena\"",
  466.                         "\"Astra\"", "\"Aerolus\"", "\"Rombus\"", "\"Lunokhod\"", "\"Fregat\"", "\"Glonass\"", "\"Dragon\"",
  467.                         "\"Salyut\"", "\"Starliner\"", "\"Skylab\"", "\"Briz\"", "\"Colombus\"", "\"Rosetta\"", "\"Redstone\"",
  468.                         "\"Antares\"", "\"Philae\"", "\"Prospero\"", "\"Leonardo\"", "\"Parker\"", "\"Dyson\"", "\"Oberon\"",
  469.                         "\"DragonFly\"", "\"Energia\"", "\"Buran\"", "\"Urgan\"", "\"Angara\"", "\"Vostok\"", "\"Voskhod\"",
  470.                         "\"Shenzhou\"", "\"Ingenuity\"", "\"Oberon\"", "\"Discovery\"", "\"Horizon\"", "\"Visionalis\"",
  471.                         "\"Cerasus\"", "\"Progress\"", "\"Unity\"", "\"Surveyor\"", "\"Prospector\"", "\"Ikar\"", "\"Redstone\"",
  472.                         "\"Lapis\"", "\"Caesius\"", "\"Iridium\"", "\"Daedlus\"", "\"Aelita\"", "\"Beta\"", "\"Gamma\"",
  473.                         "\"Alpha\"", "\"Epsilon\"", "\"Omega\"", "\"Discoverer\"", "\"Explorer\"", "\"Hornet\"", "\"Serenity\"",
  474.                         "\"Ariane\"", "\"Hornet\"", "\"Asimov\"", "\"Pegasus\"", "\"Venture\"", "\"Antares\"", "\"Star\"",
  475.                         "\"Archimedes\"", "\"Hera\"", "\"Iris\"", "\"Titan\"", "\"Artemis\"", "\"Phoenix\"", "\"Ross\"",
  476.                         "\"Sarychev\"", "\"Nemesis\"", "\"Heimdall\"", "\"Sturt\"", "\"Odin\"", "\"Aethelred\"", "\"Vesper\"",
  477.                         "\"Aces\"", "\"Argon\"", "\"Olympia\"", "\"Perseus\"", "\"Chyron\"", "\"Proxima\"", "\"Arminus\"",
  478.                         "\"Destiny\"", "\"Valient\"", "\"FireFly\"", "\"Obsidian\"", "\"Leviathan\"", "\"Magellan\"", "\"Voyager\"",
  479.                         "\"Mariner\"", "\"Joist\"", "\"Crimson\"", "\"Fortune\"", "\"Vanguard\"", "\"Aurora\"", "\"Ulysses\"",
  480.                         "\"Crusader\"", "\"Python\"", "\"Kuiper\"", "\"Insurgent\"", "\"Pathfinder\"", "\"Kvant\"", "\"Spektr\"",
  481.                         "\"Cassini\"", "\"Zemlya\"", "\"Dawn\"", "\"Kepler\"", "\"Parom\"", "\"Elektron\"", "\"Aeonian\"", "\"Node\"",
  482.                         "\"Burya\"", "\"Voyager\"", "\"Ceres\"", "\"Bayern\"", "\"Chasovoy\"", "\"Copernicus\"", "\"Quaoar\"",
  483.                         "\"Minotaur\"", "\"Agena\"", "\"Thor\"", "\"Vega\"", "\"Scout\"", "\"Coeus\"", "\"Minerva\"", "\"Kratos\"",
  484.                         "\"Neith\"", "\"Omoikane\"", "\"Gayamun\"", "\"Odin\"", "\"Kronos\"", "\"Hope\"", "\"Polet\"", "\"Polyot\"",
  485.                         "\"Sputnik\"", "\"Clementine\"", "\"Sojourner\"", "\"Ingenuity\"", "\"Perseverence\"", "\"Onatchesko\"",
  486.                         "\"Atlantis\"", "\"Tsyklon\"", "\"Zenit\"", "\"Almaz\"", "\"Soyuz\"", "\"Molniya\"", "\"Oreol\"",
  487.                         "\"Yantar\"", "\"Foton\"", "\"Meteor\"", "\"Ekran\"", "\"Strela\"", "\"Bion\"", "\"Piroda\"", "\"Salyut\"",
  488.                         "\"Strela\"", "\"Luch\"", "\"Potok\"", "\"Prognoz\"", "\"Orlets\"", "\"Etalon\"", "\"Astron\"", "\"Efir\"",
  489.                         "\"Kometa\"", "\"Fram\"", "\"Zemlya\"", "\"Gorizont\"", "\"Arkon\"", "\"Gamma\"", "\"Ekspress\"",
  490.                         "\"Gonets\"", "\"Taifun\"", "\"Okean\"", "\"Reflektor\"", "\"Kolibr\"", "\"Sever\"", "\"Comet\"",
  491.                         "\"Roton\"", "\"Solaris\"", "\"Altaris\"", "\"Ithacus\"", "\"Dekto\"", "\"Dream\"", "\"Impuls\"",
  492.                         "\"Vremya\"", "\"Portal\"", "\"Zodiak\"", "\"Slava\"", "\"Inertsiya\"", "\"Stimuls\"", "\"Ambross\"",
  493.                         "\"Amal\"", "\"Thea\"", "\"Orphelia\"", "\"Polyot\"", "\"Mudrost\"", "\"Carrack\"", "\"Artak\"",
  494.                         "\"Questar\"", "\"Artyom\"", "\"Tsyclon\"", "\"Ascension\"", "\"Tenacity\"", "\"Contour\"", "\"Zephyr\"",
  495.                         "\"Atlanta\"", "\"Polaris\"", "\"Aeolus\"", "\"Mayak\"", "\"Pamir\"", "\"Taimyr\"", "\"Cheget\"",
  496.                         "\"Sirius\"", "\"Uragan\"", "\"Agat\"", "\"Skiph\"", "\"Kristall\"", "\"Altair\"", "\"Uran\"",
  497.                         "\"Ingul\"", "\"Carat\"", "\"Pulsar\"", "\"Titan\"", "\"Eridanus\"", "\"Parus\"", "\"Cepheus\"",
  498.                         "\"Varagian\"", "\"Olympus\"", "\"Tarkhaniy\"", "\"Astraeus\"", "\"Antares\"", "\"Kazbek\"",
  499.                         "\"Burlak\"", "\"Borei\"", "\"Favor\"", "\"Rubin\"", "\"Almaz\"", "\"Granit\"", "\"Ruby\"",
  500.                         "\"Sokol\"", "\"Argon\"", "\"Kavkaz\"", "\"Ural\"", "\"Berkut\"", "\"Dunay\"", "\"Yastreb\"",
  501.                         "\"Terek\"", "\"Radon\"", "\"Taymyr\"", "\"Pamir\"", "\"Photon\"", "\"Elbrus\"", "\"Isayiev\"", "\"Shmel\"",
  502.                         "\"Kobra\"", "\"Shturn\"", "\"Metis\"", "\"Malyutka\"", "\"Fleyta\"", "\"Konkurs\"", "\"Bastion\"", "\"Svir\"",
  503.                         "\"Ataka\"", "\"Vodopad\"", "\"Veter\"", "\"Vyuga\"", "\"Vulga\"", "\"Tochka\"", "\"Oka\"", "\"Dvina\"",
  504.                         "\"Almaz\"", "\"Araks\"", "\"Kanopus\"", "\"Kliper\"", "\"Kobalt\"", "\"Siluet\"", "\"Kondor\"",
  505.                         "\"Lotos\"", "\"Luch\"", "\"Mir\"", "\"Neman\"", "\"Obzor\"", "\"Okean\"", "\"Oktan\"", "\"Orlets\"",
  506.                         "\"Poisk\"", "\"Potok\"", "\"Pirs\"", "\"Prognoz\"", "\"Resurs\"", "\"Rodnik\"", "\"Romb\"", "\"Kapustin\"",
  507.                         "\"Oplot\"", "\"Tsygan\"", "\"Teplokhod\"", "\"Sokosha\"", "\"Rubezh\"", "\"Zircon\"", "\"Moskva\"",
  508.                         "\"Tryol\"", "\"Ustinov\"", "\"Belyayev\"", "\"Novorod\"", "\"Argos\"", "\"Nerthus\"", "\"Janus\"",
  509.                         "\"Hephaestus\"", "\"Themis\"", "\"Chronos\"", "\"Tethys\"", "\"Minos\"", "\"Autumn\"", "\"Resilience\"",
  510.                         "\"Aelita\"", "\"Rheus\"", "\"Solntspek\"", "\"Spitzer\"", "\"Cartago\"", "\"Melibea\"", "\"Spartacus\"",
  511.                         "\"Pulsar\"", "\"Fusion\"", "\"Reliant\"", "\"Thunder\"", "\"Novo\"", "\"Panthera\"", "\"Nematoda\"",
  512.                         "\"Anelida\"", "\"Chordata\"", "\"Tetrapoda\"", "\"Cyclero\"", "\"Carrier\"", "\"Gaia\"", "\"Irtysh\"",
  513.                         "\"Wyvern\"", "\"Tarsier\"", "\"Alpina\"", "\"Espadon\"", "\"Parlos\"", "\"Nebula\"", "\"Lazarus\"",
  514.                         "\"Rufus\"", "\"Dornier\"", "\"Argus\"", "\"Kybau\"", "\"Kalau\"", "\"Chasvoy\"", "\"Zephyr\"", "\"Temny\"",
  515.                         "\"Gorizont\"", "\"Yars\"", "\"Krugazor\"", "\"Soprotivlenye\"", "\"Shtil\"", "\"Layner\""]
  516.         engine_Cycle = ["Gas Generator", "Staged Combustion (Oxidizer Rich)", "Staged Combustion (Fuel Rich)",
  517.                         "Expander (Open/Bleed)", "Expander (Closed)", "Dual Expander (Open/Bleed)", "Dual Expander (Closed)",
  518.                         "Pressure-Fed", "Full Flow Staged", "Electric Pump Fed", "Combustion Tap Off", "Monopropellant (Cold Gas)",
  519.                         "Monopropellant (Decomposition)", "Gas Core", "Liquid Core", "Solid Core", "Pulsed Nuclear",
  520.                         "Pebble-Bed Core", "Nuclear SaltWater", "MagnetoPlasmaDynamic Thruster", "Hall Effect Thruster",
  521.                         "Gridded Ion Thruster", "Colloid Thruster", "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)"]
  522.         propellant_List1 = ["H2O2 (Hydrogen Peroxide)", "N2H4 (Hydrazine)", "NH2OH+NO3 (Hydroxylammonium nitrate)",
  523.                             "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)"]
  524.         propellant_List2 = ["Nitrogen (N2)", "Helium (He)", "Carbon Dioxide (CO2)", "Ammonia (NH3)",
  525.                             "Hydrogen (H2)", "Methane (CH4)"]
  526.         propellant_List3 = ["Hydrogen (H2)", "Helium (He)", "Nitrogen (N2)", "Hydrogen (H)", "Ammonia (NH3)",
  527.                             "Water (H2O)", "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)",
  528.                             "Methane (CH4)"]
  529.         altitude_Of_Operation = ["0-10 km (Sea Level)", "20-30 km (Medium Atmosphere)", "30-80 km (High Atmosphere)",
  530.                                     "80 km+ (Vacuum)", "Any Altitude (0-80 km+)"]
  531.         tank_Repressurisation = ["Autogenous", "Inert Gas"]
  532.         firstPart = ["RD", "RS", "AJ", "XLR", "NK", "RL", "KDTU", "AR", "BE", "MV", "YF", "PKA", "J", "RSA", "MJ", "XS",
  533.                         "LM10", "HM", "LE", "LRE", "CE", "DST", "DOK", "KDU", "KRD", "R", "RO", "LMS", "LMP", "RT", "F", "E",
  534.                         "A", "B", "S.10", "R", "JDK", "SPP", "TYS", "SOK", "RES", "FWR", "NAA75", "LR", "MA", "GE", "OSA",
  535.                         "OBA", "NA", "RM02", "RM", "H", "MBB", "MB", "DF", "DE", "BF", "X", "BW", "BADR", "HS", "DC"]
  536.         engine_Name = assCrack(engine_Name1, firstPart)
  537.         random.shuffle(engine_Cycle)
  538.         engine_Cycle_Chosen = random.choice(engine_Cycle)
  539.         nuclear_Cycle_Chosen = ""
  540.         match engine_Cycle_Chosen:
  541.             case "Gas Core" | "Liquid Core" | "Solid Core" | "Pulsed Nuclear" | "Nuclear SaltWater" | "Pebble-Bed Core":
  542.                 cooling_mechanism = ["Radiative Cooling", "Dump Cooling", "Film Cooling", "Regenerative Cooling", "Transpiration Cooling"]
  543.                 match engine_Cycle_Chosen:
  544.                     case "Gas Core":
  545.                         remass_List = ["Hydrogen (H2)", "Nitrogen (N2)", "Monoatomic Hydrogen (H)", "Ammonia (NH3)",
  546.                                         "Water (H2O)", "Oxygen (O2)", "Carbon Dioxide (CO2)", "Carbon Monoxide (CO)", "Methane (CH4)"]
  547.                         random.shuffle(remass_List)
  548.                         remass_List_Chosen = random.choice(remass_List)
  549.                         propellant_List_Chosen = "Uranium HexaFluoride (UF6) + " + remass_List_Chosen
  550.                         nuclear_cycle1 = ["\"Expander Bleed\"", "\"Expander Closed\"", "\"Nuclear Lightbulb\"",
  551.                                             "\"Vortex Confined\"", "\"Wheel Flow\"", "\"Magnetohydrodynamic(MHD) vortex\"",
  552.                                             "\"Expander Open\""]
  553.                         random.shuffle(nuclear_cycle1)
  554.                         nuclear_Cycle_Chosen = random.choice(nuclear_cycle1)
  555.                         reactor_fuel = ["100-90% Uranium-235", "50% Uranium-235", "25-8% Uranium-235", "1-2% Uranium-235"]
  556.                         random.shuffle(reactor_fuel)
  557.                         reactor_Fuel_Chosen = random.choice(reactor_fuel)
  558.                         nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)"
  559.  
  560.                     case "Liquid Core", "Colloid-Core", "Pebble-Bed Core":
  561.                         remass_List2 = ["Hydrogen (H2)", "Nitrogen (N2)", "Monoatomic Hydrogen (H)",
  562.                                         "Ammonia (NH3)", "Water (H2O)", "Oxygen (O2)", "Carbon Dioxide (CO2)",
  563.                                         "Carbon Monoxide (CO)",
  564.                                         "Methane (CH4)"]
  565.                         random.shuffle(remass_List2)
  566.                         remass_List_Chosen = random.choice(remass_List2)
  567.                         propellant_List_Chosen = "Uranium HexaFluoride (UF6) + " + remass_List_Chosen
  568.                         nuclear_cycle1 = ["\"Expander Bleed\"", "\"Expander Closed\"", "\"Vortex Confined\"",
  569.                                             "\"Expander Open\""]
  570.                         random.shuffle(nuclear_cycle1)
  571.                         nuclear_Cycle_Chosen = random.choice(nuclear_cycle1)
  572.                         reactor_fuel = ["100-90% Uranium-235", "50% Uranium-235", "25-8% Uranium-235", "1-2% Uranium-235"]
  573.                         random.shuffle(reactor_fuel)
  574.                         reactor_Fuel_Chosen = random.choice(reactor_fuel)
  575.                         nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)"
  576.  
  577.                     case "Nuclear SaltWater":
  578.                         propellant_List_Chosen = "Uranium TetraBromide (UBr4) + Water (H2O)"
  579.                         reactor_fuel = ["100-90% Uranium-235", "50% Uranium-235", "25-8% Uranium-235",
  580.                                         "1-2% Uranium-235"]
  581.                         random.shuffle(reactor_fuel)
  582.                         reactor_Fuel_Chosen = random.choice(reactor_fuel)
  583.                         nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)"
  584.  
  585.                     case _:
  586.                         random.shuffle(propellant_List3)
  587.                         propellant_List_Chosen = random.choice(propellant_List3)
  588.                         nuclear_cycle1 = ["\"Expander Bleed\"", "\"Expander Closed\"", "\"Expander Open\""]
  589.                         random.shuffle(nuclear_cycle1)
  590.                         nuclear_Cycle_Chosen = random.choice(nuclear_cycle1)
  591.                         reactor_fuel = ["100-90% Uranium-235", "50% Uranium-235", "20-8% Uranium-235", "1-2% Uranium-235",
  592.                                         "100-90% Plutonium-238", "50% Plutonium-238", "25-8% Plutonium-238", "1-2% Plutonium-238"]
  593.                         random.shuffle(reactor_fuel)
  594.                         reactor_Fuel_Chosen = random.choice(reactor_fuel)
  595.                         nozzle_Type_List_Chosen = "De Laval Bell (With Nozzle Extension)"
  596.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  597.                 random.shuffle(tank_Repressurisation)
  598.                 tank_Repressurisation_Chosen = random.choice(tank_Repressurisation)
  599.                 random.shuffle(cooling_mechanism)
  600.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  601.                 bimodal_decider = random.randint(15, 168)
  602.                 bimodal = False
  603.                 if bimodal_decider % 2 == 0:
  604.                     bimodal = True
  605.                 NT = outputNt(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, nuclear_Cycle_Chosen,
  606.                             propellant_List_Chosen, reactor_Fuel_Chosen, nozzle_Type_List_Chosen,
  607.                             tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, bimodal)
  608.                 return NT
  609.            
  610.             case "MagnetoPlasmaDynamic Thruster" | "Hall Effect Thruster" | "Gridded Ion Thruster" | "Colloid Thruster" | "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)":
  611.                 powerGen_List = ["Hydrogen Fuel cell", "Nuclear Fission Reactor", "Nuclear Fusion Reactor", "Photovoltaic Panel",
  612.                                     "Solar Thermal Panel", "Radioisotope Thermoelectric Generator (RTG)"]
  613.                 match engine_Cycle_Chosen:
  614.                     case "Hall Effect Thruster":
  615.                         propellant_List = ["Xenon", "Krypton", "Argon", "Bismuth", "Iodine","Magnesium", "Zinc", "Adamantane"]
  616.                         random.shuffle(propellant_List)
  617.                         propellant_List_Chosen = random.choice(propellant_List)
  618.                         nozzle_Type_List_Chosen = "Hall Effect Thruster Nozzle"
  619.                     case "Gridded Ion Thruster":
  620.                         propellant_List = ["Xenon", "Mercury", "Caesium"]
  621.                         random.shuffle(propellant_List)
  622.                         propellant_List_Chosen = random.choice(propellant_List)
  623.                         nozzle_Type_List_Chosen = "Electrostatic Ion Nozzle"
  624.                     case "Colloid Thruster":
  625.                         propellant_List_Chosen = "NH2OH+NO3 (Hydroxylammonium nitrate)"
  626.                         nozzle_Type_List_Chosen = "Capillary Emitter-Electrode Cone"
  627.                     case "Variable Specific Impulse Magnetoplasma Rocket (VASIMR)":
  628.                         propellant_List = ["Xenon", "Krypton", "Argon"]
  629.                         random.shuffle(propellant_List)
  630.                         propellant_List_Chosen = random.choice(propellant_List)
  631.                         nozzle_Type_List_Chosen = "VASIMR Magnetic Confinement Nozzle"
  632.                     case "MagnetoPlasmaDynamic Thruster":
  633.                         propellant_List = ["Xenon", "Neon", "Argon", "Hydrogen", "Hydrazine", "Lithium"]
  634.                         random.shuffle(propellant_List)
  635.                         propellant_List_Chosen = random.choice(propellant_List)
  636.                         nozzle_Type_List_Chosen = "Cathode Plug Magnetic Confinement Nozzle"
  637.                 random.shuffle(powerGen_List)
  638.                 powerGen_List_Chosen = random.choice(powerGen_List)
  639.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  640.                 ET = outputEt(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen,
  641.                             propellant_List_Chosen, nozzle_Type_List_Chosen, powerGen_List_Chosen)
  642.                 return ET
  643.            
  644.             case "Monopropellant (Decomposition)":
  645.                 engine_Name = assCrack(engine_Name1, firstPart)
  646.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling"]
  647.                 nozzle_Type_List1 = ["De Laval Cone (Without Nozzle Extension)", "De Laval Bell (Without Nozzle Extension)"]
  648.                 random.shuffle(nozzle_Type_List1)
  649.                 nozzle_Type_List_Chosen = random.choice(nozzle_Type_List1)
  650.                 random.shuffle(propellant_List1)
  651.                 propellant_List_Chosen = random.choice(propellant_List1)
  652.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  653.                 random.shuffle(cooling_mechanism)
  654.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  655.                 if propellant_List_Chosen == "N2H4 (Hydrazine)" or propellant_List_Chosen == "65% NH4N(NO2)2 (Ammonium Dinitramide) + 35% CH3OH(Methanol)":
  656.                     catalyst_Chosen = "Iridium coated Alumina Pellets"
  657.                 elif propellant_List_Chosen == "H2O2 (Hydrogen Peroxide)":
  658.                     catalyst_Chosen = "KMNO4 (Potassium Permanganate) Honeycomb"
  659.                 elif "NH2OH+NO3 (Hydroxylammonium nitrate)":
  660.                     catalyst_Chosen = "Iridium coated Copper Pellets"
  661.                 MonoD = outputMonod(engine_Name, altitude_Of_Operation_Chosen, propellant_List_Chosen,nozzle_Type_List_Chosen,
  662.                             cooling_Mechanism_Chosen, catalyst_Chosen)
  663.                 return MonoD
  664.                
  665.             case "Monopropellant (Cold Gas)":
  666.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling"]
  667.                 nozzle_Type_List1 = ["De Laval Cone (Without Nozzle Extension)", "De Laval Bell (Without Nozzle Extension)"]
  668.                 random.choice(propellant_List2)
  669.                 propellant_List_Chosen = random.choice(propellant_List2)
  670.                 altitude_Of_Operation_Chosen = "80 km+ (Vacuum)"
  671.                 random.choice(nozzle_Type_List1)
  672.                 nozzle_Type_List_Chosen = random.choice(nozzle_Type_List1)
  673.                 random.choice(cooling_mechanism)
  674.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  675.                 Mono = outputMono(engine_Name, engine_Cycle_Chosen, altitude_Of_Operation_Chosen, propellant_List_Chosen,
  676.                             nozzle_Type_List_Chosen, cooling_Mechanism_Chosen)
  677.                 return Mono
  678.                
  679.             case "Expander (Closed)" | "Expander (Open/Bleed)":
  680.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"]
  681.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling",
  682.                                         "Regenerative Cooling", "Transpiration Cooling"]
  683.                 random.choice(oxidizer_List)
  684.                 oxidizer_Chosen = random.choice(oxidizer_List)
  685.                 match oxidizer_Chosen:
  686.                     case "O2 (Oxygen)":
  687.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%",
  688.                                         "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)", "NH3 (Ammonia)",
  689.                                         "CH6N2 (MonomethylHydrazine)",
  690.                                         "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)",
  691.                                         "B5H9 (Pentaborane)"]
  692.                         random.shuffle(fuel_List)
  693.                         fuel_Chosen = random.choice(fuel_List)
  694.                     case "F2 (Fluorine)":
  695.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%",
  696.                                         "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "N2H4 (Hydrazine)",
  697.                                         "C2H8N2 (UnsymetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)",
  698.                                         "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)", "B5H9 (Pentaborane)"]
  699.                         random.shuffle(fuel_List)
  700.                         fuel_Chosen = random.choice(fuel_List)
  701.                     case "F2 (Fluorine) + O2 (Oxygen)" | "O3 (Ozone)":
  702.                         fuel_List = ["H2 (Hydrogen)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  703.                                         "C12H24 (Kerosene)", "B2H6 (Diborane)", "B5H9 (Pentaborane)"]
  704.                         random.shuffle(fuel_List)
  705.                         fuel_Chosen = random.choice(fuel_List)
  706.                 random.shuffle(altitude_Of_Operation)
  707.                 altitude_Of_Operation_Chosen = random.choice(altitude_Of_Operation)
  708.                 nozzle_Type_Chosen = bussy(altitude_Of_Operation_Chosen)
  709.                 random.shuffle(cooling_mechanism)
  710.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  711.                 isHype = isHypergolic(oxidizer_Chosen, fuel_Chosen)
  712.                 EX = outputEx(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
  713.                             nozzle_Type_Chosen, "Autogenous", cooling_Mechanism_Chosen, isHype)
  714.                 return EX
  715.                
  716.             case "Dual Expander (Closed)" | "Dual Expander (Open/Bleed)":
  717.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)"]
  718.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling",
  719.                                         "Regenerative Cooling", "Transpiration Cooling"]
  720.                 random.choice(oxidizer_List)
  721.                 oxidizer_Chosen = random.choice(oxidizer_List)
  722.                 fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)"]
  723.                 match oxidizer_Chosen:
  724.                     case "O2 (Oxygen)" | "F2 (Fluorine)":
  725.                         random.shuffle(fuel_List)
  726.                         fuel_Chosen = random.choice(fuel_List)
  727.                     case "F2 (Fluorine) + O2 (Oxygen)" : fuel_Chosen = "H2 (Hydrogen)"
  728.                 random.shuffle(altitude_Of_Operation)
  729.                 altitude_Of_Operation_Chosen = random.choice(altitude_Of_Operation)
  730.                 nozzle_Type_Chosen = bussy(altitude_Of_Operation_Chosen)
  731.                 random.shuffle(cooling_mechanism)
  732.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  733.                 isHype = isHypergolic(oxidizer_Chosen, fuel_Chosen)
  734.                 EX = outputEx(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
  735.                             nozzle_Type_Chosen, "Autogenous", cooling_Mechanism_Chosen, isHype)
  736.                 return EX
  737.                
  738.             case "Staged Combustion (Fuel Rich)":
  739.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "O3 (Ozone)"]
  740.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling",
  741.                                         "Regenerative Cooling", "Transpiration Cooling"]
  742.                 random.choice(oxidizer_List)
  743.                 oxidizer_Chosen = random.choice(oxidizer_List)
  744.                 match oxidizer_Chosen:
  745.                     case "O2 (Oxygen)" | "F2 (Fluorine)":
  746.                         fuel_List = ["H2 (Hydrogen)", "NH3 (Ammonia)", "N2H4 (Hydrazine)"]
  747.                         random.shuffle(fuel_List)
  748.                         fuel_Chosen = random.choice(fuel_List)
  749.                
  750.                     case "F2 (Fluorine) + O2 (Oxygen)" | "O3 (Ozone)": fuel_Chosen = "H2 (Hydrogen)"
  751.                 random.shuffle(tank_Repressurisation)
  752.                 tank_Repressurisation_Chosen = random.choice(tank_Repressurisation)
  753.                 random.shuffle(altitude_Of_Operation)
  754.                 altitude_Of_Operation_Chosen = random.choice(altitude_Of_Operation)
  755.                 nozzle_Type_Chosen = bussy(altitude_Of_Operation_Chosen)
  756.                 random.shuffle(cooling_mechanism)
  757.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  758.                 isHype = isHypergolic(oxidizer_Chosen, fuel_Chosen)
  759.                 DEF = outputDef(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
  760.                             nozzle_Type_Chosen, tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, isHype)
  761.                 return DEF
  762.            
  763.             case "Staged Combustion (Oxidizer Rich)":
  764.                 oxidizer_List = ["O2 (Oxygen)", "O3 (Ozone)", "N2O4 (Nitrogen Tetroxide)"]
  765.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling", "Film Cooling",
  766.                                         "Regenerative Cooling", "Transpiration Cooling"]
  767.                 random.choice(oxidizer_List)
  768.                 oxidizer_Chosen = random.choice(oxidizer_List)
  769.                 match oxidizer_Chosen:
  770.                     case "O2 (Oxygen)" | "O3 (Ozone)":
  771.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  772.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)",
  773.                                         "CH3OH (Methanol)"]
  774.                         random.shuffle(fuel_List)
  775.                         fuel_Chosen = random.choice(fuel_List)
  776.                     case "N2O4 (Nitrogen Tetroxide)":
  777.                         fuel_List = ["C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  778.                                         "50% CH6N2 + 50% N2H4 (Aerosine-50)", "C2H8N2 (UnsymetricalDimethylHydrazine)"]
  779.                         random.shuffle(fuel_List)
  780.                         fuel_Chosen = random.choice(fuel_List)
  781.                 random.shuffle(tank_Repressurisation)
  782.                 tank_Repressurisation_Chosen = random.choice(tank_Repressurisation)
  783.                 random.shuffle(altitude_Of_Operation)
  784.                 altitude_Of_Operation_Chosen = random.choice(altitude_Of_Operation)
  785.                 nozzle_Type_Chosen = bussy(altitude_Of_Operation_Chosen)
  786.                 random.shuffle(cooling_mechanism)
  787.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  788.                 isHype = isHypergolic(oxidizer_Chosen, fuel_Chosen)
  789.                 DEF = outputDef(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
  790.                             nozzle_Type_Chosen, tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, isHype)
  791.                 return DEF
  792.            
  793.             case "Full Flow Staged Combustion" | "Combustion Tap Off":
  794.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)", "N2H4 (Hydrazine)",
  795.                                     "O3 (Ozone)", "N2O4 (Nitrogen Tetroxide)"]
  796.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling",
  797.                                         "Film Cooling", "Regenerative Cooling", "Transpiration Cooling"]
  798.                 random.choice(oxidizer_List)
  799.                 oxidizer_Chosen = random.choice(oxidizer_List)
  800.                 match oxidizer_Chosen:
  801.                     case "O2 (Oxygen)":
  802.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%",
  803.                                         "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)", "NH3 (Ammonia)",
  804.                                         "CH6N2 (MonomethylHydrazine)",
  805.                                         "N2H4 (Hydrazine)", "CH3OH (Methanol)", "B2H6 (Diborane)", "B5H9 (Pentaborane)"]
  806.                         random.shuffle(fuel_List)
  807.                         fuel_Chosen = random.choice(fuel_List)
  808.                     case "F2 (Fluorine)":
  809.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%",
  810.                                         "C2H5OH(Ethanol) 75%", "NH3 (Ammonia)", "C2H8N2 (UnsymetricalDimethylHydrazine)",
  811.                                         "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)"]
  812.                         random.shuffle(fuel_List)
  813.                         fuel_Chosen = random.choice(fuel_List)
  814.                     case "F2 (Fluorine) + O2 (Oxygen)" | "O3 (Ozone)":
  815.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%",
  816.                                         "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  817.                                         "50% CH6N2 + 50% N2H4 (Aerosine-50)", "CH6N2 (MonomethylHydrazine)", "B2H6 (Diborane)",
  818.                                         "B5H9 (Pentaborane)"]
  819.                         random.shuffle(fuel_List)
  820.                         fuel_Chosen = random.choice(fuel_List)
  821.                     case "N2H4 (Hydrazine)" | "N2O4 (Nitrogen Tetroxide)":
  822.                         fuel_List = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  823.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  824.                                         "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  825.                                         "C2H8N2 (UnsymetricalDimethylHydrazine)", "CH3OH (Methanol)", "B2H6 (Diborane)"]
  826.                         random.shuffle(fuel_List)
  827.                         fuel_Chosen = random.choice(fuel_List)
  828.                 random.shuffle(tank_Repressurisation)
  829.                 tank_Repressurisation_Chosen = random.choice(tank_Repressurisation)
  830.                 random.shuffle(altitude_Of_Operation)
  831.                 altitude_Of_Operation_Chosen = random.choice(altitude_Of_Operation)
  832.                 nozzle_Type_Chosen = bussy(altitude_Of_Operation_Chosen)
  833.                 random.shuffle(cooling_mechanism)
  834.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  835.                 isHype = isHypergolic(oxidizer_Chosen, fuel_Chosen)
  836.                 DEF = outputDef(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
  837.                             nozzle_Type_Chosen, tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, isHype)
  838.                 return DEF
  839.            
  840.             case _:
  841.                 cooling_mechanism = ["Ablative Cooling", "Radiative Cooling", "Dump Cooling",
  842.                                         "Film Cooling", "Regenerative Cooling", "Transpiration Cooling"]
  843.                 oxidizer_List = ["O2 (Oxygen)", "F2 (Fluorine)", "F2 (Fluorine) + O2 (Oxygen)","N2O4 (Nitrogen Tetroxide)",
  844.                                     "H2O2 (Hydrogen Peroxide) 95%", "H2O2 (Hydrogen Peroxide) 85%", "O3 (Ozone)",
  845.                                     "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)","AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)",
  846.                                     "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)", "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)",
  847.                                     "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)", "ClF3 (Chlorine Trifluoride)",
  848.                                     "ClF5 (Chlorine Pentafluoride)"]
  849.                 random.choice(oxidizer_List)
  850.                 oxidizer_Chosen = random.choice(oxidizer_List)
  851.                 match oxidizer_Chosen:
  852.                     case "O2 (Oxygen)":
  853.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%",
  854.                                         "C2H5OH(Ethanol) 75%", "C6H5NH2 (Aniline)", "NH3 (Ammonia)",
  855.                                         "CH6N2 (MonomethylHydrazine)",
  856.                                         "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)",
  857.                                         "B5H9 (Pentaborane)", "C2H6 (Ethane)"]
  858.                         random.shuffle(fuel_List)
  859.                         fuel_Chosen = random.choice(fuel_List)
  860.                     case "F2 (Fluorine)":
  861.                         fuel_List = ["H2 (Hydrogen)", "CH4 (Methane)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  862.                                         "C6H5NH2 (Aniline)", "NH3 (Ammonia)", "C2H8N2 (UnsymetricalDimethylHydrazine)",
  863.                                         "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)",
  864.                                         "C12H24 (Kerosene)", "B2H6 (Diborane)", "B5H9 (Pentaborane)"]
  865.                         random.shuffle(fuel_List)
  866.                         fuel_Chosen = random.choice(fuel_List)
  867.                     case "F2 (Fluorine) + O2 (Oxygen)"| "O3 (Ozone)":
  868.                         fuel_List = ["H2 (Hydrogen)", "CH3OH (Methanol)", "C12H24 (Kerosene)", "B2H6 (Diborane)","B5H9 (Pentaborane)"]
  869.                         random.shuffle(fuel_List)
  870.                         fuel_Chosen = random.choice(fuel_List)
  871.                     case "AK20F: 80% HNO3 + 20% N2O4 (Nitric Acid)" | "AK20I: 80% HNO3 + 20% N2O4 (Nitric Acid)" |\
  872.                             "AK20K: 80% HNO3 + 20% N2O4 (Nitric Acid)" | "AK27I: 73% HNO3 + 27% N2O4 (Nitric Acid)" |\
  873.                             "AK27P: 73% HNO3 + 27% N2O4 (Nitric Acid)" | "ClF3 (Chlorine Trifluoride)" | "ClF5 (Chlorine Pentafluoride)":
  874.                         fuel_List = ["C2H5OH(Ethanol) 85%", "CH6N2 (MonomethylHydrazine)", "N2H4 (Hydrazine)", "CH3OH (Methanol)"]
  875.                         random.shuffle(fuel_List)
  876.                         fuel_Chosen = random.choice(fuel_List)
  877.                     case "N2O4 (Nitrogen Tetroxide)" | "H2O2 (Hydrogen Peroxide) 95%" | "H2O2 (Hydrogen Peroxide) 85%":
  878.                         fuel_List = ["H2 (Hydrogen)", "C2H5OH(Ethanol) 85%", "C2H5OH(Ethanol) 75%",
  879.                                         "C6H5NH2 (Aniline)", "75% CH6N2 + 25% N2H4 (UH-25)",
  880.                                         "50% CH6N2 + 50% N2H4 (Aerosine-50)",
  881.                                         "C2H8N2 (UnsymmetricalDimethylHydrazine)", "CH6N2 (MonomethylHydrazine)",
  882.                                         "N2H4 (Hydrazine)", "CH3OH (Methanol)", "C12H24 (Kerosene)"]
  883.                         random.shuffle(fuel_List)
  884.                         fuel_Chosen = random.choice(fuel_List)
  885.                 random.shuffle(tank_Repressurisation)
  886.                 tank_Repressurisation_Chosen = random.choice(tank_Repressurisation)
  887.                 random.shuffle(altitude_Of_Operation)
  888.                 altitude_Of_Operation_Chosen = random.choice(altitude_Of_Operation)
  889.                 nozzle_Type_Chosen = bussy(altitude_Of_Operation_Chosen)
  890.                 random.shuffle(cooling_mechanism)
  891.                 cooling_Mechanism_Chosen = random.choice(cooling_mechanism)
  892.                 isHype = isHypergolic(oxidizer_Chosen, fuel_Chosen)
  893.                 DEF = outputDef(engine_Name, engine_Cycle_Chosen, oxidizer_Chosen, fuel_Chosen, altitude_Of_Operation_Chosen,
  894.                             nozzle_Type_Chosen, tank_Repressurisation_Chosen, cooling_Mechanism_Chosen, isHype)
  895.                 return DEF
  896.     def basic_code():
  897.         pass
  898.     def advanced_code():
  899.         pass
  900.     def credits_code():
  901.         jimy = [675,310]
  902.         font = pygame.font.SysFont("Arial", 30)
  903.         textsurface = font.render("Creator: MAKS_Enjoyer", False, Gray)
  904.         jimy[0] = (jimy[0] - (textsurface.get_width()/2))
  905.         screen.blit(textsurface, jimy)
  906.     def render(color, input_rect, base_font, user_text, IsCredits, IsRandom, IsGuide, IsBasic, current, main_y):
  907.         screen.fill((Dark_Gray))
  908.         pygame.draw.rect(screen, Gray, random_gen)
  909.         pygame.draw.rect(screen, Gray, basic_gen)
  910.         pygame.draw.rect(screen, Gray, advanced_gen)
  911.         pygame.draw.rect(screen, Gray, guide)
  912.         pygame.draw.rect(screen, Gray, credits)
  913.         pygame.draw.rect(screen, Gray, exit_btn)
  914.         reddit_btn = screen.blit(imp1, jim_bob8)
  915.         discord_btn = screen.blit(imp2, jim_bob9)
  916.         web_btn = screen.blit(imp3, jim_bob10)
  917.         #------------------------------------------------------------------
  918.         #Rectangle Thingy for the screen
  919.         (x, y, width, height) = (360, 162, 620, 380)
  920.         border_width = 3
  921.         pygame.draw.rect(screen, Dark_Gray, (x, y, width, height))
  922.         pygame.draw.rect(screen, Gray, (x, y, width, height), width=border_width)
  923.         #-------------------------------------------------------------------
  924.         font1 = pygame.font.SysFont("Segoe UI Black", 70)
  925.         textsurface1 = font1.render("Rocket Engine Builder", True, Gray)  
  926.         jim1 = textsurface1.get_rect(center = screen.get_rect().center)
  927.         jim1[1] = 0
  928.         screen.blit(textsurface1, jim1)
  929.         #-------------------------------------------------------------------
  930.         font2 = pygame.font.SysFont("Arial", 20, True)
  931.         textsurface2 = font2.render("Choose a configuration:", True, Gray)    
  932.         jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  933.         jim2[0] = (167 - (textsurface2.get_width()/2))
  934.         jim2[1] = main_y - 32
  935.         screen.blit(textsurface2, jim2)
  936.         #-------------------------------------------------------------------
  937.         font2 = pygame.font.SysFont("Arial", 18)
  938.         textsurface2 = font2.render("Random Generation", True, Dark_Gray)  
  939.         jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  940.         jim2[0] = cntrx - 80
  941.         jim2[1] = ys1 + 25
  942.         screen.blit(textsurface2, jim2)    
  943.         #-------------------------------------------------------------------
  944.         font2 = pygame.font.SysFont("Arial", 18)
  945.         textsurface2 = font2.render("Basic Generation", True, Dark_Gray)  
  946.         jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  947.         jim2[0] = cntrx - 71
  948.         jim2[1] = ys1 + 110
  949.         screen.blit(textsurface2, jim2)      
  950.         #-------------------------------------------------------------------
  951.         font2 = pygame.font.SysFont("Arial", 18)
  952.         textsurface2 = font2.render("Advanced Generation", True, Dark_Gray)  
  953.         jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  954.         jim2[0] = cntrx - 86
  955.         jim2[1] = ys2 + 111
  956.         screen.blit(textsurface2, jim2)
  957.         #-------------------------------------------------------------------
  958.         font2 = pygame.font.SysFont("Arial", 18)
  959.         textsurface2 = font2.render("Credits", True, Dark_Gray)  
  960.         jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  961.         jim2[0] = ((cntrx + 53) - (btnw4/2)) + 19
  962.         jim2[1] = main_y + 263
  963.         screen.blit(textsurface2, jim2)
  964.         #-------------------------------------------------------------------
  965.         font2 = pygame.font.SysFont("Arial", 18)
  966.         textsurface2 = font2.render("Help", True, Dark_Gray)  
  967.         jim2 = textsurface2.get_rect(center = screen.get_rect().center)
  968.         jim2[0] = ((cntrx - 53) - (btnw4/2)) + 30
  969.         jim2[1] = main_y + 263
  970.         screen.blit(textsurface2, jim2)
  971.         #-------------------------------------------------------------------
  972.         if IsRandom == False and IsAdvanced == False and IsBasic == False:
  973.             jimy2 = [675,133]
  974.             font4 = pygame.font.SysFont("Arial", 20)
  975.             textsurface4 = font4.render("Press a button on your left to start...", True, Gray)
  976.             jimy2[0] = (jimy2[0] - (textsurface4.get_width()/2))
  977.             screen.blit(textsurface4, jimy2)          
  978.             guide_code()
  979.         #-------------------------------------------------------------------
  980.         font3 = pygame.font.SysFont("Garamond", 22)
  981.         textsurface3 = font3.render("EXIT", False, Dark_Gray)
  982.         jim3 = [17,575]
  983.         screen.blit(textsurface3, jim3)    
  984.         #-------------------------------------------------------------------
  985.         if IsCredits == True:
  986.             credits_code()
  987.         #-------------------------------------------------------------------
  988.         if IsRandom == True:
  989.             back_btn = screen.blit(imp4, jim_bob11)
  990.             reload_btn = screen.blit(imp5, jim_bob12)
  991.             Foldr_path = r"C:/Users/Public/Operational_Functional_Block/Python_Projects/LogData/RandomSection"
  992.             filepath = os.path.join(Foldr_path, 'log_file.txt')
  993.             if not os.path.exists(Foldr_path):
  994.                 os.makedirs(Foldr_path)
  995.             f = open(filepath, "a")
  996.             ass = current[0]
  997.             for i in current:
  998.                 if current.index(i) == 0:
  999.                     jimy = [680,173]
  1000.                     font = pygame.font.SysFont("Segoe UI", 22)
  1001.                     textsurface = font.render(i, True, Gray)
  1002.                     jimy[0] = (jimy[0] - (textsurface.get_width()/2))
  1003.                     screen.blit(textsurface, jimy)
  1004.                 else:
  1005.                     jimy = [380,((current.index(i)*19) + 200)]
  1006.                     font = pygame.font.SysFont("Segoe UI", 14)
  1007.                     textsurface = font.render(i, True, Gray)
  1008.                     screen.blit(textsurface, jimy)
  1009.             if search_str(filepath, ass) == False:
  1010.                 for i in current:
  1011.                     if current.index(i) == 0:
  1012.                         f.write(i + '\n')
  1013.                     else:
  1014.                         if current.index(i) == (len(current)-1):
  1015.                             f.write(i + '\n' + '\n')
  1016.                             f.close()
  1017.                         else:
  1018.                             f.write(i + '\n')
  1019.             IsRandom = False
  1020.         #-------------------------------------------------------------------
  1021.         if IsAdvanced == True:
  1022.             pygame.draw.rect(screen, color, input_rect)
  1023.             text_surface = base_font.render(user_text, True, Gray)
  1024.             screen.blit(text_surface, (input_rect.x+5, input_rect.y+5))
  1025.             input_rect.w = max(100, text_surface.get_width()+10)
  1026.             advanced_code()
  1027.         #-------------------------------------------------------------------
  1028.         if IsGuide == True:
  1029.             guide_code()
  1030.         #-------------------------------------------------------------------
  1031.         if IsBasic == True:
  1032.             w01 = 335
  1033.             h01 = 50
  1034.             x01 = 680 - (w01/2)
  1035.             y01 = 340 - (h01/2)
  1036.             list1 = DropDown(
  1037.             [(200, 200, 200), (165, 165, 165)], [(182, 182, 182), (172, 172, 172)],
  1038.             x01, y01, w01, h01, pygame.font.SysFont("Segoe UI Black", 18),
  1039.             "Select the Purpose of the Engine", ["Lander", "Launcher", "SpaceTug"])
  1040.  
  1041.             selected_option = list1.update(events)
  1042.             if selected_option >= 0:
  1043.                 sock = list1.options[selected_option]
  1044.                 print(sock)
  1045.             list1.draw(screen)
  1046.             basic_code()
  1047.         #-------------------------------------------------------------------
  1048.         pygame.display.flip()
  1049.  
  1050.     clock.tick(60)
  1051.     run = True
  1052.     IsBasic = False
  1053.     IsGuide = False
  1054.     IsRandom = False
  1055.     IsCredits = False
  1056.     IsAdvanced = False
  1057.     base_font = pygame.font.Font(None, 32)
  1058.     user_text = ""
  1059.     basic_info = ""
  1060.     color_active = (0,0,0)
  1061.     color_passive = (0,0,0)
  1062.     color = color_passive
  1063.     input_rect = pygame.Rect(400, 200, 140, 32)
  1064.     active = False
  1065.     count = -1
  1066.     prevR = []
  1067.     current = []
  1068.     while run:
  1069.         render(color, input_rect, base_font, user_text, IsCredits, IsRandom, IsGuide, IsBasic, current, main_y)
  1070.         events = pygame.event.get()
  1071.         for event in events:
  1072.             if event.type == pygame.QUIT:
  1073.                 run = False
  1074.             elif event.type == pygame.MOUSEBUTTONDOWN:
  1075.                 mouse_pos = event.pos
  1076.                 if IsRandom == True:
  1077.                     if back_btn.collidepoint(mouse_pos):
  1078.                         IsBasic = False
  1079.                         IsGuide = False
  1080.                         IsCredits = False
  1081.                         IsAdvanced = False
  1082.                         if prevR.index(current) > 0:
  1083.                             current = prevR[prevR.index(current)-1]
  1084.                         else:
  1085.                             pass
  1086.                     if reload_btn.collidepoint(mouse_pos):
  1087.                         IsBasic = False
  1088.                         IsGuide = False
  1089.                         IsRandom = True
  1090.                         IsCredits = False
  1091.                         IsAdvanced = False
  1092.                         if (prevR.index(current) + 1) <= count and count > 2:
  1093.                             if next + 2 >= len(prevR.index(current)):
  1094.                                 next = len(prevR.index(current))+1
  1095.                             else:
  1096.                                 next = prevR.index(current)+2
  1097.                             current = prevR[next]
  1098.                             print("Count = " + str(count))
  1099.                             print("Current Index = " + str(prevR.index(current)))
  1100.                         elif (prevR.index(current) + 1) > count:
  1101.                             current = random_code()
  1102.                             prevR.append(current)
  1103.                             print("Count = " + str(count))
  1104.                             print("Current Index = " + str(prevR.index(current)))
  1105.                         else:
  1106.                             print("EdgeCase: Error encountered while buttons were buttoning")
  1107.                             print("Count = " + str(count))
  1108.                             print("Current Index = " + str(prevR.index(current)))
  1109.                         count = count + 1
  1110.                         if count > prevR.index(current):
  1111.                             count = prevR.index(current)
  1112.                 if random_gen.collidepoint(mouse_pos):
  1113.                     IsBasic = False
  1114.                     IsGuide = False
  1115.                     IsRandom = True
  1116.                     IsCredits = False
  1117.                     IsAdvanced = False
  1118.                     if count <= 0:
  1119.                         current = random_code()
  1120.                     prevR.append(current)
  1121.                     count = count + 1
  1122.                     print("Count = " + str(count))
  1123.                     print("Current Index = " + str(prevR.index(current)))
  1124.                 if basic_gen.collidepoint(mouse_pos):
  1125.                     IsBasic = True
  1126.                     IsGuide = False
  1127.                     IsRandom = False
  1128.                     IsCredits = False
  1129.                     IsAdvanced = False
  1130.                 if advanced_gen.collidepoint(mouse_pos):
  1131.                     IsBasic = False
  1132.                     IsGuide = False
  1133.                     IsRandom = False
  1134.                     IsCredits = False
  1135.                     IsAdvanced = True
  1136.                     if event.type == pygame.MOUSEBUTTONDOWN:
  1137.                         if input_rect.collidepoint(event.pos):
  1138.                             active = True
  1139.                         else:
  1140.                             active = False
  1141.                     if event.type == pygame.KEYDOWN:
  1142.                         if event.key == pygame.K_BACKSPACE:
  1143.                             user_text = user_text[:-1]
  1144.                         elif event.key == pygame.K_RETURN:
  1145.                             final = user_text
  1146.                             if final != "trans rights are human rights":
  1147.                                 user_text = ""
  1148.                         else:
  1149.                             user_text += event.unicode
  1150.                     if active:
  1151.                         color = color_active
  1152.                     else:
  1153.                         color = color_passive      
  1154.                     #-------------------------------------------------------------------    
  1155.                 if guide.collidepoint(mouse_pos):
  1156.                     IsBasic = False
  1157.                     IsGuide = True
  1158.                     IsRandom = False
  1159.                     IsCredits = False
  1160.                     IsAdvanced = False
  1161.                     guide_code()
  1162.                 if credits.collidepoint(mouse_pos):
  1163.                     IsBasic = False
  1164.                     IsGuide = False
  1165.                     IsRandom = False
  1166.                     IsCredits = True
  1167.                     IsAdvanced = False
  1168.                 if reddit_btn.collidepoint(mouse_pos):
  1169.                     webbrowser.open(r"https://reddit.com/")    
  1170.                 if discord_btn.collidepoint(mouse_pos):
  1171.                     webbrowser.open(r"https://youtube.com/")    
  1172.                 if web_btn.collidepoint(mouse_pos):
  1173.                     webbrowser.open(r"https://stackoverflow.com/")      
  1174.                 if exit_btn.collidepoint(mouse_pos):
  1175.                     sys.exit()    
  1176.         if IsBasic == True:
  1177.             IsGuide = False
  1178.             IsRandom = False
  1179.             IsCredits = False
  1180.             IsAdvanced = False
  1181.             list1 = DropDown(
  1182.                 [(200, 200, 200), (165, 165, 165)],
  1183.                 [(182, 182, 182), (172, 172, 172)],
  1184.                 (680-167), (340-25), 335, 50,
  1185.                 pygame.font.SysFont(None, 30),
  1186.                 "Select the Purpose of the Engine", ["Lander", "Launcher", "SpaceTug"])
  1187.             selected_option = list1.update(events)
  1188.             if selected_option >= 0:
  1189.                 basic_info = list1.options[selected_option]
  1190.                 print(basic_info)
  1191.             list1.draw(screen)                                                                
  1192.         render(color, input_rect, base_font, user_text, IsCredits, IsRandom, IsGuide, IsBasic, current, main_y)        
  1193.     pygame.quit()
  1194. reg()
Add Comment
Please, Sign In to add comment