diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm index 637ea90c8e4..2f011f2e5a3 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_carbon.dm @@ -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) diff --git a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm index 1d3c9304c3c..bf6e68f127c 100644 --- a/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm +++ b/code/__DEFINES/dcs/signals/signals_mob/signals_mob_living.dm @@ -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) diff --git a/code/datums/status_effects/wound_effects.dm b/code/datums/status_effects/wound_effects.dm index f7d640a6d1c..fc3f3140593 100644 --- a/code/datums/status_effects/wound_effects.dm +++ b/code/datums/status_effects/wound_effects.dm @@ -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 diff --git a/code/game/objects/items/stacks/rods.dm b/code/game/objects/items/stacks/rods.dm index 63625536b74..20b79bdfa71 100644 --- a/code/game/objects/items/stacks/rods.dm +++ b/code/game/objects/items/stacks/rods.dm @@ -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), \ )) diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm index 155ba411715..2843feed54a 100644 --- a/code/game/objects/items/stacks/sheets/sheet_types.dm +++ b/code/game/objects/items/stacks/sheets/sheet_types.dm @@ -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), \ diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm index 54f77ff1b70..cc94637f3ae 100644 --- a/code/game/objects/items/weaponry.dm +++ b/code/game/objects/items/weaponry.dm @@ -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]. * diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 4c2c3ae1067..6cc826aa580 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -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) diff --git a/code/modules/vending/medical.dm b/code/modules/vending/medical.dm index ad1c63e7e79..71171e57837 100644 --- a/code/modules/vending/medical.dm +++ b/code/modules/vending/medical.dm @@ -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, ) diff --git a/icons/mob/inhands/weapons/melee_lefthand.dmi b/icons/mob/inhands/weapons/melee_lefthand.dmi index d1ac470b093..dc9cb6e9866 100644 Binary files a/icons/mob/inhands/weapons/melee_lefthand.dmi and b/icons/mob/inhands/weapons/melee_lefthand.dmi differ diff --git a/icons/mob/inhands/weapons/melee_righthand.dmi b/icons/mob/inhands/weapons/melee_righthand.dmi index 8c18a06de3a..c694a765520 100644 Binary files a/icons/mob/inhands/weapons/melee_righthand.dmi and b/icons/mob/inhands/weapons/melee_righthand.dmi differ diff --git a/icons/obj/weapons/staff.dmi b/icons/obj/weapons/staff.dmi index da97e484df9..2d1460cf7e9 100644 Binary files a/icons/obj/weapons/staff.dmi and b/icons/obj/weapons/staff.dmi differ