forked from TauCetiStation/TauCetiClassic
-
Notifications
You must be signed in to change notification settings - Fork 0
/
is_helpers.dm
256 lines (130 loc) · 7.08 KB
/
is_helpers.dm
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
// This file is used to test the entire build
// To use istype-defines from this file for tests, wrap your istype in brackets
// Example: isabductor(A) (istype(A, /mob/living/carbon/human/abductor))
// Bad example: isabductor(A) istype(A, /mob/living/carbon/human/abductor)
// META
#define isweakref(D) (istype(D, /datum/weakref))
// TURFS
#define isenvironmentturf(A) (istype(A, /turf/environment))
#define isspaceturf(A) (istype(A, /turf/environment/space))
#define isiceturf(A) (istype(A, /turf/environment/snow/ice))
#define isfloorturf(A) (istype(A, /turf/simulated/floor))
#define isplatingturf(A) (istype(A, /turf/simulated/floor/plating))
#define iswallturf(A) (istype(A, /turf/simulated/wall))
#define iswaterturf(A) (istype(A, /turf/simulated/floor/beach/water) || istype(A, /turf/unsimulated/beach/water) || istype(A, /turf/unsimulated/jungle/water))
// HUMAN
#define ishuman(A) (istype(A, /mob/living/carbon/human))
#define isskeleton(A) (A.get_species() in list(SKELETON, SKELETON_UNATHI, SKELETON_TAJARAN, SKELETON_SKRELL, SKELETON_VOX))
// CARBON
#define isxenoqueen(A) (istype(A, /mob/living/carbon/xenomorph/humanoid/queen))
#define isxenodrone(A) (istype(A, /mob/living/carbon/xenomorph/humanoid/drone))
#define isxenosentinel(A) (istype(A, /mob/living/carbon/xenomorph/humanoid/sentinel))
#define isxenohunter(A) (istype(A, /mob/living/carbon/xenomorph/humanoid/hunter))
#define isxenoadult(A) (istype(A, /mob/living/carbon/xenomorph/humanoid))
#define isxenolarva(A) (istype(A, /mob/living/carbon/xenomorph/larva))
#define isfacehugger(A) (istype(A, /mob/living/carbon/xenomorph/facehugger))
#define isxeno(A) (istype(A, /mob/living/carbon/xenomorph))
#define isbrain(A) (istype(A, /mob/living/carbon/brain))
#define isslimeadult(A) (istype(A, /mob/living/carbon/slime/adult))
#define isslime(A) (istype(A, /mob/living/carbon/slime))
#define ismonkey(A) (istype(A, /mob/living/carbon/monkey))
#define isIAN(A) (istype(A, /mob/living/carbon/ian))
#define iscarbon(A) (istype(A, /mob/living/carbon))
// SILICON
#define isdrone(A) (istype(A, /mob/living/silicon/robot/drone))
#define isrobot(A) (istype(A, /mob/living/silicon/robot))
#define isAI(A) (istype(A, /mob/living/silicon/ai))
#define ispAI(A) (istype(A, /mob/living/silicon/pai))
#define issilicon(A) (istype(A, /mob/living/silicon))
// LIVING
#define iscorgi(A) (istype(A, /mob/living/simple_animal/corgi))
#define iscrab(A) (istype(A, /mob/living/simple_animal/crab))
#define iscat(A) (istype(A, /mob/living/simple_animal/cat))
#define ismouse(A) (istype(A, /mob/living/simple_animal/mouse))
#define isclown(A) (istype(A, mob/living/simple_animal/hostile/retaliate/clown))
#define isbear(A) (istype(A, /mob/living/simple_animal/hostile/bear))
#define iscarp(A) (istype(A, /mob/living/simple_animal/hostile/carp))
#define isanimal(A) (istype(A, /mob/living/simple_animal))
#define isliving(A) (istype(A, /mob/living))
#define isessence(A) (istype(A, /mob/living/parasite/essence))
#define isshade(A) (istype(A, /mob/living/simple_animal/shade))
#define isconstruct(A) istype(A, /mob/living/simple_animal/construct)
#define isgod(A) (istype(A, /mob/living/simple_animal/shade/god))
#define isreplicator(A) (istype(A, /mob/living/simple_animal/hostile/replicator))
// MOB
#define isobserver(A) (istype(A, /mob/dead/observer))
#define isovermind(A) (istype(A, /mob/camera/blob))
#define isnewplayer(A) (istype(A, /mob/dead/new_player))
#define isautosay(A) (istype(A, /mob/autosay))
#define isMMI(A) (istype(A, /obj/item/device/mmi))
// ELSE
#define isbodypart(A) (istype(A, /obj/item/organ/external))
#define isbot(A) (istype(A, /obj/machinery/bot))
#define ismachinery(A) (istype(A, /obj/machinery))
#define istagger(A) (istype(A, /obj/item/device/tagger))
#define isdiagnostichud(A) (istype(A, /obj/item/clothing/glasses/hud/diagnostic))
// GOONCHAT PORT
#define isatom(A) (istype(A, /atom))
#define isclient(A) (istype(A, /client))
// ASSEMBLY HELPERS
#define isassembly(O) (istype(O, /obj/item/device/assembly))
#define isigniter(O) (istype(O, /obj/item/device/assembly/igniter))
#define isinfared(O) (istype(O, /obj/item/device/assembly/infra))
#define isprox(O) (istype(O, /obj/item/device/assembly/prox_sensor))
#define issignaler(O) (istype(O, /obj/item/device/assembly/signaler))
#define istimer(O) (istype(O, /obj/item/device/assembly/timer))
// TOOLS HELPERS
#define iswrenching(I) I.get_quality(QUALITY_WRENCHING)
#define iswelding(I) I.get_quality(QUALITY_WELDING)
#define iscutter(I) I.get_quality(QUALITY_CUTTING)
#define isscrewing(I) I.get_quality(QUALITY_SCREWING)
#define isprying(I) I.get_quality(QUALITY_PRYING)
#define ispulsing(I) I.get_quality(QUALITY_PULSING)
#define issignaling(I) I.get_quality(QUALITY_SIGNALLING)
#define iscoil(A) (istype(A, /obj/item/stack/cable_coil))
// OBJECTS
#define isitem(A) (istype(A, /obj/item))
#define isunder(A) (istype(A, /obj/item/clothing/under))
// ROLES / ANTAG
#define isfaction(A) (istype(A, /datum/faction))
#define isrole(type, H) (H?.mind ? H.mind.GetRole(type) : FALSE)
#define isrolebytype(type, H) (H?.mind ? H.mind.GetRoleByType(type) : FALSE)
#define isanyantag(H) (H?.mind && H.mind.antag_roles.len)
#define isabductor(H) isrolebytype(/datum/role/abductor, H)
#define isabductorsci(H) isrole(ABDUCTOR_SCI, H)
#define isabductoragent(H) isrole(ABDUCTOR_AGENT, H)
#define isshadowling(H) isrole(SHADOW, H)
#define isshadowthrall(H) isrole(SHADOW_THRALL, H)
#define iscultist(mob) (mob && global.cult_religion?.is_member(mob))
#define iseminence(A) (istype(A, /mob/camera/eminence))
#define isvoxraider(H) isrole(VOXRAIDER, H)
#define ischangeling(H) isrolebytype(/datum/role/changeling, H)
#define isanyrev(H) (isrev(H) || isrevhead(H))
#define isrev(H) isrole(REV, H)
#define isrevhead(H) isrole(HEADREV, H)
#define istraitor(H) isrole(TRAITOR, H)
#define iselitesyndie(H) isrole(SYNDIESQUADIE, H)
#define ismalf(H) isrole(MALF, H)
#define isnukeop(H) (isrole(NUKE_OP, H) || isrole(NUKE_OP_LEADER, H) || isrole(SYNDIESQUADIE, H))
#define iswizard(H) isrole(WIZARD, H)
#define iswizardapprentice(H) isrole(WIZ_APPRENTICE, H)
#define isdeathsquad(H) isrole(DEATHSQUADIE, H)
#define isninja(H) isrole(NINJA, H)
#define isERT(H) isrole(RESPONDER, H)
#define isrolezombie(H) isrole(ZOMBIE, H)
#define iszombie(H) (H.get_species() in global.all_zombie_species_names)
#define isalien(H) isrole(XENOMORPH, H)
#define isgangster(H) isrole(GANGSTER, H)
#define isgangsterlead(H) isrole(GANGSTER_LEADER, H)
#define isanygangster(H) isrolebytype(/datum/role/gangster, H)
#define isgundealer(H) isrole(GANGSTER_DEALER, H)
#define isanycop(H) isrolebytype(/datum/role/cop, H)
#define isanyblob(H) isrolebytype(/datum/role/blob_overmind, H)
// BLOB
#define isblob(A) (istype(A, /obj/structure/blob))
#define isblobnormal(A) (istype(A, /obj/structure/blob/normal))
#define isblobcore(A) (istype(A, /obj/structure/blob/core))
#define isblobnode(A) (istype(A, /obj/structure/blob/node))
#define isblobfactory(A) (istype(A, /obj/structure/blob/factory))
#define isblobshield(A) (istype(A, /obj/structure/blob/shield))
#define isblobresource(A) (istype(A, /obj/structure/blob/resource))