Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- """
- This script is just a hacky way to simulate setups. Keep in mind the actions
- list is very specific to the specific angle we used in the Majora's Mask moon
- warp setup using the owl statue. There are probably better ways to write an
- algorithm for this, but it gets the job done. - @Faschz
- """
- actions = [(0,0, "NULL"),
- (0.51708984375, -1.9093915224075317, "ZORA B"),
- (29.566650390625, -19.113862991333008, "ZORA B (HOLD R or Z)"),
- (32.0498046875, -21.834140777587891, "ZORA FORWARD B WITH FINS PUT AWAY (HOLD R or Z)"),
- (39.729248046875, -26.933433532714844, "ZORA ROLL"),
- (104.2890625, -70.700263977050781, "ZORA FULL ROLL then R"),
- (63.939697265625, -43.34600830078125, "ZORA JUMPSLASH (same with R)"),
- (72.320068359375, -49.027290344238281, "ZORA JUMPSLASH + HOLD UP + HOLD R"),
- (-88.149169921875, 59.758556365966797, "ZORA FULL BACKFLIP"),
- (117.267822265625, -79.49853515625, "ZORA JUMPSLASH + B (Zora clipping)"),
- (2369.546875, -48.70623779296875, "ZORA DOUBLE B ATTACK"),
- (2362.59130859375, -41.502281188964844, "ZORA DOUBLE B ATTACK then R"),
- (59.13330078125, -38.227725982666016, "ZORA DOUBLE B then R (or double B with Z)"),
- (61.63427734375, -43.341995239257813, "ZORA TRIPLE B"),
- (48.341552734375, -34.330516815185547, "ZORA TRIPLE B+R"),
- (14.091796875, -11.111648559570313, "ZORA HOLD B TO HOLD FINS"),
- (4.96630859375, -3.3666796684265137, "ZORA/HUMAN SHIELD SCOOT"),
- (3.994140625, -3.1140971183776855, "HUMAN B"),
- (4.8935546875, -5.4199552536010742, "HUMAN B then R"),
- (7.796630859375, -2.2444829940795898, "HUMAN HOLD Z, PRESS B (same with R)"),
- (39.729248046875, -26.933433532714844, "HUMAN ROLL"),
- (96.83984375, -65.650260925292969, "HUMAN FULL ROLL then R"),
- (31.693115234375, -21.243093490600586, "HUMAN JUMPSLASH + RELEASE Z"),
- (36.907470703125, -24.778099060058594, "HUMAN JUMPSLASH + HOLD UP + RELEASE Z"),
- (46.02294921875, -31.215547561645508, "HUMAN JUMPSLASH + (R or Z)"),
- (51.2373046875, -34.750553131103516, "HUMAN JUMPSLASH + HOLD UP + (R or Z)"),
- (-82.561767578125, 55.971050262451172, "HUMAN FULL BACKFLIP"),
- (4.34326171875, -3.7413227558135986, "HUMAN SPIN ATTACK"),
- (4.5703125, -3.3949298858642578, "HUMAN SPIN ATTACK+R"),
- (22.76904296875, -14.419496536254883, "HUMAN FORWARD B"),
- (24.748779296875, -16.699634552001953, "HUMAN FORWARD B (untarget)"),
- (0.87158203125, 1.308686375617981, "HUMAN DIAGONAL SLASH (release Z)"),
- (4.781005859375, -2.5297741889953613, "HUMAN DIAGONAL SLASH"),
- (124.126953125, -84.1488037109375, "DEKU FORWARD SPIN + R"),
- ]
- best_dist = 2**32
- best_actions = []
- def get_permutations(x, z, action=0, prev_dist=2**32, action_list=[]):
- """
- @param x: The X coordinate of Link.
- @param z: The Z coordinate of Link.
- @param action: The index of the action being performed in the table.
- @param prev_dist: The previous square distance to the destination.
- @param action_list: The current list of actions on the given branch
- """
- global best_dist
- global best_actions
- # This limits the depth of the search by preventing too many actions
- if (len(action_list) > 7):
- return False
- # Perform the action that was received.
- x += actions[action][0]
- z += actions[action][1]
- action_list.append(action)
- # This is the square distance to the destination point.
- dist = (x - 2605.066786875)**2 + (z - -168.244163818)**2
- # This cuts the branch short incase you move further away from the target
- # destination. As a result, backflips typically are just tossed using this.
- # Removing this check will result in a longer simulation time, but might
- # give a better result if setups moving further away from the destination
- # for an action do yield closer results.
- if (dist >= prev_dist):
- return False
- # Recursively test all of the other actions
- for a in range(action, len(actions)):
- copy_actions = action_list[:]
- # Check if we reached the end of the branch, if so the distance needs
- # to be compared against our best.
- if (get_permutations(x, z, a, dist, copy_actions) == False):
- if (dist < best_dist):
- print(action_list)
- best_dist = dist
- best_actions = action_list[1:]
- # The starting point of our simulation
- x = 2329.29028320313
- z = -8.10069179534912
- # Simulate all permutations
- get_permutations(x, z)
- # Now that we have found the best setup, let's go ahead and calculate what the
- # resulting (x, z) coordinates would be. Also while going through the actions,
- # print out what the steps would be. Reminder: These steps can be performed in
- # any order
- for a in best_actions:
- x += actions[a][0]
- z += actions[a][1]
- print(actions[a][2])
- print(x,z)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement