This repository has been archived by the owner on Feb 14, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
RoleHelper.h
263 lines (239 loc) · 4.32 KB
/
RoleHelper.h
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
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
#pragma once
#include "imgui/imgui.h"
namespace RoleHelper {
ImColor GetTeamColor(int team) {
auto role = (RoleType)team;
switch (role)
{
case None:
return ImColor(255, 255, 255);
// xorstr_("white");
break;
case Scp173:
return ImColor(255, 0, 0);
// xorstr_("red");
break;
case ClassD:
return ImColor(184, 73, 0);
// xorstr_("orange");
break;
case Spectator:
return ImColor(255, 255, 255);
// xorstr_("white");
break;
case Scp106:
return ImColor(255, 0, 0);
// xorstr_("red");
break;
case NtfSpecialist:
case NtfSergeant:
return ImColor(0, 119, 255);
break;
case Scp049:
return ImColor(255, 0, 0);
// xorstr_("red");
break;
case Scientist:
return ImColor(199, 199, 0);
// xorstr_("yellow");
break;
case Scp079:
return ImColor(255, 0, 0);
break;
case ChaosConscript:
case ChaosMarauder:
case ChaosRepressor:
case ChaosRifleman:
return ImColor(0, 163, 0);
// xorstr_("green");
break;
case Scp096:
return ImColor(255, 0, 0);
// xorstr_("red");
break;
case Scp0492:
return ImColor(255, 0, 0);
// xorstr_("red");
break;
case NtfCaptain:
return ImColor(0, 0, 255);
// xorstr_("blue");
break;
case NtfPrivate:
return ImColor(0, 217, 255);
break;
case Tutorial:
return ImColor(0, 255, 0);
// xorstr_("lime");
break;
case FacilityGuard:
return ImColor(0, 219, 164);
// xorstr_("lightblue");
break;
case Scp93953:
return ImColor(255, 0, 0);
// xorstr_("red");
break;
case Scp93989:
return ImColor(255, 0, 0);
// xorstr_("red");
break;
default:
return ImColor(255, 255, 255);
break;
}
return ImColor(255, 255, 255);
}
bool IsSCP(int team) {
auto role = (RoleType)team;
switch (role)
{
case Scp173:
case Scp106:
case Scp049:
case Scp079:
case Scp096:
case Scp0492:
case Scp93953:
case Scp93989:
return true;
default:
return false;
}
}
bool IsAlive(int team, bool includeSpectator = false) {
auto role = (RoleType)team;
switch (role)
{
case Spectator:
return includeSpectator;
case Scp173:
case ClassD:
case Scp106:
case NtfSpecialist:
case Scp049:
case Scientist:
case Scp079:
case ChaosConscript:
case Scp096:
case Scp0492:
case NtfSergeant:
case NtfCaptain:
case NtfPrivate:
case Tutorial:
case FacilityGuard:
case Scp93953:
case Scp93989:
case ChaosRifleman:
case ChaosRepressor:
case ChaosMarauder:
return true;
default:
return false;
}
}
bool IsHuman(int team) {
auto role = (RoleType)team;
switch (role)
{
case ClassD:
case NtfSpecialist:
case Scientist:
case ChaosConscript:
case NtfSergeant:
case NtfCaptain:
case NtfPrivate:
case Tutorial:
case FacilityGuard:
case ChaosRifleman:
case ChaosRepressor:
case ChaosMarauder:
return true;
default:
return false;
}
}
bool IsNTF(int team) {
auto role = (RoleType)team;
switch (role)
{
case NtfSpecialist:
case Scientist:
case NtfSergeant:
case NtfCaptain:
case NtfPrivate:
case FacilityGuard:
return true;
default:
return false;
}
}
bool IsChaos(int team) {
auto role = (RoleType)team;
switch (role)
{
case ClassD:
case ChaosConscript:
case ChaosRifleman:
case ChaosRepressor:
case ChaosMarauder:
return true;
default:
return false;
}
}
bool AimPermission(int local, int target, bool friendlyFire, bool scpFriendlyFire, bool targetSerpentsHand) {
if (!targetSerpentsHand && target == 14) return false;
if (IsNTF(local))
{
if (IsNTF(target))
return friendlyFire;
else
return true;
}
if (IsChaos(local))
{
if (IsChaos(target))
return friendlyFire;
else
return true;
}
if (IsSCP(local)) {
if (IsSCP(target))
#if _DEVELOPER
return scpFriendlyFire;
#else
return false;
#endif
else
return true;
}
if (local == 14 && target == 14) return friendlyFire;
return true;
}
float GetAimbotOffset(int hitbox, int classId) {
switch (classId)
{
case 0: //173
return 0.5f;
case 3: //106
return 0.65f;
case 9: //096
return 0.5f;
case 5: //049
return 0.45f;
case 16://939
case 17:
return 0.13f;
default:
if (hitbox == 0) // body
return 0.45f;
else if (hitbox == 1) // neck
return 0.75f;
else
return 0.8;
break;
}
return 0.f;
}
}