Files
Bubberstation/code/modules/unit_tests/ling_decap.dm
Ghom 778ed9f1ab The death or internal/external organ pathing (ft. fixed fox ears and recoloring bodypart overlays with dye sprays) (#87434)
## About The Pull Request
This PR kills the abstract internal and external typepaths for organs,
now replaced by an EXTERNAL_ORGAN flag to distinguish the two kinds.

This PR also fixes fox ears (from #87162, no tail is added) and
mushpeople's caps (they should be red, the screenshot is a tad
outdated).

And yes, you can now use a hair dye spray to recolor body parts like
most tails, podpeople hair, mushpeople caps and cat ears. The process
can be reversed by using the spray again.

## Why It's Good For The Game
Time-Green put some effort during the last few months to untie functions
and mechanics from external/internal organ pathing. Now, all that this
pathing is good for are a few typechecks, easily replaceable with
bitflags.

Also podpeople and mushpeople need a way to recolor their "hair". This
kind of applies to fish tails from the fish infusion, which colors can't
be selected right now. The rest is just there if you ever want to
recolor your lizard tail for some reason.

Proof of testing btw (screenshot taken before mushpeople cap fix, right
side has dyed body parts, moth can't be dyed, they're already fabolous):

![immagine](https://github.com/user-attachments/assets/2bb625c9-9233-42eb-b9b8-e0bd6909ce89)

## Changelog

🆑
code: Removed internal/external pathing from organs in favor of a bit
flag. Hopefully this shouldn't break anything about organs.
fix: Fixed invisible fox ears.
fix: Fixed mushpeople caps not being colored red by default.
add: You can now dye most tails, podpeople hair, mushpeople caps etc.
with a hair dye spray.
/🆑
2024-10-30 08:03:02 +01:00

48 lines
2.1 KiB
Plaintext

/// Test lings don't die when decapitated.
/datum/unit_test/ling_decap
/datum/unit_test/ling_decap/Run()
var/mob/living/carbon/human/ling = allocate(/mob/living/carbon/human/consistent)
ling.mind_initialize()
ling.mind.add_antag_datum(/datum/antagonist/changeling)
var/obj/item/bodypart/head/noggin = ling.get_bodypart(BODY_ZONE_HEAD)
noggin.dismember()
TEST_ASSERT_NULL(ling.get_bodypart(BODY_ZONE_HEAD), "Changeling failed to be decapitated.")
var/obj/item/organ/brain/brain = locate(/obj/item/organ/brain) in noggin
TEST_ASSERT_NULL(brain.brainmob.mind, "Changeling's mind was moved to their brain after decapitation, but it should have remained in their body.")
var/obj/item/organ/brain/oldbrain = locate(/obj/item/organ/brain) in noggin
noggin.drop_organs()
TEST_ASSERT_NULL(locate(/obj/item/organ/brain) in noggin, "Changeling's head failed to drop its brain.")
TEST_ASSERT_NULL(oldbrain.brainmob.mind, "Changeling's mind was moved to their brain after decapitation and organ dropping, but it should have remained in their body.")
TEST_ASSERT_EQUAL(ling.stat, CONSCIOUS, "Changeling was not conscious after losing their head.")
// Cleanup
qdel(noggin)
for(var/obj/item/organ/leftover in ling.loc)
qdel(leftover)
/// Tests people get decapitated properly.
/datum/unit_test/normal_decap
/datum/unit_test/normal_decap/Run()
var/mob/living/carbon/human/normal_guy = allocate(/mob/living/carbon/human/consistent)
normal_guy.mind_initialize()
var/my_guys_mind = normal_guy.mind
var/obj/item/bodypart/head/noggin = normal_guy.get_bodypart(BODY_ZONE_HEAD)
noggin.dismember()
var/obj/item/organ/brain/brain = locate(/obj/item/organ/brain) in noggin
TEST_ASSERT_EQUAL(brain.brainmob.mind, my_guys_mind, "Dummy's mind was not moved to their brain after decapitation.")
var/obj/item/organ/brain/oldbrain = locate(/obj/item/organ/brain) in noggin
noggin.drop_organs()
TEST_ASSERT_EQUAL(oldbrain.brainmob.mind, my_guys_mind, "Dummy's mind was not moved to their brain after being removed from their head.")
// Cleanup
qdel(noggin)
for(var/obj/item/organ/leftover in normal_guy.loc)
qdel(leftover)