Merge pull request #1995 from Cyantime/tfrefactor

TF refactor
This commit is contained in:
Spades
2017-08-13 05:16:40 -04:00
committed by GitHub
5 changed files with 392 additions and 407 deletions
+134 -406
View File
@@ -345,534 +345,262 @@
///////////////////////////// DM_TRANSFORM_HAIR_AND_EYES /////////////////////////////
if(digest_mode == DM_TRANSFORM_HAIR_AND_EYES && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
var/mob/living/carbon/human/O = owner
var/TFchance = 1 //This used to be RNG, resulting people waiting ages. This way does it instantly.
if(TFchance == 1)
if(P.r_hair != O.r_hair || P.g_hair != O.g_hair || P.b_hair != O.b_hair || P.r_skin != O.r_skin || P.g_skin != O.g_skin || P.b_skin != O.b_skin || P.r_facial != O.r_facial || P.g_facial != O.g_facial || P.b_facial != O.b_facial)
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P << "<span class='notice'>Your body tingles all over...</span>"
owner << "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>"
P.update_hair()
P.update_body()
P.updateicon()
if(O.nutrition > 400 && P.nutrition < 400)
O.nutrition -= 2
P.nutrition += 1.5
if(check_eyes(P) || check_hair(P))
change_eyes(P)
change_hair(P,1)
return
///////////////////////////// DM_TRANSFORM_MALE /////////////////////////////
if(digest_mode == DM_TRANSFORM_MALE && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
var/mob/living/carbon/human/O = owner
var/TFchance = 1
if(TFchance == 1)
var/TFmodify = rand(1,3)
if(TFmodify == 1 && P.r_eyes != O.r_eyes || P.g_eyes != O.g_eyes || P.b_eyes != O.b_eyes)
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
P << "<span class='notice'>You feel lightheaded and drowsy...</span>"
owner << "<span class='notice'>You feel warm as you make subtle changes to your captive's body.</span>"
P.update_eyes()
if(TFmodify == 2 && P.r_hair != O.r_hair || P.g_hair != O.g_hair || P.b_hair != O.b_hair || P.r_skin != O.r_skin || P.g_skin != O.g_skin || P.b_skin != O.b_skin || P.r_facial != O.r_facial || P.g_facial != O.g_facial || P.b_facial != O.b_facial)
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P << "<span class='notice'>Your body tingles all over...</span>"
owner << "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>"
P.update_hair()
P.update_body()
P.updateicon()
if(TFmodify == 3 && P.gender != MALE && P.identifying_gender != MALE)
P.gender = MALE
P.identifying_gender = MALE
P << "<span class='notice'>Your body feels very strange...</span>"
owner << "<span class='notice'>You feel strange as you alter your captive's gender.</span>"
P.update_body()
P.updateicon()
if(O.nutrition > 400 && P.nutrition < 400)
O.nutrition -= 2
P.nutrition += 1.5
if(check_eyes(P))
change_eyes(P,1)
continue
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
continue
if(check_gender(P,MALE))
change_gender(P,MALE,1)
return
///////////////////////////// DM_TRANSFORM_FEMALE /////////////////////////////
if(digest_mode == DM_TRANSFORM_FEMALE && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
var/mob/living/carbon/human/O = owner
var/TFchance = 1
if(TFchance == 1)
var/TFmodify = rand(1,3)
if(TFmodify == 1 && P.r_eyes != O.r_eyes || P.g_eyes != O.g_eyes || P.b_eyes != O.b_eyes)
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
P << "<span class='notice'>You feel lightheaded and drowsy...</span>"
owner << "<span class='notice'>You feel warm as your make subtle changes to your captive's body.</span>"
P.update_eyes()
if(TFmodify == 2 && P.r_hair != O.r_hair || P.g_hair != O.g_hair || P.b_hair != O.b_hair || P.r_skin != O.r_skin || P.g_skin != O.g_skin || P.b_skin != O.b_skin)
P.r_hair = O.r_hair
P.g_hair = O.g_hair
P.b_hair = O.b_hair
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P << "<span class='notice'>Your body tingles all over...</span>"
owner << "<span class='notice'>You tingle as your make noticeable changes to your captive's body.</span>"
P.update_hair()
P.update_body()
P.updateicon()
if(TFmodify == 3 && P.gender != FEMALE && P.identifying_gender != FEMALE)
P.f_style = "Shaved"
P.gender = FEMALE
P.identifying_gender = FEMALE
P << "<span class='notice'>Your body feels very strange...</span>"
owner << "<span class='notice'>You feel strange as you alter your captive's gender.</span>"
P.update_body()
P.updateicon()
if(O.nutrition > 400 && P.nutrition < 400)
O.nutrition -= 2
P.nutrition += 1.5
if(check_eyes(P))
change_eyes(P,1)
continue
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
continue
if(check_gender(P,FEMALE))
change_gender(P,FEMALE,1)
return
///////////////////////////// DM_TRANSFORM_KEEP_GENDER /////////////////////////////
if(digest_mode == DM_TRANSFORM_KEEP_GENDER && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
var/mob/living/carbon/human/O = owner
var/TFchance = 1
if(TFchance == 1)
var/TFmodify = rand(1,2)
if(TFmodify == 1 && P.r_eyes != O.r_eyes || P.g_eyes != O.g_eyes || P.b_eyes != O.b_eyes)
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
P << "<span class='notice'>You feel lightheaded and drowsy...</span>"
owner << "<span class='notice'>You feel warm as you make subtle changes to your captive's body.</span>"
P.update_eyes()
if(TFmodify == 2 && P.r_hair != O.r_hair || P.g_hair != O.g_hair || P.b_hair != O.b_hair || P.r_skin != O.r_skin || P.g_skin != O.g_skin || P.b_skin != O.b_skin || P.r_facial != O.r_facial || P.g_facial != O.g_facial || P.b_facial != O.b_facial)
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P << "<span class='notice'>Your body tingles all over...</span>"
owner << "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>"
P.update_hair()
P.update_body()
P.updateicon()
if(O.nutrition > 400 && P.nutrition < 400)
O.nutrition -= 2
P.nutrition += 1.5
if(check_eyes(P))
change_eyes(P,1)
continue
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
return
///////////////////////////// DM_TRANSFORM_CHANGE_SPECIES_AND_TAUR /////////////////////////////
if(digest_mode == DM_TRANSFORM_CHANGE_SPECIES_AND_TAUR && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
var/mob/living/carbon/human/O = owner
var/TFchance = 1 //This used to be RNG, resulting people waiting ages. This way does it instantly.
if(TFchance == 1)
if(P.species != O.species || P.tail_style != O.tail_style || P.custom_species != O.custom_species || P.ear_style != O.ear_style)
P.tail_style = O.tail_style
P.wing_style = O.wing_style
P.ear_style = O.ear_style
P.species = O.species
P.custom_species = O.custom_species
P.species.create_organs(P) //This is the only way to make it so Unathi TF doesn't result in people dying from organ rejection.
for(var/obj/item/organ/I in P.organs) //This prevents organ rejection
I.species = O.species
for(var/obj/item/organ/I in P.internal_organs) //This prevents organ rejection
I.species = O.species
for(var/obj/item/organ/external/Z in P.organs)//Just in case.
Z.sync_colour_to_human(P)
P << "<span class='notice'>You lose sensation of your body, feeling only the warmth of everything around you... </span>"
owner << "<span class='notice'>Your body shifts as you make dramatic changes to your captive's body.</span>"
P.fixblood()
P.update_body()
P.update_tail_showing()
P.updateicon()
if(O.nutrition > 400 && P.nutrition < 400)
O.nutrition -= 2
P.nutrition += 1.5
if(check_ears(P) || check_tail_nocolor(P) || check_wing_nocolor(P) || check_species(P))
change_ears(P)
change_tail_nocolor(P)
change_wing_nocolor(P)
change_species(P,1)
return
///////////////////////////// DM_TRANSFORM_REPLICA /////////////////////////////
if(digest_mode == DM_TRANSFORM_REPLICA && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
var/mob/living/carbon/human/O = owner
var/TFchance = 1 //This used to be RNG, resulting people waiting ages. This way does it instantly.
if(TFchance == 1)
var/TFmodify = rand(1,3)
if(TFmodify == 1 && P.r_eyes != O.r_eyes || P.g_eyes != O.g_eyes || P.b_eyes != O.b_eyes)
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
P << "<span class='notice'>You feel lightheaded and drowsy...</span>"
owner << "<span class='notice'>You feel warm as you make subtle changes to your captive's body.</span>"
P.update_eyes()
if(TFmodify == 2 && P.r_hair != O.r_hair || P.g_hair != O.g_hair || P.b_hair != O.b_hair || P.r_skin != O.r_skin || P.g_skin != O.g_skin || P.b_skin != O.b_skin || P.r_facial != O.r_facial || P.g_facial != O.g_facial || P.b_facial != O.b_facial)
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P << "<span class='notice'>Your body tingles all over...</span>"
owner << "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>"
P.update_hair()
P.update_body()
P.updateicon()
if(TFmodify == 3 && P.r_hair != O.r_hair || P.g_hair != O.g_hair || P.species != O.species || P.b_hair != O.b_hair || P.r_skin != O.r_skin || P.g_skin != O.g_skin || P.b_skin != O.b_skin || P.tail_style != O.tail_style || P.r_tail != O.r_tail || P.g_tail != O.g_tail || P.b_tail != O.b_tail || P.ear_style != O.ear_style || P.r_facial != O.r_facial || P.g_facial != O.g_facial || P.b_facial != O.b_facial || P.custom_species != O.custom_species)
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.tail_style = O.tail_style
P.wing_style = O.wing_style
P.r_tail = O.r_tail
P.g_tail = O.g_tail
P.b_tail = O.b_tail
P.ear_style = O.ear_style
P.species = O.species
P.custom_species = O.custom_species
P.species.create_organs(P)
for(var/obj/item/organ/I in P.organs)
I.species = O.species
for(var/obj/item/organ/I in P.internal_organs)
I.species = O.species
for(var/obj/item/organ/external/Z in P.organs)
Z.sync_colour_to_human(P)
P << "<span class='notice'>You lose sensation of your body, feeling only the warmth of everything around you... </span>"
owner << "<span class='notice'>Your body shifts as you make dramatic changes to your captive's body.</span>"
P.fixblood()
P.update_hair()
P.update_body()
P.update_tail_showing()
P.updateicon()
if(O.nutrition > 400 && P.nutrition < 400)
O.nutrition -= 2
P.nutrition += 1.5
if(check_eyes(P))
change_eyes(P,1)
continue
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
continue
if(check_ears(P) || check_tail(P) || check_wing(P) || check_species(P))
change_ears(P)
change_tail(P)
change_wing(P)
change_species(P,1)
return
///////////////////////////// DM_TRANSFORM_CHANGE_SPECIES_AND_TAUR_EGG /////////////////////////////
if(digest_mode == DM_TRANSFORM_CHANGE_SPECIES_AND_TAUR_EGG && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
if(P.absorbed) //If they're absorbed, don't egg them
return
var/mob/living/carbon/human/O = owner
if(check_ears(P) || check_tail_nocolor(P) || check_wing_nocolor(P)|| check_species(P))
change_ears(P)
change_tail_nocolor(P)
change_wing_nocolor(P)
change_species(P,1)
continue
P.tail_style = O.tail_style
P.wing_style = O.wing_style
P.ear_style = O.ear_style
P.species = O.species
P.custom_species = O.custom_species
P.species.create_organs(P)
for(var/obj/item/organ/I in P.organs)
I.species = O.species
for(var/obj/item/organ/I in P.internal_organs)
I.species = O.species
for(var/obj/item/organ/external/Z in P.organs)
Z.sync_colour_to_human(P)
P << "<span class='notice'>You lose sensation of your body, feeling only the warmth around you as are you as you're encased in an egg. </span>"
owner << "<span class='notice'>You shift as you make dramatic changes to your captive's body as you encase them in an egg.</span>"
P.fixblood()
P.update_hair()
P.update_body()
P.update_tail_showing()
P.update_eyes()
P.updateicon()
var/egg_path = /obj/structure/closet/secure_closet/egg //Full credit to Aronai for this version of the egg code.
var/egg_name = "Odd egg"
if(!P.absorbed)
put_in_egg(P,1)
if(O.egg_type in tf_egg_types)
egg_path = tf_egg_types[O.egg_type]
egg_name = "[O.egg_type] egg"
var/obj/structure/closet/secure_closet/egg/egg = new egg_path(get_turf(O))
P.forceMove(egg)
egg.name = egg_name
internal_contents -= P
return
///////////////////////////// DM_TRANSFORM_KEEP_GENDER_EGG /////////////////////////////
if(digest_mode == DM_TRANSFORM_KEEP_GENDER_EGG && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
if(P.absorbed) //If they're absorbed, don't egg them
return
var/mob/living/carbon/human/O = owner
if(check_eyes(P))
change_eyes(P,1)
continue
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
P << "<span class='notice'>Your body tingles all over...</span>"
owner << "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>"
P.update_hair()
P.update_body()
P.update_eyes()
P.updateicon()
var/egg_path = /obj/structure/closet/secure_closet/egg
var/egg_name = "Odd egg"
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
continue
if(O.egg_type in tf_egg_types)
egg_path = tf_egg_types[O.egg_type]
egg_name = "[O.egg_type] egg"
if(!P.absorbed)
put_in_egg(P,1)
var/obj/structure/closet/secure_closet/egg/egg = new egg_path(get_turf(O))
P.forceMove(egg)
egg.name = egg_name
internal_contents -= P
return
///////////////////////////// DM_TRANSFORM_REPLICA_EGG /////////////////////////////
if(digest_mode == DM_TRANSFORM_REPLICA_EGG && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
if(P.absorbed) //If they're absorbed, don't egg them
return
var/mob/living/carbon/human/O = owner
if(check_eyes(P))
change_eyes(P,1)
continue
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.tail_style = O.tail_style
P.wing_style = O.wing_style
P.r_tail = O.r_tail
P.g_tail = O.g_tail
P.b_tail = O.b_tail
P.ear_style = O.ear_style
P.h_style = O.h_style
P.species = O.species
P.custom_species = O.custom_species
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
continue
P.species.create_organs(P)
for(var/obj/item/organ/I in P.organs)
I.species = O.species
for(var/obj/item/organ/I in P.internal_organs)
I.species = O.species
for(var/obj/item/organ/external/Z in P.organs)
Z.sync_colour_to_human(P)
P << "<span class='notice'>You lose sensation of your body, feeling only the warmth around you as are you as you're encased in an egg. </span>"
owner << "<span class='notice'>You shift as you make dramatic changes to your captive's body as you encase them in an egg.</span>"
P.fixblood()
P.update_hair()
P.update_body()
P.update_tail_showing()
P.update_eyes()
P.updateicon()
var/egg_path = /obj/structure/closet/secure_closet/egg
var/egg_name = "Odd egg"
if(check_ears(P) || check_tail(P) || check_wing(P) || check_species(P))
change_ears(P)
change_tail(P)
change_wing(P)
change_species(P,1)
continue
if(O.egg_type in tf_egg_types)
egg_path = tf_egg_types[O.egg_type]
egg_name = "[O.egg_type] egg"
if(!P.absorbed)
put_in_egg(P,1)
var/obj/structure/closet/secure_closet/egg/egg = new egg_path(get_turf(O))
P.forceMove(egg)
egg.name = egg_name
internal_contents -= P
return
///////////////////////////// DM_TRANSFORM_MALE_EGG /////////////////////////////
if(digest_mode == DM_TRANSFORM_MALE_EGG && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
if(P.absorbed) //If they're absorbed, don't egg them
return
var/mob/living/carbon/human/O = owner
if(check_eyes(P))
change_eyes(P,1)
continue
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P.gender = MALE
P.identifying_gender= MALE
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
P << "<span class='notice'>Your body feels very strange...</span>"
owner << "<span class='notice'>You feel strange as you alter your captive's gender.</span>"
P.update_hair()
P.update_body()
P.updateicon()
var/egg_path = /obj/structure/closet/secure_closet/egg
var/egg_name = "Odd egg"
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
continue
if(O.egg_type in tf_egg_types)
egg_path = tf_egg_types[O.egg_type]
egg_name = "[O.egg_type] egg"
if(check_gender(P,MALE))
change_gender(P,MALE,1)
continue
if(!P.absorbed)
put_in_egg(P,1)
var/obj/structure/closet/secure_closet/egg/egg = new egg_path(get_turf(O))
P.forceMove(egg)
egg.name = egg_name
internal_contents -= P
return
///////////////////////////// DM_TRANSFORM_FEMALE_EGG /////////////////////////////
if(digest_mode == DM_TRANSFORM_FEMALE_EGG && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.stat == DEAD)
continue
if(P.absorbed) //If they're absorbed, don't egg them
return
var/mob/living/carbon/human/O = owner
if(check_eyes(P))
change_eyes(P,1)
continue
P.r_hair = O.r_hair
P.r_facial = O.r_facial
P.g_hair = O.g_hair
P.g_facial = O.g_facial
P.b_hair = O.b_hair
P.b_facial = O.b_facial
P.r_skin = O.r_skin
P.g_skin = O.g_skin
P.b_skin = O.b_skin
P.h_style = O.h_style
P.gender = FEMALE
P.identifying_gender= FEMALE
P.r_eyes = O.r_eyes
P.g_eyes = O.g_eyes
P.b_eyes = O.b_eyes
owner << "<span class='notice'>You feel strange as you alter your captive's gender.</span>"
P << "<span class='notice'>Your body feels very strange...</span>"
P.update_hair()
P.update_body()
P.updateicon()
var/egg_path = /obj/structure/closet/secure_closet/egg
var/egg_name = "Odd egg"
if(check_hair(P) || check_skin(P))
change_hair(P)
change_skin(P,1)
continue
if(O.egg_type in tf_egg_types)
egg_path = tf_egg_types[O.egg_type]
egg_name = "[O.egg_type] egg"
if(check_gender(P,MALE))
change_gender(P,MALE,1)
continue
if(!P.absorbed)
put_in_egg(P,1)
var/obj/structure/closet/secure_closet/egg/egg = new egg_path(get_turf(O))
P.forceMove(egg)
egg.name = egg_name
internal_contents -= P
return
///////////////////////////// DM_EGG /////////////////////////////
if(digest_mode == DM_EGG && ishuman(owner))
for (var/mob/living/carbon/human/P in internal_contents)
if(P.stat)
if(P.absorbed || P.stat == DEAD)
continue
if(P.absorbed) //If they're absorbed, don't egg them
return
var/mob/living/carbon/human/O = owner
P << "<span class='notice'>You lose sensation of your body, feeling only the warmth around you as you're encased in an egg. </span>"
owner << "<span class='notice'>Your body shifts as you encase [P] in an egg.</span>"
var/egg_path = /obj/structure/closet/secure_closet/egg
var/egg_name = "Odd egg"
if(O.egg_type in tf_egg_types)
egg_path = tf_egg_types[O.egg_type]
egg_name = "[O.egg_type] egg"
var/obj/structure/closet/secure_closet/egg/egg = new egg_path(get_turf(O))
P.forceMove(egg)
egg.name = egg_name
internal_contents -= P
put_in_egg(P,1)
+250
View File
@@ -0,0 +1,250 @@
/datum/belly/proc/check_eyes(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
return (M.r_eyes != O.r_eyes || M.g_eyes != O.g_eyes || M.b_eyes != O.b_eyes)
/datum/belly/proc/change_eyes(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.r_eyes = O.r_eyes
M.g_eyes = O.g_eyes
M.b_eyes = O.b_eyes
M.update_eyes()
M.update_body()
if(message)
to_chat(M, "<span class='notice'>You feel lightheaded and drowsy...</span>")
to_chat(O, "<span class='notice'>You feel warm as you make subtle changes to your captive's body.</span>")
/datum/belly/proc/check_hair(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
if(M.r_hair != O.r_hair || M.g_hair != O.g_hair || M.b_hair != O.b_hair)
return 1
if(M.r_facial != O.r_facial || M.g_facial != O.g_facial || M.b_facial != O.b_facial)
return 1
if(M.h_style != O.h_style || M.f_style != O.f_style)
return 1
return 0
/datum/belly/proc/change_hair(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.r_hair = O.r_hair
M.g_hair = O.g_hair
M.b_hair = O.b_hair
M.r_facial = O.r_facial
M.g_facial = O.g_facial
M.b_facial = O.b_facial
M.h_style = O.h_style
M.f_style = O.f_style
M.update_hair()
if(message)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
/datum/belly/proc/check_skin(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
return (M.r_skin != O.r_skin || M.g_skin != O.g_skin || M.b_skin != O.b_skin)
/datum/belly/proc/change_skin(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.r_skin = O.r_skin
M.g_skin = O.g_skin
M.b_skin = O.b_skin
for(var/obj/item/organ/external/Z in M.organs)
Z.sync_colour_to_human(M)
M.update_body()
if(message)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
/datum/belly/proc/check_gender(var/mob/living/carbon/human/M, target_gender)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
if(!target_gender)
target_gender = O.gender
return (M.gender != target_gender || M.identifying_gender != target_gender)
/datum/belly/proc/change_gender(var/mob/living/carbon/human/M, target_gender, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
if(!target_gender)
target_gender = O.gender
M.gender = target_gender
M.identifying_gender = target_gender
if(target_gender == FEMALE)
M.f_style = "Shaved"
M.dna.SetUIState(DNA_UI_GENDER,M.gender!=MALE,1)
M.sync_organ_dna()
M.update_body()
if(message)
to_chat(M, "<span class='notice'>Your body feels very strange...</span>")
to_chat(O, "<span class='notice'>You feel strange as you alter your captive's gender.</span>")
/datum/belly/proc/check_tail(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
if(M.tail_style != O.tail_style)
return 1
if(M.r_tail != O.r_tail || M.g_tail != O.g_tail || M.b_tail != O.b_tail)
return 1
return 0
/datum/belly/proc/change_tail(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.r_tail = O.r_tail
M.g_tail = O.g_tail
M.b_tail = O.b_tail
M.tail_style = O.tail_style
M.update_tail_showing()
if(message)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
/datum/belly/proc/check_tail_nocolor(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
return (M.tail_style != O.tail_style)
/datum/belly/proc/change_tail_nocolor(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.tail_style = O.tail_style
M.update_tail_showing()
if(message)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
/datum/belly/proc/check_wing(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
if(M.wing_style != O.wing_style)
return 1
if(M.r_wing != O.r_wing || M.g_wing != O.g_wing || M.b_wing != O.b_wing)
return 1
return 0
/datum/belly/proc/change_wing(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.r_wing = O.r_wing
M.g_wing = O.g_wing
M.b_wing = O.b_wing
M.wing_style = O.wing_style
M.update_wing_showing()
if(message)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
/datum/belly/proc/check_wing_nocolor(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
return (M.wing_style != O.wing_style)
/datum/belly/proc/change_wing_nocolor(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.wing_style = O.wing_style
M.update_wing_showing()
if(message)
to_chat(M, "<span class='notice'>Your body tingles all over...</span>")
to_chat(O, "<span class='notice'>You tingle as you make noticeable changes to your captive's body.</span>")
/datum/belly/proc/check_ears(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
return (M.ear_style != O.ear_style)
/datum/belly/proc/change_ears(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.ear_style = O.ear_style
M.update_hair()
/datum/belly/proc/check_species(var/mob/living/carbon/human/M)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return 0
if(M.species != O.species || M.custom_species != O.custom_species)
return 1
return 0
/datum/belly/proc/change_species(var/mob/living/carbon/human/M, message=0)
var/mob/living/carbon/human/O = owner
if(!istype(M) || !istype(O))
return
M.species = O.species
M.custom_species = O.custom_species
M.species.create_organs(M) //This is the only way to make it so Unathi TF doesn't result in people dying from organ rejection.
for(var/obj/item/organ/I in M.organs) //This prevents organ rejection
I.species = O.species
for(var/obj/item/organ/I in M.internal_organs) //This prevents organ rejection
I.species = O.species
for(var/obj/item/organ/external/Z in M.organs)//Just in case.
Z.sync_colour_to_human(M)
M.fixblood()
M.update_body()
M.update_tail_showing()
if(message)
to_chat(M, "<span class='notice'>You lose sensation of your body, feeling only the warmth of everything around you... </span>")
to_chat(O, "<span class='notice'>Your body shifts as you make dramatic changes to your captive's body.</span>")
/datum/belly/proc/put_in_egg(var/atom/movable/M, message=0)
var/mob/living/carbon/human/O = owner
var/egg_path = /obj/structure/closet/secure_closet/egg
var/egg_name = "odd egg"
if(O.egg_type in tf_egg_types)
egg_path = tf_egg_types[O.egg_type]
egg_name = "[O.egg_type] egg"
var/obj/structure/closet/secure_closet/egg/egg = new egg_path(owner)
M.forceMove(egg)
egg.name = egg_name
internal_contents -= M
internal_contents += egg
if(message)
to_chat(M, "<span class='notice'>You lose sensation of your body, feeling only the warmth around you as you're encased in an egg.</span>")
to_chat(O, "<span class='notice'>Your body shifts as you encase [M] in an egg.</span>")