Skip to content

Commit

Permalink
step_action to pure signals (#10694)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsar-Salat authored May 8, 2024
1 parent 8641b07 commit c19510a
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
28 changes: 16 additions & 12 deletions code/modules/clothing/shoes/bananashoes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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, "<span class='warning'>You ran out of bananium!</span>")
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, "<span class='warning'>You ran out of bananium!</span>")
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)
Expand Down
5 changes: 4 additions & 1 deletion code/modules/clothing/shoes/cluwne.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 7 additions & 3 deletions code/modules/clothing/shoes/miscellaneous.dm
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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)

Expand Down
3 changes: 1 addition & 2 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c19510a

Please sign in to comment.