Files
GS13NG/code/modules/surgery/bodyparts/helpers.dm
Poojawa b393789f19 Character Creation Overhaul (#7987)
* Rebase fail. good thing I made back ups. c:

* Tails more or less done

* wouldn't update cleanly otherwise

* It's completly working now. holy fuck I did it

Just need the refurbished body markings done, then to chop 'em up for full PR status

* MARKINGS DONE AAAAAAAAAAAAA

* fixes digi legs that didn't convert correctly

* ports the refractored preferences

Kinda ugly now tbh. but fuckit

* quality sweep, things should should properly now in general

* Taurs converted and improved! BODYMARKING -> MATRIXED

* oops. s'what I get for not compile checking

* remember to throw shade at furries

* vigorously update markings upon switching species and colors

* re-adds old wolf ears, Big Wolf fixes snout bugs

* few more snout tweaks

* cut the lists, cut everything. reeee

* This code I s2g

* Adds context clues to preferences

Hopefully people will read them before making an OOC fuss

* Fixes hands and feet markings with this one weird trick

remember kids, proper layering and order of operations is important

* Sprite tweaking and polishing

Sergal stuff being worked on

* a few QoL things for species swapping

* how the fuck did I miss these markings

* fleshes out sprites in preperation for marking experimentation later

* fixes catboy problems

* Mam_snout is a thing now,

* pixel adjusted tails, cleaned up wah tail a bit better

also gets digitgate legs missing pixels fixed

* cleans up more shit. ree

* force "plain" instead of none to avoid missing pixel reports

* tweaks to reinspire mapdiff

* Clean up Preference UI

Looks a little better now

* k

* doubly ensure None markings aren't valid

* reee spessman barbie

* brightens pixels around tiger head markings

* YEENS

* Cat ears tweaked because it triggers Kev otherwise

* another session of quality control

* Crows and crow accessories

* husk fixes

* works good enough, mission accomplished

* fixes the proc properly

* cleans up brute force code that isn't needed

* c a t
2019-02-22 05:59:05 -08:00

316 lines
7.8 KiB
Plaintext

/mob/living/proc/get_bodypart(zone)
return
/mob/living/carbon/get_bodypart(zone)
if(!zone)
zone = BODY_ZONE_CHEST
for(var/X in bodyparts)
var/obj/item/bodypart/L = X
if(L.body_zone == zone)
return L
/mob/living/carbon/has_hand_for_held_index(i)
if(i)
var/obj/item/bodypart/L = hand_bodyparts[i]
if(L && !L.disabled)
return L
return FALSE
/mob/proc/has_left_hand(check_disabled = TRUE)
return TRUE
/mob/living/carbon/has_left_hand(check_disabled = TRUE)
for(var/obj/item/bodypart/L in hand_bodyparts)
if(L.held_index % 2)
if(!check_disabled || !L.disabled)
return TRUE
return FALSE
/mob/living/carbon/alien/larva/has_left_hand()
return 1
/mob/proc/has_right_hand(check_disabled = TRUE)
return TRUE
/mob/living/carbon/has_right_hand(check_disabled = TRUE)
for(var/obj/item/bodypart/L in hand_bodyparts)
if(!(L.held_index % 2))
if(!check_disabled || !L.disabled)
return TRUE
return FALSE
/mob/living/carbon/alien/larva/has_right_hand()
return 1
//Limb numbers
/mob/proc/get_num_arms(check_disabled = TRUE)
return 2
/mob/living/carbon/get_num_arms(check_disabled = TRUE)
. = 0
for(var/X in bodyparts)
var/obj/item/bodypart/affecting = X
if(affecting.body_part == ARM_RIGHT)
if(!check_disabled || !affecting.disabled)
.++
if(affecting.body_part == ARM_LEFT)
if(!check_disabled || !affecting.disabled)
.++
//sometimes we want to ignore that we don't have the required amount of arms.
/mob/proc/get_arm_ignore()
return 0
/mob/living/carbon/alien/larva/get_arm_ignore()
return 1 //so we can still handcuff larvas.
/mob/proc/get_num_legs(check_disabled = TRUE)
return 2
/mob/living/carbon/get_num_legs(check_disabled = TRUE)
. = 0
for(var/X in bodyparts)
var/obj/item/bodypart/affecting = X
if(affecting.body_part == LEG_RIGHT)
if(!check_disabled || !affecting.disabled)
.++
if(affecting.body_part == LEG_LEFT)
if(!check_disabled || !affecting.disabled)
.++
//sometimes we want to ignore that we don't have the required amount of legs.
/mob/proc/get_leg_ignore()
return FALSE
/mob/living/carbon/alien/larva/get_leg_ignore()
return TRUE
/mob/living/carbon/human/get_leg_ignore()
if((movement_type & FLYING) || floating)
return TRUE
return FALSE
/mob/living/proc/get_missing_limbs()
return list()
/mob/living/carbon/get_missing_limbs()
var/list/full = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
for(var/zone in full)
if(get_bodypart(zone))
full -= zone
return full
/mob/living/carbon/alien/larva/get_missing_limbs()
var/list/full = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST)
for(var/zone in full)
if(get_bodypart(zone))
full -= zone
return full
/mob/living/proc/get_disabled_limbs()
return list()
/mob/living/carbon/get_disabled_limbs()
var/list/full = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST, BODY_ZONE_R_ARM, BODY_ZONE_L_ARM, BODY_ZONE_R_LEG, BODY_ZONE_L_LEG)
var/list/disabled = list()
for(var/zone in full)
var/obj/item/bodypart/affecting = get_bodypart(zone)
if(affecting && affecting.disabled)
disabled += zone
return disabled
/mob/living/carbon/alien/larva/get_disabled_limbs()
var/list/full = list(BODY_ZONE_HEAD, BODY_ZONE_CHEST)
var/list/disabled = list()
for(var/zone in full)
var/obj/item/bodypart/affecting = get_bodypart(zone)
if(affecting && affecting.disabled)
disabled += zone
return disabled
//Remove all embedded objects from all limbs on the carbon mob
/mob/living/carbon/proc/remove_all_embedded_objects()
var/turf/T = get_turf(src)
for(var/X in bodyparts)
var/obj/item/bodypart/L = X
for(var/obj/item/I in L.embedded_objects)
L.embedded_objects -= I
I.forceMove(T)
clear_alert("embeddedobject")
SEND_SIGNAL(src, COMSIG_CLEAR_MOOD_EVENT, "embedded")
/mob/living/carbon/proc/has_embedded_objects()
. = 0
for(var/X in bodyparts)
var/obj/item/bodypart/L = X
for(var/obj/item/I in L.embedded_objects)
return 1
//Helper for quickly creating a new limb - used by augment code in species.dm spec_attacked_by
/mob/living/carbon/proc/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if(BODY_ZONE_L_ARM)
L = new /obj/item/bodypart/l_arm()
if(BODY_ZONE_R_ARM)
L = new /obj/item/bodypart/r_arm()
if(BODY_ZONE_HEAD)
L = new /obj/item/bodypart/head()
if(BODY_ZONE_L_LEG)
L = new /obj/item/bodypart/l_leg()
if(BODY_ZONE_R_LEG)
L = new /obj/item/bodypart/r_leg()
if(BODY_ZONE_CHEST)
L = new /obj/item/bodypart/chest()
if(L)
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
/mob/living/carbon/monkey/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if(BODY_ZONE_L_ARM)
L = new /obj/item/bodypart/l_arm/monkey()
if(BODY_ZONE_R_ARM)
L = new /obj/item/bodypart/r_arm/monkey()
if(BODY_ZONE_HEAD)
L = new /obj/item/bodypart/head/monkey()
if(BODY_ZONE_L_LEG)
L = new /obj/item/bodypart/l_leg/monkey()
if(BODY_ZONE_R_LEG)
L = new /obj/item/bodypart/r_leg/monkey()
if(BODY_ZONE_CHEST)
L = new /obj/item/bodypart/chest/monkey()
if(L)
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
/mob/living/carbon/alien/larva/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if(BODY_ZONE_HEAD)
L = new /obj/item/bodypart/head/larva()
if(BODY_ZONE_CHEST)
L = new /obj/item/bodypart/chest/larva()
if(L)
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
/mob/living/carbon/alien/humanoid/newBodyPart(zone, robotic, fixed_icon)
var/obj/item/bodypart/L
switch(zone)
if(BODY_ZONE_L_ARM)
L = new /obj/item/bodypart/l_arm/alien()
if(BODY_ZONE_R_ARM)
L = new /obj/item/bodypart/r_arm/alien()
if(BODY_ZONE_HEAD)
L = new /obj/item/bodypart/head/alien()
if(BODY_ZONE_L_LEG)
L = new /obj/item/bodypart/l_leg/alien()
if(BODY_ZONE_R_LEG)
L = new /obj/item/bodypart/r_leg/alien()
if(BODY_ZONE_CHEST)
L = new /obj/item/bodypart/chest/alien()
if(L)
L.update_limb(fixed_icon, src)
if(robotic)
L.change_bodypart_status(BODYPART_ROBOTIC)
. = L
/proc/skintone2hex(skin_tone)
. = 0
switch(skin_tone)
if("caucasian1")
. = "ffe0d1"
if("caucasian2")
. = "fcccb3"
if("caucasian3")
. = "e8b59b"
if("latino")
. = "d9ae96"
if("mediterranean")
. = "c79b8b"
if("asian1")
. = "ffdeb3"
if("asian2")
. = "e3ba84"
if("arab")
. = "c4915e"
if("indian")
. = "b87840"
if("african1")
. = "754523"
if("african2")
. = "471c18"
if("albino")
. = "fff4e6"
if("orange")
. = "ffc905"
/mob/living/carbon/proc/Digitigrade_Leg_Swap(swap_back)
var/body_plan_changed = FALSE
for(var/X in bodyparts)
var/obj/item/bodypart/O = X
var/obj/item/bodypart/N
if((!O.use_digitigrade && swap_back == FALSE) || (O.use_digitigrade && swap_back == TRUE))
if(O.body_part == LEG_LEFT)
if(swap_back == TRUE)
N = new /obj/item/bodypart/l_leg
else
N = new /obj/item/bodypart/l_leg/digitigrade
else if(O.body_part == LEG_RIGHT)
if(swap_back == TRUE)
N = new /obj/item/bodypart/r_leg
else
N = new /obj/item/bodypart/r_leg/digitigrade
if(!N)
continue
body_plan_changed = TRUE
O.drop_limb(1)
qdel(O)
N.attach_limb(src)
if(body_plan_changed && ishuman(src))
var/mob/living/carbon/human/H = src
if(H.w_uniform)
var/obj/item/clothing/under/U = H.w_uniform
if(U.mutantrace_variation)
if(swap_back)
U.suit_style = NORMAL_SUIT_STYLE
else
U.suit_style = DIGITIGRADE_SUIT_STYLE
H.update_inv_w_uniform()
if(H.shoes)
var/obj/item/clothing/shoes/S = H.shoes
if(swap_back)
S.adjusted = NORMAL_STYLE
else
S.adjusted = ALT_STYLE
H.update_inv_shoes()
if(H.wear_suit)
var/obj/item/clothing/suit/S = H.wear_suit
if(swap_back)
S.adjusted = NORMAL_STYLE
else
S.adjusted = ALT_STYLE
H.update_inv_wear_suit()