-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdebug.opy
248 lines (218 loc) · 10.4 KB
/
debug.opy
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
#!mainFile "main.opy"
playervar debugMenuEnabled = false
playervar debugDisasterId = 0
playervar debugDisasterName = ""
#!define displayDebugDisaster(disaster) \
eventPlayer.debugDisasterName = "{0} {1} {0}".format(disaster[disasterData.ICON], disaster[disasterData.NAME])
subroutine displayDebugDisasterName
def displayDebugDisasterName():
switch (eventPlayer.debugDisasterId):
case disasters.MOTHS[disasterData.ID]:
displayDebugDisaster(disasters.MOTHS)
break
case disasters.WIFELEAVER[disasterData.ID]:
displayDebugDisaster(disasters.WIFELEAVER)
break
case disasters.MINEFIELD[disasterData.ID]:
displayDebugDisaster(disasters.MINEFIELD)
break
case disasters.BOB[disasterData.ID]:
displayDebugDisaster(disasters.BOB)
break
case disasters.SIMON[disasterData.ID]:
displayDebugDisaster(disasters.SIMON)
break
case disasters.ACID_RAIN[disasterData.ID]:
displayDebugDisaster(disasters.ACID_RAIN)
break
case disasters.SOMBRA[disasterData.ID]:
displayDebugDisaster(disasters.SOMBRA)
break
case disasters.WINTON[disasterData.ID]:
displayDebugDisaster(disasters.WINTON)
break
case disasters.KAME[disasterData.ID]:
displayDebugDisaster(disasters.KAME)
break
case disasters.FLOOD[disasterData.ID]:
displayDebugDisaster(disasters.FLOOD)
break
case disasters.MYSTERY[disasterData.ID]:
displayDebugDisaster(disasters.MYSTERY)
break
case disasters.GET_DOWN[disasterData.ID]:
displayDebugDisaster(disasters.GET_DOWN)
break
case disasters.DEATH_TRAMPOLINE[disasterData.ID]:
displayDebugDisaster(disasters.DEATH_TRAMPOLINE)
break
case disasters.GREEN_ZONE[disasterData.ID]:
displayDebugDisaster(disasters.GREEN_ZONE)
break
case disasters.MURDERERS[disasterData.ID]:
displayDebugDisaster(disasters.MURDERERS)
break
case disasters.NULL_SECTOR[disasterData.ID]:
displayDebugDisaster(disasters.NULL_SECTOR)
break
case disasters.TALON[disasterData.ID]:
displayDebugDisaster(disasters.TALON)
break
case disasters.BUTTON[disasterData.ID]:
displayDebugDisaster(disasters.BUTTON)
break
case disasters.NINJA[disasterData.ID]:
displayDebugDisaster(disasters.NINJA)
break
case disasters.COPYCAT[disasterData.ID]:
displayDebugDisaster(disasters.COPYCAT)
break
case disasters.BLACK_HOLE[disasterData.ID]:
displayDebugDisaster(disasters.BLACK_HOLE)
break
case disasters.LAVA[disasterData.ID]:
displayDebugDisaster(disasters.LAVA)
break
case disasters.ACID[disasterData.ID]:
displayDebugDisaster(disasters.ACID)
break
case disasters.SNIPER[disasterData.ID]:
displayDebugDisaster(disasters.SNIPER)
break
case disasters.BOMBS[disasterData.ID]:
displayDebugDisaster(disasters.BOMBS)
break
case disasters.FAKE_BP[disasterData.ID]:
displayDebugDisaster(disasters.FAKE_BP)
break
case disasters.WISP[disasterData.ID]:
displayDebugDisaster(disasters.WISP)
break
case disasters.BLIZZARD[disasterData.ID]:
displayDebugDisaster(disasters.BLIZZARD)
break
case disasters.WITCH[disasterData.ID]:
displayDebugDisaster(disasters.WITCH)
break
case disasters.TIKTOK[disasterData.ID]:
displayDebugDisaster(disasters.TIKTOK)
break
case disasters.PHARAMERCY[disasterData.ID]:
displayDebugDisaster(disasters.PHARAMERCY)
break
case disasters.GALACTIC_SIGMA[disasterData.ID]:
displayDebugDisaster(disasters.GALACTIC_SIGMA)
break
case disasters.VISHKAR[disasterData.ID]:
displayDebugDisaster(disasters.VISHKAR)
break
case disasters.ZEUS[disasterData.ID]:
displayDebugDisaster(disasters.ZEUS)
break
case disasters.NUCLEAR_BOMB[disasterData.ID]:
displayDebugDisaster(disasters.NUCLEAR_BOMB)
break
case disasters.CRUSADERS[disasterData.ID]:
displayDebugDisaster(disasters.CRUSADERS)
break
case disasters.ORISA_DEFENDER[disasterData.ID]:
displayDebugDisaster(disasters.ORISA_DEFENDER)
break
case disasters.FLYING_BASTION[disasterData.ID]:
displayDebugDisaster(disasters.FLYING_BASTION)
break
case disasters.COWBOY[disasterData.ID]:
displayDebugDisaster(disasters.COWBOY)
break
case disasters.JUNKERS[disasterData.ID]:
displayDebugDisaster(disasters.JUNKERS)
break
case disasters.CLIMATOLOGIST[disasterData.ID]:
displayDebugDisaster(disasters.CLIMATOLOGIST)
break
case disasters.INTI_WARRIORS[disasterData.ID]:
displayDebugDisaster(disasters.INTI_WARRIORS)
break
case disasters.THIS_ENDS[disasterData.ID]:
displayDebugDisaster(disasters.THIS_ENDS)
break
case disasters.FROGGERS[disasterData.ID]:
displayDebugDisaster(disasters.FROGGERS)
break
case disasters.WAYFINDERS[disasterData.ID]:
displayDebugDisaster(disasters.WAYFINDERS)
break
default:
displayDebugDisaster([iconString(Icon.QUESTION_MARK), "No Data"])
break
rule "[debug.opy] Enable Inspector / Create Debug Header":
@Condition createWorkshopSetting(bool, "General", "Debug Mode", false, 3) == true
debugMode = true
hudText(localPlayer if localPlayer.debugMenuEnabled else [], localPlayer.debugDisasterId, "Disaster Id", localPlayer.debugDisasterName, HudPosition.TOP, 69, Color.WHITE, Color.WHITE, Color.WHITE, HudReeval.VISIBILITY_AND_STRING, SpecVisibility.NEVER)
hudSubheader(localPlayer if localPlayer.debugMenuEnabled else [], "{0}{1} Select {2}{3} | [{4}]: Add Disaster | [{6}] Add Hardcore Disaster | [{5}]: Reset".format(iconString(Icon.ARROW_LEFT), buttonString(Button.PRIMARY_FIRE), buttonString(Button.SECONDARY_FIRE), iconString(Icon.ARROW_RIGHT), buttonString(Button.ABILITY_2), buttonString(Button.RELOAD), buttonString(Button.ULTIMATE)), HudPosition.TOP, 70, Color.WHITE, HudReeval.VISIBILITY_AND_STRING, SpecVisibility.NEVER)
hudHeader(localPlayer, "{0} \n{1} \n{2}".format("{0} fx {1} txt".format(getNumberOfEntityIds(), getNumberOfTextIds()), "{0} ld {1} avg {2} pk".format(getServerLoad(), getAverageServerLoad(), getPeakServerLoad()), "{0} \n{1}".format("{0} pos \n {1} facing \n {2} facing angles".format(localPlayer.getPosition(), localPlayer.getFacingDirection(), "({0}°, {1}°)".format(localPlayer.getHorizontalFacingAngle(), localPlayer.getVerticalFacingAngle())), "spd {0} hspd {1} vspd {2}".format(localPlayer.getSpeed(), localPlayer.getHorizontalSpeed(), localPlayer.getVerticalSpeed()))), HudPosition.RIGHT, 0, Color.WHITE, HudReeval.VISIBILITY_AND_STRING, SpecVisibility.DEFAULT)
wait(0.032)
enableInspector()
rule "[debug.opy] Debug Rule #1":
@Condition debugMode
@Condition hostPlayer.hasSpawned()
@Disabled
while getNumberOfPlayers(Team.1) < 6:
createDummy(getAllHeroes().exclude([player.getCurrentHero() for player in getPlayers(Team.1)]), Team.1, -1, random.choice(getSpawnPoints(Team.ALL)).getPosition(), [])
getLastCreatedEntity().BOT_DISABLE_AI = true
wait(0.016)
rule "[debug.opy] Debug Rule #2":
@Event eachPlayer
@Team 1
@Condition debugMode
@Condition eventPlayer.isDummy()
@Condition eventPlayer.BOT_DISABLE_AI == false
eventPlayer.BOT_DISABLE_AI = true
rule "[debug.opy] Toggle Debug Menu":
@Event eachPlayer
@Condition debugMode
@Condition eventPlayer == hostPlayer
@Condition eventPlayer.isHoldingButton(Button.INTERACT)
wait(0.5, Wait.ABORT_WHEN_FALSE)
eventPlayer.debugMenuEnabled = not eventPlayer.debugMenuEnabled
eventPlayer.setAbility1Enabled(not eventPlayer.debugMenuEnabled)
eventPlayer.setAbility2Enabled(not eventPlayer.debugMenuEnabled)
eventPlayer.setPrimaryFireEnabled(not eventPlayer.debugMenuEnabled)
eventPlayer.setSecondaryFireEnabled(not eventPlayer.debugMenuEnabled)
if not eventPlayer.debugMenuEnabled and len(activeDisasters) > 0:
clearShopEffects()
disasterReady = true
displayDisaster()
queueDisasterEntities()
rule "[debug.opy] Input":
@Event eachPlayer
@Condition debugMode
@Condition eventPlayer == hostPlayer
@Condition eventPlayer.debugMenuEnabled
@Condition any([eventPlayer.isHoldingButton(Button.PRIMARY_FIRE), eventPlayer.isHoldingButton(Button.SECONDARY_FIRE), eventPlayer.isHoldingButton(Button.RELOAD), eventPlayer.isHoldingButton(Button.ABILITY_2), eventPlayer.isHoldingButton(Button.ULTIMATE)])
if eventPlayer.isHoldingButton(Button.PRIMARY_FIRE):
eventPlayer.debugDisasterId -= 5 if eventPlayer.isHoldingButton(Button.ABILITY_1) else 1
eventPlayer.debugDisasterId = max(0, eventPlayer.debugDisasterId)
displayDebugDisasterName()
if eventPlayer.isHoldingButton(Button.SECONDARY_FIRE):
eventPlayer.debugDisasterId += 5 if eventPlayer.isHoldingButton(Button.ABILITY_1) else 1
eventPlayer.debugDisasterId = eventPlayer.debugDisasterId
displayDebugDisasterName()
if eventPlayer.isHoldingButton(Button.ABILITY_2):
addDisasterToQueueById(eventPlayer.debugDisasterId)
if eventPlayer.isHoldingButton(Button.ULTIMATE):
addDisasterToQueueById(eventPlayer.debugDisasterId)
activeDisasterFlags.append(disasterFlags.HARDCORE)
if eventPlayer.isHoldingButton(Button.RELOAD):
cleanupDisaster()
if SHOP_EFFECTS == []:
createShopEffects()
/* selectMultipleDisasters() */
/* disasterReady = false
addDisasterToQueueById(disasters.COPYCAT[disasterData.ID])
wait(3)
disasterReady = true
displayDisaster()
queueDisasterEntities()
waitUntil(eventPlayer.isHoldingButton(Button.INTERACT), 9999)
cleanupDisaster() */