/
human.dm
1773 lines (1487 loc) · 59.7 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/effects/effects.dmi' //We have an ultra-complex update icons that overlays everything, don't load some stupid random male human
icon_state = "nothing"
has_huds = TRUE //We do have HUDs (like health, wanted, status, not inventory slots)
var/embedded_flag //To check if we've need to roll for damage on movement while an item is imbedded in us.
var/obj/item/weapon/rig/wearing_rig // This is very not good, but it's much much better than calling get_rig() every update_canmove() call.
var/last_push_time //For human_attackhand.dm, keeps track of the last use of disarm
var/spitting = 0 //Spitting and spitting related things. Any human based ranged attacks, be it innate or added abilities.
var/spit_projectile = null //Projectile type.
var/spit_name = null //String
var/last_spit = 0 //Timestamp.
var/can_defib = 1 //Horrible damage (like beheadings) will prevent defibbing organics.
var/active_regen = FALSE //Used for the regenerate proc in human_powers.dm
var/active_regen_delay = 300
/mob/living/carbon/human/Initialize(mapload, var/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)
else
set_species()
if(species)
real_name = species.get_random_name(gender)
name = real_name
if(mind)
mind.name = real_name
nutrition = rand(200,400)
human_mob_list |= src
. = ..()
hide_underwear.Cut()
for(var/category in global_underwear.categories_by_name)
hide_underwear[category] = FALSE
if(dna)
dna.ready_dna(src)
dna.real_name = real_name
sync_organ_dna()
//verbs |= /mob/living/proc/toggle_selfsurgery //VOREStation Removal
AddComponent(/datum/component/personal_crafting)
/mob/living/carbon/human/Destroy()
human_mob_list -= src
/* //Chomp REMOVE - this is done on mob/living/Destroy
for(var/organ in organs)
qdel(organ)
*/
if(nif)
QDEL_NULL(nif) //VOREStation Add
worn_clothing.Cut()
if(vessel)
QDEL_NULL(vessel)
return ..()
/mob/living/carbon/human/Stat()
..()
if(statpanel("Status"))
stat("Intent:", "[a_intent]")
stat("Move Mode:", "[m_intent]")
if(emergency_shuttle)
var/eta_status = emergency_shuttle.get_status_panel_eta()
if(eta_status)
stat(null, eta_status)
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)
var/obj/item/organ/internal/xenos/plasmavessel/P = internal_organs_by_name[O_PLASMA] //Xenomorphs. Mech.
if(P)
stat(null, "Phoron Stored: [P.stored_plasma]/[P.max_plasma]")
if(back && istype(back,/obj/item/weapon/rig))
var/obj/item/weapon/rig/suit = back
var/cell_status = "ERROR"
if(suit.cell) cell_status = "[suit.cell.charge]/[suit.cell.maxcharge]"
stat(null, "Suit charge: [cell_status]")
if(mind)
if(mind.changeling)
stat("Chemical Storage", mind.changeling.chem_charges)
stat("Genetic Damage Time", mind.changeling.geneticdamage)
stat("Re-Adaptations", "[mind.changeling.readapts]/[mind.changeling.max_readapts]")
if(species)
species.Stat(src)
/mob/living/carbon/human/ex_act(severity)
if(!blinded)
flash_eyes()
for(var/datum/modifier/M in modifiers)
if(!isnull(M.explosion_modifier))
severity = CLAMP(severity + M.explosion_modifier, 1, 4)
severity = round(severity)
if(severity > 3)
return
var/shielded = 0
var/b_loss = null
var/f_loss = null
switch (severity)
if (1.0)
b_loss += 500
if (!prob(getarmor(null, "bomb")))
gib()
return
else
var/atom/target = get_edge_target_turf(src, get_dir(src, get_step_away(src, src)))
throw_at(target, 200, 4)
//return
// var/atom/target = get_edge_target_turf(user, get_dir(src, get_step_away(user, src)))
//user.throw_at(target, 200, 4)
if (2.0)
if (!shielded)
b_loss += 60
f_loss += 60
if (prob(getarmor(null, "bomb")))
b_loss = b_loss/1.5
f_loss = f_loss/1.5
if (!get_ear_protection() >= 2)
ear_damage += 30
ear_deaf += 120
if (prob(70) && !shielded)
Paralyse(10)
if(3.0)
b_loss += 30
if (prob(getarmor(null, "bomb")))
b_loss = b_loss/2
if (!get_ear_protection() >= 2)
ear_damage += 15
ear_deaf += 60
if (prob(50) && !shielded)
Paralyse(10)
var/blastsoak = getsoak(null, "bomb")
b_loss = max(1, b_loss - blastsoak)
f_loss = max(1, f_loss - blastsoak)
var/update = 0
// focus most of the blast on one organ
var/obj/item/organ/external/take_blast = pick(organs)
update |= take_blast.take_damage(b_loss * 0.9, f_loss * 0.9, used_weapon = "Explosive blast")
// distribute the remaining 10% on all limbs equally
b_loss *= 0.1
f_loss *= 0.1
var/weapon_message = "Explosive Blast"
for(var/obj/item/organ/external/temp in organs)
switch(temp.organ_tag)
if(BP_HEAD)
update |= temp.take_damage(b_loss * 0.2, f_loss * 0.2, used_weapon = weapon_message)
if(BP_TORSO)
update |= temp.take_damage(b_loss * 0.4, f_loss * 0.4, used_weapon = weapon_message)
else
update |= temp.take_damage(b_loss * 0.05, f_loss * 0.05, used_weapon = weapon_message)
if(update) UpdateDamageIcon()
/mob/living/carbon/human/proc/implant_loyalty(override = FALSE) // Won't override by default.
if(!config.use_loyalty_implants && !override) return // Nuh-uh.
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(src)
if(L.handle_implant(src, BP_HEAD))
L.post_implant(src)
/mob/living/carbon/human/proc/is_loyalty_implanted()
for(var/L in src.contents)
if(istype(L, /obj/item/weapon/implant/loyalty))
for(var/obj/item/organ/external/O in src.organs)
if(L in O.implants)
return 1
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/co2overloadtime = null
/mob/living/carbon/human/var/temperature_resistance = T0C+75
// called when something steps onto a human
// this handles mobs on fire - mulebot and vehicle code has been relocated to /mob/living/Crossed()
/mob/living/carbon/human/Crossed(var/atom/movable/AM)
if(AM.is_incorporeal())
return
spread_fire(AM)
..() // call parent because we moved behavior to parent
// 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/device/pda/pda = wear_id
if (istype(pda))
if (pda.id)
return pda.id.rank ? pda.id.rank : if_no_job
else
return pda.ownrank ? pda.ownrank : if_no_job
else
var/obj/item/weapon/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/device/pda/pda = wear_id
if (istype(pda))
if (pda.id)
return pda.id.assignment
else
return pda.ownjob ? pda.ownjob : if_no_job
else
var/obj/item/weapon/card/id/id = get_idcard()
if(id)
return id.assignment ? id.assignment : if_no_job
else
return if_no_id
//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/device/pda/pda = wear_id
if (istype(pda))
if (pda.id)
return pda.id.registered_name
else
return pda.owner ? pda.owner : if_no_id
else
var/obj/item/weapon/card/id/id = get_idcard()
if(id)
return id.registered_name
else
return if_no_id
//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/proc/get_visible_name()
if(ability_flags & AB_PHASE_SHIFTED)
return "Something" // Something
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((face_name == "Unknown") && id_name && (id_name != face_name))
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(BP_HEAD)
if(!head || head.disfigured || head.is_stump() || !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")
. = if_no_id
if(istype(wear_id,/obj/item/device/pda))
var/obj/item/device/pda/P = wear_id
return P.owner ? P.owner : if_no_id
if(wear_id)
var/obj/item/weapon/card/id/I = wear_id.GetID()
if(I)
return I.registered_name
return
//gets ID card object from special clothes slot or null.
/mob/living/carbon/human/proc/get_idcard()
if(wear_id)
return wear_id.GetID()
//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(var/shock_damage, var/obj/source, var/base_siemens_coeff = 1.0, var/def_zone = null)
if(status_flags & GODMODE) return 0 //godmode
if (!def_zone)
def_zone = pick("l_hand", "r_hand")
if(species.siemens_coefficient == -1)
if(stored_shock_by_ref["\ref[src]"])
stored_shock_by_ref["\ref[src]"] += shock_damage
else
stored_shock_by_ref["\ref[src]"] = shock_damage
return
var/obj/item/organ/external/affected_organ = get_organ(check_zone(def_zone))
var/siemens_coeff = base_siemens_coeff * get_siemens_coefficient_organ(affected_organ)
if(fire_stacks < 0) // Water makes you more conductive.
siemens_coeff *= 1.5
return ..(shock_damage, source, siemens_coeff, def_zone)
/mob/living/carbon/human/Topic(href, href_list)
if (href_list["mach_close"]) // This is horrible.
var/t1 = text("window=[]", href_list["mach_close"])
unset_machine()
src << browse(null, t1)
if(href_list["item"])
log_runtime(EXCEPTION("Warning: human/Topic was called with item [href_list["item"]], but the item Topic is deprecated!"))
// handle_strip(href_list["item"],usr)
if (href_list["criminal"])
if(hasHUD(usr,"security"))
var/modified = 0
var/perpname = "wot"
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_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 = tgui_input_list(usr, "Specify a new criminal status for this person.", "Security HUD", list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel"))
if(hasHUD(usr, "security"))
if(setcriminal != "Cancel")
R.fields["criminal"] = setcriminal
modified = 1
spawn()
BITSET(hud_updateflag, WANTED_HUD)
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
U.handle_hud_list()
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
U.handle_regular_hud_updates()
if(!modified)
to_chat(usr, "<span class='filter_notice'>[span_red("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
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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/list/security_hud_text = list()
security_hud_text += "<b>Name:</b> [R.fields["name"]] <b>Criminal Status:</b> [R.fields["criminal"]]"
security_hud_text += "<b>Species:</b> [R.fields["species"]]"
security_hud_text += "<b>Minor Crimes:</b> [R.fields["mi_crim"]]"
security_hud_text += "<b>Details:</b> [R.fields["mi_crim_d"]]"
security_hud_text += "<b>Major Crimes:</b> [R.fields["ma_crim"]]"
security_hud_text += "<b>Details:</b> [R.fields["ma_crim_d"]]"
security_hud_text += "<b>Notes:</b> [R.fields["notes"]]"
security_hud_text += "<a href='?src=\ref[src];secrecordComment=`'>\[View Comment Log\]</a>"
to_chat(usr, "<span class='filter_notice'>[jointext(security_hud_text, "<br>")]</span>")
read = 1
if(!read)
to_chat(usr, "<span class='filter_notice'>[span_red("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
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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
var/counter = 1
while(R.fields[text("com_[]", counter)])
to_chat(usr, "[R.fields[text("com_[]", counter)]]")
counter++
if (counter == 1)
to_chat(usr, "<span class='filter_notice'>No comment found.</span>")
to_chat(usr, "<span class='filter_notice'><a href='?src=\ref[src];secrecordadd=`'>\[Add comment\]</a></span>")
if(!read)
to_chat(usr, "<span class='filter_notice'>[span_red("Unable to locate a data core entry for this person.")]</span>")
if (href_list["secrecordadd"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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 = sanitize(tgui_input_text(usr, "Add Comment:", "Sec. records", null, null, multiline = TRUE, prevent_enter = TRUE))
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
counter++
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if (href_list["medical"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/modified = 0
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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 = tgui_input_list(usr, "Specify a new medical status for this person.", "Medical HUD", 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()
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
U.handle_regular_hud_updates()
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
U.handle_regular_hud_updates()
if(!modified)
to_chat(usr, "<span class='filter_notice'>[span_red("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
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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/list/medical_hud_text = list()
medical_hud_text += "<b>Name:</b> [R.fields["name"]] <b>Blood Type:</b> [R.fields["b_type"]] <b>Blood Basis:</b> [R.fields["blood_reagent"]]"
medical_hud_text += "<b>Species:</b> [R.fields["species"]]"
medical_hud_text += "<b>DNA:</b> [R.fields["b_dna"]]"
medical_hud_text += "<b>Minor Disabilities:</b> [R.fields["mi_dis"]]"
medical_hud_text += "<b>Details:</b> [R.fields["mi_dis_d"]]"
medical_hud_text += "<b>Major Disabilities:</b> [R.fields["ma_dis"]]"
medical_hud_text += "<b>Details:</b> [R.fields["ma_dis_d"]]"
medical_hud_text += "<b>Notes:</b> [R.fields["notes"]]"
medical_hud_text += "<a href='?src=\ref[src];medrecordComment=`'>\[View Comment Log\]</a>"
to_chat(usr, "<span class='filter_notice'>[jointext(medical_hud_text, "<br>")]</span>")
read = 1
if(!read)
to_chat(usr, "<span class='filter_notice'>[span_red("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
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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
var/counter = 1
while(R.fields[text("com_[]", counter)])
to_chat(usr, "[R.fields[text("com_[]", counter)]]")
counter++
if (counter == 1)
to_chat(usr, "<span class='filter_notice'>No comment found.</span>")
to_chat(usr, "<span class='filter_notice'><a href='?src=\ref[src];medrecordadd=`'>\[Add comment\]</a></span>")
if(!read)
to_chat(usr, "<span class='filter_notice'>[span_red("Unable to locate a data core entry for this person.")]</span>")
if (href_list["medrecordadd"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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 = sanitize(tgui_input_text(usr, "Add Comment:", "Med. records", null, null, multiline = TRUE, prevent_enter = TRUE))
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
counter++
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if (href_list["emprecord"])
if(hasHUD(usr,"best"))
var/perpname = "wot"
var/read = 0
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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"])
if(hasHUD(usr,"best"))
var/list/emp_hud_text = list()
emp_hud_text += "<b>Name:</b> [R.fields["name"]]"
emp_hud_text += "<b>Species:</b> [R.fields["species"]]"
emp_hud_text += "<b>Assignment:</b> [R.fields["real_rank"]] ([R.fields["rank"]])"
emp_hud_text += "<b>Home System:</b> [R.fields["home_system"]]"
emp_hud_text += "<b>Birthplace:</b> [R.fields["birthplace"]]"
emp_hud_text += "<b>Citizenship:</b> [R.fields["citizenship"]]"
emp_hud_text += "<b>Primary Employer:</b> [R.fields["personal_faction"]]"
emp_hud_text += "<b>Religious Beliefs:</b> [R.fields["religion"]]"
emp_hud_text += "<b>Known Languages:</b> [R.fields["languages"]]"
emp_hud_text += "<b>Notes:</b> [R.fields["notes"]]"
emp_hud_text += "<a href='?src=\ref[src];emprecordComment=`'>\[View Comment Log\]</a>"
to_chat(usr, "<span class='filter_notice'>[jointext(emp_hud_text, "<br>")]</span>")
read = 1
if(!read)
to_chat(usr, "<span class='filter_notice'>[span_red("Unable to locate a data core entry for this person.")]</span>")
if (href_list["emprecordComment"])
if(hasHUD(usr,"best"))
var/perpname = "wot"
var/read = 0
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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"])
if(hasHUD(usr,"best"))
read = 1
var/counter = 1
while(R.fields[text("com_[]", counter)])
to_chat(usr, "[R.fields[text("com_[]", counter)]]")
counter++
if (counter == 1)
to_chat(usr, "<span class='filter_notice'>No comment found.</span>")
to_chat(usr, "<span class='filter_notice'><a href='?src=\ref[src];emprecordadd=`'>\[Add comment\]</a></span>")
if(!read)
to_chat(usr, "<span class='filter_notice'>[span_red("Unable to locate a data core entry for this person.")]</span>")
if (href_list["emprecordadd"])
if(hasHUD(usr,"best"))
var/perpname = "wot"
var/obj/item/weapon/card/id/I = GetIdCard()
if(I)
perpname = I.registered_name
else
perpname = 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"])
if(hasHUD(usr,"best"))
var/t1 = sanitize(tgui_input_text(usr, "Add Comment:", "Emp. records", null, null, multiline = TRUE, prevent_enter = TRUE))
if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"best")) )
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
counter++
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if (href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
src.examinate(I)
if (href_list["lookitem_desc_only"])
var/obj/item/I = locate(href_list["lookitem_desc_only"])
if(!I)
return
usr.examinate(I, 1)
if (href_list["lookmob"])
var/mob/M = locate(href_list["lookmob"])
src.examinate(M)
if (href_list["clickitem"])
var/obj/item/I = locate(href_list["clickitem"])
if(src.client)
src.ClickOn(I)
if (href_list["flavor_change"])
switch(href_list["flavor_change"])
if("done")
src << browse(null, "window=flavor_changes")
return
if("general")
var/msg = strip_html_simple(tgui_input_text(usr,"Update the general description of your character. This will be shown regardless of clothing.","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE, prevent_enter = TRUE)) //VOREStation Edit: separating out OOC notes
if(msg)
flavor_texts[href_list["flavor_change"]] = msg
set_flavor()
return
else
var/msg = strip_html_simple(tgui_input_text(usr,"Update the flavor text for your [href_list["flavor_change"]].","Flavor Text",html_decode(flavor_texts[href_list["flavor_change"]]), multiline = TRUE, prevent_enter = TRUE))
if(msg)
flavor_texts[href_list["flavor_change"]] = msg
set_flavor()
return
..()
return
///eyecheck()
///Returns a number between -1 to 2
/mob/living/carbon/human/eyecheck()
var/obj/item/organ/internal/eyes/I
if(internal_organs_by_name[O_EYES]) // Eyes are fucked, not a 'weak point'.
I = internal_organs_by_name[O_EYES]
if(I.is_broken())
return FLASH_PROTECTION_MAJOR
else if(!species.dispersed_eyes) // They can't be flashed if they don't have eyes, or widespread sensing surfaces.
return FLASH_PROTECTION_MAJOR
var/number = get_equipment_flash_protection()
if(I)
number = I.get_total_protection(number)
I.additional_flash_effects(number)
return number
/mob/living/carbon/human/flash_eyes(var/intensity = FLASH_PROTECTION_MODERATE, override_blindness_check = FALSE, affect_silicon = FALSE, visual = FALSE, type = /obj/screen/fullscreen/flash)
if(internal_organs_by_name[O_EYES]) // Eyes are fucked, not a 'weak point'.
var/obj/item/organ/internal/eyes/I = internal_organs_by_name[O_EYES]
I.additional_flash_effects(intensity)
return ..()
#define add_clothing_protection(A) \
var/obj/item/clothing/C = A; \
flash_protection += C.flash_protection; \
/mob/living/carbon/human/proc/get_equipment_flash_protection()
var/flash_protection = 0
if(istype(src.head, /obj/item/clothing/head))
add_clothing_protection(head)
if(istype(src.glasses, /obj/item/clothing/glasses))
add_clothing_protection(glasses)
if(istype(src.wear_mask, /obj/item/clothing/mask))
add_clothing_protection(wear_mask)
return flash_protection
#undef add_clothing_protection
//Used by various things that knock people out by applying blunt trauma to the head.
//Checks that the species has a "head" (brain containing organ) and that hit_zone refers to it.
/mob/living/carbon/human/proc/headcheck(var/target_zone, var/brain_tag = "brain")
var/obj/item/organ/affecting = internal_organs_by_name[brain_tag]
target_zone = check_zone(target_zone)
if(!affecting || affecting.parent_organ != target_zone)
return 0
//if the parent organ is significantly larger than the brain organ, then hitting it is not guaranteed
var/obj/item/organ/parent = get_organ(target_zone)
if(!parent)
return 0
if(parent.w_class > affecting.w_class + 1)
return prob(100 / 2**(parent.w_class - affecting.w_class - 1))
return 1
/mob/living/carbon/human/IsAdvancedToolUser(var/silent)
// VOREstation start
if(feral)
to_chat(src, "<span class='warning'>Your primitive mind can't grasp the concept of that thing.</span>")
return 0
// VOREstation end
if(species.has_fine_manipulation)
return 1
if(!silent)
to_chat(src, "<span class='warning'>You don't have the dexterity to use that!</span>")
return 0
/mob/living/carbon/human/abiotic(var/full_body = 0)
if(full_body && ((src.l_hand && !( src.l_hand.abstract )) || (src.r_hand && !( src.r_hand.abstract )) || (src.back || src.wear_mask || src.head || src.shoes || src.w_uniform || src.wear_suit || src.glasses || src.l_ear || src.r_ear || src.gloves)))
return 1
if( (src.l_hand && !src.l_hand.abstract) || (src.r_hand && !src.r_hand.abstract) )
return 1
return 0
/mob/living/carbon/human/proc/check_dna()
dna.check_integrity(src)
return
/mob/living/carbon/human/get_species()
if(!species)
set_species()
return species.name
/mob/living/carbon/human/proc/play_xylophone()
if(!src.xylophone)
var/datum/gender/T = gender_datums[get_visible_gender()]
visible_message("<span class='filter_notice'>[span_red("\The [src] begins playing [T.his] ribcage like a xylophone. It's quite spooky.")]</span>","<span class='notice'>You begin to play a spooky refrain on your ribcage.</span>","<span class='filter_notice'>[span_red("You hear a spooky xylophone melody.")]</span>")
var/song = pick('sound/effects/xylophone1.ogg','sound/effects/xylophone2.ogg','sound/effects/xylophone3.ogg')
playsound(src, song, 50, 1, -1)
xylophone = 1
spawn(1200)
xylophone=0
return
/mob/living/proc/check_has_mouth()
return 1
/mob/living/carbon/human/check_has_mouth()
// Todo, check stomach organ when implemented.
var/obj/item/organ/external/head/H = get_organ(BP_HEAD)
if(!H || !H.can_intake_reagents)
return 0
return 1
/mob/living/carbon/human/proc/morph()
set name = "Morph"
set category = "Superpower"
if(stat!=CONSCIOUS)
reset_view(0)
remoteview_target = null
return
if(!(mMorph in mutations))
src.verbs -= /mob/living/carbon/human/proc/morph
return
var/new_facial = input(usr, "Please select facial hair color.", "Character Generation",rgb(r_facial,g_facial,b_facial)) as color
if(new_facial)
r_facial = hex2num(copytext(new_facial, 2, 4))
g_facial = hex2num(copytext(new_facial, 4, 6))
b_facial = hex2num(copytext(new_facial, 6, 8))
var/new_hair = input(usr, "Please select hair color.", "Character Generation",rgb(r_hair,g_hair,b_hair)) as color
if(new_facial)
r_hair = hex2num(copytext(new_hair, 2, 4))
g_hair = hex2num(copytext(new_hair, 4, 6))
b_hair = hex2num(copytext(new_hair, 6, 8))
var/new_eyes = input(usr, "Please select eye color.", "Character Generation",rgb(r_eyes,g_eyes,b_eyes)) as color
if(new_eyes)
r_eyes = hex2num(copytext(new_eyes, 2, 4))
g_eyes = hex2num(copytext(new_eyes, 4, 6))
b_eyes = hex2num(copytext(new_eyes, 6, 8))
update_eyes()
// hair
var/list/all_hairs = subtypesof(/datum/sprite_accessory/hair)
var/list/hairs = list()
// loop through potential hairs
for(var/x in all_hairs)
var/datum/sprite_accessory/hair/H = new x // create new hair datum based on type x
hairs.Add(H.name) // add hair name to hairs
qdel(H) // delete the hair after it's all done
var/new_style = tgui_input_list(usr, "Please select hair style", "Character Generation", hairs)
// if new style selected (not cancel)
if (new_style)
h_style = new_style
// facial hair
var/list/all_fhairs = subtypesof(/datum/sprite_accessory/facial_hair)
var/list/fhairs = list()
for(var/x in all_fhairs)
var/datum/sprite_accessory/facial_hair/H = new x
fhairs.Add(H.name)
qdel(H)
new_style = tgui_input_list(usr, "Please select facial style", "Character Generation", fhairs)
if(new_style)
f_style = new_style
var/new_gender = tgui_alert(usr, "Please select gender.", "Character Generation", list("Male", "Female", "Neutral"))
if (new_gender)
if(new_gender == "Male")
gender = MALE
else if(new_gender == "Female")
gender = FEMALE
else
gender = NEUTER
regenerate_icons()
check_dna()
var/datum/gender/T = gender_datums[get_visible_gender()]
visible_message("<span class='notice'>\The [src] morphs and changes [T.his] appearance!</span>", "<span class='notice'>You change your appearance!</span>", "<span class='filter_notice'>[span_red("Oh, god! What the hell was that? It sounded like flesh getting squished and bone ground into a different shape!")]</span>")
/mob/living/carbon/human/proc/remotesay()
set name = "Project mind"
set category = "Superpower"
if(stat!=CONSCIOUS)
reset_view(0)
remoteview_target = null
return
if(!(mRemotetalk in src.mutations))
src.verbs -= /mob/living/carbon/human/proc/remotesay
return
var/list/creatures = list()
for(var/mob/living/carbon/h in mob_list)
creatures += h
var/mob/target = tgui_input_list(usr, "Who do you want to project your mind to?", "Project Mind", creatures)
if (isnull(target))
return
var/say = sanitize(tgui_input_text(usr, "What do you wish to say?"))
if(mRemotetalk in target.mutations)
target.show_message("<span class='filter_say'>[span_blue("You hear [src.real_name]'s voice: [say]")]</span>")
else
target.show_message("<span class='filter_say'>[span_blue("You hear a voice that seems to echo around the room: [say]")]</span>")
usr.show_message("<span class='filter_say'>[span_blue("You project your mind into [target.real_name]: [say]")]</span>")
log_say("(TPATH to [key_name(target)]) [say]",src)
for(var/mob/observer/dead/G in mob_list)
G.show_message("<span class='filter_say'><i>Telepathic message from <b>[src]</b> to <b>[target]</b>: [say]</i></span>")
/mob/living/carbon/human/proc/remoteobserve()
set name = "Remote View"
set category = "Superpower"
if(stat!=CONSCIOUS)
remoteview_target = null
reset_view(0)
return
if(!(mRemote in src.mutations))
remoteview_target = null
reset_view(0)
src.verbs -= /mob/living/carbon/human/proc/remoteobserve
return
if(client.eye != client.mob)
remoteview_target = null
reset_view(0)
return
var/list/mob/creatures = list()
for(var/mob/living/carbon/h in mob_list)
var/turf/temp_turf = get_turf(h)
if((temp_turf.z != 1 && temp_turf.z != 5) || h.stat!=CONSCIOUS) //Not on mining or the station. Or dead
continue
creatures += h
var/mob/target = input ("Who do you want to project your mind to?") as mob in creatures
if (target)
remoteview_target = target
reset_view(target)
else
remoteview_target = null
reset_view(0)
/mob/living/carbon/human/get_visible_gender(mob/user, force)
switch(force)
if(VISIBLE_GENDER_FORCE_PLURAL)
return PLURAL
if(VISIBLE_GENDER_FORCE_IDENTIFYING)
return get_gender()
if(VISIBLE_GENDER_FORCE_BIOLOGICAL)
return gender
else
if(((wear_mask?.flags_inv & HIDEFACE) || (head?.flags_inv & HIDEMASK) || (head?.flags_inv & HIDEFACE)) && (wear_suit?.flags_inv & HIDEJUMPSUIT))
return PLURAL
if(species?.ambiguous_genders && user)
if(ishuman(user))
var/mob/living/carbon/human/human = user
if(!istype(human.species, species))
return PLURAL
else if(!isobserver(user) && !issilicon(user))
return PLURAL
return get_gender()
/mob/living/carbon/human/proc/increase_germ_level(n)
if(gloves)
gloves.germ_level += n
else
germ_level += n
/mob/living/carbon/human/revive()
if(should_have_organ(O_HEART))
vessel.add_reagent("blood",species.blood_volume-vessel.total_volume)
fixblood()
species.create_organs(src) // Reset our organs/limbs.
restore_all_organs() // Reapply robotics/amputated status from preferences.