diff options
Diffstat (limited to 'racing/router.gd')
-rw-r--r-- | racing/router.gd | 149 |
1 files changed, 149 insertions, 0 deletions
diff --git a/racing/router.gd b/racing/router.gd new file mode 100644 index 0000000..15b3f31 --- /dev/null +++ b/racing/router.gd | |||
@@ -0,0 +1,149 @@ | |||
1 | extends Node | ||
2 | |||
3 | const LL1_AREAS = [ | ||
4 | ["Starting Room", 0, 0, 0], | ||
5 | ["Second Room", 0, 0, -15], | ||
6 | ["The Traveled", 34, 0, -18], | ||
7 | ["The Agreeable", 30, 0, -45], | ||
8 | ["The Colorful", 10, 0, -83], | ||
9 | ["Suits Area", 0, 0, -78, true], | ||
10 | ["Arrow Garden", -93, 1, -93], | ||
11 | ["The Wondrous (Table)", -108, 1, -78], | ||
12 | ["Courtyard", -64, 0, -71], | ||
13 | ["Yellow Backside Nine", -38, 0, -58], | ||
14 | ["Hot Crusts Area", -20, 0, -81], | ||
15 | ["Crossroads Corner", -28, 0, -54], | ||
16 | ["The Discerning", -54, 0, -34, true], | ||
17 | ["Green Backside", 22, 0, -94], | ||
18 | ["Observant Upstairs", 40, 9, -92, true], | ||
19 | ["Eight Room", 95, 15, -28], | ||
20 | ["The Perceptive", 60, 9, -57], | ||
21 | ["The Tenacious", 0, 0, -43], | ||
22 | ["Rainbow", -96, 0, -41], | ||
23 | ["The Undeterred", -87, 0, 25, true], | ||
24 | ["Directional Gallery", -57, 0, 0], | ||
25 | ["The Eyes They See", -54, 0, -23], | ||
26 | ["Tower First Floor", -27, 0, -23], | ||
27 | ["The Optimistic", 76, 0, -17], | ||
28 | ["The Initiated", 63, 0, -0, true], | ||
29 | ["Art Gallery", 92, 0, 15], | ||
30 | ["Art Gallery Top", 80, 30, 15], | ||
31 | ["Lookout", 75, 18, 51], | ||
32 | ["Knight Night Room", 37, 0, 7], | ||
33 | ["The Seeker", 9, 0, 16, true], | ||
34 | ["Hidden Room", 13, 0, 4], | ||
35 | ["Owl Hallway", 44, 0, -26], | ||
36 | ["Challenge Room", -9, 6, 13], | ||
37 | ["Pilgrim Room", -22, 0, 24, true], | ||
38 | ["Cellar Replica", -44, 0, 30], | ||
39 | ["Elements Area", -61, 0, 40], | ||
40 | ["The Artistic", -25, 0, 54, true], | ||
41 | ["Outside The Wise", -44, 0, 71], | ||
42 | ["The Wise", -72, 0, 72, true], | ||
43 | ["The Scientific", -18, 0, 89], | ||
44 | ["The Wanderer", 0, 0, 80], | ||
45 | ["The Fearless", 18, 10, 90], | ||
46 | ["Champion's Rest", 23, 0, 62, true], | ||
47 | ["The Steady", 31, 0, 77, true], | ||
48 | ["The Bold", 67, 0, 77, true], | ||
49 | ["Color Hunt", 45, 0, 69], | ||
50 | ["Room Room", 95, 6, 84], | ||
51 | ["The Bearer", 61, 0, 51], | ||
52 | ["Tower Third Floor", 18, 0, 33], | ||
53 | ["Rhyme Room (Cross)", 0, 9, 42], | ||
54 | ["Tower Seventh Floor", 0, 37, 64], | ||
55 | ] | ||
56 | |||
57 | const LL2_AREAS = [ | ||
58 | ["Orange Pyramid", 86, 10, -84, true], | ||
59 | ["The Stellar", 43, 6, -86], | ||
60 | ["The Fuzzy", 12, 1, -86, true], | ||
61 | ["The Devious", 0, 0, -88], | ||
62 | ["The Sharp", -26, 0, -88, true], | ||
63 | ["The Structured", -50, 0, -88], | ||
64 | ["Brown Pyramid", -86, 10, -85, true], | ||
65 | ["The Tasty", -86, 7, -62], | ||
66 | ["Black White Room", -88, 0, -32], | ||
67 | ["Lime Magenta Room", -96, 0, -24], | ||
68 | ["Red Blue Room", -87, 0, -23], | ||
69 | ["The Archaeologist", -74, 0, -32], | ||
70 | ["The Earnest", -87, 0, -56], | ||
71 | ["The Hidden", -50, 6, -71, true], | ||
72 | ["The Sapient", -36, 36, -41], | ||
73 | ["The Ethereal", -42, 0, -22], | ||
74 | ["The Learned", 34, 1, -64, true], | ||
75 | ["Whispers Behind Quiet Walls", 44, 0, -51, true], | ||
76 | ["The Lunar", 45, 0, -22], | ||
77 | ["The Arcadian", 86, 0, -53], | ||
78 | ["The Frozen", 84, 0, -27], | ||
79 | ["The Unscrambled", -50, 0, -10], | ||
80 | ["Nightmare", 73, 0, -27, true], | ||
81 | ["The Amazing", -13, 0, -42], | ||
82 | ["Challenge Room", -94, 0, 2], | ||
83 | ["The Fresh", -82, 0, -10], | ||
84 | ["The Exemplary", -82, 0, 11], | ||
85 | ["The Roaming", -66, 0, -11], | ||
86 | ["The Veteran", -66, 0, 12], | ||
87 | ["The Royal", -50, 0, 10], | ||
88 | ["The Exact", -33, 0, -12], | ||
89 | ["The Appreciated", -33, 0, 11], | ||
90 | ["The Unsullied", -17, 0, -11], | ||
91 | ["The Unopposed", -18, 0, 10], | ||
92 | ["The Multitalented", -10, 0, 0], | ||
93 | ["Starting Room", 0, 0, 0], | ||
94 | ["Control Room", 0, 0, 14], | ||
95 | ["Countdown Room", 0, 0, 33, true], | ||
96 | ["The Lucky", 13, 1, 32, true], | ||
97 | ["Greenhouse", 14, 0, 6], | ||
98 | ["The Sweet", 24, 0, 18, true], | ||
99 | ["The Fall", 87, 0, -4, true], | ||
100 | ["White Pyramid", 46, 0, -1], | ||
101 | ["Z", 95, 0, 25, true], | ||
102 | ["The Worldly", 92, 0, 58], | ||
103 | ["The Perennial", 39, 0, 32], | ||
104 | ["The Analytical", -28, 0, 35], | ||
105 | ["Car Room", -59, 0, 50, true], | ||
106 | ["The Mythical", -35, 4, 73], | ||
107 | ["LL1 Starting Room", -70, 0, 41], | ||
108 | ["LL1 Second Room", -86, 0, 41], | ||
109 | ["The Seen", -83, 0, 57, true], | ||
110 | ["Purple Pyramid", -87, 10, 85, true], | ||
111 | ["Four Pips", -66, 0, 76], | ||
112 | ["Twinkle Twinkle Little Star", 6, 0, 55, true], | ||
113 | ["The Unforgettable", 9, 40, 88], | ||
114 | ["HI Room", 27, 0, 59], | ||
115 | ["The Handy", 39, 10, 83], | ||
116 | ["Mint Pyramid", 86, 10, 83, true], | ||
117 | ] | ||
118 | |||
119 | |||
120 | func choose_route(): | ||
121 | var rng = RandomNumberGenerator.new() | ||
122 | rng.randomize() | ||
123 | |||
124 | var areas_slot | ||
125 | var level_name | ||
126 | if rng.randi_range(0, 2) == 0: | ||
127 | areas_slot = LL1_AREAS | ||
128 | level_name = "level1" | ||
129 | else: | ||
130 | areas_slot = LL2_AREAS | ||
131 | level_name = "level2" | ||
132 | |||
133 | var start_pos | ||
134 | var end_pos | ||
135 | var found = false | ||
136 | while !found: | ||
137 | var areas_dupe = areas_slot.duplicate() | ||
138 | var i = rng.randi_range(0, areas_dupe.size() - 1) | ||
139 | start_pos = areas_dupe[i] | ||
140 | areas_dupe.remove(i) | ||
141 | i = rng.randi_range(0, areas_dupe.size() - 1) | ||
142 | end_pos = areas_dupe[i] | ||
143 | |||
144 | var start_vec = Vector3(start_pos[1], start_pos[2], start_pos[3]) | ||
145 | var end_vec = Vector3(end_pos[1], end_pos[2], end_pos[3]) | ||
146 | if start_vec.distance_to(end_vec) > 50 and not (start_pos.size() >= 5 and start_pos[4]): | ||
147 | found = true | ||
148 | |||
149 | return [level_name, start_pos, end_pos] | ||