/
human.dm
2020 lines (1672 loc) · 74.3 KB
/
human.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
/mob/living/carbon/human
name = "unknown"
real_name = "unknown"
voice_name = "unknown"
icon = 'icons/mob/human.dmi'
icon_state = "body_m_s"
//why are these here and not in human_defines.dm
//var/list/hud_list[10]
var/datum/species/species //Contains icon generation and language information, set during New().
var/obj/item/rig/wearing_rig // This is very not good, but it's much much better than calling get_rig() every update_canmove() call.
/mob/living/carbon/human/New(loc)
if(length(args) > 1)
log_runtime(EXCEPTION("human/New called with more than 1 argument (REPORT THIS ENTIRE RUNTIME TO A CODER)"))
. = ..()
/mob/living/carbon/human/Initialize(mapload, new_species = null)
if(!dna)
dna = new /datum/dna(null)
// Species name is handled by set_species()
if(!species)
if(new_species)
set_species(new_species, 1, delay_icon_update = 1)
else
set_species(delay_icon_update = 1)
..()
if(species)
real_name = species.get_random_name(gender)
name = real_name
if(mind)
mind.name = real_name
create_reagents(330)
martial_art = default_martial_art
handcrafting = new()
var/mob/M = src
faction |= "\ref[M]" //what
// Set up DNA.
if(dna)
dna.ready_dna(src)
dna.real_name = real_name
sync_organ_dna(1)
UpdateAppearance()
/mob/living/carbon/human/OpenCraftingMenu()
handcrafting.ui_interact(src)
/mob/living/carbon/human/prepare_data_huds()
//Update med hud images...
..()
//...sec hud images...
sec_hud_set_ID()
sec_hud_set_implants()
sec_hud_set_security_status()
//...and display them.
add_to_all_human_data_huds()
/mob/living/carbon/human/Destroy()
QDEL_LIST(bodyparts)
splinted_limbs.Cut()
return ..()
/mob/living/carbon/human/dummy
real_name = "Test Dummy"
status_flags = GODMODE|CANPUSH
/mob/living/carbon/human/skrell/Initialize(mapload)
..(mapload, "Skrell")
/mob/living/carbon/human/tajaran/Initialize(mapload)
..(mapload, "Tajaran")
/mob/living/carbon/human/vulpkanin/Initialize(mapload)
..(mapload, "Vulpkanin")
/mob/living/carbon/human/unathi/Initialize(mapload)
..(mapload, "Unathi")
/mob/living/carbon/human/vox/Initialize(mapload)
..(mapload, "Vox")
/mob/living/carbon/human/voxarmalis/Initialize(mapload)
..(mapload, "Vox Armalis")
/mob/living/carbon/human/skeleton/Initialize(mapload)
..(mapload, "Skeleton")
/mob/living/carbon/human/kidan/Initialize(mapload)
..(mapload, "Kidan")
/mob/living/carbon/human/plasma/Initialize(mapload)
..(mapload, "Plasmaman")
/mob/living/carbon/human/slime/Initialize(mapload)
..(mapload, "Slime People")
/mob/living/carbon/human/grey/Initialize(mapload)
..(mapload, "Grey")
/mob/living/carbon/human/abductor/Initialize(mapload)
..(mapload, "Abductor")
/mob/living/carbon/human/human/Initialize(mapload)
..(mapload, "Human")
/mob/living/carbon/human/diona/Initialize(mapload)
..(mapload, "Diona")
/mob/living/carbon/human/machine/Initialize(mapload)
..(mapload, "Machine")
/mob/living/carbon/human/shadow/Initialize(mapload)
..(mapload, "Shadow")
/mob/living/carbon/human/golem/Initialize(mapload)
..(mapload, "Golem")
/mob/living/carbon/human/wryn/Initialize(mapload)
..(mapload, "Wryn")
/mob/living/carbon/human/nucleation/Initialize(mapload)
..(mapload, "Nucleation")
/mob/living/carbon/human/drask/Initialize(mapload)
..(mapload, "Drask")
/mob/living/carbon/human/monkey/Initialize(mapload)
..(mapload, "Monkey")
/mob/living/carbon/human/farwa/Initialize(mapload)
..(mapload, "Farwa")
/mob/living/carbon/human/wolpin/Initialize(mapload)
..(mapload, "Wolpin")
/mob/living/carbon/human/neara/Initialize(mapload)
..(mapload, "Neara")
/mob/living/carbon/human/stok/Initialize(mapload)
..(mapload, "Stok")
/mob/living/carbon/human/Stat()
..()
statpanel("Status")
stat(null, "Intent: [a_intent]")
stat(null, "Move Mode: [m_intent]")
show_stat_station_time()
show_stat_emergency_shuttle_eta()
if(client.statpanel == "Status")
if(locate(/obj/item/assembly/health) in src)
stat(null, "Health: [health]")
if(internal)
if(!internal.air_contents)
qdel(internal)
else
stat("Internal Atmosphere Info", internal.name)
stat("Tank Pressure", internal.air_contents.return_pressure())
stat("Distribution Pressure", internal.distribute_pressure)
if(istype(back, /obj/item/rig))
var/obj/item/rig/suit = back
var/cell_status = "ERROR"
if(suit.cell)
cell_status = "[suit.cell.charge]/[suit.cell.maxcharge]"
stat(null, "Suit charge: [cell_status]")
// I REALLY need to split up status panel things into datums
var/mob/living/simple_animal/borer/B = has_brain_worms()
if(B && B.controlling)
stat("Chemicals", B.chemicals)
if(mind)
if(mind.changeling)
stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]")
stat("Absorbed DNA", mind.changeling.absorbedcount)
if(mind.vampire)
stat("Total Blood", "[mind.vampire.bloodtotal]")
stat("Usable Blood", "[mind.vampire.bloodusable]")
if(mind.nation)
stat("Nation Name", "[mind.nation.current_name ? "[mind.nation.current_name]" : "[mind.nation.default_name]"]")
stat("Nation Leader", "[mind.nation.current_leader ? "[mind.nation.current_leader]" : "None"]")
stat("Nation Heir", "[mind.nation.heir ? "[mind.nation.heir]" : "None"]")
if(istype(loc, /obj/spacepod)) // Spacdpods!
var/obj/spacepod/S = loc
stat("Spacepod Charge", "[istype(S.battery) ? "[(S.battery.charge / S.battery.maxcharge) * 100]" : "No cell detected"]")
stat("Spacepod Integrity", "[!S.health ? "0" : "[(S.health / initial(S.health)) * 100]"]%")
/mob/living/carbon/human/ex_act(severity)
var/shielded = 0
var/b_loss = null
var/f_loss = null
if(status_flags & GODMODE)
return 0
switch(severity)
if(1)
b_loss += 500
if(!prob(getarmor(null, "bomb")))
gib()
return 0
else
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
throw_at(target, 200, 4)
var/limbs_affected = pick(2,3,4)
var/obj/item/organ/external/processing_dismember
var/list/valid_limbs = bodyparts.Copy()
while(limbs_affected != 0 && valid_limbs.len > 0)
processing_dismember = pick(valid_limbs)
if(processing_dismember.limb_name != "chest" && processing_dismember.limb_name != "head" && processing_dismember.limb_name != "groin")
processing_dismember.droplimb(1,DROPLIMB_SHARP,0,1)
valid_limbs -= processing_dismember
limbs_affected -= 1
else valid_limbs -= processing_dismember
if(2)
if(!shielded) //literally nothing could change shielded before this so wth
b_loss += 60
f_loss += 60
var/limbs_affected = 0
var/obj/item/organ/external/processing_dismember
var/list/valid_limbs = bodyparts.Copy()
if(prob(getarmor(null, "bomb")))
b_loss = b_loss/1.5
f_loss = f_loss/1.5
limbs_affected = pick(1, 1, 2)
else
limbs_affected = pick(1, 2, 3)
while(limbs_affected != 0 && valid_limbs.len > 0)
processing_dismember = pick(valid_limbs)
if(processing_dismember.limb_name != "chest" && processing_dismember.limb_name != "head" && processing_dismember.limb_name != "groin")
processing_dismember.droplimb(1,DROPLIMB_SHARP,0,1)
valid_limbs -= processing_dismember
limbs_affected -= 1
else valid_limbs -= processing_dismember
if(!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
AdjustEarDamage(30)
AdjustEarDeaf(120)
if(prob(70) && !shielded)
Paralyse(10)
if(3)
b_loss += 30
if(prob(getarmor(null, "bomb")))
b_loss = b_loss/2
else
var/limbs_affected = pick(0, 1)
var/obj/item/organ/external/processing_dismember
var/list/valid_limbs = bodyparts.Copy()
while(limbs_affected != 0 && valid_limbs.len > 0)
processing_dismember = pick(valid_limbs)
if(processing_dismember.limb_name != "chest" && processing_dismember.limb_name != "head" && processing_dismember.limb_name != "groin")
processing_dismember.droplimb(1,DROPLIMB_SHARP,0,1)
valid_limbs -= processing_dismember
limbs_affected -= 1
else valid_limbs -= processing_dismember
if(!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
AdjustEarDamage(15)
AdjustEarDeaf(60)
if(prob(50) && !shielded)
Paralyse(10)
take_overall_damage(b_loss,f_loss, used_weapon = "Explosive Blast")
..()
/mob/living/carbon/human/blob_act()
if(stat == DEAD)
return
show_message("<span class='userdanger'>The blob attacks you!</span>")
var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee"))
/mob/living/carbon/human/bullet_act()
if(martial_art && martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
if(!prob(martial_art.deflection_chance))
return ..()
if(!src.lying && !(HULK in mutations)) //But only if they're not lying down, and hulks can't do it
visible_message("<span class='danger'>[src] deflects the projectile; they can't be hit with ranged weapons!</span>", "<span class='userdanger'>You deflect the projectile!</span>")
return 0
..()
/mob/living/carbon/human/restrained()
if(handcuffed)
return 1
if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return 1
return 0
/mob/living/carbon/human/var/temperature_resistance = T0C+75
/mob/living/carbon/human/show_inv(mob/user)
user.set_machine(src)
var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask) || get_organ_slot("breathing_tube")
var/list/obscured = check_obscured_slots()
var/dat = {"<table>
<tr><td><B>Left Hand:</B></td><td><A href='?src=[UID()];item=[slot_l_hand]'>[(l_hand && !(l_hand.flags&ABSTRACT)) ? l_hand : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td><B>Right Hand:</B></td><td><A href='?src=[UID()];item=[slot_r_hand]'>[(r_hand && !(r_hand.flags&ABSTRACT)) ? r_hand : "<font color=grey>Empty</font>"]</A></td></tr>
<tr><td> </td></tr>"}
dat += "<tr><td><B>Back:</B></td><td><A href='?src=[UID()];item=[slot_back]'>[(back && !(back.flags&ABSTRACT)) ? back : "<font color=grey>Empty</font>"]</A>"
if(has_breathable_mask && istype(back, /obj/item/tank))
dat += " <A href='?src=[UID()];internal=[slot_back]'>[internal ? "Disable Internals" : "Set Internals"]</A>"
dat += "</td></tr><tr><td> </td></tr>"
dat += "<tr><td><B>Head:</B></td><td><A href='?src=[UID()];item=[slot_head]'>[(head && !(head.flags&ABSTRACT)) ? head : "<font color=grey>Empty</font>"]</A></td></tr>"
var/obj/item/organ/internal/headpocket/C = get_int_organ(/obj/item/organ/internal/headpocket)
if(C)
if(slot_wear_mask in obscured)
dat += "<tr><td><font color=grey> ↳<B>Headpocket:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
var/list/items = C.get_contents()
if(items.len)
dat += "<tr><td> ↳<B>Headpocket:</B></td><td><A href='?src=[UID()];dislodge_headpocket=1'>Dislodge Items</A></td></tr>"
else
dat += "<tr><td> ↳<B>Headpocket:</B></td><td><font color=grey>Empty</font></td></tr>"
if(slot_wear_mask in obscured)
dat += "<tr><td><font color=grey><B>Mask:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Mask:</B></td><td><A href='?src=[UID()];item=[slot_wear_mask]'>[(wear_mask && !(wear_mask.flags&ABSTRACT)) ? wear_mask : "<font color=grey>Empty</font>"]</A>"
if(istype(wear_mask, /obj/item/clothing/mask/muzzle))
var/obj/item/clothing/mask/muzzle/M = wear_mask
if(M.security_lock)
dat += " <A href='?src=[M.UID()];locked=\ref[src]'>[M.locked ? "Disable Lock" : "Set Lock"]</A>"
dat += "</td></tr><tr><td> </td></tr>"
if(!issmall(src))
if(slot_glasses in obscured)
dat += "<tr><td><font color=grey><B>Eyes:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Eyes:</B></td><td><A href='?src=[UID()];item=[slot_glasses]'>[(glasses && !(glasses.flags&ABSTRACT)) ? glasses : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_l_ear in obscured)
dat += "<tr><td><font color=grey><B>Left Ear:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Left Ear:</B></td><td><A href='?src=[UID()];item=[slot_l_ear]'>[(l_ear && !(l_ear.flags&ABSTRACT)) ? l_ear : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_r_ear in obscured)
dat += "<tr><td><font color=grey><B>Right Ear:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Right Ear:</B></td><td><A href='?src=[UID()];item=[slot_r_ear]'>[(r_ear && !(r_ear.flags&ABSTRACT)) ? r_ear : "<font color=grey>Empty</font>"]</A></td></tr>"
dat += "<tr><td> </td></tr>"
dat += "<tr><td><B>Exosuit:</B></td><td><A href='?src=[UID()];item=[slot_wear_suit]'>[(wear_suit && !(wear_suit.flags&ABSTRACT)) ? wear_suit : "<font color=grey>Empty</font>"]</A></td></tr>"
if(wear_suit)
dat += "<tr><td> ↳<B>Suit Storage:</B></td><td><A href='?src=[UID()];item=[slot_s_store]'>[(s_store && !(s_store.flags&ABSTRACT)) ? s_store : "<font color=grey>Empty</font>"]</A>"
if(has_breathable_mask && istype(s_store, /obj/item/tank))
dat += " <A href='?src=[UID()];internal=[slot_s_store]'>[internal ? "Disable Internals" : "Set Internals"]</A>"
dat += "</td></tr>"
else
dat += "<tr><td><font color=grey> ↳<B>Suit Storage:</B></font></td></tr>"
if(slot_shoes in obscured)
dat += "<tr><td><font color=grey><B>Shoes:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Shoes:</B></td><td><A href='?src=[UID()];item=[slot_shoes]'>[(shoes && !(shoes.flags&ABSTRACT)) ? shoes : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_gloves in obscured)
dat += "<tr><td><font color=grey><B>Gloves:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Gloves:</B></td><td><A href='?src=[UID()];item=[slot_gloves]'>[(gloves && !(gloves.flags&ABSTRACT)) ? gloves : "<font color=grey>Empty</font>"]</A></td></tr>"
if(slot_w_uniform in obscured)
dat += "<tr><td><font color=grey><B>Uniform:</B></font></td><td><font color=grey>Obscured</font></td></tr>"
else
dat += "<tr><td><B>Uniform:</B></td><td><A href='?src=[UID()];item=[slot_w_uniform]'>[(w_uniform && !(w_uniform.flags&ABSTRACT)) ? w_uniform : "<font color=grey>Empty</font>"]</A></td></tr>"
if(w_uniform == null || (slot_w_uniform in obscured))
dat += "<tr><td><font color=grey> ↳<B>Pockets:</B></font></td></tr>"
dat += "<tr><td><font color=grey> ↳<B>ID:</B></font></td></tr>"
dat += "<tr><td><font color=grey> ↳<B>Belt:</B></font></td></tr>"
dat += "<tr><td><font color=grey> ↳<B>Suit Sensors:</B></font></td></tr>"
dat += "<tr><td><font color=grey> ↳<B>PDA:</B></font></td></tr>"
else
dat += "<tr><td> ↳<B>Belt:</B></td><td><A href='?src=[UID()];item=[slot_belt]'>[(belt && !(belt.flags&ABSTRACT)) ? belt : "<font color=grey>Empty</font>"]</A>"
if(has_breathable_mask && istype(belt, /obj/item/tank))
dat += " <A href='?src=[UID()];internal=[slot_belt]'>[internal ? "Disable Internals" : "Set Internals"]</A>"
dat += "</td></tr>"
dat += "<tr><td> ↳<B>Pockets:</B></td><td><A href='?src=[UID()];pockets=left'>[(l_store && !(l_store.flags&ABSTRACT)) ? "Left (Full)" : "<font color=grey>Left (Empty)</font>"]</A>"
dat += " <A href='?src=[UID()];pockets=right'>[(r_store && !(r_store.flags&ABSTRACT)) ? "Right (Full)" : "<font color=grey>Right (Empty)</font>"]</A></td></tr>"
dat += "<tr><td> ↳<B>ID:</B></td><td><A href='?src=[UID()];item=[slot_wear_id]'>[(wear_id && !(wear_id.flags&ABSTRACT)) ? wear_id : "<font color=grey>Empty</font>"]</A></td></tr>"
dat += "<tr><td> ↳<B>PDA:</B></td><td><A href='?src=[UID()];item=[slot_wear_pda]'>[(wear_pda && !(wear_pda.flags&ABSTRACT)) ? wear_pda : "<font color=grey>Empty</font>"]</A></td></tr>"
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
dat += "<tr><td> ↳<B>Suit Sensors:</b></td><td><A href='?src=[UID()];set_sensor=1'>[U.has_sensor >= 2 ? "</a><font color=grey>--SENSORS LOCKED--</font>" : "Set Sensors</a>"]</td></tr>"
if(U.accessories.len)
dat += "<tr><td> ↳<A href='?src=[UID()];strip_accessory=1'>Remove Accessory</a></td></tr>"
if(handcuffed)
dat += "<tr><td><B>Handcuffed:</B> <A href='?src=[UID()];item=[slot_handcuffed]'>Remove</A></td></tr>"
if(legcuffed)
dat += "<tr><td><A href='?src=[UID()];item=[slot_legcuffed]'>Legcuffed</A></td></tr>"
dat += {"</table>
<A href='?src=[user.UID()];mach_close=mob\ref[src]'>Close</A>
"}
var/datum/browser/popup = new(user, "mob\ref[src]", "[src]", 440, 540)
popup.set_content(dat)
popup.open()
/mob/living/carbon/human/Crossed(atom/movable/AM)
var/mob/living/simple_animal/bot/mulebot/MB = AM
if(istype(MB))
MB.RunOver(src)
// Get rank from ID, ID inside PDA, PDA, ID in wallet, etc.
/mob/living/carbon/human/proc/get_authentification_rank(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/pda/pda = wear_id
if(istype(pda))
if(pda.id)
return pda.id.rank
else
return pda.ownrank
else
var/obj/item/card/id/id = get_idcard()
if(id)
return id.rank ? id.rank : if_no_job
else
return if_no_id
//gets assignment from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/pda/pda = wear_id
var/obj/item/card/id/id = wear_id
if(istype(pda))
if(pda.id && istype(pda.id, /obj/item/card/id))
. = pda.id.assignment
else
. = pda.ownjob
else if(istype(id))
. = id.assignment
else
return if_no_id
if(!.)
. = if_no_job
return
//gets name from ID or ID inside PDA or PDA itself
//Useful when player do something with computers
/mob/living/carbon/human/proc/get_authentification_name(var/if_no_id = "Unknown")
var/obj/item/pda/pda = wear_id
var/obj/item/card/id/id = wear_id
if(istype(pda))
if(pda.id)
. = pda.id.registered_name
else
. = pda.owner
else if(istype(id))
. = id.registered_name
else
return if_no_id
return
//repurposed proc. Now it combines get_id_name() and get_face_name() to determine a mob's name variable. Made into a seperate proc as it'll be useful elsewhere
/mob/living/carbon/human/get_visible_name(var/id_override = FALSE)
if(name_override)
return name_override
if(wear_mask && (wear_mask.flags_inv & HIDEFACE)) //Wearing a mask which hides our face, use id-name if possible
return get_id_name("Unknown")
if(head && (head.flags_inv & HIDEFACE))
return get_id_name("Unknown") //Likewise for hats
var/face_name = get_face_name()
var/id_name = get_id_name("")
if(id_name && (id_name != face_name) && !id_override)
return "[face_name] (as [id_name])"
return face_name
//Returns "Unknown" if facially disfigured and real_name if not. Useful for setting name when polyacided or when updating a human's name variable
/mob/living/carbon/human/proc/get_face_name()
var/obj/item/organ/external/head = get_organ("head")
if( !head || head.disfigured || !real_name || (HUSK in mutations) ) //disfigured. use id-name if possible
return "Unknown"
return real_name
//gets name from ID or PDA itself, ID inside PDA doesn't matter
//Useful when player is being seen by other mobs
/mob/living/carbon/human/proc/get_id_name(var/if_no_id = "Unknown")
var/obj/item/pda/pda = wear_id
var/obj/item/card/id/id = wear_id
if(istype(pda)) . = pda.owner
else if(istype(id)) . = id.registered_name
if(!.) . = if_no_id //to prevent null-names making the mob unclickable
return
//gets ID card object from special clothes slot or, if applicable, hands as well
/mob/living/carbon/human/proc/get_idcard(var/check_hands = FALSE)
var/obj/item/card/id/id = wear_id
var/obj/item/pda/pda = wear_id
if(istype(pda) && pda.id)
id = pda.id
if(check_hands)
if(istype(get_active_hand(), /obj/item/card/id))
id = get_active_hand()
else if(istype(get_inactive_hand(), /obj/item/card/id))
id = get_inactive_hand()
if(istype(id))
return id
/mob/living/carbon/human/update_sight()
if(!client)
return
if(stat == DEAD)
grant_death_vision()
return
species.update_sight(src)
//Removed the horrible safety parameter. It was only being used by ninja code anyways.
//Now checks siemens_coefficient of the affected area by default
/mob/living/carbon/human/electrocute_act(shock_damage, obj/source, siemens_coeff = 1, safety = 0, override = 0, tesla_shock = 0)
if(status_flags & GODMODE) //godmode
return 0
if(NO_SHOCK in mutations) //shockproof
return 0
if(tesla_shock)
var/total_coeff = 1
if(gloves)
var/obj/item/clothing/gloves/G = gloves
if(G.siemens_coefficient <= 0)
total_coeff -= 0.5
if(wear_suit)
var/obj/item/clothing/suit/S = wear_suit
if(S.siemens_coefficient <= 0)
total_coeff -= 0.95
else if(S.siemens_coefficient == (-1))
total_coeff -= 1
siemens_coeff = total_coeff
if(tesla_ignore)
siemens_coeff = 0
else if(!safety)
var/gloves_siemens_coeff = 1
var/species_siemens_coeff = 1
if(gloves)
var/obj/item/clothing/gloves/G = gloves
gloves_siemens_coeff = G.siemens_coefficient
if(species)
species_siemens_coeff = species.siemens_coeff
siemens_coeff = gloves_siemens_coeff * species_siemens_coeff
if(undergoing_cardiac_arrest())
if(shock_damage * siemens_coeff >= 1 && prob(25))
set_heartattack(FALSE)
if(stat == CONSCIOUS)
to_chat(src, "<span class='notice'>You feel your heart beating again!</span>")
. = ..()
/mob/living/carbon/human/Topic(href, href_list)
if(!usr.stat && usr.canmove && !usr.restrained() && in_range(src, usr))
var/thief_mode = 0
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
var/obj/item/clothing/gloves/G = H.gloves
if(G && G.pickpocket)
thief_mode = 1
if(href_list["embedded_object"])
var/obj/item/organ/external/L = locate(href_list["embedded_limb"]) in bodyparts
if(!L)
return
var/obj/item/I = locate(href_list["embedded_object"]) in L.embedded_objects
if(!I || I.loc != src) //no item, no limb, or item is not in limb or in the person anymore
return
var/time_taken = I.embedded_unsafe_removal_time*I.w_class
usr.visible_message("<span class='warning'>[usr] attempts to remove [I] from their [L.name].</span>","<span class='notice'>You attempt to remove [I] from your [L.name]... (It will take [time_taken/10] seconds.)</span>")
if(do_after(usr, time_taken, needhand = 1, target = src))
if(!I || !L || I.loc != src || !(I in L.embedded_objects))
return
L.embedded_objects -= I
L.receive_damage(I.embedded_unsafe_removal_pain_multiplier*I.w_class)//It hurts to rip it out, get surgery you dingus.
I.forceMove(get_turf(src))
usr.put_in_hands(I)
usr.emote("scream")
usr.visible_message("[usr] successfully rips [I] out of their [L.name]!","<span class='notice'>You successfully remove [I] from your [L.name].</span>")
if(!has_embedded_objects())
clear_alert("embeddedobject")
return
if(href_list["item"])
var/slot = text2num(href_list["item"])
if(slot in check_obscured_slots())
to_chat(usr, "<span class='warning'>You can't reach that! Something is covering it.</span>")
return
if(href_list["pockets"])
var/pocket_side = href_list["pockets"]
var/pocket_id = (pocket_side == "right" ? slot_r_store : slot_l_store)
var/obj/item/pocket_item = (pocket_id == slot_r_store ? r_store : l_store)
var/obj/item/place_item = usr.get_active_hand() // Item to place in the pocket, if it's empty
var/delay_denominator = 1
if(pocket_item && !(pocket_item.flags&ABSTRACT))
if(pocket_item.flags & NODROP)
to_chat(usr, "<span class='warning'>You try to empty [src]'s [pocket_side] pocket, it seems to be stuck!</span>")
to_chat(usr, "<span class='notice'>You try to empty [src]'s [pocket_side] pocket.</span>")
else if(place_item && place_item.mob_can_equip(src, pocket_id, 1) && !(place_item.flags&ABSTRACT))
to_chat(usr, "<span class='notice'>You try to place [place_item] into [src]'s [pocket_side] pocket.</span>")
delay_denominator = 4
else
return
if(do_mob(usr, src, POCKET_STRIP_DELAY/delay_denominator)) //placing an item into the pocket is 4 times faster
if(pocket_item)
if(pocket_item == (pocket_id == slot_r_store ? r_store : l_store)) //item still in the pocket we search
unEquip(pocket_item)
if(thief_mode)
usr.put_in_hands(pocket_item)
add_attack_logs(usr, src, "Stripped of [pocket_item]", isLivingSSD(src))
else
if(place_item)
usr.unEquip(place_item)
equip_to_slot_if_possible(place_item, pocket_id, 0, 1)
add_attack_logs(usr, src, "Equipped with [pocket_item]", isLivingSSD(src))
// Update strip window
if(usr.machine == src && in_range(src, usr))
show_inv(usr)
else
// Display a warning if the user mocks up if they don't have pickpocket gloves.
if(!thief_mode)
to_chat(src, "<span class='warning'>You feel your [pocket_side] pocket being fumbled with!</span>")
add_attack_logs(usr, src, "Attempted strip of [pocket_item]", isLivingSSD(src))
if(href_list["set_sensor"])
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
U.set_sensors(usr)
if(href_list["dislodge_headpocket"])
usr.visible_message("<span class='danger'>[usr] is trying to remove something from [src]'s head!</span>",
"<span class='danger'>You start to dislodge whatever's inside [src]'s headpocket!</span>")
if(do_mob(usr, src, POCKET_STRIP_DELAY))
usr.visible_message("<span class='danger'>[usr] has dislodged something from [src]'s head!</span>",
"<span class='danger'>You have dislodged everything from [src]'s headpocket!</span>")
var/obj/item/organ/internal/headpocket/C = get_int_organ(/obj/item/organ/internal/headpocket)
C.empty_contents()
add_attack_logs(usr, src, "Stripped of headpocket items", isLivingSSD(src))
if(href_list["strip_accessory"])
if(istype(w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/U = w_uniform
if(U.accessories.len)
var/obj/item/clothing/accessory/A = U.accessories[1]
if(!thief_mode)
usr.visible_message("<span class='danger'>\The [usr] starts to take off \the [A] from \the [src]'s [U]!</span>", \
"<span class='danger'>You start to take off \the [A] from \the [src]'s [U]!</span>")
if(do_mob(usr, src, 40) && A && U.accessories.len)
if(!thief_mode)
usr.visible_message("<span class='danger'>\The [usr] takes \the [A] off of \the [src]'s [U]!</span>", \
"<span class='danger'>You take \the [A] off of \the [src]'s [U]!</span>")
A.on_removed(usr)
U.accessories -= A
update_inv_w_uniform()
if(href_list["criminal"])
if(hasHUD(usr,"security"))
var/found_record = 0
var/perpname = "wot"
if(wear_id)
var/obj/item/card/id/I = wear_id.GetID()
if(I)
perpname = I.registered_name
else
perpname = name
else
perpname = name
if(perpname)
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
if(R.fields["id"] == E.fields["id"])
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
var/t1 = copytext(trim(sanitize(input("Enter Reason:", "Security HUD", null, null) as text)), 1, MAX_MESSAGE_LEN)
if(!t1)
t1 = "(none)"
if(hasHUD(usr, "security") && setcriminal != "Cancel")
found_record = 1
var/their_name = R.fields["name"]
var/their_rank = R.fields["rank"]
if(R.fields["criminal"] == "*Execute*")
to_chat(usr, "<span class='warning'>Unable to modify the sec status of a person with an active Execution order. Use a security computer instead.</span>")
else
if(ishuman(usr))
var/mob/living/carbon/human/U = usr
R.fields["comments"] += "Set to [setcriminal] by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()] with comment: [t1]<BR>"
if(isrobot(usr))
var/mob/living/silicon/robot/U = usr
R.fields["comments"] += "Set to [setcriminal] by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()] with comment: [t1]<BR>"
if(isAI(usr))
var/mob/living/silicon/ai/U = usr
R.fields["comments"] += "Set to [setcriminal] by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()] with comment: [t1]<BR>"
R.fields["criminal"] = setcriminal
log_admin("[key_name_admin(usr)] set secstatus of [their_rank] [their_name] to [setcriminal], comment: [t1]")
spawn()
sec_hud_set_security_status()
if(!found_record)
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
if(href_list["secrecord"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
var/read = 0
if(wear_id)
if(istype(wear_id,/obj/item/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/pda))
var/obj/item/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Criminal Status:</b> [R.fields["criminal"]]")
to_chat(usr, "<b>Minor Crimes:</b> [R.fields["mi_crim"]]")
to_chat(usr, "<b>Details:</b> [R.fields["mi_crim_d"]]")
to_chat(usr, "<b>Major Crimes:</b> [R.fields["ma_crim"]]")
to_chat(usr, "<b>Details:</b> [R.fields["ma_crim_d"]]")
to_chat(usr, "<b>Notes:</b> [R.fields["notes"]]")
to_chat(usr, "<a href='?src=[UID()];secrecordComment=`'>\[View Comment Log\]</a>")
read = 1
if(!read)
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
if(href_list["secrecordComment"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
var/read = 0
if(wear_id)
if(istype(wear_id,/obj/item/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/pda))
var/obj/item/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
read = 1
if(length(R.fields["comments"]))
for(var/c in R.fields["comments"])
to_chat(usr, c)
else
to_chat(usr, "<span class='warning'>No comment found</span>")
to_chat(usr, "<a href='?src=[UID()];secrecordadd=`'>\[Add comment\]</a>")
if(!read)
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
if(href_list["secrecordadd"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
if(wear_id)
if(istype(wear_id,/obj/item/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/pda))
var/obj/item/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.security)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
var/t1 = copytext(trim(sanitize(input("Add Comment:", "Sec. records", null, null) as message)), 1, MAX_MESSAGE_LEN)
if(!t1 || usr.stat || usr.restrained() || !hasHUD(usr, "security"))
return
if(ishuman(usr))
var/mob/living/carbon/human/U = usr
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
if(isrobot(usr))
var/mob/living/silicon/robot/U = usr
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
if(isAI(usr))
var/mob/living/silicon/ai/U = usr
R.fields["comments"] += "Made by [U.name] (artificial intelligence) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
if(href_list["medical"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/modified = 0
if(wear_id)
if(istype(wear_id,/obj/item/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/pda))
var/obj/item/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.general)
if(R.fields["id"] == E.fields["id"])
var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel")
if(hasHUD(usr,"medical"))
if(setmedical != "Cancel")
R.fields["p_stat"] = setmedical
modified = 1
if(PDA_Manifest.len)
PDA_Manifest.Cut()
spawn()
sec_hud_set_security_status()
if(!modified)
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
if(href_list["medrecord"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/read = 0
if(wear_id)
if(istype(wear_id,/obj/item/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/pda))
var/obj/item/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.medical)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
to_chat(usr, "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["b_type"]]")
to_chat(usr, "<b>DNA:</b> [R.fields["b_dna"]]")
to_chat(usr, "<b>Minor Disabilities:</b> [R.fields["mi_dis"]]")
to_chat(usr, "<b>Details:</b> [R.fields["mi_dis_d"]]")
to_chat(usr, "<b>Major Disabilities:</b> [R.fields["ma_dis"]]")
to_chat(usr, "<b>Details:</b> [R.fields["ma_dis_d"]]")
to_chat(usr, "<b>Notes:</b> [R.fields["notes"]]")
to_chat(usr, "<a href='?src=[UID()];medrecordComment=`'>\[View Comment Log\]</a>")
read = 1
if(!read)
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
if(href_list["medrecordComment"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/read = 0
if(wear_id)
if(istype(wear_id,/obj/item/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/pda))
var/obj/item/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.medical)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
read = 1
if(length(R.fields["comments"]))
for(var/c in R.fields["comments"])
to_chat(usr, c)
else
to_chat(usr, "<span class='warning'>No comment found</span>")
to_chat(usr, "<a href='?src=[UID()];medrecordadd=`'>\[Add comment\]</a>")
if(!read)
to_chat(usr, "<span class='warning'>Unable to locate a data core entry for this person.</span>")
if(href_list["medrecordadd"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
if(wear_id)
if(istype(wear_id,/obj/item/card/id))
perpname = wear_id:registered_name
else if(istype(wear_id,/obj/item/pda))
var/obj/item/pda/tempPda = wear_id
perpname = tempPda.owner
else
perpname = src.name
for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
for(var/datum/data/record/R in data_core.medical)
if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
var/t1 = copytext(trim(sanitize(input("Add Comment:", "Med. records", null, null) as message)), 1, MAX_MESSAGE_LEN)
if(!t1 || usr.stat || usr.restrained() || !hasHUD(usr, "medical"))
return
if(ishuman(usr))
var/mob/living/carbon/human/U = usr
R.fields["comments"] += "Made by [U.get_authentification_name()] ([U.get_assignment()]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
if(isrobot(usr))
var/mob/living/silicon/robot/U = usr
R.fields["comments"] += "Made by [U.name] ([U.modtype] [U.braintype]) on [current_date_string] [station_time_timestamp()]<BR>[t1]"
if(href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
src.examinate(I)
if(href_list["lookmob"])
var/mob/M = locate(href_list["lookmob"])
src.examinate(M)
. = ..()
///check_eye_prot()
///Returns a number between -1 to 2
/mob/living/carbon/human/check_eye_prot()
var/number = ..()
if(istype(head, /obj/item/clothing/head)) //are they wearing something on their head
var/obj/item/clothing/head/HFP = head //if yes gets the flash protection value from that item
number += HFP.flash_protect
if(istype(glasses, /obj/item/clothing/glasses)) //glasses
var/obj/item/clothing/glasses/GFP = glasses
number += GFP.flash_protect
if(istype(wear_mask, /obj/item/clothing/mask)) //mask
var/obj/item/clothing/mask/MFP = wear_mask
number += MFP.flash_protect
for(var/obj/item/organ/internal/cyberimp/eyes/EFP in internal_organs)
number += EFP.flash_protect
return number
/mob/living/carbon/human/check_ear_prot()
if(head && (head.flags & HEADBANGPROTECT))
return 1
if(l_ear && (l_ear.flags & EARBANGPROTECT))
return 1
if(r_ear && (r_ear.flags & EARBANGPROTECT))
return 1
///tintcheck()
///Checks eye covering items for visually impairing tinting, such as welding masks
///Checked in life.dm. 0 & 1 = no impairment, 2 = welding mask overlay, 3 = You can see jack, but you can't see shit.
/mob/living/carbon/human/tintcheck()
var/tinted = 0
if(istype(src.head, /obj/item/clothing/head))