@@ -93,6 +93,7 @@ FLASHBANG
93
93
active = 0
94
94
det_time = 30
95
95
proc
96
+ bang (var /turf /T , var /mob /living/carbon/M )
96
97
prime ()
97
98
clown_check (var /mob /living/user )
98
99
@@ -143,81 +144,92 @@ FLASHBANG
143
144
.. ()
144
145
return
145
146
147
+ bang (var /turf /T , var /mob /living/carbon/M ) // Added a new proc called 'bang' that takes a location and a person to be banged.
148
+ if (locate (/ obj / item/ weapon/ cloaking_device, M)) // Called during the loop that bangs people in lockers/containers and when banging
149
+ for (var /obj /item/weapon/cloaking_device/S in M) // people in normal view. Could theroetically be called during other explosions.
150
+ S. active = 0 // -- Polymorph
151
+ S. icon_state = " shield0"
146
152
147
- prime ()
153
+ M << " \r ed <B>BANG</B> "
148
154
playsound (src . loc, ' bang.ogg' , 25 , 1 )
149
- var /turf /T = get_turf(src )
150
- if (T)
151
- T. hotspot_expose(700 ,125 )
152
-
153
- for (var /mob /living/carbon/M in viewers (T, null ))
154
- if (locate (/ obj / item/ weapon/ cloaking_device, M))
155
- for (var /obj /item/weapon/cloaking_device/S in M)
156
- S. active = 0
157
- S. icon_state = " shield0"
158
-
159
- M << " \r ed <B>BANG</B>"
160
155
161
156
// Checking for protections
162
- var /eye_safety = 0
163
- var /ear_safety = 0
164
- if (iscarbon(M))
165
- eye_safety = M. eyecheck()
166
- if (ishuman(M))
167
- if (istype(M: ears, / obj / item/ clothing/ ears/ earmuffs))
168
- ear_safety += 2
169
- if (M. mutations & HULK )
170
- ear_safety += 1
171
- if (istype(M: head, / obj / item/ clothing/ head/ helmet))
172
- ear_safety += 1
157
+ var /eye_safety = 0
158
+ var /ear_safety = 0
159
+ if (iscarbon(M))
160
+ eye_safety = M. eyecheck()
161
+ if (ishuman(M))
162
+ if (istype(M: ears, / obj / item/ clothing/ ears/ earmuffs))
163
+ ear_safety += 2
164
+ if (M. mutations & HULK )
165
+ ear_safety += 1
166
+ if (istype(M: head, / obj / item/ clothing/ head/ helmet))
167
+ ear_safety += 1
173
168
174
169
// Flashing everyone
175
- if (eye_safety < 1 )
176
- flick (" e_flash" , M. flash)
177
- M. eye_stat += rand(1 , 3 )
178
- M. stunned = max(M. stunned,2 )
179
- M. weakened = max(M. weakened,10 )
170
+ if (eye_safety < 1 )
171
+ flick (" e_flash" , M. flash)
172
+ M. eye_stat += rand(1 , 3 )
173
+ M. stunned = max(M. stunned,2 )
174
+ M. weakened = max(M. weakened,10 )
175
+
176
+
180
177
181
178
// Now applying sound
182
- if ((get_dist(M, T) <= 2 || src . loc == M. loc || src . loc == M))
183
- if (ear_safety > 0 )
184
- M. stunned = max(M. stunned,2 )
185
- M. weakened = max(M. weakened,1 )
179
+ if ((get_dist(M, T) <= 2 || src . loc == M. loc || src . loc == M))
180
+ if (ear_safety > 0 )
181
+ M. stunned = max(M. stunned,2 )
182
+ M. weakened = max(M. weakened,1 )
183
+ else
184
+ M. stunned = max(M. stunned,10 )
185
+ M. weakened = max(M. weakened,3 )
186
+ if ((prob(14 ) || (M == src . loc && prob(70 ))))
187
+ M. ear_damage += rand(1 , 10 )
186
188
else
187
- M. stunned = max(M. stunned,10 )
188
- M. weakened = max(M. weakened,3 )
189
- if ((prob(14 ) || (M == src . loc && prob(70 ))))
190
- M. ear_damage += rand(1 , 10 )
191
- else
192
- M. ear_damage += rand(0 , 5 )
189
+ M. ear_damage += rand(0 , 5 )
193
190
M. ear_deaf = max(M. ear_deaf,15 )
194
191
195
- else if (get_dist(M, T) <= 5 )
196
- if (! ear_safety)
197
- M. stunned = max(M. stunned,8 )
198
- M. ear_damage += rand(0 , 3 )
199
- M. ear_deaf = max(M. ear_deaf,10 )
192
+ else if (get_dist(M, T) <= 5 )
193
+ if (! ear_safety)
194
+ M. stunned = max(M. stunned,8 )
195
+ M. ear_damage += rand(0 , 3 )
196
+ M. ear_deaf = max(M. ear_deaf,10 )
200
197
201
- else if (! ear_safety)
202
- M. stunned = max(M. stunned,4 )
203
- M. ear_damage += rand(0 , 1 )
204
- M. ear_deaf = max(M. ear_deaf,5 )
198
+ else if (! ear_safety)
199
+ M. stunned = max(M. stunned,4 )
200
+ M. ear_damage += rand(0 , 1 )
201
+ M. ear_deaf = max(M. ear_deaf,5 )
205
202
206
203
// This really should be in mob not every check
207
- if (M. eye_stat >= 20 )
208
- M << " \r ed Your eyes start to burn badly!"
209
- M. disabilities |= 1
210
- if (prob(M. eye_stat - 20 + 1 ))
211
- M << " \r ed You can't see anything!"
212
- M. sdisabilities |= 1
213
- if (M. ear_damage >= 15 )
214
- M << " \r ed Your ears start to ring badly!"
215
- if (prob(M. ear_damage - 10 + 5 ))
216
- M << " \r ed You can't hear anything!"
217
- M. sdisabilities |= 4
218
- else
219
- if (M. ear_damage >= 5 )
220
- M << " \r ed Your ears start to ring!"
204
+ if (M. eye_stat >= 20 )
205
+ M << " \r ed Your eyes start to burn badly!"
206
+ M. disabilities |= 1
207
+ if (prob(M. eye_stat - 20 + 1 ))
208
+ M << " \r ed You can't see anything!"
209
+ M. sdisabilities |= 1
210
+ if (M. ear_damage >= 15 )
211
+ M << " \r ed Your ears start to ring badly!"
212
+ if (prob(M. ear_damage - 10 + 5 ))
213
+ M << " \r ed You can't hear anything!"
214
+ M. sdisabilities |= 4
215
+ else
216
+ if (M. ear_damage >= 5 )
217
+ M << " \r ed Your ears start to ring!"
218
+
219
+ prime () // Prime now just handles the two loops that query for people in lockers and people who can see it.
220
+ var /turf /T = get_turf(src )
221
+ if (T)
222
+ T. hotspot_expose(700 ,125 )
223
+
224
+ for (var /obj /structure/closet/L in view (T, null ))
225
+ if (locate (/ mob / living/ carbon/ , L))
226
+ for (var /mob /living/carbon/M in L)
227
+ bang (T, M)
228
+
229
+
230
+ for (var /mob /living/carbon/M in viewers (T, null ))
231
+ bang (T, M)
232
+
221
233
222
234
// Blob damage here
223
235
for (var /obj /effect/blob/B in view (8 ,T))
@@ -251,3 +263,16 @@ FLASHBANG
251
263
prime ()
252
264
return 0
253
265
return 1
266
+
267
+
268
+
269
+
270
+
271
+
272
+
273
+
274
+
275
+
276
+
277
+
278
+
0 commit comments