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:
Watermelon914
2021-06-14 13:03:53 -07:00
committed by GitHub
parent b9982f6970
commit 375a20e49b
1676 changed files with 15455 additions and 15226 deletions
+2 -2
View File
@@ -67,7 +67,7 @@
STR.max_combined_w_class = 35
/obj/item/storage/backpack/holding/suicide_act(mob/living/user)
user.visible_message("<span class='suicide'>[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide.</span>")
user.visible_message(span_suicide("[user] is jumping into [src]! It looks like [user.p_theyre()] trying to commit suicide."))
user.dropItemToGround(src, TRUE)
user.Stun(100, ignore_canstun = TRUE)
sleep(20)
@@ -92,7 +92,7 @@
STR.max_combined_w_class = 60
/obj/item/storage/backpack/santabag/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] places [src] over [user.p_their()] head and pulls it tight! It looks like [user.p_they()] [user.p_are()]n't in the Christmas spirit...</span>")
user.visible_message(span_suicide("[user] places [src] over [user.p_their()] head and pulls it tight! It looks like [user.p_they()] [user.p_are()]n't in the Christmas spirit..."))
return (OXYLOSS)
/obj/item/storage/backpack/santabag/proc/regenerate_presents()
+7 -7
View File
@@ -51,7 +51,7 @@
STR.set_holdable(null, list(/obj/item/disk/nuclear))
/obj/item/storage/bag/trash/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!</span>")
user.visible_message(span_suicide("[user] puts [src] over [user.p_their()] head and starts chomping at the insides! Disgusting!"))
playsound(loc, 'sound/items/eatfood.ogg', 50, TRUE, -1)
return (TOXLOSS)
@@ -76,7 +76,7 @@
J.mybag=src
J.update_appearance()
else
to_chat(user, "<span class='warning'>You are unable to fit your [name] into the [J.name].</span>")
to_chat(user, span_warning("You are unable to fit your [name] into the [J.name]."))
return
/obj/item/storage/bag/trash/filled
@@ -164,17 +164,17 @@
show_message = TRUE
else
if(!spam_protection)
to_chat(user, "<span class='warning'>Your [name] is full and can't hold any more!</span>")
to_chat(user, span_warning("Your [name] is full and can't hold any more!"))
spam_protection = TRUE
continue
if(show_message)
playsound(user, "rustle", 50, TRUE)
if (box)
user.visible_message("<span class='notice'>[user] offloads the ores beneath [user.p_them()] into [box].</span>", \
"<span class='notice'>You offload the ores beneath you into your [box].</span>")
user.visible_message(span_notice("[user] offloads the ores beneath [user.p_them()] into [box]."), \
span_notice("You offload the ores beneath you into your [box]."))
else
user.visible_message("<span class='notice'>[user] scoops up the ores beneath [user.p_them()].</span>", \
"<span class='notice'>You scoop up the ores beneath you with your [name].</span>")
user.visible_message(span_notice("[user] scoops up the ores beneath [user.p_them()]."), \
span_notice("You scoop up the ores beneath you with your [name]."))
spam_protection = FALSE
/obj/item/storage/bag/ore/cyborg
+4 -4
View File
@@ -15,7 +15,7 @@
var/content_overlays = FALSE //If this is true, the belt will gain overlays based on what it's holding
/obj/item/storage/belt/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins belting [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] begins belting [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/storage/belt/update_overlays()
@@ -702,18 +702,18 @@
/obj/item/storage/belt/sabre/examine(mob/user)
. = ..()
if(length(contents))
. += "<span class='notice'>Alt-click it to quickly draw the blade.</span>"
. += span_notice("Alt-click it to quickly draw the blade.")
/obj/item/storage/belt/sabre/AltClick(mob/user)
if(!user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, TRUE))
return
if(length(contents))
var/obj/item/I = contents[1]
user.visible_message("<span class='notice'>[user] takes [I] out of [src].</span>", "<span class='notice'>You take [I] out of [src].</span>")
user.visible_message(span_notice("[user] takes [I] out of [src]."), span_notice("You take [I] out of [src]."))
user.put_in_hands(I)
update_appearance()
else
to_chat(user, "<span class='warning'>[src] is empty!</span>")
to_chat(user, span_warning("[src] is empty!"))
/obj/item/storage/belt/sabre/update_icon_state()
icon_state = initial(inhand_icon_state)
+28 -28
View File
@@ -16,7 +16,7 @@
STR.max_items = 1
/obj/item/storage/book/attack_self(mob/user)
to_chat(user, "<span class='notice'>The pages of [title] have been cut out!</span>")
to_chat(user, span_notice("The pages of [title] have been cut out!"))
GLOBAL_LIST_INIT(biblenames, list("Bible", "Quran", "Scrapbook", "Burning Bible", "Clown Bible", "Banana Bible", "Creeper Bible", "White Bible", "Holy Light", "The God Delusion", "Tome", "The King in Yellow", "Ithaqua", "Scientology", "Melted Bible", "Necronomicon", "Insulationism", "Guru Granth Sahib"))
//If you get these two lists not matching in size, there will be runtimes and I will hurt you in ways you couldn't even begin to imagine
@@ -48,7 +48,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
AddComponent(/datum/component/anti_magic, FALSE, TRUE)
/obj/item/storage/book/bible/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is offering [user.p_them()]self to [deity_name]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] is offering [user.p_them()]self to [deity_name]! It looks like [user.p_theyre()] trying to commit suicide!"))
return (BRUTELOSS)
/obj/item/storage/book/bible/attack_self(mob/living/carbon/human/user)
@@ -118,7 +118,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
for(var/X in H.bodyparts)
var/obj/item/bodypart/BP = X
if(BP.status == BODYPART_ROBOTIC)
to_chat(user, "<span class='warning'>[src.deity_name] refuses to heal this metallic taint!</span>")
to_chat(user, span_warning("[src.deity_name] refuses to heal this metallic taint!"))
return 0
var/heal_amt = 10
@@ -129,8 +129,8 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
var/obj/item/bodypart/affecting = X
if(affecting.heal_damage(heal_amt, heal_amt, null, BODYPART_ORGANIC))
H.update_damage_overlays()
H.visible_message("<span class='notice'>[user] heals [H] with the power of [deity_name]!</span>")
to_chat(H, "<span class='boldnotice'>May the power of [deity_name] compel you to be healed!</span>")
H.visible_message(span_notice("[user] heals [H] with the power of [deity_name]!"))
to_chat(H, span_boldnotice("May the power of [deity_name] compel you to be healed!"))
playsound(src.loc, "punch", 25, TRUE, -1)
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "blessing", /datum/mood_event/blessing)
return 1
@@ -138,11 +138,11 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
/obj/item/storage/book/bible/attack(mob/living/M, mob/living/carbon/human/user, heal_mode = TRUE)
if (!ISADVANCEDTOOLUSER(user))
to_chat(user, "<span class='warning'>You don't have the dexterity to do this!</span>")
to_chat(user, span_warning("You don't have the dexterity to do this!"))
return
if (HAS_TRAIT(user, TRAIT_CLUMSY) && prob(50))
to_chat(user, "<span class='danger'>[src] slips out of your hand and hits your head.</span>")
to_chat(user, span_danger("[src] slips out of your hand and hits your head."))
user.take_bodypart_damage(10)
user.Unconscious(400)
return
@@ -152,7 +152,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
chaplain = 1
if(!chaplain)
to_chat(user, "<span class='danger'>The book sizzles in your hands.</span>")
to_chat(user, span_danger("The book sizzles in your hands."))
user.take_bodypart_damage(0,10)
return
@@ -163,7 +163,7 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
if (M.stat != DEAD)
if(chaplain && user == M)
to_chat(user, "<span class='warning'>You can't heal yourself!</span>")
to_chat(user, span_warning("You can't heal yourself!"))
return
if(prob(60) && bless(M, user))
@@ -172,16 +172,16 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
var/mob/living/carbon/C = M
if(!istype(C.head, /obj/item/clothing/head/helmet))
C.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5, 60)
to_chat(C, "<span class='danger'>You feel dumber.</span>")
to_chat(C, span_danger("You feel dumber."))
if(smack)
M.visible_message("<span class='danger'>[user] beats [M] over the head with [src]!</span>", \
"<span class='userdanger'>[user] beats [M] over the head with [src]!</span>")
M.visible_message(span_danger("[user] beats [M] over the head with [src]!"), \
span_userdanger("[user] beats [M] over the head with [src]!"))
playsound(src.loc, "punch", 25, TRUE, -1)
log_combat(user, M, "attacked", src)
else
M.visible_message("<span class='danger'>[user] smacks [M]'s lifeless corpse with [src].</span>")
M.visible_message(span_danger("[user] smacks [M]'s lifeless corpse with [src]."))
playsound(src.loc, "punch", 25, TRUE, -1)
/obj/item/storage/book/bible/afterattack(atom/A, mob/user, proximity)
@@ -189,30 +189,30 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
if(!proximity)
return
if(isfloorturf(A))
to_chat(user, "<span class='notice'>You hit the floor with the bible.</span>")
to_chat(user, span_notice("You hit the floor with the bible."))
if(user.mind && (user.mind.holy_role))
for(var/obj/effect/rune/R in orange(2,user))
R.invisibility = 0
if(user?.mind?.holy_role)
if(A.reagents && A.reagents.has_reagent(/datum/reagent/water)) // blesses all the water in the holder
to_chat(user, "<span class='notice'>You bless [A].</span>")
to_chat(user, span_notice("You bless [A]."))
var/water2holy = A.reagents.get_reagent_amount(/datum/reagent/water)
A.reagents.del_reagent(/datum/reagent/water)
A.reagents.add_reagent(/datum/reagent/water/holywater,water2holy)
if(A.reagents && A.reagents.has_reagent(/datum/reagent/fuel/unholywater)) // yeah yeah, copy pasted code - sue me
to_chat(user, "<span class='notice'>You purify [A].</span>")
to_chat(user, span_notice("You purify [A]."))
var/unholy2clean = A.reagents.get_reagent_amount(/datum/reagent/fuel/unholywater)
A.reagents.del_reagent(/datum/reagent/fuel/unholywater)
A.reagents.add_reagent(/datum/reagent/water/holywater,unholy2clean)
if(istype(A, /obj/item/storage/book/bible) && !istype(A, /obj/item/storage/book/bible/syndicate))
to_chat(user, "<span class='notice'>You purify [A], conforming it to your belief.</span>")
to_chat(user, span_notice("You purify [A], conforming it to your belief."))
var/obj/item/storage/book/bible/B = A
B.name = name
B.icon_state = icon_state
B.inhand_icon_state = inhand_icon_state
if(istype(A, /obj/item/cult_bastard) && !IS_CULTIST(user))
var/obj/item/cult_bastard/sword = A
to_chat(user, "<span class='notice'>You begin to exorcise [sword].</span>")
to_chat(user, span_notice("You begin to exorcise [sword]."))
playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,TRUE)
if(do_after(user, 40, target = sword))
playsound(src,'sound/effects/pray_chaplain.ogg',60,TRUE)
@@ -229,13 +229,13 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
SS.release_shades(user)
qdel(SS)
new /obj/item/nullrod/claymore(get_turf(sword))
user.visible_message("<span class='notice'>[user] purifies [sword]!</span>")
user.visible_message(span_notice("[user] purifies [sword]!"))
qdel(sword)
else if(istype(A, /obj/item/soulstone) && !IS_CULTIST(user))
var/obj/item/soulstone/SS = A
if(SS.theme == THEME_HOLY)
return
to_chat(user, "<span class='notice'>You begin to exorcise [SS].</span>")
to_chat(user, span_notice("You begin to exorcise [SS]."))
playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,TRUE)
if(do_after(user, 40, target = SS))
playsound(src,'sound/effects/pray_chaplain.ogg',60,TRUE)
@@ -249,21 +249,21 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
for(var/mob/living/simple_animal/shade/EX in SS)
EX.icon_state = "ghost1"
EX.name = "Purified [initial(EX.name)]"
user.visible_message("<span class='notice'>[user] purifies [SS]!</span>")
user.visible_message(span_notice("[user] purifies [SS]!"))
else if(istype(A, /obj/item/nullrod/scythe/talking))
var/obj/item/nullrod/scythe/talking/sword = A
to_chat(user, "<span class='notice'>You begin to exorcise [sword]...</span>")
to_chat(user, span_notice("You begin to exorcise [sword]..."))
playsound(src,'sound/hallucinations/veryfar_noise.ogg',40,TRUE)
if(do_after(user, 40, target = sword))
playsound(src,'sound/effects/pray_chaplain.ogg',60,TRUE)
for(var/mob/living/simple_animal/shade/S in sword.contents)
to_chat(S, "<span class='userdanger'>You were destroyed by the exorcism!</span>")
to_chat(S, span_userdanger("You were destroyed by the exorcism!"))
qdel(S)
sword.possessed = FALSE //allows the chaplain (or someone else) to reroll a new spirit for their sword
sword.name = initial(sword.name)
REMOVE_TRAIT(sword, TRAIT_NODROP, HAND_REPLACEMENT_TRAIT) //in case the "sword" is a possessed dummy
user.visible_message("<span class='notice'>[user] exorcises [sword]!</span>", \
"<span class='notice'>You successfully exorcise [sword]!</span>")
user.visible_message(span_notice("[user] exorcises [sword]!"), \
span_notice("You successfully exorcise [sword]!"))
/obj/item/storage/book/bible/booze
desc = "To be applied to the head repeatedly."
@@ -289,12 +289,12 @@ GLOBAL_LIST_INIT(bibleitemstates, list("bible", "koran", "scrapbook", "burning",
if (uses)
H.mind.holy_role = HOLY_ROLE_PRIEST
uses -= 1
to_chat(H, "<span class='userdanger'>You try to open the book AND IT BITES YOU!</span>")
to_chat(H, span_userdanger("You try to open the book AND IT BITES YOU!"))
playsound(src.loc, 'sound/effects/snap.ogg', 50, TRUE)
H.apply_damage(5, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
to_chat(H, "<span class='notice'>Your name appears on the inside cover, in blood.</span>")
to_chat(H, span_notice("Your name appears on the inside cover, in blood."))
var/ownername = H.real_name
desc += "<span class='warning'>The name [ownername] is written in blood inside the cover.</span>"
desc += span_warning("The name [ownername] is written in blood inside the cover.")
/obj/item/storage/book/bible/syndicate/attack(mob/living/M, mob/living/carbon/human/user, heal_mode = TRUE)
if (!user.combat_mode)
+13 -13
View File
@@ -41,12 +41,12 @@
/obj/item/storage/box/suicide_act(mob/living/carbon/user)
var/obj/item/bodypart/head/myhead = user.get_bodypart(BODY_ZONE_HEAD)
if(myhead)
user.visible_message("<span class='suicide'>[user] puts [user.p_their()] head into \the [src], and begins closing it! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] puts [user.p_their()] head into \the [src], and begins closing it! It looks like [user.p_theyre()] trying to commit suicide!"))
myhead.dismember()
myhead.forceMove(src)//force your enemies to kill themselves with your head collection box!
playsound(user, "desecration-01.ogg", 50, TRUE, -1)
return BRUTELOSS
user.visible_message("<span class='suicide'>[user] beating [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] beating [user.p_them()]self with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/storage/box/update_overlays()
@@ -60,12 +60,12 @@
if(!foldable || (flags_1 & HOLOGRAM_1))
return
if(contents.len)
to_chat(user, "<span class='warning'>You can't fold this box with items still inside!</span>")
to_chat(user, span_warning("You can't fold this box with items still inside!"))
return
if(!ispath(foldable))
return
to_chat(user, "<span class='notice'>You fold [src] flat.</span>")
to_chat(user, span_notice("You fold [src] flat."))
var/obj/item/I = new foldable
qdel(src)
user.put_in_hands(I)
@@ -812,14 +812,14 @@
foldable = null
/obj/item/storage/box/hug/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] clamps the box of hugs on [user.p_their()] jugular! Guess it wasn't such a hugbox after all..</span>")
user.visible_message(span_suicide("[user] clamps the box of hugs on [user.p_their()] jugular! Guess it wasn't such a hugbox after all.."))
return (BRUTELOSS)
/obj/item/storage/box/hug/attack_self(mob/user)
..()
user.changeNext_move(CLICK_CD_MELEE)
playsound(loc, "rustle", 50, TRUE, -5)
user.visible_message("<span class='notice'>[user] hugs \the [src].</span>","<span class='notice'>You hug \the [src].</span>")
user.visible_message(span_notice("[user] hugs \the [src]."),span_notice("You hug \the [src]."))
/////clown box & honkbot assembly
/obj/item/storage/box/clown
@@ -830,12 +830,12 @@
/obj/item/storage/box/clown/attackby(obj/item/I, mob/user, params)
if((istype(I, /obj/item/bodypart/l_arm/robot)) || (istype(I, /obj/item/bodypart/r_arm/robot)))
if(contents.len) //prevent accidently deleting contents
to_chat(user, "<span class='warning'>You need to empty [src] out first!</span>")
to_chat(user, span_warning("You need to empty [src] out first!"))
return
if(!user.temporarilyRemoveItemFromInventory(I))
return
qdel(I)
to_chat(user, "<span class='notice'>You add some wheels to the [src]! You've got a honkbot assembly now! Honk!</span>")
to_chat(user, span_notice("You add some wheels to the [src]! You've got a honkbot assembly now! Honk!"))
var/obj/item/bot_assembly/honkbot/A = new
qdel(src)
user.put_in_hands(A)
@@ -970,19 +970,19 @@
desc = "A paper sack with a crude smile etched onto the side."
else
return FALSE
to_chat(user, "<span class='notice'>You make some modifications to [src] using your pen.</span>")
to_chat(user, span_notice("You make some modifications to [src] using your pen."))
icon_state = "paperbag_[choice]"
inhand_icon_state = "paperbag_[choice]"
return FALSE
else if(W.get_sharpness())
if(!contents.len)
if(inhand_icon_state == "paperbag_None")
user.show_message("<span class='notice'>You cut eyeholes into [src].</span>", MSG_VISUAL)
user.show_message(span_notice("You cut eyeholes into [src]."), MSG_VISUAL)
new /obj/item/clothing/head/papersack(user.loc)
qdel(src)
return FALSE
else if(inhand_icon_state == "paperbag_SmileyFace")
user.show_message("<span class='notice'>You cut eyeholes into [src] and modify the design.</span>", MSG_VISUAL)
user.show_message(span_notice("You cut eyeholes into [src] and modify the design."), MSG_VISUAL)
new /obj/item/clothing/head/papersack/smiley(user.loc)
qdel(src)
return FALSE
@@ -1001,10 +1001,10 @@
if(user.incapacitated())
return FALSE
if(contents.len)
to_chat(user, "<span class='warning'>You can't modify [src] with items still inside!</span>")
to_chat(user, span_warning("You can't modify [src] with items still inside!"))
return FALSE
if(!P || !user.is_holding(P))
to_chat(user, "<span class='warning'>You need a pen to modify [src]!</span>")
to_chat(user, span_warning("You need a pen to modify [src]!"))
return FALSE
return TRUE
+9 -9
View File
@@ -53,7 +53,7 @@
if(contents.len)
return
new fold_result(user.drop_location())
to_chat(user, "<span class='notice'>You fold the [src] into [initial(fold_result.name)].</span>")
to_chat(user, span_notice("You fold the [src] into [initial(fold_result.name)]."))
user.put_in_active_hand(fold_result)
qdel(src)
@@ -165,7 +165,7 @@
/obj/item/storage/fancy/candle_box/attack_self(mob/user)
if(!contents.len)
new fold_result(user.drop_location())
to_chat(user, "<span class='notice'>You fold the [src] into [initial(fold_result.name)].</span>")
to_chat(user, span_notice("You fold the [src] into [initial(fold_result.name)]."))
user.put_in_active_hand(fold_result)
qdel(src)
@@ -198,7 +198,7 @@
if(contents.len != 0 || !spawn_coupon)
return ..()
to_chat(user, "<span class='notice'>You rip the back off \the [src] and get a coupon!</span>")
to_chat(user, span_notice("You rip the back off \the [src] and get a coupon!"))
var/obj/item/coupon/attached_coupon = new
user.put_in_hands(attached_coupon)
attached_coupon.generate(rigged_omen)
@@ -219,9 +219,9 @@
/obj/item/storage/fancy/cigarettes/examine(mob/user)
. = ..()
. += "<span class='notice'>Alt-click to extract contents.</span>"
. += span_notice("Alt-click to extract contents.")
if(spawn_coupon)
. += "<span class='notice'>There's a coupon on the back of the pack! You can tear it off once it's empty.</span>"
. += span_notice("There's a coupon on the back of the pack! You can tear it off once it's empty.")
/obj/item/storage/fancy/cigarettes/AltClick(mob/user)
if(!user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, TRUE))
@@ -231,9 +231,9 @@
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, W, user)
user.put_in_hands(W)
contents -= W
to_chat(user, "<span class='notice'>You take \a [W] out of the pack.</span>")
to_chat(user, span_notice("You take \a [W] out of the pack."))
else
to_chat(user, "<span class='notice'>There are no [contents_tag]s left in the pack.</span>")
to_chat(user, span_notice("There are no [contents_tag]s left in the pack."))
/obj/item/storage/fancy/cigarettes/update_icon_state()
. = ..()
@@ -269,7 +269,7 @@
var/obj/item/clothing/mask/cigarette/cig = locate() in contents
if(!cig)
to_chat(user, "<span class='notice'>There are no [contents_tag]s left in the pack.</span>")
to_chat(user, span_notice("There are no [contents_tag]s left in the pack."))
return
if(target != user || !contents.len || user.wear_mask)
return ..()
@@ -277,7 +277,7 @@
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_TAKE, cig, target)
target.equip_to_slot_if_possible(cig, ITEM_SLOT_MASK)
contents -= cig
to_chat(user, "<span class='notice'>You take \a [cig] out of the pack.</span>")
to_chat(user, span_notice("You take \a [cig] out of the pack."))
return
+12 -12
View File
@@ -24,7 +24,7 @@
desc = "A first aid kit with the ability to heal common types of injuries."
/obj/item/storage/firstaid/regular/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins giving [user.p_them()]self aids with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] begins giving [user.p_them()]self aids with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/storage/firstaid/regular/PopulateContents()
@@ -158,7 +158,7 @@
damagetype_healed = BURN
/obj/item/storage/firstaid/fire/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins rubbing \the [src] against [user.p_them()]self! It looks like [user.p_theyre()] trying to start a fire!</span>")
user.visible_message(span_suicide("[user] begins rubbing \the [src] against [user.p_them()]self! It looks like [user.p_theyre()] trying to start a fire!"))
return FIRELOSS
/obj/item/storage/firstaid/fire/Initialize(mapload)
@@ -183,7 +183,7 @@
damagetype_healed = TOX
/obj/item/storage/firstaid/toxin/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins licking the lead paint off \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] begins licking the lead paint off \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return TOXLOSS
/obj/item/storage/firstaid/toxin/Initialize(mapload)
@@ -208,7 +208,7 @@
damagetype_healed = OXY
/obj/item/storage/firstaid/o2/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins hitting [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] begins hitting [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return OXYLOSS
/obj/item/storage/firstaid/o2/Initialize(mapload)
@@ -233,7 +233,7 @@
damagetype_healed = BRUTE
/obj/item/storage/firstaid/brute/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins beating [user.p_them()]self over the head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] begins beating [user.p_them()]self over the head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/storage/firstaid/brute/Initialize(mapload)
@@ -298,7 +298,7 @@
//Making a medibot!
if(contents.len >= 1)
to_chat(user, "<span class='warning'>You need to empty [src] out first!</span>")
to_chat(user, span_warning("You need to empty [src] out first!"))
return
var/obj/item/bot_assembly/medbot/A = new
@@ -313,7 +313,7 @@
else if (istype(src, /obj/item/storage/firstaid/advanced))
A.set_skin("advanced")
user.put_in_hands(A)
to_chat(user, "<span class='notice'>You add [S] to [src].</span>")
to_chat(user, span_notice("You add [S] to [src]."))
A.robot_arm = S.type
A.firstaid = type
qdel(S)
@@ -341,7 +341,7 @@
STR.set_holdable(list(/obj/item/reagent_containers/pill, /obj/item/dice))
/obj/item/storage/pill_bottle/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] is trying to get the cap off [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] is trying to get the cap off [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return (TOXLOSS)
/obj/item/storage/pill_bottle/multiver
@@ -622,18 +622,18 @@
var/obj/item/reagent_containers/RC = I
var/units = RC.reagents.trans_to(src, RC.amount_per_transfer_from_this, transfered_by = user)
if(units)
to_chat(user, "<span class='notice'>You transfer [units] units of the solution to [src].</span>")
to_chat(user, span_notice("You transfer [units] units of the solution to [src]."))
return
if(istype(I, /obj/item/plunger))
to_chat(user, "<span class='notice'>You start furiously plunging [name].</span>")
to_chat(user, span_notice("You start furiously plunging [name]."))
if(do_after(user, 10, target = src))
to_chat(user, "<span class='notice'>You finish plunging the [name].</span>")
to_chat(user, span_notice("You finish plunging the [name]."))
reagents.clear_reagents()
return
return ..()
/obj/item/storage/organbox/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] is putting [user.p_theyre()] head inside the [src], it looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] is putting [user.p_theyre()] head inside the [src], it looks like [user.p_theyre()] trying to commit suicide!"))
user.adjust_bodytemperature(-300)
user.apply_status_effect(/datum/status_effect/freon)
return (OXYLOSS)
+9 -9
View File
@@ -25,27 +25,27 @@
var/locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(W.GetID())
if(broken)
to_chat(user, "<span class='danger'>It appears to be broken.</span>")
to_chat(user, span_danger("It appears to be broken."))
return
if(allowed(user))
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, !locked)
locked = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
if(locked)
icon_state = icon_locked
to_chat(user, "<span class='danger'>You lock the [src.name]!</span>")
to_chat(user, span_danger("You lock the [src.name]!"))
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_HIDE_ALL)
return
else
icon_state = icon_closed
to_chat(user, "<span class='danger'>You unlock the [src.name]!</span>")
to_chat(user, span_danger("You unlock the [src.name]!"))
return
else
to_chat(user, "<span class='danger'>Access Denied.</span>")
to_chat(user, span_danger("Access Denied."))
return
if(!locked)
return ..()
else
to_chat(user, "<span class='danger'>It's locked!</span>")
to_chat(user, span_danger("It's locked!"))
/obj/item/storage/lockbox/emag_act(mob/user)
if(!broken)
@@ -54,7 +54,7 @@
desc += "It appears to be broken."
icon_state = src.icon_broken
if(user)
visible_message("<span class='warning'>\The [src] is broken by [user] with an electromagnetic card!</span>")
visible_message(span_warning("\The [src] is broken by [user] with an electromagnetic card!"))
return
/obj/item/storage/lockbox/Entered()
@@ -108,7 +108,7 @@
/obj/item/storage/lockbox/medal/examine(mob/user)
. = ..()
if(!SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED))
. += "<span class='notice'>Alt-click to [open ? "close":"open"] it.</span>"
. += span_notice("Alt-click to [open ? "close":"open"] it.")
/obj/item/storage/lockbox/medal/AltClick(mob/user)
if(user.canUseTopic(src, BE_CLOSE))
@@ -233,6 +233,6 @@
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_SET_LOCKSTATE, !privacy_lock)
privacy_lock = SEND_SIGNAL(src, COMSIG_IS_STORAGE_LOCKED)
user.visible_message("<span class='notice'>[user] [privacy_lock ? "" : "un"]locks [src]'s privacy lock.</span>",
"<span class='notice'>You [privacy_lock ? "" : "un"]lock [src]'s privacy lock.</span>")
user.visible_message(span_notice("[user] [privacy_lock ? "" : "un"]locks [src]'s privacy lock."),
span_notice("You [privacy_lock ? "" : "un"]lock [src]'s privacy lock."))
+6 -6
View File
@@ -41,26 +41,26 @@
if (W.tool_behaviour == TOOL_SCREWDRIVER)
if (W.use_tool(src, user, 20))
open = !open
to_chat(user, "<span class='notice'>You [open ? "open" : "close"] the service panel.</span>")
to_chat(user, span_notice("You [open ? "open" : "close"] the service panel."))
return
if (W.tool_behaviour == TOOL_WIRECUTTER)
to_chat(user, "<span class='danger'>[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be <b>pulsed</b>.</span>")
to_chat(user, span_danger("[src] is protected from this sort of tampering, yet it appears the internal memory wires can still be <b>pulsed</b>."))
return
if (W.tool_behaviour == TOOL_MULTITOOL)
if(l_hacking)
to_chat(user, "<span class='danger'>This safe is already being hacked.</span>")
to_chat(user, span_danger("This safe is already being hacked."))
return
if(open == TRUE)
to_chat(user, "<span class='danger'>Now attempting to reset internal memory, please hold.</span>")
to_chat(user, span_danger("Now attempting to reset internal memory, please hold."))
l_hacking = TRUE
if (W.use_tool(src, user, 400))
to_chat(user, "<span class='danger'>Internal memory reset - lock has been disengaged.</span>")
to_chat(user, span_danger("Internal memory reset - lock has been disengaged."))
l_set = FALSE
l_hacking = FALSE
return
to_chat(user, "<span class='warning'>You must <b>unscrew</b> the service panel before you can pulse the wiring!</span>")
to_chat(user, span_warning("You must <b>unscrew</b> the service panel before you can pulse the wiring!"))
return
// -> storage/attackby() what with handle insertion, etc
+1 -1
View File
@@ -10,7 +10,7 @@
max_integrity = 500
/obj/item/storage/cans/suicide_act(mob/living/carbon/user)
user.visible_message("<span class='suicide'>[user] begins popping open a final cold one with the boys! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] begins popping open a final cold one with the boys! It looks like [user.p_theyre()] trying to commit suicide!"))
return BRUTELOSS
/obj/item/storage/cans/update_icon_state()
+4 -4
View File
@@ -38,7 +38,7 @@
/obj/item/storage/toolbox/suicide_act(mob/user)
user.visible_message("<span class='suicide'>[user] robusts [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
user.visible_message(span_suicide("[user] robusts [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
return (BRUTELOSS)
/obj/item/storage/toolbox/emergency
@@ -292,7 +292,7 @@
if(!is_type_in_list(src, allowed_toolbox) && (type != /obj/item/storage/toolbox))
return
if(contents.len >= 1)
to_chat(user, "<span class='warning'>They won't fit in, as there is already stuff inside!</span>")
to_chat(user, span_warning("They won't fit in, as there is already stuff inside!"))
return
if(T.use(10))
var/obj/item/bot_assembly/floorbot/B = new
@@ -310,10 +310,10 @@
B.toolbox_color = "s"
user.put_in_hands(B)
B.update_appearance()
to_chat(user, "<span class='notice'>You add the tiles into the empty [name]. They protrude from the top.</span>")
to_chat(user, span_notice("You add the tiles into the empty [name]. They protrude from the top."))
qdel(src)
else
to_chat(user, "<span class='warning'>You need 10 floor tiles to start building a floorbot!</span>")
to_chat(user, span_warning("You need 10 floor tiles to start building a floorbot!"))
return
+1 -1
View File
@@ -117,7 +117,7 @@
/obj/item/storage/wallet/examine()
. = ..()
if(front_id)
. += "<span class='notice'>Alt-click to remove the id.</span>"
. += span_notice("Alt-click to remove the id.")
/obj/item/storage/wallet/get_id_examine_strings(mob/user)
. = ..()