Files
GhomandGitHub 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

81 lines
3.0 KiB
Plaintext

/**
* Attempts to implant this skillchip into the target carbon's brain.
*
* Returns whether the skillchip was inserted or not. Can optionally give chat message notification to the mob.
* Arguments:
* * skillchip - The skillchip you want to insert.
* * silent - Whether or not to display the implanting message.
* * force - Whether to force the implant to happen, including forcing activating if activate = TRUE. Ignores incompatibility checks. Used by changelings.
*/
/mob/living/carbon/proc/implant_skillchip(obj/item/skillchip/skillchip, force = FALSE)
// Grab the brain.
var/obj/item/organ/brain/brain = get_organ_slot(ORGAN_SLOT_BRAIN)
// Check for the brain. No brain = no implant.
if(QDELETED(brain))
return "Brain not found."
if(force)
return brain.implant_skillchip(skillchip, force)
// Check the chip can actually be implanted.
var/mob_incompat_msg = skillchip.has_mob_incompatibility(src)
if(mob_incompat_msg)
return mob_incompat_msg
// Implant in the brain.
return brain.implant_skillchip(skillchip, force)
/**
* Attempts to remove this skillchip from the target carbon's brain.
*
* Returns FALSE when the skillchip couldn't be removed for some reason,
* including the target or brain not existing or the skillchip not being in the brain.
* Arguments:
* * target - The living carbon whose brain you want to remove the chip from.
* * silent - Whether or not to display the removal message.
*/
/mob/living/carbon/proc/remove_skillchip(obj/item/skillchip/skillchip, silent = FALSE)
// Check the target's brain, making sure the target exists and has a brain.
var/obj/item/organ/brain/brain = get_organ_slot(ORGAN_SLOT_BRAIN)
if(QDELETED(brain))
return FALSE
// Remove and call on_removal proc
if(!brain.remove_skillchip(skillchip, silent))
stack_trace("Failed to remove skillchip [skillchip] from [src].")
return FALSE
return TRUE
/**
* Creates a list of new skillchips cloned from old skillchips in the mob's brain.
*
* Returns a complete list of new skillchips cloned from the mob's brain's existing skillchip stock.
* Rumour has it that Changelings just LOVE this proc.
* Arguments:
* * cloned_chip_holder - The new holder for the cloned chips. Please don't be null.
* * not_removable - Special override, whether or not to force cloned chips to be non-removable, i.e. to delete on removal.
*/
/mob/living/carbon/proc/clone_skillchip_list(not_removable = FALSE)
// Check the target's brain, making sure the target exists and has a brain.
var/obj/item/organ/brain/brain = get_organ_slot(ORGAN_SLOT_BRAIN)
if(QDELETED(brain))
return list()
return brain.clone_skillchip_list(not_removable)
/**
* Destroys all skillchips in the brain, handling appropriate cleanup and event calls.
*/
/mob/living/carbon/proc/destroy_all_skillchips(silent = FALSE)
// Check the target's brain, making sure the target exists and has a brain.
var/obj/item/organ/brain/brain = get_organ_slot(ORGAN_SLOT_BRAIN)
if(QDELETED(brain))
return FALSE
brain.destroy_all_skillchips(silent)
return TRUE