/
_species.dm
2123 lines (1798 loc) · 87.1 KB
/
_species.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
GLOBAL_LIST_EMPTY(roundstart_races)
///List of all roundstart languages by path except common
GLOBAL_LIST_EMPTY(uncommon_roundstart_languages)
/// An assoc list of species types to their features (from get_features())
GLOBAL_LIST_EMPTY(features_by_species)
/**
* # species datum
*
* Datum that handles different species in the game.
*
* This datum handles species in the game, such as lizardpeople, mothmen, zombies, skeletons, etc.
* It is used in [carbon humans][mob/living/carbon/human] to determine various things about them, like their food preferences, if they have biological genders, their damage resistances, and more.
*
*/
/datum/species
///If the game needs to manually check your race to do something not included in a proc here, it will use this.
var/id
///This is used for children, it will determine their default limb ID for use of examine. See [/mob/living/carbon/human/proc/examine].
var/examine_limb_id
///This is the fluff name. They are displayed on health analyzers and in the character setup menu. Leave them generic for other servers to customize.
var/name
/**
* The formatting of the name of the species in plural context. Defaults to "[name]\s" if unset.
* Ex "[Plasmamen] are weak", "[Mothmen] are strong", "[Lizardpeople] don't like", "[Golems] hate"
*/
var/plural_form
///Whether or not the race has sexual characteristics (biological genders). At the moment this is only FALSE for skeletons and shadows
var/sexes = TRUE
///The maximum number of bodyparts this species can have.
var/max_bodypart_count = 6
/// This allows races to have specific hair colors.
/// If null, it uses the mob's hair/facial hair colors.
/// If USE_MUTANT_COLOR, it uses the mob's mutant_color.
/// If USE_FIXED_MUTANT_COLOR, it uses fixedmutcolor
var/hair_color_mode
///The alpha used by the hair. 255 is completely solid, 0 is invisible.
var/hair_alpha = 255
///The alpha used by the facial hair. 255 is completely solid, 0 is invisible.
var/facial_hair_alpha = 255
///Never, Optional, or Forced digi legs?
var/digitigrade_customization = DIGITIGRADE_NEVER
///If your race bleeds something other than bog standard blood, change this to reagent id. For example, ethereals bleed liquid electricity.
var/datum/reagent/exotic_blood
///If your race uses a non standard bloodtype (A+, O-, AB-, etc). For example, lizards have L type blood.
var/exotic_bloodtype
///The rate at which blood is passively drained by having the blood deficiency quirk. Some races such as slimepeople can regen their blood at different rates so this is to account for that
var/blood_deficiency_drain_rate = BLOOD_REGEN_FACTOR + BLOOD_DEFICIENCY_MODIFIER // slightly above the regen rate so it slowly drains instead of regenerates.
///What the species drops when gibbed by a gibber machine.
var/meat = /obj/item/food/meat/slab/human
///What skin the species drops when gibbed by a gibber machine.
var/skinned_type
///flags for inventory slots the race can't equip stuff to. Golems cannot wear jumpsuits, for example.
var/no_equip_flags
/// What languages this species can understand and say.
/// Use a [language holder datum][/datum/language_holder] typepath in this var.
/// Should never be null.
var/datum/language_holder/species_language_holder = /datum/language_holder/human_basic
/**
* Visible CURRENT bodyparts that are unique to a species.
* DO NOT USE THIS AS A LIST OF ALL POSSIBLE BODYPARTS AS IT WILL FUCK
* SHIT UP! Changes to this list for non-species specific bodyparts (ie
* cat ears and tails) should be assigned at organ level if possible.
* Assoc values are defaults for given bodyparts, also modified by aforementioned organs.
* They also allow for faster '[]' list access versus 'in'. Other than that, they are useless right now.
* Layer hiding is handled by [/datum/species/proc/handle_mutant_bodyparts] below.
*/
var/list/mutant_bodyparts = list()
///The bodyparts this species uses. assoc of bodypart string - bodypart type. Make sure all the fucking entries are in or I'll skin you alive.
var/list/bodypart_overrides = list(
BODY_ZONE_L_ARM = /obj/item/bodypart/arm/left,
BODY_ZONE_R_ARM = /obj/item/bodypart/arm/right,
BODY_ZONE_HEAD = /obj/item/bodypart/head,
BODY_ZONE_L_LEG = /obj/item/bodypart/leg/left,
BODY_ZONE_R_LEG = /obj/item/bodypart/leg/right,
BODY_ZONE_CHEST = /obj/item/bodypart/chest,
)
///Internal organs that are unique to this race, like a tail. list(typepath of organ 1, typepath of organ 2)
var/list/mutant_organs = list()
///List of external organs to generate like horns, frills, wings, etc. list(typepath of organ = "Round Beautiful BDSM Snout"). Still WIP
var/list/external_organs = list()
///Replaces default brain with a different organ
var/obj/item/organ/internal/brain/mutantbrain = /obj/item/organ/internal/brain
///Replaces default heart with a different organ
var/obj/item/organ/internal/heart/mutantheart = /obj/item/organ/internal/heart
///Replaces default lungs with a different organ
var/obj/item/organ/internal/lungs/mutantlungs = /obj/item/organ/internal/lungs
///Replaces default eyes with a different organ
var/obj/item/organ/internal/eyes/mutanteyes = /obj/item/organ/internal/eyes
///Replaces default ears with a different organ
var/obj/item/organ/internal/ears/mutantears = /obj/item/organ/internal/ears
///Replaces default tongue with a different organ
var/obj/item/organ/internal/tongue/mutanttongue = /obj/item/organ/internal/tongue
///Replaces default liver with a different organ
var/obj/item/organ/internal/liver/mutantliver = /obj/item/organ/internal/liver
///Replaces default stomach with a different organ
var/obj/item/organ/internal/stomach/mutantstomach = /obj/item/organ/internal/stomach
///Replaces default appendix with a different organ.
var/obj/item/organ/internal/appendix/mutantappendix = /obj/item/organ/internal/appendix
/// Flat modifier on all damage taken via [apply_damage][/mob/living/proc/apply_damage] (so being punched, shot, etc.)
/// IE: 10 = 10% less damage taken.
var/damage_modifier = 0
///multiplier for damage from cold temperature
var/coldmod = 1
///multiplier for damage from hot temperature
var/heatmod = 1
///multiplier for stun durations
var/stunmod = 1
///multiplier for money paid at payday
var/payday_modifier = 1.0
///Base electrocution coefficient. Basically a multiplier for damage from electrocutions.
var/siemens_coeff = 1
///To use MUTCOLOR with a fixed color that's independent of the mcolor feature in DNA.
var/fixed_mut_color = ""
///Special mutation that can be found in the genepool exclusively in this species. Dont leave empty or changing species will be a headache
var/inert_mutation = /datum/mutation/human/dwarfism
///Used to set the mob's death_sound upon species change
var/death_sound
///Sounds to override barefeet walking
var/list/special_step_sounds
///Special sound for grabbing
var/grab_sound
/// A path to an outfit that is important for species life e.g. plasmaman outfit
var/datum/outfit/outfit_important_for_life
/// The natural temperature for a body
var/bodytemp_normal = BODYTEMP_NORMAL
/// Minimum amount of kelvin moved toward normal body temperature per tick.
var/bodytemp_autorecovery_min = BODYTEMP_AUTORECOVERY_MINIMUM
/// The body temperature limit the body can take before it starts taking damage from heat.
var/bodytemp_heat_damage_limit = BODYTEMP_HEAT_DAMAGE_LIMIT
/// The body temperature limit the body can take before it starts taking damage from cold.
var/bodytemp_cold_damage_limit = BODYTEMP_COLD_DAMAGE_LIMIT
/// The icon_state of the fire overlay added when sufficently ablaze and standing. see onfire.dmi
var/fire_overlay = "human"
/// Generic traits tied to having the species.
var/list/inherent_traits = list()
/// List of biotypes the mob belongs to. Used by diseases.
var/inherent_biotypes = MOB_ORGANIC|MOB_HUMANOID
/// The type of respiration the mob is capable of doing. Used by adjustOxyLoss.
var/inherent_respiration_type = RESPIRATION_OXYGEN
///List of factions the mob gain upon gaining this species.
var/list/inherent_factions
///What gas does this species breathe? Used by suffocation screen alerts, most of actual gas breathing is handled by mutantlungs. See [life.dm][code/modules/mob/living/carbon/human/life.dm]
var/breathid = GAS_O2
///What anim to use for dusting
var/dust_anim = "dust-h"
///What anim to use for gibbing
var/gib_anim = "gibbed-h"
///Bitflag that controls what in game ways something can select this species as a spawnable source, such as magic mirrors. See [mob defines][code/__DEFINES/mobs.dm] for possible sources.
var/changesource_flags = NONE
///Unique cookie given by admins through prayers
var/species_cookie = /obj/item/food/cookie
/// List of family heirlooms this species can get with the family heirloom quirk. List of types.
var/list/family_heirlooms
///List of results you get from knife-butchering. null means you cant butcher it. Associated by resulting type - value of amount
var/list/knife_butcher_results
/// Should we preload this species's organs?
var/preload = TRUE
/// Do we try to prevent reset_perspective() from working? Useful for Dullahans to stop perspective changes when they're looking through their head.
var/prevent_perspective_change = FALSE
///Was the species changed from its original type at the start of the round?
var/roundstart_changed = FALSE
/// This supresses the "dosen't appear to be himself" examine text for if the mob is run by an AI controller. Should be used on any NPC human subtypes. Monkeys are the prime example.
var/ai_controlled_species = FALSE
/**
* Was on_species_gain ever actually called?
* Species code is really odd...
**/
var/properly_gained = FALSE
///A list containing outfits that will be overridden in the species_equip_outfit proc. [Key = Typepath passed in] [Value = Typepath of outfit you want to equip for this specific species instead].
var/list/outfit_override_registry = list()
///////////
// PROCS //
///////////
/datum/species/New()
if(!plural_form)
plural_form = "[name]\s"
if(!examine_limb_id)
examine_limb_id = id
return ..()
/// Gets a list of all species available to choose in roundstart.
/proc/get_selectable_species()
RETURN_TYPE(/list)
if (!GLOB.roundstart_races.len)
GLOB.roundstart_races = generate_selectable_species_and_languages()
return GLOB.roundstart_races
/**
* Generates species available to choose in character setup at roundstart
*
* This proc generates which species are available to pick from in character setup.
* If there are no available roundstart species, defaults to human.
*/
/proc/generate_selectable_species_and_languages()
var/list/selectable_species = list()
for(var/species_type in subtypesof(/datum/species))
var/datum/species/species = new species_type
if(species.check_roundstart_eligible())
selectable_species += species.id
var/datum/language_holder/temp_holder = new species.species_language_holder
for(var/datum/language/spoken_language as anything in temp_holder.understood_languages)
GLOB.uncommon_roundstart_languages |= spoken_language
qdel(temp_holder)
qdel(species)
GLOB.uncommon_roundstart_languages -= /datum/language/common
if(!selectable_species.len)
selectable_species += SPECIES_HUMAN
return selectable_species
/**
* Checks if a species is eligible to be picked at roundstart.
*
* Checks the config to see if this species is allowed to be picked in the character setup menu.
* Used by [/proc/generate_selectable_species_and_languages].
*/
/datum/species/proc/check_roundstart_eligible()
if(id in (CONFIG_GET(keyed_list/roundstart_races)))
return TRUE
return FALSE
/**
* Generates a random name for a carbon.
*
* This generates a random unique name based on a human's species and gender.
* Arguments:
* * gender - The gender that the name should adhere to. Use MALE for male names, use anything else for female names.
* * unique - If true, ensures that this new name is not a duplicate of anyone else's name currently on the station.
* * last_name - Do we use a given last name or pick a random new one?
*/
/datum/species/proc/random_name(gender, unique, last_name)
if(unique)
return random_unique_name(gender)
var/randname
if(gender == MALE)
randname = pick(GLOB.first_names_male)
else
randname = pick(GLOB.first_names_female)
if(last_name)
randname += " [last_name]"
else
randname += " [pick(GLOB.last_names)]"
return randname
/**
* Copies some vars and properties over that should be kept when creating a copy of this species.
*
* Used by slimepeople to copy themselves, and by the DNA datum to hardset DNA to a species
* Arguments:
* * old_species - The species that the carbon used to be before copying
*/
/datum/species/proc/copy_properties_from(datum/species/old_species)
return
/**
* Gets the default mutant organ for the species based on the provided slot.
*/
/datum/species/proc/get_mutant_organ_type_for_slot(slot)
switch(slot)
if(ORGAN_SLOT_BRAIN)
return mutantbrain
if(ORGAN_SLOT_HEART)
return mutantheart
if(ORGAN_SLOT_LUNGS)
return mutantlungs
if(ORGAN_SLOT_APPENDIX)
return mutantappendix
if(ORGAN_SLOT_EYES)
return mutanteyes
if(ORGAN_SLOT_EARS)
return mutantears
if(ORGAN_SLOT_TONGUE)
return mutanttongue
if(ORGAN_SLOT_LIVER)
return mutantliver
if(ORGAN_SLOT_STOMACH)
return mutantstomach
else
CRASH("Invalid organ slot [slot]")
/**
* Corrects organs in a carbon, removing ones it doesn't need and adding ones it does.
*
* Takes all organ slots, removes organs a species should not have, adds organs a species should have.
* can use replace_current to refresh all organs, creating an entirely new set.
*
* Arguments:
* * organ_holder - carbon, the owner of the species datum AKA whoever we're regenerating organs in
* * old_species - datum, used when regenerate organs is called in a switching species to remove old mutant organs.
* * replace_current - boolean, forces all old organs to get deleted whether or not they pass the species' ability to keep that organ
* * excluded_zones - list, add zone defines to block organs inside of the zones from getting handled. see headless mutation for an example
* * visual_only - boolean, only load organs that change how the species looks. Do not use for normal gameplay stuff
*/
/datum/species/proc/regenerate_organs(mob/living/carbon/organ_holder, datum/species/old_species, replace_current = TRUE, list/excluded_zones, visual_only = FALSE)
//what should be put in if there is no mutantorgan (brains handled separately)
var/list/organ_slots = list(
ORGAN_SLOT_BRAIN,
ORGAN_SLOT_HEART,
ORGAN_SLOT_LUNGS,
ORGAN_SLOT_APPENDIX,
ORGAN_SLOT_EYES,
ORGAN_SLOT_EARS,
ORGAN_SLOT_TONGUE,
ORGAN_SLOT_LIVER,
ORGAN_SLOT_STOMACH,
)
for(var/slot in organ_slots)
var/obj/item/organ/existing_organ = organ_holder.get_organ_slot(slot)
var/obj/item/organ/new_organ = get_mutant_organ_type_for_slot(slot)
if(isnull(new_organ)) // if they aren't suppose to have an organ here, remove it
if(existing_organ)
existing_organ.Remove(organ_holder, special = TRUE)
qdel(existing_organ)
continue
// we don't want to remove organs that are not the default for this species
if(!isnull(existing_organ))
if(!isnull(old_species) && existing_organ.type != old_species.get_mutant_organ_type_for_slot(slot))
continue
else if(!replace_current && existing_organ.type != get_mutant_organ_type_for_slot(slot))
continue
// at this point we already know new_organ is not null
if(existing_organ?.type == new_organ)
continue // we don't want to remove organs that are the same as the new one
if(visual_only && !initial(new_organ.visual))
continue
var/used_neworgan = FALSE
new_organ = SSwardrobe.provide_type(new_organ)
var/should_have = new_organ.get_availability(src, organ_holder)
// Check for an existing organ, and if there is one check to see if we should remove it
var/health_pct = 1
var/remove_existing = !isnull(existing_organ) && !(existing_organ.zone in excluded_zones) && !(existing_organ.organ_flags & ORGAN_UNREMOVABLE)
if(remove_existing)
health_pct = (existing_organ.maxHealth - existing_organ.damage) / existing_organ.maxHealth
if(slot == ORGAN_SLOT_BRAIN)
var/obj/item/organ/internal/brain/existing_brain = existing_organ
existing_brain.before_organ_replacement(new_organ)
existing_brain.Remove(organ_holder, special = TRUE, movement_flags = NO_ID_TRANSFER)
else
existing_organ.before_organ_replacement(new_organ)
existing_organ.Remove(organ_holder, special = TRUE)
QDEL_NULL(existing_organ)
if(isnull(existing_organ) && should_have && !(new_organ.zone in excluded_zones) && organ_holder.get_bodypart(deprecise_zone(new_organ.zone)))
used_neworgan = TRUE
new_organ.set_organ_damage(new_organ.maxHealth * (1 - health_pct))
new_organ.Insert(organ_holder, special = TRUE, movement_flags = DELETE_IF_REPLACED)
if(!used_neworgan)
QDEL_NULL(new_organ)
if(!isnull(old_species))
for(var/mutant_organ in old_species.mutant_organs)
if(mutant_organ in mutant_organs)
continue // need this mutant organ, but we already have it!
var/obj/item/organ/current_organ = organ_holder.get_organ_by_type(mutant_organ)
if(current_organ)
current_organ.Remove(organ_holder)
QDEL_NULL(current_organ)
for(var/obj/item/organ/external/external_organ in organ_holder.organs)
// External organ checking. We need to check the external organs owned by the carbon itself,
// because we want to also remove ones not shared by its species.
// This should be done even if species was not changed.
if(external_organ in external_organs)
continue // Don't remove external organs this species is supposed to have.
external_organ.Remove(organ_holder)
QDEL_NULL(external_organ)
var/list/species_organs = mutant_organs + external_organs
for(var/organ_path in species_organs)
var/obj/item/organ/current_organ = organ_holder.get_organ_by_type(organ_path)
if(ispath(organ_path, /obj/item/organ/external) && !should_external_organ_apply_to(organ_path, organ_holder))
if(!isnull(current_organ) && replace_current)
// if we have an organ here and we're replacing organs, remove it
current_organ.Remove(organ_holder)
QDEL_NULL(current_organ)
continue
if(!current_organ || replace_current)
var/obj/item/organ/replacement = SSwardrobe.provide_type(organ_path)
// If there's an existing mutant organ, we're technically replacing it.
// Let's abuse the snowflake proc that skillchips added. Basically retains
// feature parity with every other organ too.
if(current_organ)
current_organ.before_organ_replacement(replacement)
// organ.Insert will qdel any current organs in that slot, so we don't need to.
replacement.Insert(organ_holder, special=TRUE, movement_flags = DELETE_IF_REPLACED)
/datum/species/proc/worn_items_fit_body_check(mob/living/carbon/wearer)
for(var/obj/item/equipped_item in wearer.get_all_worn_items())
var/equipped_item_slot = wearer.get_slot_by_item(equipped_item)
if(!equipped_item.mob_can_equip(wearer, equipped_item_slot, bypass_equip_delay_self = TRUE, ignore_equipped = TRUE))
wearer.dropItemToGround(equipped_item, force = TRUE)
/datum/species/proc/update_no_equip_flags(mob/living/carbon/wearer, new_flags)
no_equip_flags = new_flags
wearer.hud_used?.update_locked_slots()
worn_items_fit_body_check(wearer)
/**
* Normalizes blood in a human if it is excessive. If it is above BLOOD_VOLUME_NORMAL, this will clamp it to that value. It will not give the human more blodo than they have less than this value.
*/
/datum/species/proc/normalize_blood(mob/living/carbon/human/blood_possessing_human)
var/normalized_blood_values = max(blood_possessing_human.blood_volume, 0, BLOOD_VOLUME_NORMAL)
blood_possessing_human.blood_volume = normalized_blood_values
/**
* Proc called when a carbon becomes this species.
*
* This sets up and adds/changes/removes things, qualities, abilities, and traits so that the transformation is as smooth and bugfree as possible.
* Produces a [COMSIG_SPECIES_GAIN] signal.
* Arguments:
* * C - Carbon, this is whoever became the new species.
* * old_species - The species that the carbon used to be before becoming this race, used for regenerating organs.
* * pref_load - Preferences to be loaded from character setup, loads in preferred mutant things like bodyparts, digilegs, skin color, etc.
*/
/datum/species/proc/on_species_gain(mob/living/carbon/human/human_who_gained_species, datum/species/old_species, pref_load)
SHOULD_CALL_PARENT(TRUE)
// Drop the items the new species can't wear
if(human_who_gained_species.hud_used)
human_who_gained_species.hud_used.update_locked_slots()
human_who_gained_species.mob_biotypes = inherent_biotypes
human_who_gained_species.mob_respiration_type = inherent_respiration_type
human_who_gained_species.butcher_results = knife_butcher_results?.Copy()
if(old_species.type != type)
replace_body(human_who_gained_species, src)
regenerate_organs(human_who_gained_species, old_species, visual_only = human_who_gained_species.visual_only_organs)
// Drop the items the new species can't wear
INVOKE_ASYNC(src, PROC_REF(worn_items_fit_body_check), human_who_gained_species, TRUE)
//Assigns exotic blood type if the species has one
if(exotic_bloodtype && human_who_gained_species.dna.blood_type != exotic_bloodtype)
human_who_gained_species.dna.blood_type = exotic_bloodtype
//Otherwise, check if the previous species had an exotic bloodtype and we do not have one and assign a random blood type
//(why the fuck is blood type not tied to a fucking DNA block?)
else if(old_species.exotic_bloodtype && !exotic_bloodtype)
human_who_gained_species.dna.blood_type = random_blood_type()
//Resets blood if it is excessively high so they don't gib
normalize_blood(human_who_gained_species)
if(ishuman(human_who_gained_species))
var/mob/living/carbon/human/human = human_who_gained_species
for(var/obj/item/organ/external/organ_path as anything in external_organs)
if(!should_external_organ_apply_to(organ_path, human))
continue
//Load a persons preferences from DNA
var/obj/item/organ/external/new_organ = SSwardrobe.provide_type(organ_path)
new_organ.Insert(human, special=TRUE, movement_flags = DELETE_IF_REPLACED)
if(length(inherent_traits))
human_who_gained_species.add_traits(inherent_traits, SPECIES_TRAIT)
if(inherent_factions)
for(var/i in inherent_factions)
human_who_gained_species.faction += i //Using +=/-= for this in case you also gain the faction from a different source.
// All languages associated with this language holder are added with source [LANGUAGE_SPECIES]
// rather than source [LANGUAGE_ATOM], so we can track what to remove if our species changes again
var/datum/language_holder/gaining_holder = GLOB.prototype_language_holders[species_language_holder]
for(var/language in gaining_holder.understood_languages)
human_who_gained_species.grant_language(language, UNDERSTOOD_LANGUAGE, LANGUAGE_SPECIES)
for(var/language in gaining_holder.spoken_languages)
human_who_gained_species.grant_language(language, SPOKEN_LANGUAGE, LANGUAGE_SPECIES)
for(var/language in gaining_holder.blocked_languages)
human_who_gained_species.add_blocked_language(language, LANGUAGE_SPECIES)
human_who_gained_species.regenerate_icons()
SEND_SIGNAL(human_who_gained_species, COMSIG_SPECIES_GAIN, src, old_species)
properly_gained = TRUE
/**
* Proc called when a carbon is no longer this species.
*
* This sets up and adds/changes/removes things, qualities, abilities, and traits so that the transformation is as smooth and bugfree as possible.
* Produces a [COMSIG_SPECIES_LOSS] signal.
* Arguments:
* * C - Carbon, this is whoever lost this species.
* * new_species - The new species that the carbon became, used for genetics mutations.
* * pref_load - Preferences to be loaded from character setup, loads in preferred mutant things like bodyparts, digilegs, skin color, etc.
*/
/datum/species/proc/on_species_loss(mob/living/carbon/human/C, datum/species/new_species, pref_load)
SHOULD_CALL_PARENT(TRUE)
C.butcher_results = null
for(var/X in inherent_traits)
REMOVE_TRAIT(C, X, SPECIES_TRAIT)
for(var/obj/item/organ/external/organ in C.organs)
organ.Remove(C)
qdel(organ)
//If their inert mutation is not the same, swap it out
if((inert_mutation != new_species.inert_mutation) && LAZYLEN(C.dna.mutation_index) && (inert_mutation in C.dna.mutation_index))
C.dna.remove_mutation(inert_mutation)
//keep it at the right spot, so we can't have people taking shortcuts
var/location = C.dna.mutation_index.Find(inert_mutation)
C.dna.mutation_index[location] = new_species.inert_mutation
C.dna.default_mutation_genes[location] = C.dna.mutation_index[location]
C.dna.mutation_index[new_species.inert_mutation] = create_sequence(new_species.inert_mutation)
C.dna.default_mutation_genes[new_species.inert_mutation] = C.dna.mutation_index[new_species.inert_mutation]
if(inherent_factions)
for(var/i in inherent_factions)
C.faction -= i
clear_tail_moodlets(C)
// Removes all languages previously associated with [LANGUAGE_SPECIES], gaining our new species will add new ones back
var/datum/language_holder/losing_holder = GLOB.prototype_language_holders[species_language_holder]
for(var/language in losing_holder.understood_languages)
C.remove_language(language, UNDERSTOOD_LANGUAGE, LANGUAGE_SPECIES)
for(var/language in losing_holder.spoken_languages)
C.remove_language(language, SPOKEN_LANGUAGE, LANGUAGE_SPECIES)
for(var/language in losing_holder.blocked_languages)
C.remove_blocked_language(language, LANGUAGE_SPECIES)
SEND_SIGNAL(C, COMSIG_SPECIES_LOSS, src)
/**
* Handles the body of a human
*
* Handles lipstick, having no eyes, eye color, undergarnments like underwear, undershirts, and socks, and body layers.
* Calls [handle_mutant_bodyparts][/datum/species/proc/handle_mutant_bodyparts]
* Arguments:
* * species_human - Human, whoever we're handling the body for
*/
/datum/species/proc/handle_body(mob/living/carbon/human/species_human)
species_human.remove_overlay(BODY_LAYER)
if(HAS_TRAIT(species_human, TRAIT_INVISIBLE_MAN))
return handle_mutant_bodyparts(species_human)
var/list/standing = list()
if(!HAS_TRAIT(species_human, TRAIT_HUSK))
var/obj/item/bodypart/head/noggin = species_human.get_bodypart(BODY_ZONE_HEAD)
if(noggin?.head_flags & HEAD_EYESPRITES)
// eyes (missing eye sprites get handled by the head itself, but sadly we have to do this stupid shit here, for now)
var/obj/item/organ/internal/eyes/eye_organ = species_human.get_organ_slot(ORGAN_SLOT_EYES)
if(eye_organ)
eye_organ.refresh(call_update = FALSE)
standing += eye_organ.generate_body_overlay(species_human)
// organic body markings (oh my god this is terrible please rework this to be done on the limbs themselves i beg you)
if(HAS_TRAIT(species_human, TRAIT_HAS_MARKINGS))
var/obj/item/bodypart/chest/chest = species_human.get_bodypart(BODY_ZONE_CHEST)
var/obj/item/bodypart/arm/right/right_arm = species_human.get_bodypart(BODY_ZONE_R_ARM)
var/obj/item/bodypart/arm/left/left_arm = species_human.get_bodypart(BODY_ZONE_L_ARM)
var/obj/item/bodypart/leg/right/right_leg = species_human.get_bodypart(BODY_ZONE_R_LEG)
var/obj/item/bodypart/leg/left/left_leg = species_human.get_bodypart(BODY_ZONE_L_LEG)
var/datum/sprite_accessory/markings = GLOB.moth_markings_list[species_human.dna.features["moth_markings"]]
var/mutable_appearance/marking = mutable_appearance(layer = -BODY_LAYER, appearance_flags = KEEP_TOGETHER)
if(noggin && (IS_ORGANIC_LIMB(noggin)))
var/mutable_appearance/markings_head_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_head")
marking.overlays += markings_head_overlay
if(chest && (IS_ORGANIC_LIMB(chest)))
var/mutable_appearance/markings_chest_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_chest")
marking.overlays += markings_chest_overlay
if(right_arm && (IS_ORGANIC_LIMB(right_arm)))
var/mutable_appearance/markings_r_arm_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_r_arm")
marking.overlays += markings_r_arm_overlay
if(left_arm && (IS_ORGANIC_LIMB(left_arm)))
var/mutable_appearance/markings_l_arm_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_l_arm")
marking.overlays += markings_l_arm_overlay
if(right_leg && (IS_ORGANIC_LIMB(right_leg)))
var/mutable_appearance/markings_r_leg_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_r_leg")
marking.overlays += markings_r_leg_overlay
if(left_leg && (IS_ORGANIC_LIMB(left_leg)))
var/mutable_appearance/markings_l_leg_overlay = mutable_appearance(markings.icon, "[markings.icon_state]_l_leg")
marking.overlays += markings_l_leg_overlay
standing += marking
//Underwear, Undershirts & Socks
if(!HAS_TRAIT(species_human, TRAIT_NO_UNDERWEAR))
if(species_human.underwear)
var/datum/sprite_accessory/underwear/underwear = GLOB.underwear_list[species_human.underwear]
var/mutable_appearance/underwear_overlay
if(underwear)
if(species_human.dna.species.sexes && species_human.physique == FEMALE && (underwear.gender == MALE))
underwear_overlay = wear_female_version(underwear.icon_state, underwear.icon, BODY_LAYER, FEMALE_UNIFORM_FULL)
else
underwear_overlay = mutable_appearance(underwear.icon, underwear.icon_state, -BODY_LAYER)
if(!underwear.use_static)
underwear_overlay.color = species_human.underwear_color
standing += underwear_overlay
if(species_human.undershirt)
var/datum/sprite_accessory/undershirt/undershirt = GLOB.undershirt_list[species_human.undershirt]
if(undershirt)
var/mutable_appearance/working_shirt
if(species_human.dna.species.sexes && species_human.physique == FEMALE)
working_shirt = wear_female_version(undershirt.icon_state, undershirt.icon, BODY_LAYER)
else
working_shirt = mutable_appearance(undershirt.icon, undershirt.icon_state, -BODY_LAYER)
standing += working_shirt
if(species_human.socks && species_human.num_legs >= 2 && !(species_human.bodyshape & BODYSHAPE_DIGITIGRADE))
var/datum/sprite_accessory/socks/socks = GLOB.socks_list[species_human.socks]
if(socks)
standing += mutable_appearance(socks.icon, socks.icon_state, -BODY_LAYER)
if(standing.len)
species_human.overlays_standing[BODY_LAYER] = standing
species_human.apply_overlay(BODY_LAYER)
handle_mutant_bodyparts(species_human)
/**
* Handles the mutant bodyparts of a human
*
* Handles the adding and displaying of, layers, colors, and overlays of mutant bodyparts and accessories.
* Handles digitigrade leg displaying and squishing.
* Arguments:
* * H - Human, whoever we're handling the body for
* * forced_colour - The forced color of an accessory. Leave null to use mutant color.
*/
/datum/species/proc/handle_mutant_bodyparts(mob/living/carbon/human/source, forced_colour)
var/list/bodyparts_to_add = mutant_bodyparts.Copy()
var/list/relevent_layers = list(BODY_BEHIND_LAYER, BODY_ADJ_LAYER, BODY_FRONT_LAYER)
var/list/standing = list()
source.remove_overlay(BODY_BEHIND_LAYER)
source.remove_overlay(BODY_ADJ_LAYER)
source.remove_overlay(BODY_FRONT_LAYER)
if(!mutant_bodyparts || HAS_TRAIT(source, TRAIT_INVISIBLE_MAN))
return
var/obj/item/bodypart/head/noggin = source.get_bodypart(BODY_ZONE_HEAD)
if(mutant_bodyparts["ears"])
if(!source.dna.features["ears"] || source.dna.features["ears"] == "None" || source.head && (source.head.flags_inv & HIDEHAIR) || (source.wear_mask && (source.wear_mask.flags_inv & HIDEHAIR)) || !noggin || IS_ROBOTIC_LIMB(noggin))
bodyparts_to_add -= "ears"
if(!bodyparts_to_add)
return
var/g = (source.physique == FEMALE) ? "f" : "m"
for(var/layer in relevent_layers)
var/layertext = mutant_bodyparts_layertext(layer)
for(var/bodypart in bodyparts_to_add)
var/datum/sprite_accessory/accessory
switch(bodypart)
if("ears")
accessory = GLOB.ears_list[source.dna.features["ears"]]
if("body_markings")
accessory = GLOB.body_markings_list[source.dna.features["body_markings"]]
if("legs")
accessory = GLOB.legs_list[source.dna.features["legs"]]
if(!accessory || accessory.icon_state == "none")
continue
var/mutable_appearance/accessory_overlay = mutable_appearance(accessory.icon, layer = -layer)
if(accessory.gender_specific)
accessory_overlay.icon_state = "[g]_[bodypart]_[accessory.icon_state]_[layertext]"
else
accessory_overlay.icon_state = "m_[bodypart]_[accessory.icon_state]_[layertext]"
if(accessory.em_block)
accessory_overlay.overlays += emissive_blocker(accessory_overlay.icon, accessory_overlay.icon_state, source, accessory_overlay.alpha)
if(accessory.center)
accessory_overlay = center_image(accessory_overlay, accessory.dimension_x, accessory.dimension_y)
if(!(HAS_TRAIT(source, TRAIT_HUSK)))
if(!forced_colour)
switch(accessory.color_src)
if(MUTANT_COLOR)
accessory_overlay.color = fixed_mut_color || source.dna.features["mcolor"]
if(HAIR_COLOR)
accessory_overlay.color = get_fixed_hair_color(source) || source.hair_color
if(FACIAL_HAIR_COLOR)
accessory_overlay.color = get_fixed_hair_color(source) || source.facial_hair_color
if(EYE_COLOR)
accessory_overlay.color = source.eye_color_left
else
accessory_overlay.color = forced_colour
standing += accessory_overlay
if(accessory.hasinner)
var/mutable_appearance/inner_accessory_overlay = mutable_appearance(accessory.icon, layer = -layer)
if(accessory.gender_specific)
inner_accessory_overlay.icon_state = "[g]_[bodypart]inner_[accessory.icon_state]_[layertext]"
else
inner_accessory_overlay.icon_state = "m_[bodypart]inner_[accessory.icon_state]_[layertext]"
if(accessory.center)
inner_accessory_overlay = center_image(inner_accessory_overlay, accessory.dimension_x, accessory.dimension_y)
standing += inner_accessory_overlay
source.overlays_standing[layer] = standing.Copy()
standing = list()
source.apply_overlay(BODY_BEHIND_LAYER)
source.apply_overlay(BODY_ADJ_LAYER)
source.apply_overlay(BODY_FRONT_LAYER)
//This exists so sprite accessories can still be per-layer without having to include that layer's
//number in their sprite name, which causes issues when those numbers change.
/datum/species/proc/mutant_bodyparts_layertext(layer)
switch(layer)
if(BODY_BEHIND_LAYER)
return "BEHIND"
if(BODY_ADJ_LAYER)
return "ADJ"
if(BODY_FRONT_LAYER)
return "FRONT"
///Proc that will randomise the hair, or primary appearance element (i.e. for moths wings) of a species' associated mob
/datum/species/proc/randomize_main_appearance_element(mob/living/carbon/human/human_mob)
human_mob.set_hairstyle(random_hairstyle(human_mob.gender), update = FALSE)
///Proc that will randomise the underwear (i.e. top, pants and socks) of a species' associated mob,
/// but will not update the body right away.
/datum/species/proc/randomize_active_underwear_only(mob/living/carbon/human/human_mob)
human_mob.undershirt = random_undershirt(human_mob.gender)
human_mob.underwear = random_underwear(human_mob.gender)
human_mob.socks = random_socks(human_mob.gender)
///Proc that will randomise the underwear (i.e. top, pants and socks) of a species' associated mob
/datum/species/proc/randomize_active_underwear(mob/living/carbon/human/human_mob)
randomize_active_underwear_only(human_mob)
human_mob.update_body()
/datum/species/proc/randomize_active_features(mob/living/carbon/human/human_mob)
var/list/new_features = randomize_features()
for(var/feature_key in new_features)
human_mob.dna.features[feature_key] = new_features[feature_key]
human_mob.updateappearance(mutcolor_update = TRUE)
/**
* Returns a list of features, randomized, to be used by DNA
*/
/datum/species/proc/randomize_features()
SHOULD_CALL_PARENT(TRUE)
var/list/new_features = list()
var/static/list/organs_to_randomize = list()
for(var/obj/item/organ/external/organ_path as anything in external_organs)
var/overlay_path = initial(organ_path.bodypart_overlay)
var/datum/bodypart_overlay/mutant/sample_overlay = organs_to_randomize[overlay_path]
if(isnull(sample_overlay))
sample_overlay = new overlay_path()
organs_to_randomize[overlay_path] = sample_overlay
new_features["[sample_overlay.feature_key]"] = pick(sample_overlay.get_global_feature_list())
return new_features
/datum/species/proc/spec_life(mob/living/carbon/human/H, seconds_per_tick, times_fired)
SHOULD_CALL_PARENT(TRUE)
if(H.stat == DEAD)
return
if(HAS_TRAIT(H, TRAIT_NOBREATH) && (H.health < H.crit_threshold) && !HAS_TRAIT(H, TRAIT_NOCRITDAMAGE))
H.adjustBruteLoss(0.5 * seconds_per_tick)
/datum/species/proc/can_equip(obj/item/I, slot, disable_warning, mob/living/carbon/human/H, bypass_equip_delay_self = FALSE, ignore_equipped = FALSE, indirect_action = FALSE)
if(no_equip_flags & slot)
if(!I.species_exception || !is_type_in_list(src, I.species_exception))
return FALSE
// if there's an item in the slot we want, fail
if(!ignore_equipped)
if(H.get_item_by_slot(slot))
return FALSE
// this check prevents us from equipping something to a slot it doesn't support, WITH the exceptions of storage slots (pockets, suit storage, and backpacks)
// we don't require having those slots defined in the item's slot_flags, so we'll rely on their own checks further down
if(!(I.slot_flags & slot))
var/excused = FALSE
// Anything that's small or smaller can fit into a pocket by default
if((slot & (ITEM_SLOT_RPOCKET|ITEM_SLOT_LPOCKET)) && I.w_class <= POCKET_WEIGHT_CLASS)
excused = TRUE
else if(slot & (ITEM_SLOT_SUITSTORE|ITEM_SLOT_BACKPACK|ITEM_SLOT_HANDS))
excused = TRUE
if(!excused)
return FALSE
switch(slot)
if(ITEM_SLOT_HANDS)
if(H.get_empty_held_indexes())
return TRUE
return FALSE
if(ITEM_SLOT_MASK)
if(!H.get_bodypart(BODY_ZONE_HEAD))
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_NECK)
return TRUE
if(ITEM_SLOT_BACK)
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_OCLOTHING)
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_GLOVES)
if(H.num_hands < 2)
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_FEET)
if(H.num_legs < 2)
return FALSE
if((H.bodyshape & BODYSHAPE_DIGITIGRADE) && !(I.item_flags & IGNORE_DIGITIGRADE))
if(!(I.supports_variations_flags & (CLOTHING_DIGITIGRADE_VARIATION|CLOTHING_DIGITIGRADE_VARIATION_NO_NEW_ICON)))
if(!disable_warning)
to_chat(H, span_warning("The footwear around here isn't compatible with your feet!"))
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_BELT)
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST)
if(!H.w_uniform && !HAS_TRAIT(H, TRAIT_NO_JUMPSUIT) && (!O || IS_ORGANIC_LIMB(O)))
if(!disable_warning)
to_chat(H, span_warning("You need a jumpsuit before you can attach this [I.name]!"))
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_EYES)
if(!H.get_bodypart(BODY_ZONE_HEAD))
return FALSE
var/obj/item/organ/internal/eyes/eyes = H.get_organ_slot(ORGAN_SLOT_EYES)
if(eyes?.no_glasses)
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_HEAD)
if(!H.get_bodypart(BODY_ZONE_HEAD))
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_EARS)
if(!H.get_bodypart(BODY_ZONE_HEAD))
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_ICLOTHING)
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_ID)
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_CHEST)
if(!H.w_uniform && !HAS_TRAIT(H, TRAIT_NO_JUMPSUIT) && (!O || IS_ORGANIC_LIMB(O)))
if(!disable_warning)
to_chat(H, span_warning("You need a jumpsuit before you can attach this [I.name]!"))
return FALSE
return equip_delay_self_check(I, H, bypass_equip_delay_self)
if(ITEM_SLOT_LPOCKET)
if(HAS_TRAIT(I, TRAIT_NODROP)) //Pockets aren't visible, so you can't move TRAIT_NODROP items into them.
return FALSE
if(!isnull(H.l_store) && H.l_store != I) // no pocket swaps at all
return FALSE
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_L_LEG)
if(!H.w_uniform && !HAS_TRAIT(H, TRAIT_NO_JUMPSUIT) && (!O || IS_ORGANIC_LIMB(O)))
if(!disable_warning)
to_chat(H, span_warning("You need a jumpsuit before you can attach this [I.name]!"))
return FALSE
return TRUE
if(ITEM_SLOT_RPOCKET)
if(HAS_TRAIT(I, TRAIT_NODROP))
return FALSE
if(!isnull(H.r_store) && H.r_store != I)
return FALSE
var/obj/item/bodypart/O = H.get_bodypart(BODY_ZONE_R_LEG)
if(!H.w_uniform && !HAS_TRAIT(H, TRAIT_NO_JUMPSUIT) && (!O || IS_ORGANIC_LIMB(O)))
if(!disable_warning)
to_chat(H, span_warning("You need a jumpsuit before you can attach this [I.name]!"))
return FALSE
return TRUE
if(ITEM_SLOT_SUITSTORE)
if(HAS_TRAIT(I, TRAIT_NODROP))
return FALSE
if(!H.wear_suit)
if(!disable_warning)
to_chat(H, span_warning("You need a suit before you can attach this [I.name]!"))
return FALSE
if(!H.wear_suit.allowed)
if(!disable_warning)
to_chat(H, span_warning("You somehow have a suit with no defined allowed items for suit storage, stop that."))
return FALSE
if(I.w_class > WEIGHT_CLASS_BULKY)
if(!disable_warning)
to_chat(H, span_warning("The [I.name] is too big to attach!")) //should be src?
return FALSE
if( istype(I, /obj/item/modular_computer/pda) || istype(I, /obj/item/pen) || is_type_in_list(I, H.wear_suit.allowed) )
return TRUE
return FALSE
if(ITEM_SLOT_HANDCUFFED)
if(!istype(I, /obj/item/restraints/handcuffs))
return FALSE
if(H.num_hands < 2)
return FALSE
return TRUE
if(ITEM_SLOT_LEGCUFFED)
if(!istype(I, /obj/item/restraints/legcuffs))
return FALSE
if(H.num_legs < 2)
return FALSE
return TRUE
if(ITEM_SLOT_BACKPACK)
if(H.back && H.back.atom_storage?.can_insert(I, H, messages = TRUE, force = indirect_action ? STORAGE_SOFT_LOCKED : STORAGE_NOT_LOCKED))
return TRUE
return FALSE
return FALSE //Unsupported slot
/datum/species/proc/equip_delay_self_check(obj/item/I, mob/living/carbon/human/H, bypass_equip_delay_self)
if(!I.equip_delay_self || bypass_equip_delay_self)
return TRUE
H.visible_message(span_notice("[H] start putting on [I]..."), span_notice("You start putting on [I]..."))
return do_after(H, I.equip_delay_self, target = H)
/// Equips the necessary species-relevant gear before putting on the rest of the uniform.
/datum/species/proc/pre_equip_species_outfit(datum/job/job, mob/living/carbon/human/equipping, visuals_only = FALSE)
return
/**
* Handling special reagent interactions.
*
* Return null continue running the normal on_mob_life() for that reagent.
* Return COMSIG_MOB_STOP_REAGENT_CHECK to not run the normal metabolism effects.
*
* NOTE: If you return COMSIG_MOB_STOP_REAGENT_CHECK, that reagent will not be removed liike normal! You must handle it manually.
**/
/datum/species/proc/handle_chemical(datum/reagent/chem, mob/living/carbon/human/affected, seconds_per_tick, times_fired)
SHOULD_CALL_PARENT(TRUE)
if(chem.type == exotic_blood)
affected.blood_volume = min(affected.blood_volume + round(chem.volume, 0.1), BLOOD_VOLUME_MAXIMUM)
affected.reagents.del_reagent(chem.type)
return COMSIG_MOB_STOP_REAGENT_CHECK
if(!chem.overdosed && chem.overdose_threshold && chem.volume >= chem.overdose_threshold && !HAS_TRAIT(affected, TRAIT_OVERDOSEIMMUNE))
chem.overdosed = TRUE
chem.overdose_start(affected)
affected.log_message("has started overdosing on [chem.name] at [chem.volume] units.", LOG_GAME)
return SEND_SIGNAL(affected, COMSIG_SPECIES_HANDLE_CHEMICAL, chem, seconds_per_tick, times_fired)
/**
* Equip the outfit required for life. Replaces items currently worn.
*/
/datum/species/proc/give_important_for_life(mob/living/carbon/human/human_to_equip)
if(!outfit_important_for_life)
return
human_to_equip.equipOutfit(outfit_important_for_life)
/**