From 2d93a64febb3012857327b128ab6968e4f2e8a58 Mon Sep 17 00:00:00 2001 From: WilliamMurdoch <31459154+WilliamMurdoch@users.noreply.github.com> Date: Wed, 12 May 2021 15:41:24 -0400 Subject: [PATCH] Telescopic Cane and loadout condensing (#11856) --- code/defines/obj/weapon.dm | 44 ++++++++++++++++++ .../loadout/loadout_general.dm | 15 +++--- .../mob/living/carbon/human/human_organs.dm | 7 ++- .../William Murdoch - Telecopic Cane.yml | 42 +++++++++++++++++ .../obj/contained_items/weapons/telebaton.dmi | Bin 521 -> 517 bytes .../obj/contained_items/weapons/telecane.dmi | Bin 0 -> 696 bytes 6 files changed, 97 insertions(+), 11 deletions(-) create mode 100644 html/changelogs/William Murdoch - Telecopic Cane.yml create mode 100644 icons/obj/contained_items/weapons/telecane.dmi diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index d81223dd40e..244799a7098 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -56,6 +56,7 @@ w_class = ITEMSIZE_LARGE matter = list(DEFAULT_WALL_MATERIAL = 50) attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed") + var/can_support = TRUE /obj/item/cane/attack(mob/living/target, mob/living/carbon/human/user, target_zone = BP_CHEST) @@ -294,6 +295,7 @@ desc = "A white cane, used by the visually impaired." icon_state = "whitecane" item_state = "whitecane" + can_support = FALSE /obj/item/cane/shillelagh name = "adhomian shillelagh" @@ -303,6 +305,48 @@ item_state = "shillelagh" contained_sprite = TRUE +/obj/item/cane/telecane + name = "telescopic cane" + desc = "A compact cane which can be collapsed for storage." + icon = 'icons/obj/contained_items/weapons/telecane.dmi' + icon_state = "telecane" + contained_sprite = TRUE + w_class = ITEMSIZE_SMALL + slot_flags = SLOT_BELT + drop_sound = 'sound/items/drop/crowbar.ogg' + pickup_sound = 'sound/items/pickup/crowbar.ogg' + var/on = FALSE + can_support = FALSE + +/obj/item/cane/telecane/attack_self(mob/user) + on = !on + if(on) + user.visible_message(SPAN_WARNING("With a flick of their wrist, [user] extends their telescopic cane."), SPAN_WARNING("You extend the cane."), SPAN_WARNING("You hear an ominous click.")) + icon_state = "telecane_1" + item_state = "telestick" + w_class = ITEMSIZE_LARGE + slot_flags = null + force = 6 + attack_verb = list("smacked", "struck", "slapped") + can_support = TRUE + else + user.visible_message(SPAN_NOTICE("\The [user] collapses their telescopic cane."), SPAN_NOTICE("You collapse the cane."), SPAN_NOTICE("You hear a click.")) + icon_state = "telecane" + item_state = "telestick_0" + w_class = ITEMSIZE_SMALL + slot_flags = SLOT_BELT + force = 3 + attack_verb = list("hit", "punched") + can_support = FALSE + + if(istype(user,/mob/living/carbon/human)) + var/mob/living/carbon/human/H = user + H.update_inv_l_hand() + H.update_inv_r_hand() + + playsound(src.loc, 'sound/weapons/click.ogg', 50, 1) + add_fingerprint(user) + /obj/item/disk name = "disk" icon = 'icons/obj/items.dmi' diff --git a/code/modules/client/preference_setup/loadout/loadout_general.dm b/code/modules/client/preference_setup/loadout/loadout_general.dm index fe61303fce5..9565328e35b 100644 --- a/code/modules/client/preference_setup/loadout/loadout_general.dm +++ b/code/modules/client/preference_setup/loadout/loadout_general.dm @@ -2,13 +2,14 @@ display_name = "cane" path = /obj/item/cane -/datum/gear/cane/crutch - display_name = "crutch" - path = /obj/item/cane/crutch - -/datum/gear/cane/white - display_name = "white cane" - path = /obj/item/cane/white +/datum/gear/cane/New() + ..() + var/list/cane = list() + cane["cane"] = /obj/item/cane + cane["telescopic cane"] = /obj/item/cane/telecane + cane["crutch"] = /obj/item/cane/crutch + cane["white cane"] = /obj/item/cane/white + gear_tweaks += new /datum/gear_tweak/path(cane) /datum/gear/dice display_name = "pack of dice" diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm index 38127aeccfa..f915ac1446b 100644 --- a/code/modules/mob/living/carbon/human/human_organs.dm +++ b/code/modules/mob/living/carbon/human/human_organs.dm @@ -113,10 +113,9 @@ // One cane mitigates a broken leg+foot, or a missing foot. // No double caning allowed, sorry. Canes also don't work if you're missing a functioning pair of feet or legs. if(has_opposite_limb) - if(l_hand && istype(l_hand, /obj/item/cane)) - stance_damage -= 2 - else if(r_hand && istype(r_hand, /obj/item/cane)) - stance_damage -= 2 + var/obj/item/cane/C = get_type_in_hands(/obj/item/cane) + if(C?.can_support) + stance_damage -=2 //Standing is poor. if(stance_damage >= 4 || (stance_damage >= 2 && prob(5))) diff --git a/html/changelogs/William Murdoch - Telecopic Cane.yml b/html/changelogs/William Murdoch - Telecopic Cane.yml new file mode 100644 index 00000000000..9d9e2cb569d --- /dev/null +++ b/html/changelogs/William Murdoch - Telecopic Cane.yml @@ -0,0 +1,42 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# wip (For works in progress) +# tweak +# soundadd +# sounddel +# rscadd (general adding of nice things) +# rscdel (general deleting of nice things) +# imageadd +# imagedel +# maptweak +# spellcheck (typo fixes) +# experiment +# balance +# admin +# backend +# security +# refactor +################################# + +# Your name. +author: William Murdoch + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries. +# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog. +changes: + - rscadd: "Adds a telecopic cane which can be found in the loadout under cane." + - tweak: "Merges white cane and crutches under the cane option in the loadout." \ No newline at end of file diff --git a/icons/obj/contained_items/weapons/telebaton.dmi b/icons/obj/contained_items/weapons/telebaton.dmi index 40bf2ddc0905ff5242d345b61be72f1f4c6ee108..f3e735b62ae4633a0f1f038d909a08de6043b645 100644 GIT binary patch delta 284 zcmV+%0ptFO1cd~U@_zvRNkliw10T(p5NQeR^|-`A|8Kgc$MvHOSEA_0nJfYi$Tooj1q2|_E@EZVtR}%U8x}}T z@&OeMO7_mA181W^Q8Jyb1F`}W*ljOVXGsE4feYlKj@AW1fPY6y7es+v+&MJ-Ea{|8KfW%k`rSSAyWjnJqmJNVlE>IRqfkEFvLkUbf3HV@l1opeD6*4QbVHK!AW(!zCQhyg1f!?0)0xOU)nbQPR zyaf(-KY?U@^AkvV1&{SOfgq{u?dCD=`N4T+q`=^SO3wiR0GUEhdCv;$HPznL(NnC! z-jtnyQiBPTVL_?EglPwq8l@C;t)T?<8UO$Qz&BBURT&niX5sL+{1Jx{LBwT5a1@xP m;4&hJ#MW-=hZz9iUwHwWfFhw07fhf40000UysL diff --git a/icons/obj/contained_items/weapons/telecane.dmi b/icons/obj/contained_items/weapons/telecane.dmi new file mode 100644 index 0000000000000000000000000000000000000000..16c298473f9eeb16952ac99c75d5ce67f3caeea9 GIT binary patch literal 696 zcmV;p0!RIcP)V=-0C=2JR&a84 z_w-Y6@%7{?OD!tS%+FJ>RWQ*r;NmRLOex6#a*U0*I5Sc+(=$pSoZ^zil2jm5sU$Tg zH90XaRf&r;C9|j)C}haRnO2mTn+joLD2z8GN@;OPW^#6XP6k4;2_eNrI29`^xca$( zy$1l&8bbNo#cqlK00EduL_t(&f$f@MbHX4Dh8qf9SF@?}|NqxX-JKsKfnWf4=D`m= zExd1maD+NdMgHwC-`+1xLa32eRccZ2vxLf~&`Y4pe zSJV%;D{cLv_`2(>Qxsnf_5TF;K4`D+W-h+E=ri#ZLTmkXjRQc&m-C_V^M9_p0M!BB zHP+`l_^RJhzNP-wSATodOMLaverAG8o_{I6^9}@lf{Xh9P+bkfSHn5!QG42TK_iq;}Re^M~86)Z(*0ORLb1KVDz z5pF&Y-!&_dCdX?r48t%C!!TYRc8i+XLZ9SSgtycAeM&o5r-GVYwdzisYwWCHAa_{M z+(0f<