Files
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

83 lines
2.9 KiB
Plaintext

/obj/item/organ/appendix/golem
name = "internal forge"
desc = "This expanded digestive chamber allows golems to smelt minerals, provided that they are immersed in lava."
icon_state = "ethereal_heart-off"
color = COLOR_GOLEM_GRAY
organ_flags = ORGAN_MINERAL
/// Action which performs smelting
var/datum/action/cooldown/internal_smelting/smelter
/obj/item/organ/appendix/golem/Initialize(mapload)
. = ..()
smelter = new(src)
/obj/item/organ/appendix/golem/on_mob_insert(mob/living/carbon/organ_owner)
. = ..()
RegisterSignal(owner, COMSIG_MOVABLE_MOVED, PROC_REF(check_for_lava))
/// Give the action while in lava
/obj/item/organ/appendix/golem/proc/check_for_lava(mob/living/owner)
SIGNAL_HANDLER
if (!islava(owner.loc))
smelter.Remove(owner)
return
if (smelter.owner != owner)
smelter.Grant(owner)
/obj/item/organ/appendix/golem/on_mob_remove(mob/living/carbon/organ_owner)
UnregisterSignal(organ_owner, COMSIG_MOVABLE_MOVED)
smelter?.Remove(organ_owner) // Might have been deleted by Destroy already
return ..()
/obj/item/organ/appendix/golem/Destroy()
QDEL_NULL(smelter)
return ..()
/// Lets golems smelt ore with their organs
/datum/action/cooldown/internal_smelting
name = "Internal Forge"
desc = "While stood in lava you can use your internal forge to smelt ores into processed bars."
button_icon = 'icons/obj/stack_objects.dmi'
button_icon_state = "sheet-adamantine_2"
check_flags = AB_CHECK_HANDS_BLOCKED | AB_CHECK_LYING | AB_CHECK_CONSCIOUS | AB_CHECK_INCAPACITATED
/// Time it takes to smelt one ore into one result
var/smelt_speed = 2 SECONDS
/// Amount to speed up by every completion
var/speed_up_interval = 0.2 SECONDS
/// Minimum time to take to smelt one ore into one result
var/minimum_smelt_speed = 1 SECONDS
/datum/action/cooldown/internal_smelting/IsAvailable(feedback)
. = ..()
if (!.)
return FALSE
if (!islava(owner.loc))
if (feedback)
owner.balloon_alert(owner, "requires lava!")
return FALSE
return TRUE
/datum/action/cooldown/internal_smelting/Activate(mob/target)
. = ..()
smelt_speed = initial(smelt_speed)
smelt_held(target)
/// Smelt an item held in one hand and put the result in the other
/datum/action/cooldown/internal_smelting/proc/smelt_held(mob/target)
var/obj/item/stack/ore/held_ore = locate(/obj/item/stack/ore) in target.held_items
if (!held_ore?.refined_type)
target.balloon_alert(target, "nothing to smelt!")
return
target.balloon_alert(owner, "smelting...")
if (!do_after(target, smelt_speed, target = held_ore, timed_action_flags = IGNORE_USER_LOC_CHANGE, extra_checks = CALLBACK(src, PROC_REF(IsAvailable), FALSE), interaction_key = REF(src)))
return
var/obj/item/smelted = new held_ore.refined_type
held_ore.use(1)
target.put_in_hands(smelted)
if (!held_ore)
target.balloon_alert(target, "no ore left!")
return
smelt_speed = max(smelt_speed - speed_up_interval, minimum_smelt_speed)
smelt_held(target)