Adds Crutches to Medbay & Crafting (#83242)

## About The Pull Request

Added crutches! Wooden ones can be made with wood. Medical ones can be
bought from the medvendor.

Crutches will reduce slowdown from missing a leg by 60%, and they will
remove the limping from fractured bones. They're also a fairly decent
bludgeon. However, they do nothing if both legs are cut off. Canes now
also remove broken bone limping as well

Changed the 'white cane' name to 'probing cane' to better reflect its
function.

Shuffled some wound and mob code around, added signals for limbless
slowdown and limping.

Crutches make you waddle.

SPRITES BY XHORIAN!!!!!!!!!!!!!


![image](https://github.com/tgstation/tgstation/assets/53100513/fe7e5ac8-0e6e-4291-ae64-c96632997607)

![image](https://github.com/tgstation/tgstation/assets/53100513/bde7fd7a-38d4-4036-82f2-01bdb8a6f00b)

![image](https://github.com/tgstation/tgstation/assets/53100513/9d94bc8d-5a80-4199-a044-7c5cf1944f99)

![image](https://github.com/tgstation/tgstation/assets/53100513/b26ecf53-177a-400d-aa5a-f2c0d5560942)



## Why It's Good For The Game

> Added crutches! Wooden ones can be made with wood. Medical ones can be
bought from the medvendor.

> Crutches will reduce slowdown from missing a leg by 60%, and they will
remove the limping from broken bones. They're also a fairly decent
bludgeon. However, they do nothing if both legs are cut off.

Currently there's no way to abate slowdown from a missing leg except
getting on a vehicle, which I think is pretty lame. What if all the
doctors are busy, missing, or dead? What if medbay is a hole? A crutch
helps make up for the loss at the cost of a hand slot.

> Changed the 'white cane' name to 'probing cane' to better reflect its
function.

'White cane' was undescriptive.

> Shuffled some wound and mob code around, added signals for limbless
slowdown and limping.

I dont know where to put the friggin signals

## Changelog

🆑
Carlarc, Xhorian
add: Added crutches! Wooden ones can be made with wood. Medical ones can
be bought from the medvendor.
add: Crutches will reduce slowdown from missing a leg by 60%, and they
will remove the limping from fractured bones. (canes do that now too)
They're also a fairly decent bludgeon. However, they do nothing if both
legs are cut off.
/🆑

---------

Co-authored-by: MrMelbert <51863163+MrMelbert@users.noreply.github.com>
This commit is contained in:
carlarctg
2024-06-01 20:02:00 +00:00
committed by GitHub
co-authored by MrMelbert
parent 560447dd18
commit 445ed08ce1
11 changed files with 112 additions and 3 deletions
@@ -159,3 +159,7 @@
#define HANDLE_BLOOD_NO_NUTRITION_DRAIN (1<<1)
/// Return to skip oxyloss and similar effecst from blood level
#define HANDLE_BLOOD_NO_EFFECTS (1<<2)
/// from /datum/status_effect/limp/proc/check_step(mob/whocares, OldLoc, Dir, forced) iodk where it shuld go
#define COMSIG_CARBON_LIMPING "mob_limp_check"
#define COMPONENT_CANCEL_LIMP (1<<0)
@@ -43,6 +43,8 @@
#define COMSIG_LIVING_SET_BUCKLED "living_set_buckled"
///from base of mob/living/set_body_position()
#define COMSIG_LIVING_SET_BODY_POSITION "living_set_body_position"
///from base of mob/living/set_usable_legs()
#define COMSIG_LIVING_LIMBLESS_SLOWDOWN "living_limbless_slowdown"
///From post-can inject check of syringe after attack (mob/user)
#define COMSIG_LIVING_TRY_SYRINGE "living_try_syringe"
///From living/Life(). (deltatime, times_fired)
@@ -73,6 +73,9 @@
// less limping while we have determination still
var/determined_mod = owner.has_status_effect(/datum/status_effect/determined) ? 0.5 : 1
if(SEND_SIGNAL(owner, COMSIG_CARBON_LIMPING) & COMPONENT_CANCEL_LIMP)
return
if(next_leg == left)
if(prob(limp_chance_left * determined_mod))
owner.client.move_delay += slowdown_left * determined_mod
+1 -1
View File
@@ -11,7 +11,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
new/datum/stack_recipe("ladder", /obj/structure/ladder/crafted, 15, time = 15 SECONDS, crafting_flags = CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
new/datum/stack_recipe("catwalk floor tile", /obj/item/stack/tile/catwalk_tile, 1, 4, 20, category = CAT_TILES), \
new/datum/stack_recipe("stairs frame", /obj/structure/stairs_frame, 10, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_STRUCTURE), \
new/datum/stack_recipe("white cane", /obj/item/cane/white, 3, time = 1 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY, category = CAT_TOOLS), \
new/datum/stack_recipe("probing cane", /obj/item/cane/white, 3, time = 1 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY, category = CAT_TOOLS), \
new/datum/stack_recipe("sharpened iron rod", /obj/item/ammo_casing/rebar, 1, time = 0.2 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY, category = CAT_WEAPON_AMMO), \
))
@@ -333,6 +333,7 @@ GLOBAL_LIST_INIT(wood_recipes, list ( \
new/datum/stack_recipe("ore box", /obj/structure/ore_box, 4, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_CONTAINERS),\
new/datum/stack_recipe("wooden crate", /obj/structure/closet/crate/wooden, 6, time = 5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_FURNITURE),\
new/datum/stack_recipe("baseball bat", /obj/item/melee/baseball_bat, 5, time = 1.5 SECONDS, crafting_flags = NONE, category = CAT_WEAPON_MELEE),\
new/datum/stack_recipe("wooden crutch", /obj/item/cane/crutch/wood, 5, time = 1.5 SECONDS, crafting_flags = NONE, category = CAT_WEAPON_MELEE),\
new/datum/stack_recipe("loom", /obj/structure/loom, 10, time = 1.5 SECONDS, crafting_flags = CRAFT_CHECK_DENSITY | CRAFT_ONE_PER_TURF | CRAFT_ON_SOLID_GROUND, category = CAT_TOOLS), \
new/datum/stack_recipe("mortar", /obj/item/reagent_containers/cup/mortar, 3, crafting_flags = NONE, category = CAT_CHEMISTRY), \
new/datum/stack_recipe("firebrand", /obj/item/match/firebrand, 2, time = 10 SECONDS, crafting_flags = NONE, category = CAT_TOOLS), \
+85 -1
View File
@@ -505,9 +505,90 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
attack_verb_continuous = list("bludgeons", "whacks", "disciplines", "thrashes")
attack_verb_simple = list("bludgeon", "whack", "discipline", "thrash")
/obj/item/cane/examine(mob/user, thats)
. = ..()
. += span_notice("This item can be used to support your weight, preventing limping from any broken bones on your legs you may have.")
/obj/item/cane/equipped(mob/living/user, slot, initial)
..()
if(!(slot & ITEM_SLOT_HANDS))
return
movement_support_add(user)
/obj/item/cane/dropped(mob/living/user, silent = FALSE)
. = ..()
movement_support_del(user)
/obj/item/cane/proc/movement_support_add(mob/living/user)
RegisterSignal(user, COMSIG_CARBON_LIMPING, PROC_REF(handle_limping))
user.set_usable_legs()
return TRUE
/obj/item/cane/proc/movement_support_del(mob/living/user)
UnregisterSignal(user, list(COMSIG_CARBON_LIMPING))
user.set_usable_legs()
return TRUE
/obj/item/cane/proc/handle_limping(mob/living/user)
SIGNAL_HANDLER
return COMPONENT_CANCEL_LIMP
/obj/item/cane/crutch
name = "medical crutch"
desc = "A medical crutch used by people missing a leg. Not all that useful if you're missing both of them, though."
icon = 'icons/obj/weapons/staff.dmi'
icon_state = "crutch_med"
inhand_icon_state = "crutch_med"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
force = 12
throwforce = 8
w_class = WEIGHT_CLASS_BULKY
custom_materials = list(/datum/material/iron = SMALL_MATERIAL_AMOUNT * 0.5)
attack_verb_continuous = list("bludgeons", "whacks", "thrashes")
attack_verb_simple = list("bludgeon", "whack", "thrash")
/obj/item/cane/crutch/examine(mob/user, thats)
. = ..()
// tacked on after the cane string
. += span_notice("As a crutch, it can also help lessen the slowdown incurred by missing a leg.")
/obj/item/cane/crutch/movement_support_add(mob/living/user)
. = ..()
if(!.)
return
RegisterSignal(user, COMSIG_LIVING_LIMBLESS_SLOWDOWN, PROC_REF(handle_slowdown))
user.update_usable_leg_status()
user.AddElementTrait(TRAIT_WADDLING, REF(src), /datum/element/waddling)
/obj/item/cane/crutch/movement_support_del(mob/living/user)
. = ..()
if(!.)
return
user.update_usable_leg_status()
UnregisterSignal(user, list(COMSIG_LIVING_LIMBLESS_SLOWDOWN, COMSIG_CARBON_LIMPING))
REMOVE_TRAIT(user, TRAIT_WADDLING, REF(src))
/obj/item/cane/crutch/proc/handle_slowdown(mob/living/user, limbless_slowdown, list/slowdown_mods)
SIGNAL_HANDLER
var/leg_amount = user.usable_legs
// Don't do anything if the number is equal (or higher) to the usual.
if(leg_amount >= user.default_num_legs)
return
// If we have at least one leg and it's less than the default, reduce slowdown by 60%.
if(leg_amount && (leg_amount < user.default_num_legs))
slowdown_mods += 0.4
/obj/item/cane/crutch/wood
name = "wooden crutch"
desc = "A handmade crutch. Also makes a decent bludgeon if you need it."
icon_state = "crutch_wood"
inhand_icon_state = "crutch_wood"
custom_materials = list(/datum/material/wood = SMALL_MATERIAL_AMOUNT * 0.5)
/obj/item/cane/white
name = "white cane"
desc = "A cane traditionally used by the blind to help them see. Folds down to be easier to transport."
desc = "Traditionally used by the blind to help them see. Folds down to be easier to transport."
icon_state = "cane_white"
inhand_icon_state = "cane_white"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
@@ -530,6 +611,9 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
RegisterSignal(src, COMSIG_TRANSFORMING_ON_TRANSFORM, PROC_REF(on_transform))
ADD_TRAIT(src, TRAIT_BLIND_TOOL, INNATE_TRAIT)
/obj/item/cane/white/handle_limping(mob/living/user)
return HAS_TRAIT(src, TRAIT_TRANSFORM_ACTIVE) ? COMPONENT_CANCEL_LIMP : NONE
/*
* Signal proc for [COMSIG_TRANSFORMING_ON_TRANSFORM].
*
+14 -1
View File
@@ -2339,8 +2339,14 @@ GLOBAL_LIST_EMPTY(fire_appearances)
. = usable_legs
usable_legs = new_value
update_usable_leg_status()
if(new_value > .) // Gained leg usage.
/**
* Proc that updates the status of the mob's legs without setting its leg value to something else.
*/
/mob/living/proc/update_usable_leg_status()
if(usable_legs > 0) // Gained leg usage.
REMOVE_TRAIT(src, TRAIT_FLOORED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, LACKING_LOCOMOTION_APPENDAGES_TRAIT)
else if(!(movement_type & (FLYING | FLOATING))) //Lost leg usage, not flying.
@@ -2353,6 +2359,13 @@ GLOBAL_LIST_EMPTY(fire_appearances)
var/limbless_slowdown = (default_num_legs - usable_legs) * 3
if(!usable_legs && usable_hands < default_num_hands)
limbless_slowdown += (default_num_hands - usable_hands) * 3
var/list/slowdown_mods = list()
SEND_SIGNAL(src, COMSIG_LIVING_LIMBLESS_SLOWDOWN, limbless_slowdown, slowdown_mods)
for(var/num in slowdown_mods)
limbless_slowdown *= num
if(limbless_slowdown == 0)
remove_movespeed_modifier(/datum/movespeed_modifier/limbless)
return
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/limbless, multiplicative_slowdown = limbless_slowdown)
else
remove_movespeed_modifier(/datum/movespeed_modifier/limbless)
+2
View File
@@ -17,6 +17,7 @@
/obj/item/stack/medical/ointment = 2,
/obj/item/stack/medical/suture = 2,
/obj/item/stack/medical/bone_gel = 4,
/obj/item/cane/crutch = 2,
/obj/item/cane/white = 2,
/obj/item/clothing/glasses/eyepatch/medical = 2,
/obj/item/storage/box/bandages = 2,
@@ -62,6 +63,7 @@
/obj/item/stack/medical/ointment = 0,
/obj/item/stack/medical/suture = 1,
/obj/item/stack/medical/bone_gel = 1,
/obj/item/cane/crutch = 2,
/obj/item/cane/white = 2,
/obj/item/clothing/glasses/eyepatch/medical = 2,
)
Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 3.0 KiB