-
-
Notifications
You must be signed in to change notification settings - Fork 452
/
scanners.dm
1010 lines (886 loc) · 40.1 KB
/
scanners.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
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
CONTAINS:
T-RAY
HEALTH ANALYZER
GAS ANALYZER
SLIME SCANNER
NANITE SCANNER
GENE SCANNER
*/
// Describes the three modes of scanning available for health analyzers
#define SCANMODE_HEALTH 0
#define SCANMODE_CHEMICAL 1
#define SCANMODE_WOUND 2
/obj/item/t_scanner
name = "\improper T-ray scanner"
desc = "A terahertz-ray emitter and scanner used to detect underfloor objects such as cables and pipes."
custom_price = 10
icon = 'icons/obj/device.dmi'
icon_state = "t-ray0"
var/on = FALSE
slot_flags = ITEM_SLOT_BELT
w_class = WEIGHT_CLASS_SMALL
item_state = "electronic"
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
materials = list(/datum/material/iron=150)
/obj/item/t_scanner/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] begins to emit terahertz-rays into [user.p_their()] brain with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return TOXLOSS
/obj/item/t_scanner/proc/toggle_on()
on = !on
icon_state = copytext_char(icon_state, 1, -1) + "[on]"
if(on)
START_PROCESSING(SSobj, src)
else
STOP_PROCESSING(SSobj, src)
/obj/item/t_scanner/attack_self(mob/user)
toggle_on()
/obj/item/t_scanner/AltClick(mob/user)
if(!user.canUseTopic(src, BE_CLOSE))
return
toggle_on()
/obj/item/t_scanner/cyborg_unequip(mob/user)
if(!on)
return
toggle_on()
/obj/item/t_scanner/process()
if(!on)
STOP_PROCESSING(SSobj, src)
return null
scan()
/obj/item/t_scanner/proc/scan()
t_ray_scan(loc)
/proc/t_ray_scan(mob/viewer, flick_time = 8, distance = 3)
if(!ismob(viewer) || !viewer.client)
return
var/list/t_ray_images = list()
for(var/obj/O in orange(distance, viewer) )
if(HAS_TRAIT(O, TRAIT_T_RAY_VISIBLE))
var/image/I = new(loc = get_turf(O))
var/mutable_appearance/MA = new(O)
MA.alpha = 128
MA.dir = O.dir
I.appearance = MA
t_ray_images += I
if(t_ray_images.len)
flick_overlay_global(t_ray_images, list(viewer.client), flick_time)
/obj/item/healthanalyzer
name = "health analyzer"
icon = 'icons/obj/device.dmi'
icon_state = "health"
item_state = "healthanalyzer"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
desc = "A hand-held body scanner able to distinguish vital signs of the subject."
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
throwforce = 3
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(/datum/material/iron=200)
var/scanmode = 0
var/advanced = FALSE
var/beep_cooldown = 0
/obj/item/healthanalyzer/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!"))
return BRUTELOSS
/obj/item/healthanalyzer/attack_self(mob/user)
scanmode = (scanmode + 1) % 3
switch(scanmode)
if(SCANMODE_HEALTH)
to_chat(user, span_notice("You switch the health analyzer to check physical health."))
if(SCANMODE_CHEMICAL)
to_chat(user, span_notice("You switch the health analyzer to scan chemical contents."))
if(SCANMODE_WOUND)
to_chat(user, span_notice("You switch the health analyzer to report extra info on wounds."))
/obj/item/healthanalyzer/attack(mob/living/M, mob/living/carbon/human/user)
flick("[icon_state]-scan", src) //makes it so that it plays the scan animation upon scanning, including clumsy scanning
if(beep_cooldown<world.time)
playsound(src, 'sound/effects/fastbeep.ogg', 20)
beep_cooldown = world.time+40
// Clumsiness/brain damage check
/* This needs to be reformated, along with 99% of this stuff
if ((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(50))
to_chat(user, span_notice("You stupidly try to analyze the floor's vitals!"))
user.visible_message(span_warning("[user] has analyzed the floor's vitals!"))
to_chat(user, span_info("Analyzing results for The floor:\n\tOverall status: <b>Healthy</b>"))
to_chat(user, span_info("Key: <font color='blue'>Suffocation</font>/<font color='green'>Toxin</font>/<font color='#FF8000'>Burn</font>/<font color='red'>Brute</font>"))
to_chat(user, span_info("\tDamage specifics: <font color='blue'>0</font>-<font color='green'>0</font>-<font color='#FF8000'>0</font>-<font color='red'>0</font>"))
to_chat(user, span_info("Body temperature: ???"))
return
*/
user.visible_message(span_notice("[user] has analyzed [M]'s vitals."))
switch(scanmode)
if(SCANMODE_HEALTH)
healthscan(user, M, advanced)
if(SCANMODE_CHEMICAL)
chemscan(user, M)
else
woundscan(user, M, src)
add_fingerprint(user)
// Used by the PDA medical scanner too
/proc/healthscan(mob/user, mob/living/M, advanced = FALSE)
var/list/combined_msg = list()
if(isliving(user) && (user.incapacitated() || user.eye_blind))
return
//Damage specifics
var/oxy_loss = M.getOxyLoss()
var/tox_loss = M.getToxLoss()
var/fire_loss = M.getFireLoss()
var/brute_loss = M.getBruteLoss()
var/mob_status = (M.stat == DEAD ? span_alert("<b>Deceased</b>") : "<b>[round(M.health/M.maxHealth,0.01)*100] % healthy</b>")
if(HAS_TRAIT(M, TRAIT_FAKEDEATH) && !advanced)
mob_status = span_alert("<b>Deceased</b>")
oxy_loss = max(rand(1, 40), oxy_loss, (300 - (tox_loss + fire_loss + brute_loss))) // Random oxygen loss
if(ishuman(M))
var/mob/living/carbon/human/H = M
if(H.undergoing_cardiac_arrest() && H.stat != DEAD)
combined_msg += span_danger("Subject suffering from heart attack: Apply defibrillation or other electric shock immediately!")
combined_msg += span_info("Analyzing results for [M]:\n\tOverall status: [mob_status]")
// Damage descriptions
if(brute_loss > 10)
combined_msg += "\t[span_alert("[brute_loss > 50 ? "Severe" : "Minor"] tissue damage detected.")]"
if(fire_loss > 10)
combined_msg += "\t[span_alert("[fire_loss > 50 ? "Severe" : "Minor"] burn damage detected.")]"
if(oxy_loss > 10)
combined_msg += "\t<span class='info'>[span_alert("[oxy_loss > 50 ? "Severe" : "Minor"] oxygen deprivation detected.")]"
if(tox_loss > 10)
combined_msg += "\t[span_alert("[tox_loss > 50 ? "Severe" : "Minor"] amount of toxin damage detected.")]"
if(M.getStaminaLoss())
combined_msg += "\t[span_alert("Subject appears to be suffering from fatigue.")]"
if(advanced)
combined_msg += "\t[span_info("Fatigue Level: [M.getStaminaLoss()]%.")]"
if (M.getCloneLoss())
combined_msg += "\t[span_alert("Subject appears to have [M.getCloneLoss() > 30 ? "Severe" : "Minor"] cellular damage.")]"
if(advanced)
combined_msg += "\t[span_info("Cellular Damage Level: [M.getCloneLoss()].")]"
if (!M.getorgan(/obj/item/organ/brain))
combined_msg += "\t[span_alert("Subject lacks a brain.")]"
if(iscarbon(M))
var/mob/living/carbon/C = M
if(LAZYLEN(C.get_traumas()))
var/list/trauma_text = list()
for(var/datum/brain_trauma/B in C.get_traumas())
var/trauma_desc = ""
switch(B.resilience)
if(TRAUMA_RESILIENCE_SURGERY)
trauma_desc += "severe "
if(TRAUMA_RESILIENCE_LOBOTOMY)
trauma_desc += "deep-rooted "
if(TRAUMA_RESILIENCE_WOUND)
trauma_desc += "fracture-derived "
if(TRAUMA_RESILIENCE_MAGIC, TRAUMA_RESILIENCE_ABSOLUTE)
trauma_desc += "permanent "
trauma_desc += B.scan_desc
trauma_text += trauma_desc
combined_msg += "\t[span_alert("Cerebral traumas detected: subject appears to be suffering from [english_list(trauma_text)].")]"
if(C.roundstart_quirks.len)
combined_msg += "\t[span_info("Subject has the following physiological traits: [C.get_trait_string()].")]"
if(C.has_quirk(/datum/quirk/allergic))
combined_msg += "\t[span_info("Subject is allergic to the chemical [C.allergies].")]"
if(advanced)
combined_msg += "\t[span_info("Brain Activity Level: [(200 - M.getOrganLoss(ORGAN_SLOT_BRAIN))/2]%.")]"
if(M.has_horror_inside())
combined_msg += "\t[span_alert("Detected parasitic organism residing in the cranial area.")]"
combined_msg += "\t[span_alert("Recommended course of action: <b>organ manipulation surgery performed on head.</b>.")]"
if (M.radiation)
combined_msg += "\t[span_alert("Subject is irradiated.")]"
if(advanced)
combined_msg += "\t[span_info("Radiation Level: [M.radiation]%.")]"
if(advanced && M.has_status_effect(/datum/status_effect/hallucination))
combined_msg += "\t[span_info("Subject is hallucinating.")]"
//Eyes and ears
if(advanced)
if(iscarbon(M))
var/mob/living/carbon/C = M
var/obj/item/organ/ears/ears = C.getorganslot(ORGAN_SLOT_EARS)
combined_msg += "\t<span class='info'><b>==EAR STATUS==</b></span>"
if(istype(ears))
var/healthy = TRUE
if(HAS_TRAIT_FROM(C, TRAIT_DEAF, GENETIC_MUTATION))
healthy = FALSE
combined_msg += "\t[span_alert("Subject is genetically deaf.")]"
else if(HAS_TRAIT(C, TRAIT_DEAF))
healthy = FALSE
combined_msg += "\t[span_alert("Subject is deaf.")]"
else
if(ears.damage)
combined_msg += "\t[span_alert("Subject has [ears.damage > ears.maxHealth ? "permanent ": "temporary "]hearing damage.")]"
healthy = FALSE
if(ears.deaf)
combined_msg += "\t[span_alert("Subject is [ears.damage > ears.maxHealth ? "permanently ": "temporarily "]deaf.")]"
healthy = FALSE
if(healthy)
combined_msg += "\t[span_info("Healthy.")]"
else
combined_msg += "\t[span_alert("Subject does not have ears.")]"
var/obj/item/organ/eyes/eyes = C.getorganslot(ORGAN_SLOT_EYES)
combined_msg += "\t<span class='info'><b>==EYE STATUS==</b></span>"
if(istype(eyes))
var/healthy = TRUE
if(HAS_TRAIT(C, TRAIT_BLIND))
combined_msg += "\t[span_alert("Subject is blind.")]"
healthy = FALSE
if(HAS_TRAIT(C, TRAIT_NEARSIGHT))
combined_msg += "\t[span_alert("Subject is nearsighted.")]"
healthy = FALSE
if(eyes.damage > 30)
combined_msg += "\t[span_alert("Subject has severe eye damage.")]"
healthy = FALSE
else if(eyes.damage > 20)
combined_msg += "\t[span_alert("Subject has significant eye damage.")]"
healthy = FALSE
else if(eyes.damage)
combined_msg += "\t[span_alert("Subject has minor eye damage.")]"
healthy = FALSE
if(healthy)
combined_msg += "\t[span_info("Healthy.")]"
else
combined_msg += "\t[span_alert("Subject does not have eyes.")]"
// Body part damage report
if(iscarbon(M))
var/mob/living/carbon/C = M
var/list/damaged = C.get_damaged_bodyparts(1,1)
if(length(damaged)>0 || oxy_loss>0 || tox_loss>0 || fire_loss>0)
combined_msg += span_info("\tDamage: <span class='info'><font color='red'>Brute</font></span>-<font color='#FF8000'>Burn</font>-<font color='green'>Toxin</font>-<font color='blue'>Suffocation</font>\n\t\tSpecifics: <font color='red'>[brute_loss]</font>-<font color='#FF8000'>[fire_loss]</font>-<font color='green'>[tox_loss]</font>-<font color='blue'>[oxy_loss]</font>")
for(var/obj/item/bodypart/org in damaged)
combined_msg += "\t\t<span class='info'>[capitalize(org.name)]: [(org.brute_dam > 0) ? "<font color='red'>[org.brute_dam]</font></span>" : "<font color='red'>0</font>"]-[(org.burn_dam > 0) ? "<font color='#FF8000'>[org.burn_dam]</font>" : "<font color='#FF8000'>0</font>"]"
//Organ damages report
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/no_damage
var/minor_damage
var/major_damage
var/max_damage
var/report_organs = FALSE
//Piece together the lists to be reported
for(var/O in H.internal_organs)
var/obj/item/organ/organ = O
if(istype(O, /obj/item/organ/cyberimp))
var/obj/item/organ/cyberimp/stealthcheck = O
if(stealthcheck.syndicate_implant)
continue
if(organ.organ_flags & ORGAN_FAILING)
report_organs = TRUE //if we report one organ, we report all organs, even if the lists are empty, just for consistency
if(max_damage)
max_damage += ", " //prelude the organ if we've already reported an organ
max_damage += organ.name //this just slaps the organ name into the string of text
else
max_damage = "\t<span class='alert'>Non-Functional Organs: " //our initial statement
max_damage += organ.name
else if(organ.damage > organ.high_threshold)
report_organs = TRUE
if(major_damage)
major_damage += ", "
major_damage += organ.name
else
major_damage = "\t<span class='info'>Severely Damaged Organs: "
major_damage += organ.name
else if(organ.damage > organ.low_threshold)
report_organs = TRUE
if(minor_damage)
minor_damage += ", "
minor_damage += organ.name
else
minor_damage = "\t<span class='info'>Mildly Damaged Organs: "
minor_damage += organ.name
else if ((organ.damage < organ.low_threshold) && (organ.name != "festering ooze"))
report_organs = TRUE // if no organs get reported, it means they have no organs
if(no_damage)
no_damage += ", "
no_damage += organ.name
else
no_damage = "\t<span class='info'>Healthy Organs: "
no_damage += organ.name
if(report_organs) //we either finish the list, or set it to be empty if no organs were reported in that category
if(!max_damage)
max_damage = "\t[span_alert("Non-Functional Organs: ")]"
else
max_damage += "</span>"
if(!major_damage)
major_damage = "\t[span_info("Severely Damaged Organs: ")]"
else
major_damage += "</span>"
if(!minor_damage)
minor_damage = "\t[span_info("Mildly Damaged Organs: ")]"
else
minor_damage += "</span>"
if(!no_damage)
no_damage = "\t[span_info("Healthy Organs: ")]"
else
no_damage += "</span>"
combined_msg += no_damage
combined_msg += minor_damage
combined_msg += major_damage
combined_msg += max_damage
//Genetic damage
if(advanced && H.has_dna())
combined_msg += "\t[span_info("Genetic Stability: [H.dna.stability]%.")]"
// Species and body temperature
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/datum/species/S = H.dna.species
var/mutant = FALSE
if (H.dna.check_mutation(HULK))
mutant = TRUE
else if (S.mutantlungs != initial(S.mutantlungs))
mutant = TRUE
else if (S.mutantbrain != initial(S.mutantbrain))
mutant = TRUE
else if (S.mutantheart != initial(S.mutantheart))
mutant = TRUE
else if (S.mutanteyes != initial(S.mutanteyes))
mutant = TRUE
else if (S.mutantears != initial(S.mutantears))
mutant = TRUE
else if (S.mutanthands != initial(S.mutanthands))
mutant = TRUE
else if (S.mutanttongue != initial(S.mutanttongue))
mutant = TRUE
else if (S.mutanttail != initial(S.mutanttail))
mutant = TRUE
else if (S.mutantliver != initial(S.mutantliver))
mutant = TRUE
else if (S.mutantstomach != initial(S.mutantstomach))
mutant = TRUE
combined_msg += span_info("Species: [S.name][mutant ? "-derived mutant" : ""]")
var/temp_span = "notice"
if(M.bodytemperature <= BODYTEMP_HEAT_DAMAGE_LIMIT || M.bodytemperature >= BODYTEMP_COLD_DAMAGE_LIMIT)
temp_span = "warning"
combined_msg += "<span_class = '[temp_span]'>Body temperature: [round(M.bodytemperature-T0C,0.1)] °C ([round(M.bodytemperature*1.8-459.67,0.1)] °F)</span>"
// Time of death
if(M.tod && (M.stat == DEAD || ((HAS_TRAIT(M, TRAIT_FAKEDEATH)) && !advanced)))
combined_msg += "[span_info("Time of Death:")] [M.tod]"
var/tdelta = round(world.time - M.timeofdeath)
if(tdelta < (DEFIB_TIME_LIMIT))
combined_msg += span_danger("Subject died [DisplayTimeText(tdelta)] ago, defibrillation may be possible!")
// Wounds
if(iscarbon(M))
var/mob/living/carbon/C = M
var/list/wounded_parts = C.get_wounded_bodyparts()
for(var/i in wounded_parts)
var/obj/item/bodypart/wounded_part = i
var/render_list = "<span class='alert ml-1'><b>Warning: Physical trauma[LAZYLEN(wounded_part.wounds) > 1? "s" : ""] detected in [wounded_part.name]</b>"
for(var/k in wounded_part.wounds)
var/datum/wound/W = k
render_list += "<div class='ml-2'>Type: [W.name]\nSeverity: [W.severity_text()]\nRecommended Treatment: [W.treat_text]</div>\n" // less lines than in woundscan() so we don't overload people trying to get basic med info
render_list += "</span>"
to_chat(render_list)
for(var/thing in M.diseases)
var/datum/disease/D = thing
if(!(D.visibility_flags & HIDDEN_SCANNER))
combined_msg += span_alert("<b>Warning: [D.form] detected</b>\nName: [D.name].\nType: [D.spread_text].\nStage: [D.stage]/[D.max_stages].\nPossible Cure: [D.cure_text].") //Yogs - Added a "."
// Blood Level
if(M.has_dna())
var/mob/living/carbon/C = M
var/blood_id = C.get_blood_id()
if(blood_id)
if(ishuman(C))
var/mob/living/carbon/human/H = C
if(H.is_bleeding())
combined_msg += span_danger("Subject is losing blood at a rate of [H.get_total_bleed_rate() * H.physiology?.bleed_mod] cl per process!")
var/blood_percent = round((C.blood_volume / BLOOD_VOLUME_NORMAL(C))*100)
var/blood_type = C.dna.blood_type.name
if(blood_id != /datum/reagent/blood)//special blood substance
var/datum/reagent/R = GLOB.chemical_reagents_list[blood_id]
if(R)
blood_type = R.name
else
blood_type = blood_id
if(HAS_TRAIT(M, TRAIT_MASQUERADE)) //bloodsuckers
combined_msg += span_info("Blood level 100%, 560 cl, type: [blood_type]")
else if(C.blood_volume <= BLOOD_VOLUME_SAFE(C) && C.blood_volume > BLOOD_VOLUME_OKAY(C))
combined_msg += "[span_danger("LOW blood level [blood_percent] %, [C.blood_volume] cl,")] [span_info("type: [blood_type]")]"
else if(C.blood_volume <= BLOOD_VOLUME_OKAY(C))
combined_msg += "[span_danger("CRITICAL blood level [blood_percent] %, [C.blood_volume] cl,")] [span_info("type: [blood_type]")]"
else
combined_msg += span_info("Blood level [blood_percent] %, [C.blood_volume] cl, type: [blood_type]")
var/cyberimp_detect
for(var/obj/item/organ/cyberimp/CI in C.internal_organs)
if(CI.status == ORGAN_ROBOTIC && !CI.syndicate_implant)
cyberimp_detect += "[C.name] is modified with a [CI.name].<br>"
if(cyberimp_detect)
combined_msg += span_notice("Detected cybernetic modifications:")
combined_msg += span_notice("[cyberimp_detect]")
to_chat(user, examine_block(combined_msg.Join("\n")))
SEND_SIGNAL(M, COMSIG_NANITE_SCAN, user, FALSE)
/proc/chemscan(mob/living/user, mob/living/M)
var/list/combined_msg = list()
if(istype(M))
if(M.reagents)
if(M.reagents.reagent_list.len)
combined_msg += span_notice("Subject contains the following reagents:")
for(var/datum/reagent/R in M.reagents.reagent_list)
combined_msg += "[span_notice("[round(R.volume, 0.001)] units of [R.name]")][R.overdosed == 1 ? "- [span_boldannounce("OVERDOSING")]" : "."]"
else
combined_msg += span_notice("Subject contains no reagents.")
if(M.reagents.addiction_list.len)
combined_msg += span_boldannounce("Subject is addicted to the following reagents:")
for(var/datum/reagent/R in M.reagents.addiction_list)
combined_msg += span_danger("[R.name]")
else
combined_msg += span_notice("Subject is not addicted to any reagents.")
to_chat(user, examine_block(combined_msg.Join("\n")))
/obj/item/healthanalyzer/advanced
name = "advanced health analyzer"
icon_state = "health_adv"
desc = "A hand-held body scanner able to distinguish vital signs of the subject with high accuracy."
advanced = TRUE
var/list/advanced_surgeries = list()
/obj/item/healthanalyzer/advanced/afterattack(obj/item/O, mob/user, proximity)
. = ..()
if(!proximity)
return
if(istype(O, /obj/item/disk/surgery))
to_chat(user, span_notice("You load the surgery protocol from [O] into [src]."))
var/obj/item/disk/surgery/D = O
if(do_after(user, 1 SECONDS, O))
advanced_surgeries |= D.surgeries
return TRUE
if(istype(O, /obj/machinery/computer/operating))
to_chat(user, span_notice("You copy surgery protocols from [O] into [src]."))
var/obj/machinery/computer/operating/OC = O
if(do_after(user, 1 SECONDS, O))
advanced_surgeries |= OC.advanced_surgeries
return TRUE
return
/obj/item/healthanalyzer/advanced/debug/Initialize(mapload)
. = ..()
advanced_surgeries = subtypesof(/datum/surgery)
/// Displays wounds with extended information on their status vs medscanners
/proc/woundscan(mob/user, mob/living/carbon/patient, obj/item/healthanalyzer/wound/scanner)
if(!istype(patient))
return
var/render_list = ""
for(var/i in patient.get_wounded_bodyparts())
var/obj/item/bodypart/wounded_part = i
render_list += "<span class='alert ml-1'><b>Warning: Physical trauma[LAZYLEN(wounded_part.wounds) > 1? "s" : ""] detected in [wounded_part.name]</b>"
for(var/k in wounded_part.wounds)
var/datum/wound/W = k
render_list += "<div class='ml-2'>[W.get_scanner_description()]</div>\n"
render_list += "</span>"
if(render_list == "")
if(istype(scanner))
// Only emit the cheerful scanner message if this scan came from a scanner
playsound(scanner, 'sound/machines/ping.ogg', 50, FALSE)
to_chat(user, span_notice("\The [scanner] makes a happy ping and briefly displays a smiley face with several exclamation points! It's really excited to report that [patient] has no wounds!"))
else
to_chat(user, "<span class='notice ml-1'>No wounds detected in subject.</span>")
else
to_chat(user, examine_block(jointext(render_list, "")))
/obj/item/healthanalyzer/wound
name = "first aid analyzer"
icon_state = "adv_spectrometer"
desc = "A prototype MeLo-Tech medical scanner used to diagnose injuries and recommend treatment for serious wounds, but offers no further insight into the patient's health. You hope the final version is less annoying to read!"
var/next_encouragement
var/greedy
/obj/item/healthanalyzer/wound/attack_self(mob/user)
if(next_encouragement < world.time)
playsound(src, 'sound/machines/ping.ogg', 50, FALSE)
var/list/encouragements = list("briefly displays a happy face, gazing emptily at you", "briefly displays a spinning cartoon heart", "displays an encouraging message about eating healthy and exercising", \
"reminds you that everyone is doing their best", "displays a message wishing you well", "displays a sincere thank-you for your interest in first-aid", "formally absolves you of all your sins")
to_chat(user, span_notice("\The [src] makes a happy ping and [pick(encouragements)]!"))
next_encouragement = world.time + 10 SECONDS
greedy = FALSE
else if(!greedy)
to_chat(user, span_warning("\The [src] displays an eerily high-definition frowny face, chastizing you for asking it for too much encouragement."))
greedy = TRUE
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 50, FALSE)
if(isliving(user))
var/mob/living/L = user
if(L.getBruteLoss() >= 10)
to_chat(L, span_warning("\The [src] makes a disappointed buzz, chastizing you for asking it for too much encouragement."))
return
to_chat(L, span_warning("\The [src] makes a disappointed buzz and pricks your finger for being greedy. Ow!"))
L.adjustBruteLoss(4)
L.dropItemToGround(src)
/obj/item/healthanalyzer/wound/attack(mob/living/carbon/patient, mob/living/carbon/human/user)
add_fingerprint(user)
user.visible_message(span_notice("[user] scans [patient] for serious injuries."), span_notice("You scan [patient] for serious injuries."))
if(!istype(patient))
playsound(src, 'sound/machines/buzz-sigh.ogg', 30, TRUE)
to_chat(user, span_notice("\The [src] makes a sad buzz and briefly displays a frowny face, indicating it can't scan [patient]."))
return
woundscan(user, patient, src)
/obj/item/analyzer
desc = "A hand-held environmental scanner which reports current gas levels. Alt-Click to use the built in barometer function."
name = "analyzer"
custom_price = 10
icon = 'icons/obj/device.dmi'
icon_state = "analyzer"
item_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
throwforce = 0
throw_speed = 3
throw_range = 7
tool_behaviour = TOOL_ANALYZER
materials = list(/datum/material/iron=30, /datum/material/glass=20)
grind_results = list(/datum/reagent/mercury = 5, /datum/reagent/iron = 5, /datum/reagent/silicon = 5)
var/cooldown = FALSE
var/cooldown_time = 50
var/accuracy // 0 is the best accuracy.
/obj/item/analyzer/examine(mob/user)
. = ..()
. += span_notice("Alt-click [src] to activate the barometer function.")
/obj/item/analyzer/suicide_act(mob/living/carbon/user)
user.visible_message(span_suicide("[user] begins to analyze [user.p_them()]self with [src]! The display shows that [user.p_theyre()] dead!"))
return BRUTELOSS
/obj/item/analyzer/attackby(obj/O, mob/living/user)
if(istype(O, /obj/item/bodypart/l_arm/robot) || istype(O, /obj/item/bodypart/r_arm/robot))
to_chat(user, "<span class='notice'>You add [O] to [src].</span>")
qdel(O)
qdel(src)
user.put_in_hands(new /obj/item/bot_assembly/atmosbot)
else
..()
/obj/item/analyzer/attack_self(mob/user)
add_fingerprint(user)
scangasses(user) //yogs start: Makes the gas scanning able to be used elseware
/obj/item/analyzer/afterattack(atom/target as obj, mob/user, proximity)
if(!proximity)
return
add_fingerprint(user)
if(istype(target, /turf))
var/turf/U = get_turf(target)
atmosanalyzer_scan(user, U)
/obj/item/proc/scangasses(mob/user)
var/list/combined_msg = list()
//yogs stop
if (user.stat || user.eye_blind)
return
if(!isopenturf(get_turf(user)))
return
var/datum/gas_mixture/environment = user.return_air()
if(!environment)
to_chat(user, span_info("No air detected."))
return
var/pressure = environment.return_pressure()
var/total_moles = environment.total_moles()
combined_msg += span_info("<B>Results:</B>")
if(abs(pressure - ONE_ATMOSPHERE) < 10)
combined_msg += span_info("Pressure: [round(pressure, 0.01)] kPa")
else
combined_msg += span_alert("Pressure: [round(pressure, 0.01)] kPa")
if(total_moles)
var/o2_concentration = environment.get_moles(GAS_O2)/total_moles
var/n2_concentration = environment.get_moles(GAS_N2)/total_moles
var/co2_concentration = environment.get_moles(GAS_CO2)/total_moles
var/plasma_concentration = environment.get_moles(GAS_PLASMA)/total_moles
if(abs(n2_concentration - N2STANDARD) < 20)
combined_msg += span_info("Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_N2), 0.01)] mol)")
else
combined_msg += span_alert("Nitrogen: [round(n2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_N2), 0.01)] mol)")
if(abs(o2_concentration - O2STANDARD) < 2)
combined_msg += span_info("Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_O2), 0.01)] mol)")
else
combined_msg += span_alert("Oxygen: [round(o2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_O2), 0.01)] mol)")
if(co2_concentration > 0.01)
combined_msg += span_alert("CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_CO2), 0.01)] mol)")
else
combined_msg += span_info("CO2: [round(co2_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_CO2), 0.01)] mol)")
if(plasma_concentration > 0.005)
combined_msg += span_alert("Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_PLASMA), 0.01)] mol)")
else
combined_msg += span_info("Plasma: [round(plasma_concentration*100, 0.01)] % ([round(environment.get_moles(GAS_PLASMA), 0.01)] mol)")
for(var/id in environment.get_gases())
if(id in GLOB.hardcoded_gases)
continue
var/gas_concentration = environment.get_moles(id)/total_moles
combined_msg += span_alert("[GLOB.gas_data.names[id]]: [round(gas_concentration*100, 0.01)] % ([round(environment.get_moles(id), 0.01)] mol)")
combined_msg += span_info("Temperature: [round(environment.return_temperature()-T0C, 0.01)] °C ([round(environment.return_temperature(), 0.01)] K)")
to_chat(user, examine_block(combined_msg.Join("\n")))
/obj/item/analyzer/AltClick(mob/user) //Barometer output for measuring when the next storm happens
..()
if(user.canUseTopic(src, BE_CLOSE))
if(cooldown)
to_chat(user, span_warning("[src]'s barometer function is preparing itself."))
return
var/turf/T = get_turf(user)
if(!T)
return
playsound(src, 'sound/effects/pop.ogg', 100)
var/area/user_area = T.loc
var/datum/weather/ongoing_weather = null
if(!user_area.outdoors)
to_chat(user, span_warning("[src]'s barometer function won't work indoors!"))
return
for(var/V in SSweather.processing)
var/datum/weather/W = V
if(W.barometer_predictable && (T.z in W.impacted_z_levels) && W.area_type == user_area.type && !(W.stage == END_STAGE))
ongoing_weather = W
break
if(ongoing_weather)
if((ongoing_weather.stage == MAIN_STAGE) || (ongoing_weather.stage == WIND_DOWN_STAGE))
to_chat(user, span_warning("[src]'s barometer function can't trace anything while the storm is [ongoing_weather.stage == MAIN_STAGE ? "already here!" : "winding down."]"))
return
to_chat(user, span_notice("The next [ongoing_weather] will hit in [butchertime(ongoing_weather.next_hit_time - world.time)]."))
if(ongoing_weather.aesthetic)
to_chat(user, span_warning("[src]'s barometer function says that the next storm will breeze on by."))
else
var/next_hit = SSweather.next_hit_by_zlevel["[T.z]"]
var/fixed = next_hit ? next_hit - world.time : -1
if(fixed < 0)
to_chat(user, span_warning("[src]'s barometer function was unable to trace any weather patterns."))
else
to_chat(user, span_warning("[src]'s barometer function says a storm will land in approximately [butchertime(fixed)]."))
cooldown = TRUE
addtimer(CALLBACK(src,/obj/item/analyzer/proc/ping), cooldown_time)
/obj/item/analyzer/proc/ping()
if(isliving(loc))
var/mob/living/L = loc
to_chat(L, span_notice("[src]'s barometer function is ready!"))
playsound(src, 'sound/machines/click.ogg', 100)
cooldown = FALSE
/obj/item/analyzer/proc/butchertime(amount)
if(!amount)
return
if(accuracy)
var/inaccurate = round(accuracy*(1/3))
if(prob(50))
amount -= inaccurate
if(prob(50))
amount += inaccurate
return DisplayTimeText(max(1,amount))
/proc/atmosanalyzer_scan(mob/user, atom/target, silent=FALSE)
var/mixture = target.return_analyzable_air()
if(!mixture)
return FALSE
var/list/combined_msg = list()
var/icon = target
if(!silent && isliving(user))
user.visible_message("[user] has used the analyzer on [icon2html(icon, viewers(user))] [target].", "<span class='notice'>You use the analyzer on [icon2html(icon, user)] [target].</span>")
combined_msg += span_boldnotice("Results of analysis of [icon2html(icon, user)] [target].")
var/list/airs = islist(mixture) ? mixture : list(mixture)
for(var/g in airs)
if(airs.len > 1) //not a unary gas mixture
combined_msg += span_boldnotice("Node [airs.Find(g)]")
var/datum/gas_mixture/air_contents = g
var/total_moles = air_contents.total_moles()
var/pressure = air_contents.return_pressure()
var/volume = air_contents.return_volume() //could just do mixture.volume... but safety, I guess?
var/temperature = air_contents.return_temperature()
var/cached_scan_results = air_contents.analyzer_results
if(total_moles > 0)
combined_msg += span_notice("Moles: [round(total_moles, 0.01)] mol")
combined_msg += span_notice("Volume: [volume] L")
combined_msg += span_notice("Pressure: [round(pressure,0.01)] kPa")
for(var/id in air_contents.get_gases())
var/gas_concentration = air_contents.get_moles(id)/total_moles
combined_msg += span_notice("[GLOB.gas_data.names[id]]: [round(gas_concentration*100, 0.01)] % ([round(air_contents.get_moles(id), 0.01)] mol)")
combined_msg += span_notice("Temperature: [round(temperature - T0C,0.01)] °C ([round(temperature, 0.01)] K)")
else
if(airs.len > 1)
combined_msg += span_notice("This node is empty!")
else
combined_msg += span_notice("[target] is empty!")
if(cached_scan_results && cached_scan_results["fusion"]) //notify the user if a fusion reaction was detected
var/instability = round(cached_scan_results["fusion"], 0.01)
combined_msg += span_boldnotice("Large amounts of free neutrons detected in the air indicate that a fusion reaction took place.")
combined_msg += span_notice("Instability of the last fusion reaction: [instability].")
to_chat(user, examine_block(combined_msg.Join("\n")))
return TRUE
//slime scanner
/obj/item/slime_scanner
name = "slime scanner"
desc = "A device that analyzes a slime's internal composition and measures its stats."
icon = 'icons/obj/device.dmi'
icon_state = "adv_spectrometer"
item_state = "analyzer"
lefthand_file = 'icons/mob/inhands/equipment/tools_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/tools_righthand.dmi'
w_class = WEIGHT_CLASS_SMALL
flags_1 = CONDUCT_1
throwforce = 0
throw_speed = 3
throw_range = 7
custom_materials = list(/datum/material/iron=30, /datum/material/glass=20)
/obj/item/slime_scanner/attack(mob/living/M, mob/living/user)
if(user.stat || !user.can_read(src))
return
if (!isslime(M))
to_chat(user, span_warning("This device can only scan slimes!"))
return
var/mob/living/simple_animal/slime/T = M
playsound(src, 'sound/effects/scanbeep.ogg', 30)
slime_scan(T, user)
/proc/slime_scan(mob/living/simple_animal/slime/T, mob/living/user)
var/to_render = "<b>Slime scan results:</b>\
\n[span_notice("[T.colour] [T.is_adult ? "adult" : "baby"] slime")]\
\nNutrition: [T.nutrition]/[T.get_max_nutrition()]"
if (T.nutrition < T.get_starve_nutrition())
to_render += "\n[span_warning("Warning: slime is starving!")]"
else if (T.nutrition < T.get_hunger_nutrition())
to_render += "\n[span_warning("Warning: slime is hungry")]"
to_render += "\nElectric change strength: [T.powerlevel]\nHealth: [round(T.health/T.maxHealth,0.01)*100]%"
if (T.slime_mutation[4] == T.colour)
to_render += "\nThis slime does not evolve any further."
else
if (T.slime_mutation[3] == T.slime_mutation[4])
if (T.slime_mutation[2] == T.slime_mutation[1])
to_render += "\nPossible mutation: [T.slime_mutation[3]]\
\nGenetic destability: [T.mutation_chance/2] % chance of mutation on splitting"
else
to_render += "\nPossible mutations: [T.slime_mutation[1]], [T.slime_mutation[2]], [T.slime_mutation[3]] (x2)\
\nGenetic destability: [T.mutation_chance] % chance of mutation on splitting"
else
to_render += "\nPossible mutations: [T.slime_mutation[1]], [T.slime_mutation[2]], [T.slime_mutation[3]], [T.slime_mutation[4]]\
\nGenetic destability: [T.mutation_chance] % chance of mutation on splitting"
if (T.cores > 1)
to_render += "\nMultiple cores detected"
to_render += "\nGrowth progress: [T.amount_grown]/[SLIME_EVOLUTION_THRESHOLD]"
if(T.effectmod)
to_render += "\n[span_notice("Core mutation in progress: [T.effectmod]")]\
\n[span_notice("Progress in core mutation: [T.applied] / [SLIME_EXTRACT_CROSSING_REQUIRED]")]"
to_chat(user, examine_block(to_render))
/obj/item/nanite_scanner
name = "nanite scanner"
icon = 'icons/obj/device.dmi'
icon_state = "nanite_scanner"
item_state = "nanite_remote"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
desc = "A hand-held body scanner able to detect nanites and their programming."
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
throwforce = 3
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(/datum/material/iron=200)
/obj/item/nanite_scanner/attack(mob/living/M, mob/living/carbon/human/user)
user.visible_message(span_notice("[user] has analyzed [M]'s nanites."))
add_fingerprint(user)
var/response = SEND_SIGNAL(M, COMSIG_NANITE_SCAN, user, TRUE)
if(!response)
to_chat(user, span_info("No nanites detected in the subject."))
/obj/item/sequence_scanner
name = "genetic sequence scanner"
icon = 'icons/obj/device.dmi'
icon_state = "gene"
item_state = "healthanalyzer"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
desc = "A hand-held scanner for analyzing someones gene sequence on the fly. Hold near a DNA console to update the internal database."
flags_1 = CONDUCT_1
item_flags = NOBLUDGEON
slot_flags = ITEM_SLOT_BELT
throwforce = 3
w_class = WEIGHT_CLASS_TINY
throw_speed = 3
throw_range = 7
materials = list(/datum/material/iron=200)
var/list/discovered = list() //hit a dna console to update the scanners database
var/list/buffer
var/ready = TRUE
var/cooldown = 200
/obj/item/sequence_scanner/attack(mob/living/M, mob/living/carbon/human/user)
add_fingerprint(user)
if (!HAS_TRAIT(M, TRAIT_GENELESS) && !HAS_TRAIT(M, TRAIT_BADDNA)) //no scanning if its a husk or DNA-less Species
user.visible_message(span_notice("[user] has analyzed [M]'s genetic sequence."))
gene_scan(M, user)
playsound(src, 'sound/effects/fastbeep.ogg', 20)
else
user.visible_message(span_notice("[user] failed to analyse [M]'s genetic sequence."), span_warning("[M] has no readable genetic sequence!"))
/obj/item/sequence_scanner/attack_self(mob/user)
display_sequence(user)
/obj/item/sequence_scanner/attack_self_tk(mob/user)
return
/obj/item/sequence_scanner/afterattack(obj/O, mob/user, proximity)
. = ..()
if(!istype(O) || !proximity)
return
if(istype(O, /obj/machinery/computer/scan_consolenew))
var/obj/machinery/computer/scan_consolenew/C = O
if(C.stored_research)
to_chat(user, span_notice("[name] database updated."))
discovered = C.stored_research.discovered_mutations
else
to_chat(user,span_warning("No database to update from."))
/obj/item/sequence_scanner/proc/gene_scan(mob/living/carbon/C, mob/living/user)
if(!iscarbon(C) || !C.has_dna())
return
buffer = C.dna.mutation_index
to_chat(user, span_notice("Subject [C.name]'s DNA sequence has been saved to buffer."))
if(LAZYLEN(buffer))
for(var/A in buffer)
to_chat(user, span_notice("[get_display_name(A)]"))
/obj/item/sequence_scanner/proc/display_sequence(mob/living/user)
if(!LAZYLEN(buffer) || !ready)
return
var/list/options = list()
for(var/A in buffer)
options += get_display_name(A)
var/answer = input(user, "Analyze Potential", "Sequence Analyzer") as null|anything in options
if(answer && ready && user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
var/sequence
for(var/A in buffer) //this physically hurts but i dont know what anything else short of an assoc list
if(get_display_name(A) == answer)
sequence = buffer[A]
break
if(sequence)
var/display
for(var/i in 0 to length_char(sequence) / DNA_MUTATION_BLOCKS-1)
if(i)
display += "-"
display += copytext_char(sequence, 1 + i*DNA_MUTATION_BLOCKS, DNA_MUTATION_BLOCKS*(1+i) + 1)
to_chat(user, "[span_boldnotice("[display]")]<br>")
ready = FALSE
icon_state = "[icon_state]_recharging"
addtimer(CALLBACK(src, PROC_REF(recharge)), cooldown, TIMER_UNIQUE)
/obj/item/sequence_scanner/proc/recharge()
icon_state = initial(icon_state)
ready = TRUE
/obj/item/sequence_scanner/proc/get_display_name(mutation)
var/datum/mutation/human/HM = GET_INITIALIZED_MUTATION(mutation)
if(!HM)
return "ERROR"
if(mutation in discovered)
return "[HM.name] ([HM.alias])"
else
return HM.alias
/obj/item/scanner_wand
name = "kiosk scanner wand"
icon = 'icons/obj/device.dmi'
icon_state = "scanner_wand"
item_state = "healthanalyzer"
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
desc = "A wand that medically scans people. Inserting it into a medical kiosk makes it able to perform a health scan on the patient."
force = 0
throwforce = 0
w_class = WEIGHT_CLASS_BULKY
var/selected_target = null
/obj/item/scanner_wand/attack(mob/living/M, mob/living/carbon/human/user)
flick("[icon_state]_active", src) //nice little visual flash when scanning someone else.
if((HAS_TRAIT(user, TRAIT_CLUMSY) || HAS_TRAIT(user, TRAIT_DUMB)) && prob(25))
user.visible_message(span_warning("[user] targets himself for scanning."), \
to_chat(user, span_info("You try scanning [M], before realizing you're holding the scanner backwards. Whoops.")))
selected_target = user
return
if(!ishuman(M))
to_chat(user, span_info("You can only scan human-like, non-robotic beings."))
selected_target = null
return
user.visible_message(span_notice("[user] targets [M] for scanning."), \
span_notice("You target [M] vitals."))
selected_target = M
return
/obj/item/scanner_wand/attack_self(mob/user)