mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-25 14:08:31 +01:00
Refactors most spans into span procs (#59645)
Converts most spans into span procs. Mostly used regex for this and sorted out any compile time errors afterwards so there could be some bugs. Was initially going to do defines, but ninja said to make it into a proc, and if there's any overhead, they can easily be changed to defines. Makes it easier to control the formatting and prevents typos when creating spans as it'll runtime if you misspell instead of silently failing. Reduces the code you need to write when writing spans, as you don't need to close the span as that's automatically handled by the proc. (Note from Lemon: This should be converted to defines once we update the minimum version to 514. Didn't do it now because byond pain and such)
This commit is contained in:
@@ -45,7 +45,7 @@
|
||||
AddElement(/datum/element/eyestab)
|
||||
|
||||
/obj/item/kitchen/fork/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] stabs \the [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to take a bite out of [user.p_them()]self!</span>")
|
||||
user.visible_message(span_suicide("[user] stabs \the [src] into [user.p_their()] chest! It looks like [user.p_theyre()] trying to take a bite out of [user.p_them()]self!"))
|
||||
playsound(src, 'sound/items/eatfood.ogg', 50, TRUE)
|
||||
return BRUTELOSS
|
||||
|
||||
@@ -55,10 +55,10 @@
|
||||
|
||||
if(forkload)
|
||||
if(M == user)
|
||||
M.visible_message("<span class='notice'>[user] eats a delicious forkful of omelette!</span>")
|
||||
M.visible_message(span_notice("[user] eats a delicious forkful of omelette!"))
|
||||
M.reagents.add_reagent(forkload.type, 1)
|
||||
else
|
||||
M.visible_message("<span class='notice'>[user] feeds [M] a delicious forkful of omelette!</span>")
|
||||
M.visible_message(span_notice("[user] feeds [M] a delicious forkful of omelette!"))
|
||||
M.reagents.add_reagent(forkload.type, 1)
|
||||
icon_state = "fork"
|
||||
forkload = null
|
||||
@@ -112,9 +112,9 @@
|
||||
AddComponent(/datum/component/butchering, 80 - force, 100, force - 10) //bonus chance increases depending on force
|
||||
|
||||
/obj/item/kitchen/knife/suicide_act(mob/user)
|
||||
user.visible_message(pick("<span class='suicide'>[user] is slitting [user.p_their()] wrists with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.</span>", \
|
||||
"<span class='suicide'>[user] is slitting [user.p_their()] throat with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide.</span>", \
|
||||
"<span class='suicide'>[user] is slitting [user.p_their()] stomach open with the [src.name]! It looks like [user.p_theyre()] trying to commit seppuku.</span>"))
|
||||
user.visible_message(pick(span_suicide("[user] is slitting [user.p_their()] wrists with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide."), \
|
||||
span_suicide("[user] is slitting [user.p_their()] throat with the [src.name]! It looks like [user.p_theyre()] trying to commit suicide."), \
|
||||
span_suicide("[user] is slitting [user.p_their()] stomach open with the [src.name]! It looks like [user.p_theyre()] trying to commit seppuku.")))
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/kitchen/knife/plastic
|
||||
@@ -258,7 +258,7 @@
|
||||
custom_materials = null
|
||||
|
||||
/obj/item/kitchen/knife/shiv/carrot/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] forcefully drives \the [src] into [user.p_their()] eye! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.visible_message(span_suicide("[user] forcefully drives \the [src] into [user.p_their()] eye! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/kitchen/rollingpin
|
||||
@@ -278,7 +278,7 @@
|
||||
tool_behaviour = TOOL_ROLLINGPIN
|
||||
|
||||
/obj/item/kitchen/rollingpin/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins flattening [user.p_their()] head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.visible_message(span_suicide("[user] begins flattening [user.p_their()] head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return BRUTELOSS
|
||||
/* Trays moved to /obj/item/storage/bag */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user