/
helmet.dm
558 lines (482 loc) · 20.9 KB
/
helmet.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
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
/obj/item/clothing/head/helmet
name = "helmet"
desc = "Standard Security gear. Protects the head from impacts."
icon_state = "helmet"
inhand_icon_state = "helmet"
armor = list(MELEE = 35, BULLET = 30, LASER = 30,ENERGY = 40, BOMB = 25, BIO = 0, RAD = 0, FIRE = 50, ACID = 50, WOUND = 10)
cold_protection = HEAD
min_cold_protection_temperature = HELMET_MIN_TEMP_PROTECT
heat_protection = HEAD
max_heat_protection_temperature = HELMET_MAX_TEMP_PROTECT
strip_delay = 60
clothing_flags = SNUG_FIT
flags_cover = HEADCOVERSEYES
flags_inv = HIDEHAIR
dog_fashion = /datum/dog_fashion/head/helmet
var/can_flashlight = FALSE //if a flashlight can be mounted. if it has a flashlight and this is false, it is permanently attached.
var/obj/item/flashlight/seclite/attached_light
var/datum/action/item_action/toggle_helmet_flashlight/alight
/obj/item/clothing/head/helmet/Initialize()
. = ..()
if(attached_light)
alight = new(src)
/obj/item/clothing/head/helmet/Destroy()
var/obj/item/flashlight/seclite/old_light = set_attached_light(null)
if(old_light)
qdel(old_light)
return ..()
/obj/item/clothing/head/helmet/examine(mob/user)
. = ..()
if(attached_light)
. += "It has \a [attached_light] [can_flashlight ? "" : "permanently "]mounted on it."
if(can_flashlight)
. += "<span class='info'>[attached_light] looks like it can be <b>unscrewed</b> from [src].</span>"
else if(can_flashlight)
. += "It has a mounting point for a <b>seclite</b>."
/obj/item/clothing/head/helmet/handle_atom_del(atom/A)
if(A == attached_light)
set_attached_light(null)
update_helmlight()
update_icon()
QDEL_NULL(alight)
qdel(A)
return ..()
///Called when attached_light value changes.
/obj/item/clothing/head/helmet/proc/set_attached_light(obj/item/flashlight/seclite/new_attached_light)
if(attached_light == new_attached_light)
return
. = attached_light
attached_light = new_attached_light
if(attached_light)
attached_light.set_light_flags(attached_light.light_flags | LIGHT_ATTACHED)
if(attached_light.loc != src)
attached_light.forceMove(src)
else if(.)
var/obj/item/flashlight/seclite/old_attached_light = .
old_attached_light.set_light_flags(old_attached_light.light_flags & ~LIGHT_ATTACHED)
if(old_attached_light.loc == src)
old_attached_light.forceMove(get_turf(src))
/obj/item/clothing/head/helmet/sec
can_flashlight = TRUE
/obj/item/clothing/head/helmet/sec/attackby(obj/item/I, mob/user, params)
if(issignaler(I))
var/obj/item/assembly/signaler/S = I
if(attached_light) //Has a flashlight. Player must remove it, else it will be lost forever.
to_chat(user, "<span class='warning'>The mounted flashlight is in the way, remove it first!</span>")
return
if(S.secured)
qdel(S)
var/obj/item/bot_assembly/secbot/A = new
user.put_in_hands(A)
to_chat(user, "<span class='notice'>You add the signaler to the helmet.</span>")
qdel(src)
return
return ..()
/obj/item/clothing/head/helmet/alt
name = "bulletproof helmet"
desc = "A bulletproof combat helmet that excels in protecting the wearer against traditional projectile weaponry and explosives to a minor extent."
icon_state = "helmetalt"
inhand_icon_state = "helmetalt"
armor = list(MELEE = 15, BULLET = 60, LASER = 10, ENERGY = 10, BOMB = 40, BIO = 0, RAD = 0, FIRE = 50, ACID = 50, WOUND = 5)
can_flashlight = TRUE
dog_fashion = null
/obj/item/clothing/head/helmet/old
name = "degrading helmet"
desc = "Standard issue security helmet. Due to degradation the helmet's visor obstructs the users ability to see long distances."
tint = 2
/obj/item/clothing/head/helmet/blueshirt
name = "blue helmet"
desc = "A reliable, blue tinted helmet reminding you that you <i>still</i> owe that engineer a beer."
icon_state = "blueshift"
inhand_icon_state = "blueshift"
custom_premium_price = 750
/obj/item/clothing/head/helmet/riot
name = "riot helmet"
desc = "It's a helmet specifically designed to protect against close range attacks."
icon_state = "riot"
inhand_icon_state = "helmet"
toggle_message = "You pull the visor down on"
alt_toggle_message = "You push the visor up on"
can_toggle = 1
armor = list(MELEE = 50, BULLET = 10, LASER = 10, ENERGY = 10, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 80, WOUND = 15)
flags_inv = HIDEEARS|HIDEFACE
strip_delay = 80
actions_types = list(/datum/action/item_action/toggle)
visor_flags_inv = HIDEFACE
toggle_cooldown = 0
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF
visor_flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF
dog_fashion = null
/obj/item/clothing/head/helmet/attack_self(mob/user)
if(can_toggle && !user.incapacitated())
if(world.time > cooldown + toggle_cooldown)
cooldown = world.time
up = !up
flags_1 ^= visor_flags
flags_inv ^= visor_flags_inv
flags_cover ^= visor_flags_cover
icon_state = "[initial(icon_state)][up ? "up" : ""]"
to_chat(user, "<span class='notice'>[up ? alt_toggle_message : toggle_message] \the [src].</span>")
user.update_inv_head()
if(iscarbon(user))
var/mob/living/carbon/C = user
C.head_update(src, forced = 1)
/obj/item/clothing/head/helmet/justice
name = "helmet of justice"
desc = "WEEEEOOO. WEEEEEOOO. WEEEEOOOO."
icon_state = "justice"
toggle_message = "You turn off the lights on"
alt_toggle_message = "You turn on the lights on"
actions_types = list(/datum/action/item_action/toggle_helmet_light)
can_toggle = 1
toggle_cooldown = 20
dog_fashion = null
///Looping sound datum for the siren helmet
var/datum/looping_sound/siren/weewooloop
/obj/item/clothing/head/helmet/justice/Initialize()
. = ..()
weewooloop = new(list(src), FALSE, FALSE)
/obj/item/clothing/head/helmet/justice/Destroy()
QDEL_NULL(weewooloop)
return ..()
/obj/item/clothing/head/helmet/justice/attack_self(mob/user)
. = ..()
if(up)
weewooloop.start()
else
weewooloop.stop()
/obj/item/clothing/head/helmet/justice/escape
name = "alarm helmet"
desc = "WEEEEOOO. WEEEEEOOO. STOP THAT MONKEY. WEEEOOOO."
icon_state = "justice2"
toggle_message = "You turn off the light on"
alt_toggle_message = "You turn on the light on"
/obj/item/clothing/head/helmet/swat
name = "\improper SWAT helmet"
desc = "An extremely robust, space-worthy helmet in a nefarious red and black stripe pattern."
icon_state = "swatsyndie"
inhand_icon_state = "swatsyndie"
armor = list(MELEE = 40, BULLET = 30, LASER = 30,ENERGY = 40, BOMB = 50, BIO = 90, RAD = 20, FIRE = 100, ACID = 100, WOUND = 15)
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELM_MIN_TEMP_PROTECT
heat_protection = HEAD
max_heat_protection_temperature = SPACE_HELM_MAX_TEMP_PROTECT
clothing_flags = STOPSPRESSUREDAMAGE
strip_delay = 80
resistance_flags = FIRE_PROOF | ACID_PROOF
dog_fashion = null
/obj/item/clothing/head/helmet/police
name = "police officer's hat"
desc = "A police officer's Hat. This hat emphasizes that you are THE LAW."
icon_state = "policehelm"
dynamic_hair_suffix = ""
/obj/item/clothing/head/helmet/constable
name = "constable helmet"
desc = "A british looking helmet."
worn_icon = 'icons/mob/large-worn-icons/64x64/head.dmi'
icon_state = "constable"
inhand_icon_state = "constable"
worn_x_dimension = 64
worn_y_dimension = 64
custom_price = 350
/obj/item/clothing/head/helmet/swat/nanotrasen
name = "\improper SWAT helmet"
desc = "An extremely robust, space-worthy helmet with the Nanotrasen logo emblazoned on the top."
icon_state = "swat"
inhand_icon_state = "swat"
/obj/item/clothing/head/helmet/thunderdome
name = "\improper Thunderdome helmet"
desc = "<i>'Let the battle commence!'</i>"
flags_inv = HIDEEARS|HIDEHAIR
icon_state = "thunderdome"
inhand_icon_state = "thunderdome"
armor = list(MELEE = 80, BULLET = 80, LASER = 50, ENERGY = 50, BOMB = 100, BIO = 100, RAD = 100, FIRE = 90, ACID = 90)
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELM_MIN_TEMP_PROTECT
heat_protection = HEAD
max_heat_protection_temperature = SPACE_HELM_MAX_TEMP_PROTECT
strip_delay = 80
dog_fashion = null
/obj/item/clothing/head/helmet/roman
name = "\improper Roman helmet"
desc = "An ancient helmet made of bronze and leather."
flags_inv = HIDEEARS|HIDEHAIR
flags_cover = HEADCOVERSEYES
armor = list(MELEE = 25, BULLET = 0, LASER = 25, ENERGY = 10, BOMB = 10, BIO = 0, RAD = 0, FIRE = 100, ACID = 50, WOUND = 5)
resistance_flags = FIRE_PROOF
icon_state = "roman"
inhand_icon_state = "roman"
strip_delay = 100
dog_fashion = null
/obj/item/clothing/head/helmet/roman/fake
desc = "An ancient helmet made of plastic and leather."
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 0, ACID = 0)
/obj/item/clothing/head/helmet/roman/legionnaire
name = "\improper Roman legionnaire helmet"
desc = "An ancient helmet made of bronze and leather. Has a red crest on top of it."
icon_state = "roman_c"
inhand_icon_state = "roman_c"
/obj/item/clothing/head/helmet/roman/legionnaire/fake
desc = "An ancient helmet made of plastic and leather. Has a red crest on top of it."
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 0, ACID = 0)
/obj/item/clothing/head/helmet/gladiator
name = "gladiator helmet"
desc = "Ave, Imperator, morituri te salutant."
icon_state = "gladiator"
inhand_icon_state = "gladiator"
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEHAIR
flags_cover = HEADCOVERSEYES
dog_fashion = null
/obj/item/clothing/head/helmet/redtaghelm
name = "red laser tag helmet"
desc = "They have chosen their own end."
icon_state = "redtaghelm"
flags_cover = HEADCOVERSEYES
inhand_icon_state = "redtaghelm"
armor = list(MELEE = 15, BULLET = 10, LASER = 20,ENERGY = 10, BOMB = 20, BIO = 0, RAD = 0, FIRE = 0, ACID = 50)
// Offer about the same protection as a hardhat.
dog_fashion = null
/obj/item/clothing/head/helmet/bluetaghelm
name = "blue laser tag helmet"
desc = "They'll need more men."
icon_state = "bluetaghelm"
flags_cover = HEADCOVERSEYES
inhand_icon_state = "bluetaghelm"
armor = list(MELEE = 15, BULLET = 10, LASER = 20,ENERGY = 10, BOMB = 20, BIO = 0, RAD = 0, FIRE = 0, ACID = 50)
// Offer about the same protection as a hardhat.
dog_fashion = null
/obj/item/clothing/head/helmet/knight
name = "medieval helmet"
desc = "A classic metal helmet."
icon_state = "knight_green"
inhand_icon_state = "knight_green"
armor = list(MELEE = 50, BULLET = 10, LASER = 10, ENERGY = 10, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 80) // no wound armor cause getting domed in a bucket head sounds like concussion city
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
strip_delay = 80
dog_fashion = null
/obj/item/clothing/head/helmet/knight/Initialize(mapload)
. = ..()
var/datum/component = GetComponent(/datum/component/wearertargeting/earprotection)
qdel(component)
/obj/item/clothing/head/helmet/knight/blue
icon_state = "knight_blue"
inhand_icon_state = "knight_blue"
/obj/item/clothing/head/helmet/knight/yellow
icon_state = "knight_yellow"
inhand_icon_state = "knight_yellow"
/obj/item/clothing/head/helmet/knight/red
icon_state = "knight_red"
inhand_icon_state = "knight_red"
/obj/item/clothing/head/helmet/knight/greyscale
name = "knight helmet"
desc = "A classic medieval helmet, if you hold it upside down you could see that it's actually a bucket."
icon_state = "knight_greyscale"
inhand_icon_state = "knight_greyscale"
armor = list(MELEE = 35, BULLET = 10, LASER = 10, ENERGY = 10, BOMB = 10, BIO = 10, RAD = 10, FIRE = 40, ACID = 40)
material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS //Can change color and add prefix
/obj/item/clothing/head/helmet/skull
name = "skull helmet"
desc = "An intimidating tribal helmet, it doesn't look very comfortable."
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
flags_cover = HEADCOVERSEYES
armor = list(MELEE = 35, BULLET = 25, LASER = 25, ENERGY = 35, BOMB = 25, BIO = 0, RAD = 0, FIRE = 50, ACID = 50)
icon_state = "skull"
inhand_icon_state = "skull"
strip_delay = 100
/obj/item/clothing/head/helmet/durathread
name = "durathread helmet"
desc = "A helmet made from durathread and leather."
icon_state = "durathread"
inhand_icon_state = "durathread"
resistance_flags = FLAMMABLE
armor = list(MELEE = 20, BULLET = 10, LASER = 30, ENERGY = 40, BOMB = 15, BIO = 0, RAD = 0, FIRE = 40, ACID = 50, WOUND = 5)
strip_delay = 60
/obj/item/clothing/head/helmet/rus_helmet
name = "russian helmet"
desc = "It can hold a bottle of vodka."
icon_state = "rus_helmet"
inhand_icon_state = "rus_helmet"
armor = list(MELEE = 25, BULLET = 30, LASER = 0, ENERGY = 10, BOMB = 10, BIO = 0, RAD = 20, FIRE = 20, ACID = 50, WOUND = 5)
pocket_storage_component_path = /datum/component/storage/concrete/pockets/helmet
/obj/item/clothing/head/helmet/rus_ushanka
name = "battle ushanka"
desc = "100% bear."
icon_state = "rus_ushanka"
inhand_icon_state = "rus_ushanka"
body_parts_covered = HEAD
cold_protection = HEAD
min_cold_protection_temperature = SPACE_HELM_MIN_TEMP_PROTECT
armor = list(MELEE = 25, BULLET = 20, LASER = 20, ENERGY = 30, BOMB = 20, BIO = 50, RAD = 20, FIRE = -10, ACID = 50, WOUND = 5)
/obj/item/clothing/head/helmet/infiltrator
name = "infiltrator helmet"
desc = "The galaxy isn't big enough for the two of us."
icon_state = "infiltrator"
inhand_icon_state = "infiltrator"
armor = list(MELEE = 40, BULLET = 40, LASER = 30, ENERGY = 40, BOMB = 70, BIO = 0, RAD = 0, FIRE = 100, ACID = 100)
resistance_flags = FIRE_PROOF | ACID_PROOF
flash_protect = FLASH_PROTECTION_WELDER
flags_inv = HIDEHAIR|HIDEFACIALHAIR|HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF
strip_delay = 80
/obj/item/clothing/head/helmet/elder_atmosian
name = "Elder Atmosian Helmet"
desc = "A superb helmet made with the toughest and rarest materials available to man."
icon_state = "knight_greyscale"
inhand_icon_state = "knight_greyscale"
armor = list(MELEE = 15, BULLET = 10, LASER = 30, ENERGY = 30, BOMB = 10, BIO = 10, RAD = 20, FIRE = 65, ACID = 40, WOUND = 15)
material_flags = MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS //Can change color and add prefix
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH
//monkey sentience caps
/obj/item/clothing/head/helmet/monkey_sentience
name = "monkey mind magnification helmet"
desc = "A fragile, circuitry embedded helmet for boosting the intelligence of a monkey to a higher level. You see several warning labels..."
icon_state = "monkeymind"
inhand_icon_state = "monkeymind"
strip_delay = 100
var/mob/living/carbon/monkey/magnification = null ///if the helmet is on a valid target (just works like a normal helmet if not (cargo please stop))
var/polling = FALSE///if the helmet is currently polling for targets (special code for removal)
var/light_colors = 1 ///which icon state color this is (red, blue, yellow)
/obj/item/clothing/head/helmet/monkey_sentience/Initialize()
. = ..()
light_colors = rand(1,3)
update_icon()
/obj/item/clothing/head/helmet/monkey_sentience/examine(mob/user)
. = ..()
. += "<span class='boldwarning'>---WARNING: REMOVAL OF HELMET ON SUBJECT MAY LEAD TO:---</span>"
. += "<span class='warning'>BLOOD RAGE</span>"
. += "<span class='warning'>BRAIN DEATH</span>"
. += "<span class='warning'>PRIMAL GENE ACTIVATION</span>"
. += "<span class='warning'>GENETIC MAKEUP MASS SUSCEPTIBILITY</span>"
. += "<span class='boldnotice'>Ask your CMO if mind magnification is right for you.</span>"
/obj/item/clothing/head/helmet/monkey_sentience/update_icon_state()
icon_state = "[initial(icon_state)][light_colors][magnification ? "up" : ""]"
/obj/item/clothing/head/helmet/monkey_sentience/equipped(mob/user, slot)
. = ..()
if(slot != ITEM_SLOT_HEAD)
return
if(!ismonkey(user) || user.ckey)
var/mob/living/something = user
to_chat(something, "<span class='boldnotice'>You feel a stabbing pain in the back of your head for a moment.</span>")
something.apply_damage(5,BRUTE,BODY_ZONE_HEAD,FALSE,FALSE,FALSE) //notably: no damage resist (it's in your helmet), no damage spread (it's in your helmet)
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
return
if(!(GLOB.ghost_role_flags & GHOSTROLE_STATION_SENTIENCE))
say("ERROR: Central Command has temporarily outlawed monkey sentience helmets in this sector. NEAREST LAWFUL SECTOR: 2.537 million light years away.")
magnification = user //this polls ghosts
visible_message("<span class='warning'>[src] powers up!</span>")
playsound(src, 'sound/machines/ping.ogg', 30, TRUE)
polling = TRUE
var/list/candidates = pollCandidatesForMob("Do you want to play as a mind magnified monkey?", ROLE_SENTIENCE, null, ROLE_SENTIENCE, 50, magnification, POLL_IGNORE_SENTIENCE_POTION)
polling = FALSE
if(!candidates.len)
magnification = null
visible_message("<span class='notice'>[src] falls silent and drops on the floor. Maybe you should try again later?</span>")
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
user.dropItemToGround(src)
var/mob/picked = pick(candidates)
magnification.key = picked.key
playsound(src, 'sound/machines/microwave/microwave-end.ogg', 100, FALSE)
to_chat(magnification, "<span class='notice'>You're a mind magnified monkey! Protect your helmet with your life- if you lose it, your sentience goes with it!</span>")
var/policy = get_policy(ROLE_MONKEY_HELMET)
if(policy)
to_chat(magnification, policy)
icon_state = "[icon_state]up"
/obj/item/clothing/head/helmet/monkey_sentience/Destroy()
disconnect()
return ..()
/obj/item/clothing/head/helmet/monkey_sentience/proc/disconnect()
if(!magnification) //not put on a viable head
return
if(!polling)//put on a viable head, but taken off after polling finished.
if(magnification.client)
to_chat(magnification, "<span class='userdanger'>You feel your flicker of sentience ripped away from you, as everything becomes dim...</span>")
magnification.ghostize(FALSE)
if(prob(10))
switch(rand(1,4))
if(1) //blood rage
magnification.aggressive = TRUE
if(2) //brain death
magnification.apply_damage(500,BRAIN,BODY_ZONE_HEAD,FALSE,FALSE,FALSE)
if(3) //primal gene (gorilla)
magnification.gorillize()
if(4) //genetic mass susceptibility (gib)
magnification.gib()
//either used up correctly or taken off before polling finished (punish this by destroying the helmet)
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
playsound(src, "sparks", 100, TRUE)
visible_message("<span class='warning'>[src] fizzles and breaks apart!</span>")
magnification = null
new /obj/effect/decal/cleanable/ash/crematorium(drop_location()) //just in case they're in a locker or other containers it needs to use crematorium ash, see the path itself for an explanation
/obj/item/clothing/head/helmet/monkey_sentience/dropped(mob/user)
. = ..()
if(magnification || polling)
qdel(src)//runs disconnect code
//LightToggle
/obj/item/clothing/head/helmet/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/clothing/head/helmet/update_icon_state()
var/state = "[initial(icon_state)]"
if(attached_light)
if(attached_light.on)
state += "-flight-on" //"helmet-flight-on" // "helmet-cam-flight-on"
else
state += "-flight" //etc.
icon_state = state
/obj/item/clothing/head/helmet/ui_action_click(mob/user, action)
if(istype(action, alight))
toggle_helmlight()
else
..()
/obj/item/clothing/head/helmet/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/flashlight/seclite))
var/obj/item/flashlight/seclite/S = I
if(can_flashlight && !attached_light)
if(!user.transferItemToLoc(S, src))
return
to_chat(user, "<span class='notice'>You click [S] into place on [src].</span>")
set_attached_light(S)
update_icon()
update_helmlight()
alight = new(src)
if(loc == user)
alight.Grant(user)
return
return ..()
/obj/item/clothing/head/helmet/screwdriver_act(mob/living/user, obj/item/I)
. = ..()
if(can_flashlight && attached_light) //if it has a light but can_flashlight is false, the light is permanently attached.
I.play_tool_sound(src)
to_chat(user, "<span class='notice'>You unscrew [attached_light] from [src].</span>")
attached_light.forceMove(drop_location())
if(Adjacent(user) && !issilicon(user))
user.put_in_hands(attached_light)
var/obj/item/flashlight/removed_light = set_attached_light(null)
update_helmlight()
removed_light.update_brightness(user)
update_icon()
user.update_inv_head()
QDEL_NULL(alight)
return TRUE
/obj/item/clothing/head/helmet/proc/toggle_helmlight()
set name = "Toggle Helmetlight"
set category = "Object"
set desc = "Click to toggle your helmet's attached flashlight."
if(!attached_light)
return
var/mob/user = usr
if(user.incapacitated())
return
attached_light.on = !attached_light.on
attached_light.update_brightness()
to_chat(user, "<span class='notice'>You toggle the helmet light [attached_light.on ? "on":"off"].</span>")
playsound(user, 'sound/weapons/empty.ogg', 100, TRUE)
update_helmlight()
/obj/item/clothing/head/helmet/proc/update_helmlight()
if(attached_light)
update_icon()
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()