diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index 6cf7a72f9e..197496259c 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -138,10 +138,78 @@ /obj/item/weapon/cane/whitecane name = "white cane" - desc = "A cane used by the blind." + desc = "A white cane. They are commonly used by the blind or visually impaired as a mobility tool or as a courtesy to others." icon = 'icons/obj/weapons.dmi' icon_state = "whitecane" +/obj/item/weapon/cane/whitecane/attack(mob/M as mob, mob/user as mob) + if(user.a_intent == I_HELP) + user.visible_message("\The [user] has lightly tapped [M] on the ankle with their white cane!") + return + else + ..() + +/obj/item/weapon/cane/crutch + name ="crutch" + desc = "A long stick with a crosspiece at the top, used to help with walking." + icon_state = "crutch" + item_state = "crutch" + +//Code for Telescopic White Cane writen by Gozulio + +/obj/item/weapon/melee/collapsable_whitecane + name = "telescopic white cane" + desc = "A telescoping white cane. They are commonly used by the blind or visually impaired as a mobility tool or as a courtesy to others." + icon = 'icons/obj/weapons.dmi' + icon_state = "whitecane1in" + item_icons = list( + slot_l_hand_str = 'icons/mob/items/lefthand_melee.dmi', + slot_r_hand_str = 'icons/mob/items/righthand_melee.dmi', + ) + slot_flags = SLOT_BELT + w_class = ITEMSIZE_SMALL + force = 3 + var/on = 0 + +/obj/item/weapon/melee/collapsable_whitecane/attack_self(mob/user as mob) + on = !on + if(on) + user.visible_message("\The [user] extends the white cane.",\ + "You extend the white cane.",\ + "You hear an ominous click.") + icon_state = "whitecane1out" + item_state_slots = list(slot_r_hand_str = "whitecane", slot_l_hand_str = "whitecane") + w_class = ITEMSIZE_NORMAL + force = 5 + attack_verb = list("smacked", "struck", "cracked", "beaten") + else + user.visible_message("\The [user] collapses the white cane.",\ + "You collapse the white cane.",\ + "You hear a click.") + icon_state = "whitecane1in" + item_state_slots = list(slot_r_hand_str = null, slot_l_hand_str = null) + w_class = ITEMSIZE_SMALL + force = 3 + attack_verb = list("hit", "poked") + + 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/empty.ogg', 50, 1) + add_fingerprint(user) + + return + +/obj/item/weapon/melee/collapsable_whitecane/attack(mob/M as mob, mob/user as mob) + if(user.a_intent == I_HELP) + user.visible_message("\The [user] has lightly tapped [M] on the ankle with their white cane!") + return + else + ..() + + /obj/item/weapon/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 06c5948aeb..5fd43d268a 100644 --- a/code/modules/client/preference_setup/loadout/loadout_general.dm +++ b/code/modules/client/preference_setup/loadout/loadout_general.dm @@ -6,6 +6,14 @@ display_name = "white cane" path = /obj/item/weapon/cane/whitecane +/datum/gear/cane/white2 + display_name = "telescopic white cane" + path = /obj/item/weapon/melee/collapsable_whitecane + +/datum/gear/crutch + display_name = "crutch" + path = /obj/item/weapon/cane/crutch + /datum/gear/dice display_name = "dice pack" path = /obj/item/weapon/storage/pill_bottle/dice diff --git a/config/example/config.txt b/config/example/config.txt index 7d711f480f..8853f337cc 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -485,4 +485,4 @@ IPR_BLOCK_BAD_IPS IPR_ALLOW_EXISTING # And what that age is (number) -IPR_MINIMUM_AGE 5 +IPR_MINIMUM_AGE 5 \ No newline at end of file diff --git a/icons/mob/items/lefthand_melee.dmi b/icons/mob/items/lefthand_melee.dmi index 92199228ca..7df4b09d86 100644 Binary files a/icons/mob/items/lefthand_melee.dmi and b/icons/mob/items/lefthand_melee.dmi differ diff --git a/icons/mob/items/righthand_melee.dmi b/icons/mob/items/righthand_melee.dmi index e2f1b7ee47..62886cb160 100644 Binary files a/icons/mob/items/righthand_melee.dmi and b/icons/mob/items/righthand_melee.dmi differ diff --git a/icons/obj/weapons.dmi b/icons/obj/weapons.dmi index 213b884a33..b0c2877e2e 100644 Binary files a/icons/obj/weapons.dmi and b/icons/obj/weapons.dmi differ