From 8963ad368391afccfa3d74bd4899d8b8fbfc5f1c Mon Sep 17 00:00:00 2001 From: "Wowzewow (Wezzy)" <42310821+alsoandanswer@users.noreply.github.com> Date: Tue, 5 Jan 2021 04:21:44 +0800 Subject: [PATCH] running in impractical footwear makes you trip (#10809) --- code/modules/clothing/clothing.dm | 18 +++++++++ code/modules/clothing/shoes/jobs.dm | 6 +++ code/modules/clothing/shoes/miscellaneous.dm | 4 +- html/changelogs/wezzy-poopyshoes.yml | 41 ++++++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 html/changelogs/wezzy-poopyshoes.yml diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm index c46d3af71b6..a505bf27922 100644 --- a/code/modules/clothing/clothing.dm +++ b/code/modules/clothing/clothing.dm @@ -668,6 +668,7 @@ pickup_sound = 'sound/items/pickup/shoes.ogg' var/can_hold_knife + var/footstep = 1 var/obj/item/holding var/shoes_under_pants = 0 @@ -677,6 +678,7 @@ var/overshoes = 0 species_restricted = list("exclude",BODYTYPE_UNATHI,BODYTYPE_TAJARA,BODYTYPE_VAURCA,BODYTYPE_VAURCA_BREEDER,BODYTYPE_VAURCA_WARFORM) var/silent = 0 + var/last_trip = 0 /obj/item/clothing/shoes/proc/draw_knife() set name = "Draw Boot Knife" @@ -752,6 +754,22 @@ var/mob/M = src.loc M.update_inv_shoes() +/obj/item/clothing/shoes/proc/trip_up(var/turf/walking, var/running) + if(!running) + if(footstep >= 2) + footstep = 0 + else + footstep++ + else + if(prob(5)) + if(last_trip <= world.time - 20) //So you don't trip immediately after. + last_trip = world.time + if(ismob(loc)) + var/mob/M = loc + M.Weaken(3) + to_chat(M, SPAN_WARNING("You trip from running in \the [src]!")) + return + /////////////////////////////////////////////////////////////////////// //Suit /obj/item/clothing/suit diff --git a/code/modules/clothing/shoes/jobs.dm b/code/modules/clothing/shoes/jobs.dm index f9542fd32d5..5ab8419d8d6 100644 --- a/code/modules/clothing/shoes/jobs.dm +++ b/code/modules/clothing/shoes/jobs.dm @@ -28,6 +28,9 @@ desc = "Taller synthleather boots with an artificial shine." icon_state = "kneeboots" item_state = "kneeboots" + +/obj/item/clothing/shoes/jackboots/knee/handle_movement(var/turf/walking, var/running) + trip_up(walking, running) /obj/item/clothing/shoes/jackboots/thigh name = "thigh-length black boots" @@ -35,6 +38,9 @@ icon_state = "thighboots" item_state = "thighboots" +/obj/item/clothing/shoes/jackboots/thigh/handle_movement(var/turf/walking, var/running) + trip_up(walking, running) + /obj/item/clothing/shoes/jackboots/toeless name = "toe-less black boots" desc = "Modified pair of boots, particularly friendly to those species whose toes hold claws." diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index 65e8fa01c16..0e62d4227a9 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -81,7 +81,6 @@ obj/item/clothing/shoes/sandal/clogs icon_state = "clown" item_state = "clown_shoes" slowdown = 1 - var/footstep = 1 //used for squeeks whilst walking species_restricted = null /obj/item/clothing/shoes/clown_shoes/handle_movement(var/turf/walking, var/running) @@ -197,6 +196,9 @@ obj/item/clothing/shoes/sandal/clogs M = user return eyestab(M,user) +/obj/item/clothing/shoes/heels/handle_movement(var/turf/walking, var/running) + trip_up(walking, running) + /obj/item/clothing/shoes/winter name = "winter boots" desc = "A pair of heavy winter boots made out of animal furs, reaching up to the knee." diff --git a/html/changelogs/wezzy-poopyshoes.yml b/html/changelogs/wezzy-poopyshoes.yml new file mode 100644 index 00000000000..aee6b64269f --- /dev/null +++ b/html/changelogs/wezzy-poopyshoes.yml @@ -0,0 +1,41 @@ +################################ +# 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: Wowzewow (Wezzy) + +# 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: "Running in impractical shoes has a chance for you to trip over." \ No newline at end of file