Advertisement
yoshi_squashy

SM64DS TAS task generator (Fernando)

Aug 7th, 2019
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 28.05 KB | None | 0 0
  1. #Code for fernando the virtual robot
  2. #Thank you to SkicoNow and VTMagno who helped in the process of making this
  3. #Coding note: the "@" symbol is a special character for this program
  4.  
  5. import random #random module needed for RNG
  6.  
  7. #DATA yay
  8. characters = ["Play as any character",
  9.               "Play as Yoshi",
  10.               "Play as Mario",
  11.               "Play as Luigi",
  12.               "Play as Wario"]
  13.  
  14. notes = "If you get something like BOB8 this means get the 100 coin star for that level"
  15.  
  16. caps = ["You cannot get caps", "You may get caps"]
  17.  
  18.  
  19. nonStarObjectives = {1:"collect @ coins",
  20.                      2:"collect two 1-ups",
  21.                      3:"Break all the ? blocks",
  22.                      4:"Break all the ! blocks",
  23.                      5:"collect @ of 8 red coins",
  24.                      6:"collect 4 of 5 silver stars",
  25.                      7:"kill all enemies"}
  26.  
  27. handicapSet1 = [("You cannot use more than @ B press(es)",(0,20)),
  28.                 ("Your TAS must have exactly @ B press(es)",(0,20)),
  29.                 ("You must ground pound exactly @ time(s)",(1,5)),
  30.                 ("The total of long jumps and jumps in your TAS"+
  31.                  " must sum to @",(15,20)),
  32.                 ("The sum of long jumps and jumps in your TAS"+
  33.                 " must be @",(15,30)),
  34.                 ("You cannot use more than @ A press(es)",(0,5)),
  35.                 ("Your TAS must have exactly @ A press(es)",(0,20))]
  36.  
  37. handicapSet2 = [("You must collect exactly @ coin(s)",(20,100)),
  38.                 ("You cannot collect more than @ coin(s)",(0,20)),
  39.                 ("The use of the touchscreen is banned",(0,0)),
  40.                 ("You must finish on exactly half health",(0,0)),
  41.                 ("You cannot kill more than @ enemie(s)",(0,3)),
  42.                 ("You cannot use cannons",(0,0))]
  43.  
  44. handicapSet3 = [("You must eat exactly @ object(s) as yoshi",(0,5)),
  45.                 ("You must grab exactly @ cap(s) as yoshi",(1,3)),
  46.                 ("You must do exactly @ spit jump(s) as yoshi",(1,5)),
  47.                 ("You must wall jump before collecting every object",(0,0)),
  48.                 ("You cannot make eggs as yoshi",(0,0)),
  49.                 ("You must use a cannon exactly @ time(s)",(0,3)),
  50.                 ("You must do exactly 1 dive reset",(0,0)),
  51.                 ("If you started the level as Mario, Luigi or Wario,"+
  52.                  " you must start with their cap not on their head",(0,0))]
  53.  
  54.  
  55.                
  56.                
  57.  
  58. #The next line of code declares a 1D array of all 29 levels using their acronym names
  59. linearLvlsData = ['BOB', 'WF', 'JRB', 'CCM', 'BBH', 'HMC', 'LLL', 'SSL', 'DDD', 'SL', 'WDW', 'TTM', 'THI', 'TTC', 'RR', 'GB', 'BBB', 'CCC', 'BitDW', 'BitFS', 'BitS', 'BF', 'TSutM', 'PSS', 'SI', '?S', 'BtW', 'OtR', 'A']
  60.  
  61. #The next lines of code delclares a 2D dictionary array that has data on lots of things
  62. complexLvlsData = {'BOB':
  63.                    {'reds':True,'silvers':True,'has!box':True,'has?box':True,
  64.                     'hasEnemies':True,'maxCoins':139,
  65.                     'loc0':"Start from the beginning of the level",
  66.                     'loc1':"Start from the tree on the floating isle\nimages/BOB/location1.jpg",
  67.                     'loc2':"Start from any inside any cannon",
  68.                     'loc3':"Start by teleporting from the teleport in the image below\nimages/BOB/location3.jpg"},
  69.                    'WF':
  70.                    {'reds': True, 'silvers': False, 'has!box': False, 'has?box': True,
  71.                     'hasEnemies': True, 'maxCoins': 182,
  72.                     'loc0': 'Start from the beginning of the level',
  73.                     'loc1': 'Start in the cannon near the Bob Omb buddy used to open it\nimages/WF/location1.jpg',
  74.                     'loc2': 'Start by using the teleporter in the image below\nimages/WF/location2.jpg',
  75.                     'loc3': 'Start from the beginning of the level'},
  76.                    'JRB':
  77.                    {'reds': True, 'silvers': False, 'has!box': True, 'has?box': True,
  78.                     'hasEnemies': True, 'maxCoins': 140,
  79.                     'loc0': 'Start from the beginning of the level',
  80.                     'loc1': 'Start from the pole in the image below\nimages/JRB/location1.jpg',
  81.                     'loc2': 'Start from the beginning of the level',
  82.                     'loc3': 'Start from the beginning of the level'},
  83.                    'CCM':
  84.                    {'reds': True, 'silvers': False, 'has!box': True,
  85.                     'has?box': False, 'hasEnemies': True, 'maxCoins': 157,
  86.                     'loc0': 'Start from the beginning of the level',
  87.                     'loc1': 'Start in the cannon in the image below\nimages/CCM/location1.jpg',
  88.                     'loc2': 'Start from the tree near the snowman\nimages/CCM/location2.jpg',
  89.                     'loc3': 'Start by entering the slide house chimney'},
  90.                    'BBH':
  91.                    {'reds': True, 'silvers': False, 'has!box': True,
  92.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 119,
  93.                     'loc0': 'Start from the beginning of the level',
  94.                     'loc1': 'Start from the beginning of the level',
  95.                     'loc2': 'Start from the beginning of the level',
  96.                     'loc3': 'Start from the beginning of the level'},
  97.                    'HMC':
  98.                    {'reds': True, 'silvers': False, 'has!box': True,
  99.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 136,
  100.                     'loc0': 'Start from the beginning of the level',
  101.                     'loc1': 'Start from the beginning of the level',
  102.                     'loc2': 'Start from the beginning of the level',
  103.                     'loc3': 'Start from the beginning of the level'},
  104.                    'LLL':
  105.                    {'reds': True, 'silvers': True, 'has!box': True,
  106.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 210,
  107.                     'loc0': 'Start from the beginning of the level',
  108.                     'loc1': 'Start from the beginning of the level',
  109.                     'loc2': 'Start from the beginning of the level',
  110.                     'loc3': 'Start from the beginning of the level'},
  111.                    'SSL':
  112.                    {'reds': True, 'silvers': True, 'has!box': True,
  113.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 139,
  114.                     'loc0': 'Start from the beginning of the level',
  115.                     'loc1': 'Start from the palm tree\nimages/SSL/location1.jpg',
  116.                     'loc2': 'Start in cannon\nimages/SSL/location2.jpg',
  117.                     'loc3': 'Start from the beginning of the level'},
  118.                    'DDD':
  119.                    {'reds': True, 'silvers': False, 'has!box': True,
  120.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 147,
  121.                     'loc0': 'Start from the beginning of the level',
  122.                     'loc1': 'Start from this pole\nimages/DDD/location1.jpg',
  123.                     'loc2': 'Start from the beginning of the level',
  124.                     'loc3': 'Start from the beginning of the level'},
  125.                    'SL':
  126.                    {'reds': True, 'silvers': True, 'has!box': True,
  127.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 131,
  128.                     'loc0': 'Start from the beginning of the level',
  129.                     'loc1': 'Start by entering the igloo',
  130.                     'loc2': 'Start from the tree on top of the snowman\nimages/SL/location2.jpg',
  131.                     'loc3': 'Start from the beginning of the level'},
  132.                    'WDW':
  133.                    {'reds': True, 'silvers': True, 'has!box': True,
  134.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 150,
  135.                     'loc0': 'Start from the beginning of the level',
  136.                     'loc1': 'Start from the cannon\nimages/WDW/location1.jpg',
  137.                     'loc2': 'Start from any tree in the underwater town\nimages/WDW/location2.jpg',
  138.                     'loc3': 'Start from the beginning of the level'},
  139.                    'TTM':
  140.                    {'reds': True, 'silvers': False, 'has!box': True,
  141.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 144,
  142.                     'loc0': 'Start from the beginning of the level',
  143.                     'loc1': 'Start from the cannon\nimages/TTM/location1.jpg',
  144.                     'loc2': 'Start by teleporting in the teleporter in the image below\nimages/TTM/location2.jpg',
  145.                     'loc3': 'Start from the beginning of the level'},
  146.                    'THI':
  147.                    {'reds': True, 'silvers': False, 'has!box': True,
  148.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 157,
  149.                     'loc0': 'Start from the beginning of the level',
  150.                     'loc1': 'Start by entering the cave that has red coins',
  151.                     'loc2': 'Start in the cannon\nimages/THI/location2.jpg',
  152.                     'loc3': 'Start by entering any small island pipe'},
  153.                    'TTC':
  154.                    {'reds': True, 'silvers': True, 'has!box': True,
  155.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 124,
  156.                     'loc0': 'Start from the beginning of the level',
  157.                     'loc1': 'Start from the pole with the amp\nimages/TTC/location1.jpg',
  158.                     'loc2': 'Start from the pole at the top\nimages/TTC/location2.jpg',
  159.                     'loc3': 'Start from the beginning of the level'},
  160.                    'RR':
  161.                    {'reds': True, 'silvers': False, 'has!box': True,
  162.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 149,
  163.                     'loc0': 'Start from the beginning of the level',
  164.                     'loc1': 'Start from the pole next to chuck-ya\nimages/RR/location1.jpg',
  165.                     'loc2': 'Start in the cannon on the cruiser\nimages/RR/location2.jpg',
  166.                     'loc3': 'Start by using the teleporter in the image\nimages/RR/location3.jpg'},
  167.                    'GB':
  168.                    {'reds': True, 'silvers': False, 'has!box': True,
  169.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 105,
  170.                     'loc0': 'Start from the beginning of the level',
  171.                     'loc1': 'Start from the pole\nimages/mario unlock level/location1.jpg',
  172.                     'loc2': 'Start from the beginning of the level',
  173.                     'loc3': 'Start from the beginning of the level'},
  174.                    'BBB':
  175.                    {'reds': True, 'silvers': False, 'has!box': False,
  176.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 79,
  177.                     'loc0': 'Start from the beginning of the level',
  178.                     'loc1': 'Start from the beginning of the level',
  179.                     'loc2': 'Start from the beginning of the level',
  180.                     'loc3': 'Start from the beginning of the level'},
  181.                    'CCC':
  182.                    {'reds': True, 'silvers': False, 'has!box': False,
  183.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 79,
  184.                     'loc0': 'Start from the beginning of the level',
  185.                     'loc1': 'Start from the beginning of the level',
  186.                     'loc2': 'Start from the beginning of the level',
  187.                     'loc3': 'Start from the beginning of the level'},
  188.                    'BitDW':
  189.                    {'reds': True, 'silvers': False, 'has!box': True,
  190.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 80,
  191.                     'loc0': 'Start from the beginning of the level',
  192.                     'loc1': 'Start from the beginning of the level',
  193.                     'loc2': 'Start from the beginning of the level',
  194.                     'loc3': 'Start from the beginning of the level'},
  195.                    'BitFS':
  196.                    {'reds': True, 'silvers': False, 'has!box': True,
  197.                     'has?box': False, 'hasEnemies': True, 'maxCoins': 80,
  198.                     'loc0': 'Start from the beginning of the level',
  199.                     'loc1': 'Start from pole 1\nimages/BitFS/location1.jpg',
  200.                     'loc2': 'Start from pole 2\nimages/BitFS/location2.jpg',
  201.                     'loc3': 'Start from the beginning of the level'},
  202.                    'BitS':
  203.                    {'reds': True, 'silvers': False, 'has!box': False,
  204.                     'has?box': False, 'hasEnemies': True, 'maxCoins': 68,
  205.                     'loc0': 'Start from the beginning of the level',
  206.                     'loc1': 'Start from the pole\nimages/BitS/location1.jpg',
  207.                     'loc2': 'Start by grabbing this ledge anywhere:\nimages/BitS/location2.jpg',
  208.                     'loc3': 'Start from the beginning of the level'},
  209.                    'BF':
  210.                    {'reds': False, 'silvers': True, 'has!box': False,
  211.                     'has?box': False, 'hasEnemies': True, 'maxCoins': 95,
  212.                     'loc0': 'Start from the beginning of the level',
  213.                     'loc1': 'Start from the pole\nimages/battle fort/location1.jpg',
  214.                     'loc2': 'Start from the beginning of the level',
  215.                     'loc3': 'Start from the beginning of the level'},
  216.                    'TSutM':
  217.                    {'reds': True, 'silvers': False, 'has!box': True,
  218.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 55,
  219.                     'loc0': 'Start from the beginning of the level',
  220.                     'loc1': 'Start by collecting any power flower',
  221.                     'loc2': 'Start from the beginning of the level',
  222.                     'loc3': 'Start from the beginning of the level'},
  223.                    'PSS':
  224.                    {'reds': False, 'silvers': False, 'has!box': True,
  225.                     'has?box': False, 'hasEnemies': False, 'maxCoins': 80,
  226.                     'loc0': 'Start from the beginning of the level',
  227.                     'loc1': 'Start from the beginning of the level',
  228.                     'loc2': 'Start from the beginning of the level',
  229.                     'loc3': 'Start from the beginning of the level'},
  230.                    'SI':
  231.                    {'reds': False, 'silvers': True, 'has!box': True,
  232.                     'has?box': False, 'hasEnemies': True, 'maxCoins': 23,
  233.                     'loc0': 'Start from the beginning of the level',
  234.                     'loc1': 'Start from tree 1\nimages/sunshine isles/location1.jpg',
  235.                     'loc2': 'Start from the beginning of the level',
  236.                     'loc3': 'Start from the beginning of the level'},
  237.                    '?S':
  238.                    {'reds': True, 'silvers': False, 'has!box': False,
  239.                     'has?box': True, 'hasEnemies': False, 'maxCoins': 63,
  240.                     'loc0': 'Start from the beginning of the level',
  241.                     'loc1': 'Start from the beginning of the level',
  242.                     'loc2': 'Start from the beginning of the level',
  243.                     'loc3': 'Start from the beginning of the level'},
  244.                    'BtW':
  245.                    {'reds': True, 'silvers': False, 'has!box': True,
  246.                     'has?box': True, 'hasEnemies': True, 'maxCoins': 63,
  247.                     'loc0': 'Start from the beginning of the level',
  248.                     'loc1': 'Start from the beginning of the level',
  249.                     'loc2': 'Start from the beginning of the level',
  250.                     'loc3': 'Start from the beginning of the level'},
  251.                    'OtR':
  252.                    {'reds': True, 'silvers': False, 'has!box': True,
  253.                     'has?box': True, 'hasEnemies': False, 'maxCoins': 40,
  254.                     'loc0': 'Start from the beginning of the level',
  255.                     'loc1': 'Start by collecting any wing cap',
  256.                     'loc2': 'Start in any cannon',
  257.                     'loc3': 'Start from any of the vines\nimages/over the rainbows/location3.jpg'},
  258.                    'A':
  259.                    {'reds': True, 'silvers': False, 'has!box': False,
  260.                     'has?box': False, 'hasEnemies': False, 'maxCoins': 56,
  261.                     'loc0': 'Start from the beginning of the level',
  262.                     'loc1': 'Start from the beginning of the level',
  263.                     'loc2': 'Start from the beginning of the level',
  264.                     'loc3': 'Start from the beginning of the level'}}
  265.                    
  266.                    
  267.                    
  268.  
  269. secretStars = {1: 'BitDW Reds', 2: 'BitDW Switch Star',
  270.                3: 'BitFS Reds', 4: 'BitFS Switch Star',
  271.                5: 'BitS Reds', 6: 'BitS Switch Star',
  272.                7: 'GB Reds', 8: 'GB Switch Star',
  273.                9: 'BBB Reds', 10: 'BBB Painting Star', 11: 'CCC Reds',
  274.                12: 'CCC Black box star', 13: 'BtW Reds',
  275.                14: 'BtW Main Star', 15: 'TSutM Reds',
  276.                16: 'TSutM Switch Star', 17: 'OtR Reds',
  277.                18: 'OtR black box star', 19: 'PSS ! box Star',
  278.                20: 'PSS Under 21 Star', 21: '?S Reds (? switch reds)',
  279.                22: 'SI Silvers (sunshine isles)', 23: 'A Reds (the secret aquarium reds)',
  280.                24: 'BF Silvers (battle fort silvers)'}                  
  281.                    
  282.                    
  283.                    
  284.                    
  285.                    
  286.                    
  287.                    
  288.                    
  289.                    
  290.  
  291.                    
  292.                    
  293.                    
  294.                          
  295.                    
  296.                    
  297.                    
  298.                    
  299.  
  300.                    
  301.                
  302.  
  303.  
  304.  
  305. def generateTask():
  306.     possibleLvls = []
  307.    
  308.     #CHAR AND CAPS
  309.     print("Character:")
  310.     charRNG = random.randint(0,4)
  311.     print(characters[charRNG])
  312.  
  313.     print("Caps:")
  314.     capsRNG = random.randint(0,1)
  315.     print(caps[capsRNG])
  316.  
  317.     print("Objective:")
  318.     #OBJECTIVE TIME + location
  319.     #There is a 40% chance the objective will be a
  320.     #non-star objective
  321.     #There is a 60% chance the objective will be to collect a specific star
  322.     starOrNoRNG = random.randint(1,100)
  323.  
  324.     #1-40 means a no star objective
  325.     if starOrNoRNG >= 1 and starOrNoRNG <= 40:
  326.  
  327.        
  328.         noStarRNG = random.randint(1,len(nonStarObjectives))#RNG for noStar
  329.        
  330.        
  331.         #objectives 0 and 1 are any level
  332.         if noStarRNG == 2:#collect two 1-ups
  333.             print(nonStarObjectives[noStarRNG])
  334.             print("Location:")
  335.             lvl = random.randint(0,28)
  336.             lvl = linearLvlsData[lvl]
  337.             print(lvl)
  338.             startRNG = random.randint(0,3)
  339.             print(complexLvlsData[lvl]["loc"+str(startRNG)])
  340.         elif noStarRNG == 1:#Collect @ coins
  341.             lvl = random.randint(0,28)
  342.             lvl = linearLvlsData[lvl]
  343.             temp = nonStarObjectives[noStarRNG].split("@")
  344.             coinTarget = random.randint(10,complexLvlsData[lvl]['maxCoins'])
  345.             print(temp[0]+str(coinTarget)+temp[1])
  346.             print("Location:")
  347.             print(lvl)
  348.             startRNG = random.randint(0,3)
  349.             print(complexLvlsData[lvl]["loc"+str(startRNG)])
  350.         elif noStarRNG == 3: #break all the ? blocks
  351.             print("Break all the ? blocks")
  352.             print("Location:")
  353.  
  354.        
  355.             for level in complexLvlsData:
  356.                 if complexLvlsData[level]['has?block'] == True:
  357.                     possibleLvls.append(level)
  358.             random.shuffle(possibleLvls)
  359.             lvl = possibleLvls[0]
  360.             print(lvl)
  361.             startRNG = random.randint(0,3)
  362.             print(complexLvlsData[lvl]["loc"+str(startRNG)])
  363.         elif noStarRNG == 4:#break all the ! blocks
  364.             print("Break all the ! blocks")
  365.             print("Location:")
  366.  
  367.        
  368.             for level in complexLvlsData:
  369.                 if complexLvlsData[level]['has!block'] == True:
  370.                     possibleLvls.append(level)
  371.             random.shuffle(possibleLvls)
  372.             lvl = possibleLvls[0]
  373.             print(lvl)
  374.             startRNG = random.randint(0,3)
  375.             print(complexLvlsData[lvl]["loc"+str(startRNG)])
  376.        
  377.         elif noStarRNG == 5:#collect @ of 8 red coins
  378.             temp = nonStarObjectives[noStarRNG].split("@")
  379.             coinTarget = random.randint(3,7)
  380.             print(temp[0]+str(coinTarget)+temp[1])
  381.             print("Location:")
  382.            
  383.             for level in complexLvlsData:
  384.                 if complexLvlsData[level]['reds'] == True:
  385.                     possibleLvls.append(level)
  386.             random.shuffle(possibleLvls)
  387.             lvl = possibleLvls[0]
  388.             print(lvl)
  389.             startRNG = random.randint(0,3)
  390.             print(complexLvlsData[lvl]["loc"+str(startRNG)])
  391.         elif noStarRNG == 6:#collect 4 of 5 silver stars
  392.             print(nonStarObjectives[noStarRNG])
  393.             print("Location:")
  394.             for level in complexLvlsData:
  395.                 if complexLvlsData[level]['silvers'] == True:
  396.                     possibleLvls.append(level)
  397.             random.shuffle(possibleLvls)
  398.             lvl = possibleLvls[0]
  399.             print(lvl)
  400.             startRNG = random.randint(0,3)
  401.             print(complexLvlsData[lvl]["loc"+str(startRNG)])
  402.         elif noStarRNG == 7:#kill every enemy
  403.             print("Kill every killable enemy")
  404.             print("Location:")
  405.             for level in complexLvlsData:
  406.                 if complexLvlsData[level]['hasEnemies'] == True:
  407.                     possibleLvls.append(level)
  408.             random.shuffle(possibleLvls)
  409.             lvl = possibleLvls[0]
  410.             print(lvl)
  411.             startRNG = random.randint(0,3)
  412.             print(complexLvlsData[lvl]["loc"+str(startRNG)])
  413.  
  414.            
  415.                        
  416.            
  417.            
  418.            
  419.            
  420.                  
  421.            
  422.            
  423.        
  424.  
  425.     elif starOrNoRNG >= 41 and starOrNoRNG <=100:
  426.         print("Collect the star: \"",end='')
  427.         #41-100 means a star objective
  428.         starRNG = random.randint(1,144)#this would be (1,150) but six of the stars in
  429.         #the game are not recollectable so I thought I'd give them a skip
  430.         #RANGES:
  431.         #1-8 BOB
  432.         #9-16 WF
  433.         #17-24 JRB
  434.         #25-32 CCM
  435.         #33-40 BBH
  436.         #41-48 HMC
  437.         #49-56 LLL
  438.         #57-64 SSL
  439.         #65-72 DDD
  440.         #73-80 SL
  441.         #81-88 WDW
  442.         #89-96 TTM
  443.         #97-104 THI
  444.         #105 -112 TTC
  445.         #113-120 RR
  446.         #121-144 SECRET STARS WOW!
  447.  
  448.         if starRNG >= 1 and starRNG <= 8:
  449.             print("BOB",end='')
  450.             print(str(starRNG-(8-8)),end='')
  451.             lvl = "BOB"
  452.         elif starRNG >= 9 and starRNG <= 16:
  453.             print("WF",end='')
  454.             print(str(starRNG-(16-8)),end='')
  455.             lvl = "WF"
  456.         elif starRNG >= 17 and starRNG <= 24:
  457.             print("JRB",end='')
  458.             print(str(starRNG-(24-8)),end='')
  459.             lvl = "JRB"
  460.         elif starRNG >= 25 and starRNG <= 32:
  461.             print("CCM",end='')
  462.             print(str(starRNG-(32-8)),end='')
  463.             lvl = "CCM"
  464.         elif starRNG >= (8*(5-1))+1 and starRNG <= (8*5):
  465.             print("BBH",end='')
  466.             print(str(starRNG-((8*5)-8)),end='')
  467.             lvl = "BBH"
  468.         elif starRNG >= (8*(6-1))+1 and starRNG <= (8*6):
  469.             print("HMC",end='')
  470.             print(str(starRNG-((8*6)-8)),end='')
  471.             lvl = "HMC"
  472.         elif starRNG >= (8*(7-1))+1 and starRNG <= (8*7):
  473.             print("LLL",end='')
  474.             print(str(starRNG-((8*7)-8)),end='')
  475.             lvl = "LLL"
  476.         elif starRNG >= (8*(8-1))+1 and starRNG <= (8*8):
  477.             print("SSL",end='')
  478.             print(str(starRNG-((8*8)-8)),end='')
  479.             lvl = "SSL"
  480.         elif starRNG >= (8*(9-1))+1 and starRNG <= (8*9):
  481.             print("DDD",end='')
  482.             print(str(starRNG-((8*9)-8)),end='')
  483.             lvl = "DDD"
  484.         elif starRNG >= (8*(10-1))+1 and starRNG <= (8*10):
  485.             print("SL",end='')
  486.             print(str(starRNG-((8*10)-8)),end='')
  487.             lvl = "SL"
  488.         elif starRNG >= (8*(11-1))+1 and starRNG <= (8*11):
  489.             print("WDW",end='')
  490.             print(str(starRNG-((8*11)-8)),end='')
  491.             lvl = "WDW"
  492.         elif starRNG >= (8*(12-1))+1 and starRNG <= (8*12):
  493.             print("TTM",end='')
  494.             print(str(starRNG-((8*12)-8)),end='')
  495.             lvl = "TTM"
  496.         elif starRNG >= (8*(13-1))+1 and starRNG <= (8*13):
  497.             print("THI",end='')
  498.             print(str(starRNG-((8*13)-8)),end='')
  499.             lvl = "THI"
  500.         elif starRNG >= (8*(14-1))+1 and starRNG <= (8*14):
  501.             print("TTC",end='')
  502.             print(str(starRNG-((8*14)-8)),end='')
  503.             lvl = "TTC"
  504.         elif starRNG >= (8*(15-1))+1 and starRNG <= (8*15):
  505.             print("RR",end='')
  506.             print(str(starRNG-((8*15)-8)),end='')
  507.             lvl = "RR"
  508.         elif starRNG >= 121 and starRNG <= 144:
  509.             starRNG = starRNG - 120
  510.             print(secretStars[starRNG],end='')
  511.             temp = secretStars[starRNG].split(' ')
  512.             lvl = temp[0]
  513.        
  514.        
  515.  
  516.         print("\"")
  517.  
  518.         print("Location:")
  519.         print(lvl)
  520.         startRNG = random.randint(0,3)
  521.         print(complexLvlsData[lvl]["loc"+str(startRNG)])
  522.  
  523.     #HANDICAPS
  524.  
  525.     for i in range(1,4):
  526.         variableHandicap = False
  527.         print("Handicap "+str(i)+":")
  528.         fifty50RNG = random.randint(0,1)
  529.         if fifty50RNG == 0:
  530.             print("(none)")
  531.         else:
  532.             if i == 1:
  533.                 handicapRNG = random.randint(0,len(handicapSet1)-1)
  534.  
  535.                 for char in handicapSet1[handicapRNG][0]:
  536.                     if char == "@":
  537.                         variableHandicap = True
  538.  
  539.                 if variableHandicap == False:
  540.                     print(handicapSet1[handicapRNG][0])
  541.                 else:
  542.                     temp = handicapSet1[handicapRNG][0].split('@')
  543.                     tempRNG = random.randint(handicapSet1[handicapRNG][1][0],handicapSet1[handicapRNG][1][1])
  544.                     print(temp[0]+str(tempRNG)+temp[1])
  545.             if i == 2:
  546.                 handicapRNG = random.randint(0,len(handicapSet2)-1)
  547.  
  548.                 for char in handicapSet2[handicapRNG][0]:
  549.                     if char == "@":
  550.                         variableHandicap = True
  551.  
  552.                 if variableHandicap == False:
  553.                     print(handicapSet2[handicapRNG][0])
  554.                 else:
  555.                     temp = handicapSet2[handicapRNG][0].split('@')
  556.                     tempRNG = random.randint(handicapSet2[handicapRNG][1][0],handicapSet2[handicapRNG][1][1])
  557.                     print(temp[0]+str(tempRNG)+temp[1])
  558.             if i == 3:
  559.                 handicapRNG = random.randint(0,len(handicapSet3)-1)
  560.  
  561.                 for char in handicapSet3[handicapRNG][0]:
  562.                     if char == "@":
  563.                         variableHandicap = True
  564.  
  565.                 if variableHandicap == False:
  566.                     print(handicapSet3[handicapRNG][0])
  567.                 else:
  568.                     temp = handicapSet3[handicapRNG][0].split('@')
  569.                     tempRNG = random.randint(handicapSet3[handicapRNG][1][0],handicapSet3[handicapRNG][1][1])
  570.                     print(temp[0]+str(tempRNG)+temp[1])
  571.  
  572.  
  573. def userInterface():
  574.     print("This is the user interface for Fernado the virtual robot.")
  575.     print("First I recommend reading the notes by typing \"notes\" and",
  576.           "reading the notes",sep='\n')
  577.     print("to generate a new task type \"g\" and Fernado will generate",
  578.           "a new TAS task for SM64DS",sep='\n')
  579.     print("Type \"quit\" to quit")
  580.     print("type \"credits\" for credits")
  581.  
  582.     while True:
  583.         usrInput = input("> ")
  584.         if usrInput == "notes":
  585.             print(notes)
  586.         elif usrInput == "g":
  587.             print("New TAS task:")
  588.             generateTask()
  589.         elif usrInput == "quit":
  590.             break
  591.         elif usrInput == "credits":
  592.             print("Thanks to VTMagno and SkicoNow who helped in the process of making this",
  593.                   "virtual robot",sep='\n')
  594.         else:
  595.             print("Invalid command")
  596.  
  597. userInterface()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement