mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-29 16:18:01 +01:00
[MIRROR] Performing a head transplant will now properly preserve the appearance. (#698)
* Performing a head transplant will now properly preserve the appearance. (#53494) * Performing a head transplant will now properly preserve the appearance. Co-authored-by: Jared-Fogle <35135081+Jared-Fogle@users.noreply.github.com>
This commit is contained in:
@@ -378,6 +378,15 @@
|
||||
|
||||
|
||||
/obj/item/bodypart/head/attach_limb(mob/living/carbon/C, special = FALSE, abort = FALSE)
|
||||
// These are stored before calling super. This is so that if the head is from a different body, it persists its appearance.
|
||||
var/hair_color = src.hair_color
|
||||
var/hairstyle = src.hairstyle
|
||||
var/facial_hair_color = src.facial_hair_color
|
||||
var/facial_hairstyle = src.facial_hairstyle
|
||||
var/lip_style = src.lip_style
|
||||
var/lip_color = src.lip_color
|
||||
var/real_name = src.real_name
|
||||
|
||||
. = ..()
|
||||
if(!.)
|
||||
return .
|
||||
|
||||
@@ -27,6 +27,33 @@
|
||||
TEST_ASSERT(!patient.has_trauma_type(), "Patient kept their brain trauma after brain surgery")
|
||||
TEST_ASSERT(patient.getOrganLoss(ORGAN_SLOT_BRAIN) < 20, "Patient did not heal their brain damage after brain surgery")
|
||||
|
||||
/datum/unit_test/head_transplant/Run()
|
||||
var/mob/living/carbon/human/user = allocate(/mob/living/carbon/human)
|
||||
var/mob/living/carbon/human/alice = allocate(/mob/living/carbon/human)
|
||||
var/mob/living/carbon/human/bob = allocate(/mob/living/carbon/human)
|
||||
|
||||
alice.fully_replace_character_name(null, "Alice")
|
||||
bob.fully_replace_character_name(null, "Bob")
|
||||
|
||||
var/obj/item/bodypart/head/alices_head = alice.get_bodypart(BODY_ZONE_HEAD)
|
||||
alices_head.drop_limb()
|
||||
|
||||
var/obj/item/bodypart/head/bobs_head = bob.get_bodypart(BODY_ZONE_HEAD)
|
||||
bobs_head.drop_limb()
|
||||
|
||||
TEST_ASSERT_EQUAL(alice.get_bodypart(BODY_ZONE_HEAD), null, "Alice still has a head after dismemberment")
|
||||
TEST_ASSERT_EQUAL(alice.get_visible_name(), "Unknown", "Alice's head was dismembered, but they are not Unknown")
|
||||
|
||||
TEST_ASSERT_EQUAL(bobs_head.real_name, "Bob", "Bob's head does not remember that it is from Bob")
|
||||
|
||||
// Put Bob's head onto Alice's body
|
||||
var/datum/surgery_step/add_prosthetic/add_prosthetic = new
|
||||
user.put_in_active_hand(bobs_head)
|
||||
add_prosthetic.success(user, alice, BODY_ZONE_HEAD, bobs_head)
|
||||
|
||||
TEST_ASSERT(!isnull(alice.get_bodypart(BODY_ZONE_HEAD)), "Alice has no head after prosthetic replacement")
|
||||
TEST_ASSERT_EQUAL(alice.get_visible_name(), "Bob", "Bob's head was transplanted onto Alice's body, but their name is not Bob")
|
||||
|
||||
/datum/unit_test/multiple_surgeries/Run()
|
||||
var/mob/living/carbon/human/user = allocate(/mob/living/carbon/human)
|
||||
var/mob/living/carbon/human/patient_zero = allocate(/mob/living/carbon/human)
|
||||
|
||||
Reference in New Issue
Block a user