-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
_glasses.dm
586 lines (506 loc) · 20 KB
/
_glasses.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
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
//Glasses
/obj/item/clothing/glasses
name = "glasses"
icon = 'icons/obj/clothing/glasses.dmi'
w_class = WEIGHT_CLASS_SMALL
flags_cover = GLASSESCOVERSEYES
slot_flags = ITEM_SLOT_EYES
strip_delay = 20
equip_delay_other = 25
resistance_flags = NONE
materials = list(/datum/material/glass = 250)
var/vision_flags = 0
var/invis_view = SEE_INVISIBLE_LIVING //admin only for now
/// Override to allow glasses to set higher than normal see_invis
var/invis_override = 0
/// A percentage of how much rgb to "max" on the lighting plane
/// This lets us brighten darkness without washing out bright color
var/lighting_cutoff = null
/// Similar to lighting_cutoff, except it has individual r g and b components in the same 0-100 scale
var/list/color_cutoffs = null
/// The current hud icons
var/list/icon/current = list()
/// Colors your vision when worn
var/glass_colour_type
/// Whether or not vision coloring is forcing
var/forced_glass_color = FALSE
//does wearing these glasses correct some of our vision defects?
var/vision_correction = 0
/obj/item/clothing/glasses/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] is stabbing \the [src] into [user.p_their()] eyes! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/clothing/glasses/examine(mob/user)
. = ..()
if(glass_colour_type && ishuman(user))
. += span_notice("Alt-click to toggle its colors.")
/obj/item/clothing/glasses/visor_toggling()
..()
if(visor_vars_to_toggle & VISOR_VISIONFLAGS)
vision_flags ^= initial(vision_flags)
if(visor_vars_to_toggle & VISOR_INVISVIEW)
invis_view ^= initial(invis_view)
/obj/item/clothing/glasses/weldingvisortoggle(mob/user)
. = ..()
if(. && user)
user.update_sight()
//called when thermal glasses are emped.
/obj/item/clothing/glasses/proc/thermal_overload()
if(ishuman(src.loc))
var/mob/living/carbon/human/H = src.loc
var/obj/item/organ/eyes/eyes = H.getorganslot(ORGAN_SLOT_EYES)
if(!(HAS_TRAIT(H, TRAIT_BLIND)))
if(H.glasses == src)
to_chat(H, span_danger("[src] overloads and blinds you!"))
H.flash_act(visual = 1)
H.blind_eyes(3)
H.adjust_eye_blur(5)
eyes.applyOrganDamage(5)
/obj/item/clothing/glasses/meson
name = "optical meson scanner"
desc = "Used by engineering and mining staff to see basic structural and terrain layouts through walls, regardless of lighting conditions."
icon_state = "meson"
item_state = "meson"
vision_flags = SEE_TURFS
// Mesons get to be lightly green
color_cutoffs = list(5, 15, 5)
glass_colour_type = /datum/client_colour/glass_colour/lightgreen
clothing_traits = list(TRAIT_MESONS)
/obj/item/clothing/glasses/meson/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] is putting \the [src] to [user.p_their()] eyes and overloading the brightness! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/clothing/glasses/meson/night
name = "night vision meson scanner"
desc = "An optical meson scanner fitted with an amplified visible light spectrum overlay, providing greater visual clarity in darkness."
icon_state = "nvgmeson"
item_state = "nvgmeson"
flash_protect = -1
// Night vision mesons get the same but more intense
color_cutoffs = list(10, 30, 10)
glass_colour_type = /datum/client_colour/glass_colour/green
/obj/item/clothing/glasses/meson/gar
name = "gar mesons"
icon_state = "garm"
item_state = "garm"
desc = "Do the impossible, see the invisible!"
force = 10
throwforce = 10
throw_speed = 4
attack_verb = list("sliced")
hitsound = 'sound/weapons/bladeslice.ogg'
sharpness = SHARP_EDGED
/obj/item/clothing/glasses/meson/sunglasses
name= "meson sunglasses"
desc = "Sunglasses that also function as a meson scanner."
icon_state = "sunhudmeson"
item_state = "sunhudmeson"
flash_protect = 1
tint = 1
/obj/item/clothing/glasses/meson/sunglasses/ce
name = "advanced engineering sunglasses"
desc = "A meson scanner, diagnostic HUD, and reactive welding shield built into a pair of sunglasses."
flash_protect = 2 // welding moment
var/hud_type = DATA_HUD_DIAGNOSTIC_BASIC
/obj/item/clothing/glasses/meson/sunglasses/ce/equipped(mob/living/carbon/human/user, slot)
..()
if(slot == ITEM_SLOT_EYES)
var/datum/atom_hud/H = GLOB.huds[hud_type]
H.show_to(user)
/obj/item/clothing/glasses/meson/sunglasses/ce/dropped(mob/living/carbon/human/user)
. = ..()
if(istype(user) && user.glasses == src)
var/datum/atom_hud/H = GLOB.huds[hud_type]
H.hide_from(user)
/obj/item/clothing/glasses/science
name = "science goggles"
desc = "A pair of snazzy goggles used to protect against chemical spills. Fitted with an analyzer for scanning items and reagents."
icon_state = "purple"
item_state = "glasses"
clothing_flags = SCAN_REAGENTS //You can see reagents while wearing science goggles
actions_types = list(/datum/action/item_action/toggle_research_scanner)
glass_colour_type = /datum/client_colour/glass_colour/purple
resistance_flags = ACID_PROOF
armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 100)
/obj/item/clothing/glasses/science/item_action_slot_check(slot)
if(slot == ITEM_SLOT_EYES)
return 1
/obj/item/clothing/glasses/science/night
name = "night vision science goggles"
desc = "A pair of snazzy goggles used to protect against chemical spills that happen in complete darkness. Fitted with an analyzer for scanning items and reagents."
icon_state = "sciencehudnight"
item_state = "sciencehudnight"
flash_protect = -1
// Real vivid purple
color_cutoffs = list(50, 10, 30)
glass_colour_type = /datum/client_colour/glass_colour/green
/obj/item/clothing/glasses/night
name = "night vision goggles"
desc = "You can totally see in the dark now!"
icon_state = "night"
item_state = "glasses"
flash_protect = -1
// Dark green
color_cutoffs = list(10, 30, 10)
glass_colour_type = /datum/client_colour/glass_colour/green
/obj/item/clothing/glasses/science/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] is tightening \the [src]'s straps around [user.p_their()] neck! It looks like [user.p_theyre()] trying to commit suicide!"))
return OXYLOSS
/obj/item/clothing/glasses/eyepatch
name = "eyepatch"
desc = "Yarr."
icon_state = "eyepatch"
item_state = "eyepatch"
/obj/item/clothing/glasses/eyepatch/bigboss
name = "faded eyepatch"
desc = "Offers night vision and protection from flashes. Another mission, right boss?"
flash_protect = 1
// Dark green
color_cutoffs = list(10, 30, 10)
/obj/item/clothing/glasses/monocle
name = "monocle"
desc = "Such a dapper eyepiece!"
icon_state = "monocle"
item_state = "headset" // lol
vision_correction = 1
/obj/item/clothing/glasses/material
name = "optical material scanner"
desc = "Very confusing glasses."
icon_state = "material"
item_state = "glasses"
vision_flags = SEE_OBJS
glass_colour_type = /datum/client_colour/glass_colour/lightblue
/obj/item/clothing/glasses/material/mining
name = "optical material scanner"
desc = "Used by miners to detect ores deep within the rock."
icon_state = "material"
item_state = "glasses"
/obj/item/clothing/glasses/material/mining/gar
name = "gar material scanner"
icon_state = "garm"
item_state = "garm"
desc = "Do the impossible, see the invisible!"
force = 10
throwforce = 20
throw_speed = 4
attack_verb = list("sliced")
hitsound = 'sound/weapons/bladeslice.ogg'
sharpness = SHARP_EDGED
glass_colour_type = /datum/client_colour/glass_colour/lightgreen
/obj/item/clothing/glasses/regular
name = "prescription glasses"
desc = "Made by Nerd. Co."
icon_state = "glasses"
item_state = "glasses"
vision_correction = 1 //corrects nearsightedness
/obj/item/clothing/glasses/regular/jamjar
name = "jamjar glasses"
desc = "Also known as Virginity Protectors."
icon_state = "jamjar_glasses"
item_state = "jamjar_glasses"
/obj/item/clothing/glasses/regular/hipster
name = "prescription glasses"
desc = "Made by Uncool. Co."
icon_state = "hipster_glasses"
item_state = "hipster_glasses"
/obj/item/clothing/glasses/regular/circle
name = "circle glasses"
desc = "Why would you wear something so controversial yet so brave?"
icon_state = "circle_glasses"
item_state = "circle_glasses"
//Here lies green glasses, so ugly they died. RIP
/obj/item/clothing/glasses/sunglasses
name = "sunglasses"
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks flashes."
icon_state = "sun"
item_state = "sunglasses"
flash_protect = 1
tint = 1
glass_colour_type = /datum/client_colour/glass_colour/gray
dog_fashion = /datum/dog_fashion/head
/obj/item/clothing/glasses/sunglasses/prescription
name = "prescription sunglasses"
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks flashes. Has prescription lenses that correct nearsightedness."
vision_correction = 1
/obj/item/clothing/glasses/sunglasses/reagent
name = "beer goggles"
desc = "A pair of sunglasses outfitted with apparatus to scan reagents, as well as providing an innate understanding of liquid viscosity while in motion."
clothing_flags = SCAN_REAGENTS
clothing_traits = list(TRAIT_BOOZE_SLIDER)
/obj/item/clothing/glasses/sunglasses/garb
name = "black gar glasses"
desc = "Go beyond impossible and kick reason to the curb!"
icon_state = "garb"
item_state = "garb"
force = 10
throwforce = 10
throw_speed = 4
attack_verb = list("sliced")
hitsound = 'sound/weapons/bladeslice.ogg'
sharpness = SHARP_EDGED
/obj/item/clothing/glasses/sunglasses/garb/supergarb
name = "black giga gar glasses"
desc = "Believe in us humans."
icon_state = "supergarb"
item_state = "garb"
force = 12
throwforce = 12
/obj/item/clothing/glasses/sunglasses/gar
name = "gar glasses"
desc = "Just who the hell do you think I am?!"
icon_state = "gar"
item_state = "gar"
force = 10
throwforce = 10
throw_speed = 4
attack_verb = list("sliced")
hitsound = 'sound/weapons/bladeslice.ogg'
sharpness = SHARP_EDGED
glass_colour_type = /datum/client_colour/glass_colour/orange
/obj/item/clothing/glasses/sunglasses/gar/supergar
name = "giga gar glasses"
desc = "We evolve past the person we were a minute before. Little by little we advance with each turn. That's how a drill works!"
icon_state = "supergar"
item_state = "gar"
force = 12
throwforce = 12
glass_colour_type = /datum/client_colour/glass_colour/red
/obj/item/clothing/glasses/welding
name = "welding goggles"
desc = "Protects the eyes from welders; approved by the mad scientist association."
icon_state = "welding-g"
item_state = "welding-g"
actions_types = list(/datum/action/item_action/toggle)
materials = list(/datum/material/iron = 250)
flash_protect = 2
tint = 2
visor_vars_to_toggle = VISOR_FLASHPROTECT | VISOR_TINT
flags_cover = GLASSESCOVERSEYES
glass_colour_type = /datum/client_colour/glass_colour/gray
/obj/item/clothing/glasses/welding/attack_self(mob/user)
weldingvisortoggle(user)
/obj/item/clothing/glasses/blindfold
name = "blindfold"
desc = "Covers the eyes, preventing sight."
icon_state = "blindfold"
item_state = "blindfold"
flash_protect = 2
tint = 3
dog_fashion = /datum/dog_fashion/head
/obj/item/clothing/glasses/blindfold/equipped(mob/living/carbon/human/user, slot)
. = ..()
if(slot == ITEM_SLOT_EYES)
user.become_blind("blindfold_[REF(src)]")
/obj/item/clothing/glasses/blindfold/dropped(mob/living/carbon/human/user)
..()
user.cure_blind("blindfold_[REF(src)]")
/obj/item/clothing/glasses/blindfold/white
name = "blind personnel blindfold"
desc = "Indicates that the wearer suffers from blindness."
icon_state = "blindfoldwhite"
item_state = "blindfoldwhite"
var/colored_before = FALSE
/obj/item/clothing/glasses/blindfold/white/equipped(mob/living/carbon/human/user, slot)
if(ishuman(user) && slot & ITEM_SLOT_EYES)
update_appearance(UPDATE_ICON)
user.update_inv_glasses() //Color might have been changed by update_icon.
return ..()
/obj/item/clothing/glasses/blindfold/white/update_icon(updates=ALL)
if(!ishuman(loc))
return ..()
var/mob/living/carbon/human/loc_human = loc
if(!colored_before)
add_atom_colour(loc_human.eye_color, FIXED_COLOUR_PRIORITY)
colored_before = TRUE
return ..()
/obj/item/clothing/glasses/blindfold/white/worn_overlays(mutable_appearance/standing, isinhands = FALSE, icon_file)
. = ..()
if(!isinhands && ishuman(loc) && !colored_before)
var/mob/living/carbon/human/H = loc
var/mutable_appearance/M = mutable_appearance('icons/mob/clothing/eyes/eyes.dmi', "blindfoldwhite")
M.appearance_flags |= RESET_COLOR
M.color = H.eye_color
. += M
/obj/item/clothing/glasses/sunglasses/big
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Larger than average enhanced shielding blocks flashes."
icon_state = "bigsunglasses"
item_state = "bigsunglasses"
/obj/item/clothing/glasses/thermal
name = "optical thermal scanner"
desc = "Thermals in the shape of glasses."
icon_state = "thermal"
item_state = "glasses"
vision_flags = SEE_MOBS
// Going for an orange color here
color_cutoffs = list(25, 8, 5)
flash_protect = -1
glass_colour_type = /datum/client_colour/glass_colour/red
/obj/item/clothing/glasses/thermal/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
return
thermal_overload()
/obj/item/clothing/glasses/thermal/xray
name = "syndicate xray goggles"
desc = "A pair of xray goggles manufactured by the Syndicate."
vision_flags = SEE_TURFS|SEE_MOBS|SEE_OBJS
/obj/item/clothing/glasses/thermal/syndi //These are now a traitor item, concealed as mesons. -Pete
name = "chameleon thermals"
desc = "A pair of thermal optic goggles with an onboard chameleon generator."
syndicate = TRUE
var/datum/action/item_action/chameleon/change/chameleon_action
/obj/item/clothing/glasses/thermal/syndi/Initialize(mapload)
. = ..()
chameleon_action = new(src)
if(syndicate)
chameleon_action.syndicate = TRUE
chameleon_action.chameleon_type = /obj/item/clothing/glasses
chameleon_action.chameleon_name = "Glasses"
chameleon_action.chameleon_blacklist = typecacheof(/obj/item/clothing/glasses/changeling, only_root_path = TRUE)
chameleon_action.initialize_disguises()
add_item_action(chameleon_action)
/obj/item/clothing/glasses/thermal/syndi/emp_act(severity)
. = ..()
if(. & EMP_PROTECT_SELF)
return
chameleon_action.emp_randomise()
/obj/item/clothing/glasses/thermal/monocle
name = "thermoncle"
desc = "Never before has seeing through walls felt so gentlepersonly."
icon_state = "thermoncle"
flags_1 = null //doesn't protect eyes because it's a monocle, duh
/obj/item/clothing/glasses/thermal/monocle/examine(mob/user) //Different examiners see a different description!
if(user.gender == MALE)
desc = replacetext(desc, "person", "man")
else if(user.gender == FEMALE)
desc = replacetext(desc, "person", "woman")
. = ..()
desc = initial(desc)
/obj/item/clothing/glasses/thermal/eyepatch
name = "optical thermal eyepatch"
desc = "An eyepatch with built-in thermal optics."
icon_state = "eyepatch"
item_state = "eyepatch"
/obj/item/clothing/glasses/cold
name = "cold goggles"
desc = "A pair of goggles meant for low temperatures."
icon_state = "cold"
item_state = "cold"
/obj/item/clothing/glasses/heat
name = "heat goggles"
desc = "A pair of goggles meant for high temperatures."
icon_state = "heat"
item_state = "heat"
/obj/item/clothing/glasses/orange
name = "orange glasses"
desc = "A sweet pair of orange shades."
icon_state = "orangeglasses"
item_state = "orangeglasses"
glass_colour_type = /datum/client_colour/glass_colour/lightorange
/obj/item/clothing/glasses/red
name = "red glasses"
desc = "Hey, you're looking good, senpai!"
icon_state = "redglasses"
item_state = "redglasses"
glass_colour_type = /datum/client_colour/glass_colour/red
/obj/item/clothing/glasses/godeye
name = "eye of god"
desc = "A strange eye, said to have been torn from an omniscient creature that used to roam the wastes."
icon_state = "godeye"
item_state = "godeye"
vision_flags = SEE_TURFS
// Blue, light blue
color_cutoffs = list(15, 30, 40)
resistance_flags = LAVA_PROOF | FIRE_PROOF
clothing_flags = SCAN_REAGENTS
var/datum/action/cooldown/expose/expose_ability
var/hud_type = DATA_HUD_MEDICAL_ADVANCED
/obj/item/clothing/glasses/godeye/Initialize(mapload)
. = ..()
expose_ability = new(src)
/obj/item/clothing/glasses/godeye/Destroy()
QDEL_NULL(expose_ability)
return ..()
/obj/item/clothing/glasses/godeye/equipped(mob/living/carbon/human/user, slot)
. = ..()
if(ishuman(user) && slot == ITEM_SLOT_EYES)
ADD_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT)
expose_ability.Grant(user)
if(hud_type)
var/datum/atom_hud/H = GLOB.huds[hud_type]
H.show_to(user)
/obj/item/clothing/glasses/godeye/dropped(mob/living/carbon/human/user)
. = ..()
// Behead someone, their "glasses" drop on the floor
// and thus, the god eye should no longer be sticky
REMOVE_TRAIT(src, TRAIT_NODROP, EYE_OF_GOD_TRAIT)
expose_ability.Remove(user)
if(hud_type && istype(user) && user.glasses == src)
var/datum/atom_hud/H = GLOB.huds[hud_type]
H.hide_from(user)
/obj/item/clothing/glasses/godeye/attackby(obj/item/W as obj, mob/user as mob, params)
if(istype(W, src) && W != src && W.loc == user)
if(W.icon_state == "godeye")
W.icon_state = "doublegodeye"
W.item_state = "doublegodeye"
W.desc = "A pair of strange eyes, said to have been torn from an omniscient creature that used to roam the wastes. There's no real reason to have two, but that isn't stopping you."
if(iscarbon(user))
var/mob/living/carbon/C = user
C.update_inv_wear_mask()
qdel(src)
..()
/datum/action/cooldown/expose
name = "Expose"
desc = "Expose an enemy, increasing all damage dealt to them by 15% for 10 seconds, effect is magnified on megafauna."
background_icon_state = "bg_demon"
overlay_icon_state = "bg_demon_border"
button_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "expose"
click_to_activate = TRUE
cooldown_time = 45 SECONDS
ranged_mousepointer = 'icons/effects/mouse_pointers/expose_target.dmi'
/datum/action/cooldown/expose/IsAvailable(feedback = FALSE)
return ..() && isliving(owner)
/datum/action/cooldown/expose/Activate(atom/exposed)
if(owner.stat != CONSCIOUS)
return FALSE
if(!isliving(exposed) || exposed == owner)
owner.balloon_alert(owner, "invalid exposed!")
return FALSE
StartCooldown(15 SECONDS)
var/mob/living/living_exposed = exposed
living_exposed.apply_status_effect(STATUS_EFFECT_EXPOSED)
living_exposed.adjust_jitter(5 SECONDS)
to_chat(living_exposed, span_warning("You feel the gaze of a malevolent presence focus on you!"))
owner.playsound_local(get_turf(owner), 'sound/magic/smoke.ogg', 50, TRUE)
living_exposed.playsound_local(get_turf(living_exposed), 'sound/hallucinations/i_see_you1.ogg', 50, TRUE)
owner.balloon_alert(owner, "[living_exposed] exposed!")
addtimer(CALLBACK(src, TYPE_PROC_REF(/atom/, balloon_alert), owner, "eye recharged"), cooldown_time)
StartCooldown()
return TRUE
/obj/item/clothing/glasses/AltClick(mob/user)
if(glass_colour_type && ishuman(user))
var/mob/living/carbon/human/human_user = user
if (human_user.glasses != src)
return ..()
if (HAS_TRAIT_FROM(human_user, TRAIT_SEE_GLASS_COLORS, GLASSES_TRAIT))
REMOVE_TRAIT(human_user, TRAIT_SEE_GLASS_COLORS, GLASSES_TRAIT)
to_chat(human_user, span_notice("You will no longer see glasses colors."))
else
ADD_TRAIT(human_user, TRAIT_SEE_GLASS_COLORS, GLASSES_TRAIT)
to_chat(human_user, span_notice("You will now see glasses colors."))
human_user.update_glasses_color(src, TRUE)
else
return ..()
/obj/item/clothing/glasses/proc/change_glass_color(mob/living/carbon/human/H, datum/client_colour/glass_colour/new_color_type)
var/old_colour_type = glass_colour_type
if(!new_color_type || ispath(new_color_type)) //the new glass colour type must be null or a path.
glass_colour_type = new_color_type
if(H && H.glasses == src)
if(old_colour_type)
H.remove_client_colour(old_colour_type)
if(glass_colour_type)
H.update_glasses_color(src, 1)
/mob/living/carbon/human/proc/update_glasses_color(obj/item/clothing/glasses/G, glasses_equipped)
if (HAS_TRAIT(src, TRAIT_SEE_GLASS_COLORS) && glasses_equipped)
add_client_colour(G.glass_colour_type)
else
remove_client_colour(G.glass_colour_type)