mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
778ed9f1ab
## 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):  ## 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. /🆑
47 lines
2.3 KiB
Plaintext
47 lines
2.3 KiB
Plaintext
/**
|
|
* Unit test to ensure that, when a mob changes species,
|
|
* certain aspects are carried over between their old and new set of organs
|
|
* (brain traumas, cybernetics, and organ damage)
|
|
*/
|
|
/datum/unit_test/species_change_organs
|
|
|
|
/datum/unit_test/species_change_organs/Run()
|
|
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)
|
|
|
|
// Give a trauma
|
|
dummy.gain_trauma(/datum/brain_trauma/severe/blindness)
|
|
// Give a cyber heart
|
|
var/obj/item/organ/heart/cybernetic/cyber_heart = allocate(/obj/item/organ/heart/cybernetic)
|
|
cyber_heart.Insert(dummy, special = TRUE, movement_flags = DELETE_IF_REPLACED)
|
|
// Give one of their organs a bit of damage
|
|
var/obj/item/organ/appendix/existing_appendix = dummy.get_organ_slot(ORGAN_SLOT_APPENDIX)
|
|
existing_appendix.set_organ_damage(25)
|
|
|
|
// Changing species should
|
|
// - Persist brain traumas
|
|
// - Persist cybernetic implants
|
|
// - Persist organ damage to identical types
|
|
|
|
// Set up a species to pass over
|
|
var/datum/species/lizard/changed_species = new()
|
|
// But make sure the lizard's mutant organs are "normal"
|
|
changed_species.mutantheart = dummy.dna.species.mutantheart
|
|
changed_species.mutantappendix = dummy.dna.species.mutantappendix
|
|
// and make sure they're not a TRAIT_NOBLOOD species so they need a heart
|
|
changed_species.inherent_traits -= TRAIT_NOBLOOD
|
|
|
|
// Now make them a lizard
|
|
dummy.set_species(changed_species)
|
|
TEST_ASSERT(istype(dummy.dna.species, /datum/species/lizard), "Dummy didn't transform into a lizard when testing species organ changes.")
|
|
|
|
// Grab the lizard's appendix for comparison later
|
|
// They should've been given a new one, but our damage should also have transferred over
|
|
var/obj/item/organ/appendix/lizard_appendix = dummy.get_organ_slot(ORGAN_SLOT_APPENDIX)
|
|
|
|
// They should have the trauma still
|
|
TEST_ASSERT(dummy.has_trauma_type(/datum/brain_trauma/severe/blindness), "Dummy, upon changing species, did not carry over their brain trauma!")
|
|
// They should have their cybernetic heart still
|
|
TEST_ASSERT_EQUAL(dummy.get_organ_slot(ORGAN_SLOT_HEART), cyber_heart, "Dummy, upon changing species, did not carry over their cybernetic organs!")
|
|
// They should have appendix damage still
|
|
TEST_ASSERT_EQUAL(lizard_appendix.damage, 25, "Dummy, upon changing species, did not carry over appendix damage!")
|