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

91 lines
2.7 KiB
Plaintext

/obj/structure/punching_bag
name = "punching bag"
desc = "A punching bag. Can you get to speed level 4???"
icon = 'icons/obj/fluff/gym_equipment.dmi'
icon_state = "punchingbag"
anchored = TRUE
layer = ABOVE_MOB_LAYER
///List of sounds that can be played when punched.
var/static/list/hit_sounds = list(
'sound/items/weapons/genhit1.ogg',
'sound/items/weapons/genhit2.ogg',
'sound/items/weapons/genhit3.ogg',
'sound/items/weapons/punch1.ogg',
'sound/items/weapons/punch2.ogg',
'sound/items/weapons/punch3.ogg',
'sound/items/weapons/punch4.ogg',
)
/obj/structure/punching_bag/Initialize(mapload)
. = ..()
AddElement( \
/datum/element/contextual_screentip_bare_hands, \
lmb_text = "Punch", \
)
var/static/list/tool_behaviors
if(!tool_behaviors)
tool_behaviors = string_assoc_nested_list(list(
TOOL_CROWBAR = list(
SCREENTIP_CONTEXT_RMB = "Deconstruct",
),
TOOL_WRENCH = list(
SCREENTIP_CONTEXT_RMB = "Anchor",
),
))
AddElement(/datum/element/contextual_screentip_tools, tool_behaviors)
/obj/structure/punching_bag/attack_hand(mob/living/user, list/modifiers)
. = ..()
if(.)
return
flick("[icon_state]-punch", src)
playsound(loc, pick(hit_sounds), 25, TRUE, -1)
if(!iscarbon(user))
return
var/is_heavy_gravity = user.has_gravity() > STANDARD_GRAVITY
var/stamina_exhaustion = 3
if(ishuman(user))
var/mob/living/carbon/human/boxer = user
var/obj/item/clothing/gloves/boxing/boxing_gloves = boxer.get_item_by_slot(ITEM_SLOT_GLOVES)
if(istype(boxing_gloves))
stamina_exhaustion = 2
if (is_heavy_gravity)
stamina_exhaustion *= 1.5
var/obj/item/organ/cyberimp/chest/spine/potential_spine = user.get_organ_slot(ORGAN_SLOT_SPINE)
if(istype(potential_spine))
stamina_exhaustion *= potential_spine.athletics_boost_multiplier
if(HAS_TRAIT(user, TRAIT_STRENGTH)) //The strong get reductions to stamina damage taken while exercising
stamina_exhaustion *= 0.5
user.adjustStaminaLoss(stamina_exhaustion)
user.mind?.adjust_experience(/datum/skill/athletics, is_heavy_gravity ? 0.6 : 0.3)
user.apply_status_effect(/datum/status_effect/exercised)
/obj/structure/punching_bag/wrench_act_secondary(mob/living/user, obj/item/tool)
tool.play_tool_sound(src)
balloon_alert(user, anchored ? "unsecured" : "secured")
anchored = !anchored
return TRUE
/obj/structure/punching_bag/crowbar_act_secondary(mob/living/user, obj/item/tool)
if(anchored)
balloon_alert(user, "still secured!")
return FALSE
tool.play_tool_sound(src)
balloon_alert(user, "deconstructing...")
if (!do_after(user, 10 SECONDS, target = src))
return FALSE
new /obj/item/stack/sheet/iron(get_turf(src), 2)
new /obj/item/stack/rods(get_turf(src))
new /obj/item/pillow(get_turf(src))
qdel(src)
return TRUE