summary refs log tree commit diff stats
path: root/racing/router.gd
blob: debfafbdf70e6e34519c81e7754be3a9588a50ea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
extends Node

const LL1_AREAS = [
	["Starting Room", 0, 0, 0],
	["Second Room", 0, 0, -15],
	["The Traveled", 34, 0, -18],
	["The Agreeable", 30, 0, -45],
	["The Colorful", 10, 0, -83],
	["Suits Area", 0, 0, -78, true],
	["Arrow Garden", -93, 1, -93],
	["The Wondrous (Table)", -108, 1, -78],
	["Courtyard", -64, 0, -71],
	["Yellow Backside Nine", -38, 0, -58],
	["Hot Crusts Area", -20, 0, -81],
	["Crossroads Corner", -28, 0, -54],
	["The Discerning", -54, 0, -34, true],
	["Green Backside", 22, 0, -94],
	["Observant Upstairs", 40, 9, -92, true],
	["Eight Room", 95, 15, -28],
	["The Perceptive", 60, 9, -57],
	["The Tenacious", 0, 0, -43],
	["Rainbow", -96, 0, -41],
	["The Undeterred", -87, 0, 25, true],
	["Directional Gallery", -57, 0, 0],
	["The Eyes They See", -54, 0, -23],
	["Tower First Floor", -27, 0, -23],
	["The Optimistic", 76, 0, -17],
	["The Initiated", 63, 0, -0, true],
	["Art Gallery", 92, 0, 15],
	["Art Gallery Top", 80, 30, 15],
	["Lookout", 75, 18, 51],
	["Knight Night Room", 37, 0, 7],
	["The Seeker", 9, 0, 16, true],
	["Hidden Room", 13, 0, 4],
	["Owl Hallway", 44, 0, -26],
	["Challenge Room", -9, 6, 13],
	["Pilgrim Room", -22, 0, 24, true],
	["Cellar Replica", -44, 0, 30],
	["Elements Area", -61, 0, 40],
	["The Artistic", -25, 0, 54, true],
	["Outside The Wise", -44, 0, 71],
	["The Wise", -72, 0, 72, true],
	["The Scientific", -18, 0, 89],
	["The Wanderer", 0, 0, 80],
	["The Fearless", 18, 10, 90],
	["Champion's Rest", 23, 0, 62, true],
	["The Steady", 31, 0, 77, true],
	["The Bold", 67, 0, 77, true],
	["Color Hunt", 45, 0, 69],
	["Room Room", 95, 6, 84],
	["The Bearer", 61, 0, 51],
	["Tower Third Floor", 18, 0, 33],
	["Rhyme Room (Cross)", 0, 9, 42],
	["Tower Seventh Floor", 0, 37, 64],
]

const LL2_AREAS = [
	["Orange Pyramid", 86, 10, -84, true],
	["The Stellar", 43, 6, -86],
	["The Fuzzy", 12, 1, -86, true],
	["The Devious", 0, 0, -88],
	["The Sharp", -26, 0, -88, true],
	["The Structured", -50, 0, -88],
	["Brown Pyramid", -86, 10, -85, true],
	["The Tasty", -86, 7, -62],
	["Black White Room", -88, 0, -32],
	["Lime Magenta Room", -96, 0, -24],
	["Red Blue Room", -87, 0, -23],
	["The Archaeologist", -74, 0, -32],
	["The Earnest", -87, 0, -56],
	["The Hidden", -50, 6, -71, true],
	["The Sapient", -36, 36, -36],
	["The Ethereal", -42, 0, -22],
	["The Learned", 34, 1, -64, true],
	["Whispers Behind Quiet Walls", 44, 0, -51, true],
	["The Lunar", 45, 0, -22],
	["The Arcadian", 86, 0, -53],
	["The Frozen", 84, 0, -27],
	["The Unscrambled", -50, 0, -10],
	["Nightmare", 73, 0, -27, true],
	["The Amazing", -13, 0, -42],
	["Challenge Room", -94, 0, 2],
	["The Fresh", -82, 0, -10],
	["The Exemplary", -82, 0, 11],
	["The Roaming", -66, 0, -11],
	["The Veteran", -66, 0, 12],
	["The Royal", -50, 0, 10],
	["The Exact", -33, 0, -12],
	["The Appreciated", -33, 0, 11],
	["The Unsullied", -17, 0, -11],
	["The Unopposed", -18, 0, 10],
	["The Multitalented", -10, 0, 0],
	["Starting Room", 0, 0, 0],
	["Control Room", 0, 0, 14],
	["Countdown Room", 0, 0, 33, true],
	["The Lucky", 13, 1, 32, true],
	["Greenhouse", 14, 0, 6],
	["The Sweet", 24, 0, 18, true],
	["The Fall", 87, 0, -4, true],
	["White Pyramid", 46, 0, -1],
	["Z", 95, 0, 25, true],
	["The Worldly", 92, 0, 58],
	["The Perennial", 39, 0, 32],
	["The Analytical", -28, 0, 35],
	["Car Room", -59, 0, 50, true],
	["The Mythical", -35, 4, 73],
	["LL1 Starting Room", -70, 0, 41],
	["LL1 Second Room", -86, 0, 41],
	["The Seen", -83, 0, 57, true],
	["Purple Pyramid", -87, 10, 85, true],
	["Four Pips", -66, 0, 76],
	["Twinkle Twinkle Little Star", 6, 0, 55, true],
	["The Unforgettable", 9, 40, 88],
	["HI Room", 27, 0, 59],
	["The Handy", 39, 10, 83],
	["Mint Pyramid", 86, 10, 83, true],
]


func choose_route():
	var rng = RandomNumberGenerator.new()
	rng.randomize()

	var areas_slot
	var level_name
	if rng.randi_range(0, 2) == 0:
		areas_slot = LL1_AREAS
		level_name = "level1"
	else:
		areas_slot = LL2_AREAS
		level_name = "level2"

	var start_pos
	var end_pos
	var found = false
	while !found:
		var areas_dupe = areas_slot.duplicate()
		var i = rng.randi_range(0, areas_dupe.size() - 1)
		start_pos = areas_dupe[i]
		areas_dupe.remove(i)
		i = rng.randi_range(0, areas_dupe.size() - 1)
		end_pos = areas_dupe[i]

		var start_vec = Vector3(start_pos[1], start_pos[2], start_pos[3])
		var end_vec = Vector3(end_pos[1], end_pos[2], end_pos[3])
		if start_vec.distance_to(end_vec) > 50 and not (start_pos.size() >= 5 and start_pos[4]):
			found = true

	return [level_name, start_pos, end_pos]