Files
Bubberstation/code/modules/unit_tests/full_heal.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

59 lines
2.1 KiB
Plaintext

/// Tests the fully heal flag [HEAL_ORGANS].
/datum/unit_test/full_heal_heals_organs
/datum/unit_test/full_heal_heals_organs/Run()
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)
for(var/obj/item/organ/organ in dummy.organs)
organ.apply_organ_damage(50)
dummy.fully_heal(HEAL_ORGANS)
for(var/obj/item/organ/organ in dummy.organs)
if(organ.damage <= 0)
continue
TEST_FAIL("Organ [organ] did not get healed by fullyheal flag HEAL_ORGANS.")
/// Tests the fully heal flag [HEAL_REFRESH_ORGANS].
/datum/unit_test/full_heal_regenerates_organs
/datum/unit_test/full_heal_regenerates_organs/Run()
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)
var/list/we_started_with = list()
for(var/obj/item/organ/organ in dummy.organs)
if(organ.organ_flags & ORGAN_VITAL) // leave this for now
continue
we_started_with += organ.type
qdel(organ)
TEST_ASSERT(length(we_started_with), "Dummy didn't spawn with any organs to regenerate.")
dummy.fully_heal(HEAL_REFRESH_ORGANS)
for(var/obj/item/organ/organ_type as anything in we_started_with)
if(dummy.get_organ_by_type(organ_type))
continue
TEST_FAIL("Organ [initial(organ_type.name)] didn't regenerate in the dummy after fullyheal flag HEAL_REFRESH_ORGANS.")
/// Tests the fully heal combination flag [HEAL_DAMAGE].
/datum/unit_test/full_heal_damage_types
/datum/unit_test/full_heal_damage_types/Run()
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)
dummy.apply_damages(brute = 10, burn = 10, tox = 10, oxy = 10, stamina = 10)
dummy.fully_heal(HEAL_DAMAGE)
if(dummy.getBruteLoss())
TEST_FAIL("The dummy still had brute damage after a fully heal!")
if(dummy.getFireLoss())
TEST_FAIL("The dummy still had burn damage after a fully heal!")
if(dummy.getToxLoss())
TEST_FAIL("The dummy still had toxins damage after a fully heal!")
if(dummy.getOxyLoss())
TEST_FAIL("The dummy still had oxy damage after a fully heal!")
if(dummy.getStaminaLoss())
TEST_FAIL("The dummy still had stamina damage after a fully heal!")