diff --git a/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_clothing.dm b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_clothing.dm index 9e654a2b7da0e..06e9484c867ca 100644 --- a/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_clothing.dm +++ b/code/__DEFINES/dcs/signals/signals_obj/signals_item/signals_clothing.dm @@ -3,4 +3,6 @@ // All signals send the source datum of the signal as the first argument // /obj/item/clothing signals -#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" //! from base of obj/item/clothing/shoes/proc/step_action(): () + +///from [/mob/living/carbon/human/Move]: () +#define COMSIG_SHOES_STEP_ACTION "shoes_step_action" diff --git a/code/modules/clothing/shoes/bananashoes.dm b/code/modules/clothing/shoes/bananashoes.dm index 133d80f67c07b..1ae58dd045454 100644 --- a/code/modules/clothing/shoes/bananashoes.dm +++ b/code/modules/clothing/shoes/bananashoes.dm @@ -12,23 +12,27 @@ . = ..() AddComponent(/datum/component/material_container, list(/datum/material/bananium), 200000, TRUE, /obj/item/stack) AddComponent(/datum/component/squeak, list('sound/items/bikehorn.ogg'=1), 75, falloff_exponent = 20) + RegisterSignal(src, COMSIG_SHOES_STEP_ACTION, PROC_REF(on_step)) if(always_noslip) clothing_flags |= NOSLIP -/obj/item/clothing/shoes/clown_shoes/banana_shoes/step_action() - . = ..() +/obj/item/clothing/shoes/clown_shoes/banana_shoes/proc/on_step() + SIGNAL_HANDLER + var/mob/wearer = loc var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container) - if(on && istype(wearer)) - if(bananium.get_material_amount(/datum/material/bananium) < 100) - on = !on - if(!always_noslip) - clothing_flags &= ~NOSLIP - update_icon() - to_chat(loc, "You ran out of bananium!") - else - new /obj/item/grown/bananapeel/specialpeel(get_step(src,turn(wearer.dir, 180))) //honk - bananium.use_amount_mat(100, /datum/material/bananium) + if(!on || !istype(wearer)) + return + + if(bananium.get_material_amount(/datum/material/bananium) < 100) + on = !on + if(!always_noslip) + clothing_flags &= ~NOSLIP + update_icon() + to_chat(loc, "You ran out of bananium!") + else + new /obj/item/grown/bananapeel/specialpeel(get_step(src,turn(wearer.dir, 180))) //honk + bananium.use_amount_mat(100, /datum/material/bananium) /obj/item/clothing/shoes/clown_shoes/banana_shoes/attack_self(mob/user) var/datum/component/material_container/bananium = GetComponent(/datum/component/material_container) diff --git a/code/modules/clothing/shoes/cluwne.dm b/code/modules/clothing/shoes/cluwne.dm index d45d3753fb3af..b65bedff42fce 100644 --- a/code/modules/clothing/shoes/cluwne.dm +++ b/code/modules/clothing/shoes/cluwne.dm @@ -11,9 +11,12 @@ /obj/item/clothing/shoes/cluwne/Initialize(mapload) .=..() + RegisterSignal(src, COMSIG_SHOES_STEP_ACTION, PROC_REF(on_step)) ADD_TRAIT(src, TRAIT_NODROP, CURSED_ITEM_TRAIT) -/obj/item/clothing/shoes/cluwne/step_action() +/obj/item/clothing/shoes/cluwne/proc/on_step() + SIGNAL_HANDLER + if(footstep > 1) playsound(src, "clownstep", 50, 1) footstep = 0 diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm index a58e4c78e8118..68eb7b389753b 100644 --- a/code/modules/clothing/shoes/miscellaneous.dm +++ b/code/modules/clothing/shoes/miscellaneous.dm @@ -1,5 +1,3 @@ -/obj/item/clothing/shoes/proc/step_action() //this was made to rewrite clown shoes squeaking - SEND_SIGNAL(src, COMSIG_SHOES_STEP_ACTION) /obj/item/clothing/shoes/combat //basic syndicate combat boots for nuke ops and mob corpses name = "combat boots" @@ -55,7 +53,13 @@ desc = "A pair of orange rubber boots, designed to prevent slipping on wet surfaces while also drying them." icon_state = "galoshes_dry" -/obj/item/clothing/shoes/galoshes/dry/step_action() +/obj/item/clothing/shoes/galoshes/dry/Initialize(mapload) + . = ..() + RegisterSignal(src, COMSIG_SHOES_STEP_ACTION, PROC_REF(on_step)) + +/obj/item/clothing/shoes/galoshes/dry/proc/on_step() + SIGNAL_HANDLER + var/turf/open/t_loc = get_turf(src) SEND_SIGNAL(t_loc, COMSIG_TURF_MAKE_DRY, TURF_WET_WATER, TRUE, INFINITY) diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm index b3640ae6f1abb..e6de200042cbb 100644 --- a/code/modules/mob/living/carbon/human/human_movement.dm +++ b/code/modules/mob/living/carbon/human/human_movement.dm @@ -43,8 +43,7 @@ /mob/living/carbon/human/Move(NewLoc, direct) . = ..() if(shoes && (mobility_flags & MOBILITY_STAND) && loc == NewLoc && has_gravity(loc)) - var/obj/item/clothing/shoes/S = shoes - S.step_action() + SEND_SIGNAL(shoes, COMSIG_SHOES_STEP_ACTION) /mob/living/carbon/human/Process_Spacemove(movement_dir = 0) //Temporary laziness thing. Will change to handles by species reee. if(dna.species.space_move(src))