mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-28 15:47:15 +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:
@@ -31,7 +31,7 @@
|
||||
return 1
|
||||
|
||||
/obj/item/stack/ore/bluespace_crystal/attack_self(mob/user)
|
||||
user.visible_message("<span class='warning'>[user] crushes [src]!</span>", "<span class='danger'>You crush [src]!</span>")
|
||||
user.visible_message(span_warning("[user] crushes [src]!"), span_danger("You crush [src]!"))
|
||||
new /obj/effect/particle_effect/sparks(loc)
|
||||
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
blink_mob(user)
|
||||
@@ -42,7 +42,7 @@
|
||||
|
||||
/obj/item/stack/ore/bluespace_crystal/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
|
||||
if(!..()) // not caught in mid-air
|
||||
visible_message("<span class='notice'>[src] fizzles and disappears upon impact!</span>")
|
||||
visible_message(span_notice("[src] fizzles and disappears upon impact!"))
|
||||
var/turf/T = get_turf(hit_atom)
|
||||
new /obj/effect/particle_effect/sparks(T)
|
||||
playsound(loc, "sparks", 50, TRUE, SHORT_RANGE_SOUND_EXTRARANGE)
|
||||
@@ -79,7 +79,7 @@
|
||||
var/crystal_type = /obj/item/stack/ore/bluespace_crystal/refined
|
||||
|
||||
/obj/item/stack/sheet/bluespace_crystal/attack_self(mob/user)// to prevent the construction menu from ever happening
|
||||
to_chat(user, "<span class='warning'>You cannot crush the polycrystal in-hand, try breaking one off.</span>")
|
||||
to_chat(user, span_warning("You cannot crush the polycrystal in-hand, try breaking one off."))
|
||||
|
||||
//ATTACK HAND IGNORING PARENT RETURN VALUE
|
||||
/obj/item/stack/sheet/bluespace_crystal/attack_hand(mob/user, list/modifiers)
|
||||
@@ -90,8 +90,8 @@
|
||||
user.put_in_hands(BC)
|
||||
use(1)
|
||||
if(!amount)
|
||||
to_chat(user, "<span class='notice'>You break the final crystal off.</span>")
|
||||
to_chat(user, span_notice("You break the final crystal off."))
|
||||
else
|
||||
to_chat(user, "<span class='notice'>You break off a crystal.</span>")
|
||||
to_chat(user, span_notice("You break off a crystal."))
|
||||
else
|
||||
..()
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
return
|
||||
if(patient == user)
|
||||
if(!silent)
|
||||
user.visible_message("<span class='notice'>[user] starts to apply [src] on [user.p_them()]self...</span>", "<span class='notice'>You begin applying [src] on yourself...</span>")
|
||||
user.visible_message(span_notice("[user] starts to apply [src] on [user.p_them()]self..."), span_notice("You begin applying [src] on yourself..."))
|
||||
if(!do_mob(user, patient, self_delay, extra_checks=CALLBACK(patient, /mob/living/proc/try_inject, user, null, INJECT_TRY_SHOW_ERROR_MESSAGE)))
|
||||
return
|
||||
else if(other_delay)
|
||||
if(!silent)
|
||||
user.visible_message("<span class='notice'>[user] starts to apply [src] on [patient].</span>", "<span class='notice'>You begin applying [src] on [patient]...</span>")
|
||||
user.visible_message(span_notice("[user] starts to apply [src] on [patient]."), span_notice("You begin applying [src] on [patient]..."))
|
||||
if(!do_mob(user, patient, other_delay, extra_checks=CALLBACK(patient, /mob/living/proc/try_inject, user, null, INJECT_TRY_SHOW_ERROR_MESSAGE)))
|
||||
return
|
||||
|
||||
@@ -60,31 +60,31 @@
|
||||
/// Apply the actual effects of the healing if it's a simple animal, goes to [/obj/item/stack/medical/proc/heal_carbon] if it's a carbon, returns TRUE if it works, FALSE if it doesn't
|
||||
/obj/item/stack/medical/proc/heal(mob/living/patient, mob/user)
|
||||
if(patient.stat == DEAD)
|
||||
to_chat(user, "<span class='warning'>[patient] is dead! You can not help [patient.p_them()].</span>")
|
||||
to_chat(user, span_warning("[patient] is dead! You can not help [patient.p_them()]."))
|
||||
return
|
||||
if(isanimal(patient) && heal_brute) // only brute can heal
|
||||
var/mob/living/simple_animal/critter = patient
|
||||
if (!critter.healable)
|
||||
to_chat(user, "<span class='warning'>You cannot use [src] on [patient]!</span>")
|
||||
to_chat(user, span_warning("You cannot use [src] on [patient]!"))
|
||||
return FALSE
|
||||
else if (critter.health == critter.maxHealth)
|
||||
to_chat(user, "<span class='notice'>[patient] is at full health.</span>")
|
||||
to_chat(user, span_notice("[patient] is at full health."))
|
||||
return FALSE
|
||||
user.visible_message("<span class='infoplain'><span class='green'>[user] applies [src] on [patient].</span></span>", "<span class='infoplain'><span class='green'>You apply [src] on [patient].</span></span>")
|
||||
patient.heal_bodypart_damage((heal_brute * 0.5))
|
||||
return TRUE
|
||||
if(iscarbon(patient))
|
||||
return heal_carbon(patient, user, heal_brute, heal_burn)
|
||||
to_chat(user, "<span class='warning'>You can't heal [patient] with [src]!</span>")
|
||||
to_chat(user, span_warning("You can't heal [patient] with [src]!"))
|
||||
|
||||
/// The healing effects on a carbon patient. Since we have extra details for dealing with bodyparts, we get our own fancy proc. Still returns TRUE on success and FALSE on fail
|
||||
/obj/item/stack/medical/proc/heal_carbon(mob/living/carbon/C, mob/user, brute, burn)
|
||||
var/obj/item/bodypart/affecting = C.get_bodypart(check_zone(user.zone_selected))
|
||||
if(!affecting) //Missing limb?
|
||||
to_chat(user, "<span class='warning'>[C] doesn't have \a [parse_zone(user.zone_selected)]!</span>")
|
||||
to_chat(user, span_warning("[C] doesn't have \a [parse_zone(user.zone_selected)]!"))
|
||||
return FALSE
|
||||
if(affecting.status != BODYPART_ORGANIC) //Limb must be organic to be healed - RR
|
||||
to_chat(user, "<span class='warning'>[src] won't work on a robotic limb!</span>")
|
||||
to_chat(user, span_warning("[src] won't work on a robotic limb!"))
|
||||
return FALSE
|
||||
if(affecting.brute_dam && brute || affecting.burn_dam && burn)
|
||||
user.visible_message("<span class='infoplain'><span class='green'>[user] applies [src] on [C]'s [affecting.name].</span></span>", "<span class='infoplain'><span class='green'>You apply [src] on [C]'s [affecting.name].</span></span>")
|
||||
@@ -93,7 +93,7 @@
|
||||
C.update_damage_overlays()
|
||||
post_heal_effects(max(previous_damage - affecting.get_damage(), 0), C, user)
|
||||
return TRUE
|
||||
to_chat(user, "<span class='warning'>[C]'s [affecting.name] can not be healed with [src]!</span>")
|
||||
to_chat(user, span_warning("[C]'s [affecting.name] can not be healed with [src]!"))
|
||||
return FALSE
|
||||
|
||||
///Override this proc for special post heal effects.
|
||||
@@ -114,7 +114,7 @@
|
||||
merge_type = /obj/item/stack/medical/bruise_pack
|
||||
|
||||
/obj/item/stack/medical/bruise_pack/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.visible_message(span_suicide("[user] is bludgeoning [user.p_them()]self with [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/stack/medical/gauze
|
||||
@@ -138,10 +138,10 @@
|
||||
/obj/item/stack/medical/gauze/try_heal(mob/living/M, mob/user, silent)
|
||||
var/obj/item/bodypart/limb = M.get_bodypart(check_zone(user.zone_selected))
|
||||
if(!limb)
|
||||
to_chat(user, "<span class='notice'>There's nothing there to bandage!</span>")
|
||||
to_chat(user, span_notice("There's nothing there to bandage!"))
|
||||
return
|
||||
if(!LAZYLEN(limb.wounds))
|
||||
to_chat(user, "<span class='notice'>There's no wounds that require bandaging on [user==M ? "your" : "[M]'s"] [limb.name]!</span>") // good problem to have imo
|
||||
to_chat(user, span_notice("There's no wounds that require bandaging on [user==M ? "your" : "[M]'s"] [limb.name]!")) // good problem to have imo
|
||||
return
|
||||
|
||||
var/gauzeable_wound = FALSE
|
||||
@@ -151,14 +151,14 @@
|
||||
gauzeable_wound = TRUE
|
||||
break
|
||||
if(!gauzeable_wound)
|
||||
to_chat(user, "<span class='notice'>There's no wounds that require bandaging on [user==M ? "your" : "[M]'s"] [limb.name]!</span>") // good problem to have imo
|
||||
to_chat(user, span_notice("There's no wounds that require bandaging on [user==M ? "your" : "[M]'s"] [limb.name]!")) // good problem to have imo
|
||||
return
|
||||
|
||||
if(limb.current_gauze && (limb.current_gauze.absorption_capacity * 0.8 > absorption_capacity)) // ignore if our new wrap is < 20% better than the current one, so someone doesn't bandage it 5 times in a row
|
||||
to_chat(user, "<span class='warning'>The bandage currently on [user==M ? "your" : "[M]'s"] [limb.name] is still in good condition!</span>")
|
||||
to_chat(user, span_warning("The bandage currently on [user==M ? "your" : "[M]'s"] [limb.name] is still in good condition!"))
|
||||
return
|
||||
|
||||
user.visible_message("<span class='warning'>[user] begins wrapping the wounds on [M]'s [limb.name] with [src]...</span>", "<span class='warning'>You begin wrapping the wounds on [user == M ? "your" : "[M]'s"] [limb.name] with [src]...</span>")
|
||||
user.visible_message(span_warning("[user] begins wrapping the wounds on [M]'s [limb.name] with [src]..."), span_warning("You begin wrapping the wounds on [user == M ? "your" : "[M]'s"] [limb.name] with [src]..."))
|
||||
if(!do_after(user, (user == M ? self_delay : other_delay), target=M))
|
||||
return
|
||||
|
||||
@@ -171,18 +171,18 @@
|
||||
/obj/item/stack/medical/gauze/attackby(obj/item/I, mob/user, params)
|
||||
if(I.tool_behaviour == TOOL_WIRECUTTER || I.get_sharpness())
|
||||
if(get_amount() < 2)
|
||||
to_chat(user, "<span class='warning'>You need at least two gauzes to do this!</span>")
|
||||
to_chat(user, span_warning("You need at least two gauzes to do this!"))
|
||||
return
|
||||
new /obj/item/stack/sheet/cloth(user.drop_location())
|
||||
user.visible_message("<span class='notice'>[user] cuts [src] into pieces of cloth with [I].</span>", \
|
||||
"<span class='notice'>You cut [src] into pieces of cloth with [I].</span>", \
|
||||
"<span class='hear'>You hear cutting.</span>")
|
||||
user.visible_message(span_notice("[user] cuts [src] into pieces of cloth with [I]."), \
|
||||
span_notice("You cut [src] into pieces of cloth with [I]."), \
|
||||
span_hear("You hear cutting."))
|
||||
use(2)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/medical/gauze/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins tightening [src] around [user.p_their()] neck! It looks like [user.p_they()] forgot how to use medical supplies!</span>")
|
||||
user.visible_message(span_suicide("[user] begins tightening [src] around [user.p_their()] neck! It looks like [user.p_they()] forgot how to use medical supplies!"))
|
||||
return OXYLOSS
|
||||
|
||||
/obj/item/stack/medical/gauze/improvised
|
||||
@@ -256,7 +256,7 @@
|
||||
merge_type = /obj/item/stack/medical/ointment
|
||||
|
||||
/obj/item/stack/medical/ointment/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] is squeezing [src] into [user.p_their()] mouth! [user.p_do(TRUE)]n't [user.p_they()] know that stuff is toxic?</span>")
|
||||
user.visible_message(span_suicide("[user] is squeezing [src] into [user.p_their()] mouth! [user.p_do(TRUE)]n't [user.p_they()] know that stuff is toxic?"))
|
||||
return TOXLOSS
|
||||
|
||||
/obj/item/stack/medical/mesh
|
||||
@@ -291,26 +291,26 @@
|
||||
|
||||
/obj/item/stack/medical/mesh/try_heal(mob/living/M, mob/user, silent = FALSE)
|
||||
if(!is_open)
|
||||
to_chat(user, "<span class='warning'>You need to open [src] first.</span>")
|
||||
to_chat(user, span_warning("You need to open [src] first."))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/medical/mesh/AltClick(mob/living/user)
|
||||
if(!is_open)
|
||||
to_chat(user, "<span class='warning'>You need to open [src] first.</span>")
|
||||
to_chat(user, span_warning("You need to open [src] first."))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/medical/mesh/attack_hand(mob/user, list/modifiers)
|
||||
if(!is_open && user.get_inactive_held_item() == src)
|
||||
to_chat(user, "<span class='warning'>You need to open [src] first.</span>")
|
||||
to_chat(user, span_warning("You need to open [src] first."))
|
||||
return
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/medical/mesh/attack_self(mob/user)
|
||||
if(!is_open)
|
||||
is_open = TRUE
|
||||
to_chat(user, "<span class='notice'>You open the sterile mesh package.</span>")
|
||||
to_chat(user, span_notice("You open the sterile mesh package."))
|
||||
update_appearance()
|
||||
playsound(src, 'sound/items/poster_ripped.ogg', 20, TRUE)
|
||||
return
|
||||
@@ -368,16 +368,16 @@
|
||||
merge_type = /obj/item/stack/medical/bone_gel
|
||||
|
||||
/obj/item/stack/medical/bone_gel/attack(mob/living/M, mob/user)
|
||||
to_chat(user, "<span class='warning'>Bone gel can only be used on fractured limbs!</span>")
|
||||
to_chat(user, span_warning("Bone gel can only be used on fractured limbs!"))
|
||||
return
|
||||
|
||||
/obj/item/stack/medical/bone_gel/suicide_act(mob/user)
|
||||
if(!iscarbon(user))
|
||||
return
|
||||
var/mob/living/carbon/C = user
|
||||
C.visible_message("<span class='suicide'>[C] is squirting all of [src] into [C.p_their()] mouth! That's not proper procedure! It looks like [C.p_theyre()] trying to commit suicide!</span>")
|
||||
C.visible_message(span_suicide("[C] is squirting all of [src] into [C.p_their()] mouth! That's not proper procedure! It looks like [C.p_theyre()] trying to commit suicide!"))
|
||||
if(!do_after(C, 2 SECONDS))
|
||||
C.visible_message("<span class='suicide'>[C] screws up like an idiot and still dies anyway!</span>")
|
||||
C.visible_message(span_suicide("[C] screws up like an idiot and still dies anyway!"))
|
||||
return (BRUTELOSS)
|
||||
|
||||
C.emote("scream")
|
||||
|
||||
@@ -33,7 +33,7 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
|
||||
merge_type = /obj/item/stack/rods
|
||||
|
||||
/obj/item/stack/rods/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins to stuff \the [src] down [user.p_their()] throat! It looks like [user.p_theyre()] trying to commit suicide!</span>")//it looks like theyre ur mum
|
||||
user.visible_message(span_suicide("[user] begins to stuff \the [src] down [user.p_their()] throat! It looks like [user.p_theyre()] trying to commit suicide!"))//it looks like theyre ur mum
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/stack/rods/Initialize(mapload, new_amount, merge = TRUE, list/mat_override=null, mat_amt=1)
|
||||
@@ -55,14 +55,14 @@ GLOBAL_LIST_INIT(rod_recipes, list ( \
|
||||
/obj/item/stack/rods/attackby(obj/item/W, mob/user, params)
|
||||
if(W.tool_behaviour == TOOL_WELDER)
|
||||
if(get_amount() < 2)
|
||||
to_chat(user, "<span class='warning'>You need at least two rods to do this!</span>")
|
||||
to_chat(user, span_warning("You need at least two rods to do this!"))
|
||||
return
|
||||
|
||||
if(W.use_tool(src, user, 0, volume=40))
|
||||
var/obj/item/stack/sheet/iron/new_item = new(usr.loc)
|
||||
user.visible_message("<span class='notice'>[user.name] shaped [src] into iron sheets with [W].</span>", \
|
||||
"<span class='notice'>You shape [src] into iron sheets with [W].</span>", \
|
||||
"<span class='hear'>You hear welding.</span>")
|
||||
user.visible_message(span_notice("[user.name] shaped [src] into iron sheets with [W]."), \
|
||||
span_notice("You shape [src] into iron sheets with [W]."), \
|
||||
span_hear("You hear welding."))
|
||||
var/obj/item/stack/rods/R = src
|
||||
src = null
|
||||
var/replace = (user.get_inactive_held_item()==R)
|
||||
|
||||
@@ -33,7 +33,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
|
||||
source = /datum/robot_energy_storage/glass
|
||||
|
||||
/obj/item/stack/sheet/glass/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins to slice [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 to slice [user.p_their()] neck with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return BRUTELOSS
|
||||
|
||||
/obj/item/stack/sheet/glass/fifty
|
||||
@@ -52,7 +52,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
|
||||
return
|
||||
CC.use(5)
|
||||
use(1)
|
||||
to_chat(user, "<span class='notice'>You attach wire to the [name].</span>")
|
||||
to_chat(user, span_notice("You attach wire to the [name]."))
|
||||
var/obj/item/stack/light_w/new_tile = new(user.loc)
|
||||
new_tile.add_fingerprint(user)
|
||||
return
|
||||
@@ -67,7 +67,7 @@ GLOBAL_LIST_INIT(glass_recipes, list ( \
|
||||
if(QDELETED(src) && replace)
|
||||
user.put_in_hands(RG)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need one rod and one sheet of glass to make reinforced glass!</span>")
|
||||
to_chat(user, span_warning("You need one rod and one sheet of glass to make reinforced glass!"))
|
||||
return
|
||||
return ..()
|
||||
|
||||
@@ -112,7 +112,7 @@ GLOBAL_LIST_INIT(pglass_recipes, list ( \
|
||||
if(QDELETED(src) && replace)
|
||||
user.put_in_hands(RG)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need one rod and one sheet of plasma glass to make reinforced plasma glass!</span>")
|
||||
to_chat(user, span_warning("You need one rod and one sheet of plasma glass to make reinforced plasma glass!"))
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
@@ -267,7 +267,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
|
||||
|
||||
|
||||
/obj/item/shard/suicide_act(mob/user)
|
||||
user.visible_message("<span class='suicide'>[user] is slitting [user.p_their()] [pick("wrists", "throat")] with the shard of glass! It looks like [user.p_theyre()] trying to commit suicide.</span>")
|
||||
user.visible_message(span_suicide("[user] is slitting [user.p_their()] [pick("wrists", "throat")] with the shard of glass! It looks like [user.p_theyre()] trying to commit suicide."))
|
||||
return (BRUTELOSS)
|
||||
|
||||
|
||||
@@ -316,7 +316,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
|
||||
if(ishuman(user))
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(!H.gloves && !HAS_TRAIT(H, TRAIT_PIERCEIMMUNE)) // golems, etc
|
||||
to_chat(H, "<span class='warning'>[src] cuts into your hand!</span>")
|
||||
to_chat(H, span_warning("[src] cuts into your hand!"))
|
||||
H.apply_damage(force*0.5, BRUTE, hit_hand)
|
||||
|
||||
/obj/item/shard/attackby(obj/item/I, mob/user, params)
|
||||
@@ -325,11 +325,11 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
|
||||
L.attackby(src, user)
|
||||
else if(istype(I, /obj/item/stack/sheet/cloth))
|
||||
var/obj/item/stack/sheet/cloth/C = I
|
||||
to_chat(user, "<span class='notice'>You begin to wrap the [C] around the [src]...</span>")
|
||||
to_chat(user, span_notice("You begin to wrap the [C] around the [src]..."))
|
||||
if(do_after(user, 35, target = src))
|
||||
var/obj/item/kitchen/knife/shiv/S = new /obj/item/kitchen/knife/shiv
|
||||
C.use(1)
|
||||
to_chat(user, "<span class='notice'>You wrap the [C] around the [src] forming a makeshift weapon.</span>")
|
||||
to_chat(user, span_notice("You wrap the [C] around the [src] forming a makeshift weapon."))
|
||||
remove_item_from_storage(src)
|
||||
qdel(src)
|
||||
user.put_in_hands(S)
|
||||
@@ -347,7 +347,7 @@ GLOBAL_LIST_INIT(plastitaniumglass_recipes, list(
|
||||
if(G.amount >= G.max_amount)
|
||||
continue
|
||||
G.attackby(NG, user)
|
||||
to_chat(user, "<span class='notice'>You add the newly-formed [NG.name] to the stack. It now contains [NG.amount] sheet\s.</span>")
|
||||
to_chat(user, span_notice("You add the newly-formed [NG.name] to the stack. It now contains [NG.amount] sheet\s."))
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -10,5 +10,5 @@
|
||||
merge_type = /obj/item/stack/sheet/hot_ice
|
||||
|
||||
/obj/item/stack/sheet/hot_ice/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins licking \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.visible_message(span_suicide("[user] begins licking \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return FIRELOSS//dont you kids know that stuff is toxic?
|
||||
|
||||
@@ -251,9 +251,9 @@ GLOBAL_LIST_INIT(sinew_recipes, list ( \
|
||||
/obj/item/stack/sheet/animalhide/attackby(obj/item/W, mob/user, params)
|
||||
if(W.get_sharpness())
|
||||
playsound(loc, 'sound/weapons/slice.ogg', 50, TRUE, -1)
|
||||
user.visible_message("<span class='notice'>[user] starts cutting hair off \the [src].</span>", "<span class='notice'>You start cutting the hair off \the [src]...</span>", "<span class='hear'>You hear the sound of a knife rubbing against flesh.</span>")
|
||||
user.visible_message(span_notice("[user] starts cutting hair off \the [src]."), span_notice("You start cutting the hair off \the [src]..."), span_hear("You hear the sound of a knife rubbing against flesh."))
|
||||
if(do_after(user, 50, target = src))
|
||||
to_chat(user, "<span class='notice'>You cut the hair from this [src.singular_name].</span>")
|
||||
to_chat(user, span_notice("You cut the hair from this [src.singular_name]."))
|
||||
new /obj/item/stack/sheet/hairlesshide(user.drop_location(), 1)
|
||||
use(1)
|
||||
else
|
||||
|
||||
@@ -19,11 +19,11 @@
|
||||
var/obj/item/stack/sheet/iron/M = O
|
||||
if (M.use(1))
|
||||
var/obj/item/L = new /obj/item/stack/tile/light(user.drop_location())
|
||||
to_chat(user, "<span class='notice'>You make a light tile.</span>")
|
||||
to_chat(user, span_notice("You make a light tile."))
|
||||
L.add_fingerprint(user)
|
||||
use(1)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need one iron sheet to finish the light tile!</span>")
|
||||
to_chat(user, span_warning("You need one iron sheet to finish the light tile!"))
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -80,7 +80,7 @@ GLOBAL_LIST_INIT(sandbag_recipes, list ( \
|
||||
/obj/item/emptysandbag/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/stack/ore/glass))
|
||||
var/obj/item/stack/ore/glass/G = W
|
||||
to_chat(user, "<span class='notice'>You fill the sandbag.</span>")
|
||||
to_chat(user, span_notice("You fill the sandbag."))
|
||||
var/obj/item/stack/sheet/mineral/sandbags/I = new /obj/item/stack/sheet/mineral/sandbags(drop_location())
|
||||
qdel(src)
|
||||
if (Adjacent(user) && !issilicon(user))
|
||||
@@ -163,7 +163,7 @@ GLOBAL_LIST_INIT(uranium_recipes, list ( \
|
||||
walltype = /turf/closed/wall/mineral/plasma
|
||||
|
||||
/obj/item/stack/sheet/mineral/plasma/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins licking \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.visible_message(span_suicide("[user] begins licking \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return TOXLOSS//dont you kids know that stuff is toxic?
|
||||
|
||||
GLOBAL_LIST_INIT(plasma_recipes, list ( \
|
||||
|
||||
@@ -154,7 +154,7 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
|
||||
. += GLOB.metal_recipes
|
||||
|
||||
/obj/item/stack/sheet/iron/suicide_act(mob/living/carbon/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins whacking [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 whacking [user.p_them()]self over the head with \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
return BRUTELOSS
|
||||
|
||||
/*
|
||||
@@ -489,13 +489,13 @@ GLOBAL_LIST_INIT(cardboard_recipes, list ( \
|
||||
var/atom/droploc = drop_location()
|
||||
if(use(1))
|
||||
playsound(I, 'sound/items/bikehorn.ogg', 50, TRUE, -1)
|
||||
to_chat(user, "<span class='notice'>You stamp the cardboard! It's a clown box! Honk!</span>")
|
||||
to_chat(user, span_notice("You stamp the cardboard! It's a clown box! Honk!"))
|
||||
if (amount >= 0)
|
||||
new/obj/item/storage/box/clown(droploc) //bugfix
|
||||
if(istype(I, /obj/item/stamp/chameleon) && !istype(loc, /obj/item/storage))
|
||||
var/atom/droploc = drop_location()
|
||||
if(use(1))
|
||||
to_chat(user, "<span class='notice'>You stamp the cardboard in a sinister way.</span>")
|
||||
to_chat(user, span_notice("You stamp the cardboard in a sinister way."))
|
||||
if (amount >= 0)
|
||||
new/obj/item/storage/box/syndie_kit(droploc)
|
||||
else
|
||||
@@ -532,12 +532,12 @@ GLOBAL_LIST_INIT(runed_metal_recipes, list ( \
|
||||
|
||||
/obj/item/stack/sheet/runed_metal/attack_self(mob/living/user)
|
||||
if(!IS_CULTIST(user))
|
||||
to_chat(user, "<span class='warning'>Only one with forbidden knowledge could hope to work this metal...</span>")
|
||||
to_chat(user, span_warning("Only one with forbidden knowledge could hope to work this metal..."))
|
||||
return
|
||||
var/turf/T = get_turf(user) //we may have moved. adjust as needed...
|
||||
var/area/A = get_area(user)
|
||||
if((!is_station_level(T.z) && !is_mining_level(T.z)) || (A && !(A.area_flags & CULT_PERMITTED)))
|
||||
to_chat(user, "<span class='warning'>The veil is not weak enough here.</span>")
|
||||
to_chat(user, span_warning("The veil is not weak enough here."))
|
||||
return FALSE
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -42,6 +42,6 @@
|
||||
user.do_attack_animation(src, ATTACK_EFFECT_BOOP)
|
||||
playsound(src, "shatter", 70, TRUE)
|
||||
use(1)
|
||||
user.visible_message("<span class='notice'>[user] shatters the sheet of [name] on the floor, leaving [english_list(shards)].</span>", \
|
||||
"<span class='notice'>You shatter the sheet of [name] on the floor, leaving [english_list(shards)].</span>")
|
||||
user.visible_message(span_notice("[user] shatters the sheet of [name] on the floor, leaving [english_list(shards)]."), \
|
||||
span_notice("You shatter the sheet of [name] on the floor, leaving [english_list(shards)]."))
|
||||
return TRUE
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
|
||||
/obj/item/stack/grind_requirements()
|
||||
if(is_cyborg)
|
||||
to_chat(usr, "<span class='warning'>[src] is electronically synthesized in your chassis and can't be ground up!</span>")
|
||||
to_chat(usr, span_warning("[src] is electronically synthesized in your chassis and can't be ground up!"))
|
||||
return
|
||||
return TRUE
|
||||
|
||||
@@ -159,7 +159,7 @@
|
||||
. += "There are [get_amount()] in the stack."
|
||||
else
|
||||
. += "There is [get_amount()] in the stack."
|
||||
. += "<span class='notice'><b>Right-click</b> with an empty hand to take a custom amount.</span>"
|
||||
. += span_notice("<b>Right-click</b> with an empty hand to take a custom amount.")
|
||||
|
||||
/obj/item/stack/proc/get_amount()
|
||||
if(is_cyborg)
|
||||
@@ -254,7 +254,7 @@
|
||||
return
|
||||
if(recipe.time)
|
||||
var/adjusted_time = 0
|
||||
usr.visible_message("<span class='notice'>[usr] starts building \a [recipe.title].</span>", "<span class='notice'>You start building \a [recipe.title]...</span>")
|
||||
usr.visible_message(span_notice("[usr] starts building \a [recipe.title]."), span_notice("You start building \a [recipe.title]..."))
|
||||
if(HAS_TRAIT(usr, recipe.trait_booster))
|
||||
adjusted_time = (recipe.time * recipe.trait_modifier)
|
||||
else
|
||||
@@ -312,9 +312,9 @@
|
||||
/obj/item/stack/proc/building_checks(datum/stack_recipe/recipe, multiplier)
|
||||
if (get_amount() < recipe.req_amount*multiplier)
|
||||
if (recipe.req_amount*multiplier>1)
|
||||
to_chat(usr, "<span class='warning'>You haven't got enough [src] to build \the [recipe.req_amount*multiplier] [recipe.title]\s!</span>")
|
||||
to_chat(usr, span_warning("You haven't got enough [src] to build \the [recipe.req_amount*multiplier] [recipe.title]\s!"))
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>You haven't got enough [src] to build \the [recipe.title]!</span>")
|
||||
to_chat(usr, span_warning("You haven't got enough [src] to build \the [recipe.title]!"))
|
||||
return FALSE
|
||||
var/turf/dest_turf = get_turf(usr)
|
||||
|
||||
@@ -322,16 +322,16 @@
|
||||
if(ispath(recipe.result_type, /obj/structure/window))
|
||||
var/obj/structure/window/result_path = recipe.result_type
|
||||
if(!valid_window_location(dest_turf, usr.dir, is_fulltile = initial(result_path.fulltile)))
|
||||
to_chat(usr, "<span class='warning'>The [recipe.title] won't fit here!</span>")
|
||||
to_chat(usr, span_warning("The [recipe.title] won't fit here!"))
|
||||
return FALSE
|
||||
|
||||
if(recipe.one_per_turf && (locate(recipe.result_type) in dest_turf))
|
||||
to_chat(usr, "<span class='warning'>There is another [recipe.title] here!</span>")
|
||||
to_chat(usr, span_warning("There is another [recipe.title] here!"))
|
||||
return FALSE
|
||||
|
||||
if(recipe.on_floor)
|
||||
if(!isfloorturf(dest_turf))
|
||||
to_chat(usr, "<span class='warning'>\The [recipe.title] must be constructed on the floor!</span>")
|
||||
to_chat(usr, span_warning("\The [recipe.title] must be constructed on the floor!"))
|
||||
return FALSE
|
||||
|
||||
for(var/obj/object in dest_turf)
|
||||
@@ -344,7 +344,7 @@
|
||||
if(!window_structure.fulltile)
|
||||
continue
|
||||
if(object.density || NO_BUILD & object.obj_flags)
|
||||
to_chat(usr, "<span class='warning'>There is \a [object.name] here. You can\'t make \a [recipe.title] here!</span>")
|
||||
to_chat(usr, span_warning("There is \a [object.name] here. You can\'t make \a [recipe.title] here!"))
|
||||
return FALSE
|
||||
if(recipe.placement_checks)
|
||||
switch(recipe.placement_checks)
|
||||
@@ -353,11 +353,11 @@
|
||||
for(var/direction in GLOB.cardinals)
|
||||
step = get_step(dest_turf, direction)
|
||||
if(locate(recipe.result_type) in step)
|
||||
to_chat(usr, "<span class='warning'>\The [recipe.title] must not be built directly adjacent to another!</span>")
|
||||
to_chat(usr, span_warning("\The [recipe.title] must not be built directly adjacent to another!"))
|
||||
return FALSE
|
||||
if(STACK_CHECK_ADJACENT)
|
||||
if(locate(recipe.result_type) in range(1, dest_turf))
|
||||
to_chat(usr, "<span class='warning'>\The [recipe.title] must be constructed at least one tile away from others of its type!</span>")
|
||||
to_chat(usr, span_warning("\The [recipe.title] must be constructed at least one tile away from others of its type!"))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
@@ -381,11 +381,11 @@
|
||||
if(get_amount() < amount)
|
||||
if(singular_name)
|
||||
if(amount > 1)
|
||||
to_chat(user, "<span class='warning'>You need at least [amount] [singular_name]\s to do this!</span>")
|
||||
to_chat(user, span_warning("You need at least [amount] [singular_name]\s to do this!"))
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least [amount] [singular_name] to do this!</span>")
|
||||
to_chat(user, span_warning("You need at least [amount] [singular_name] to do this!"))
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need at least [amount] to do this!</span>")
|
||||
to_chat(user, span_warning("You need at least [amount] to do this!"))
|
||||
|
||||
return FALSE
|
||||
|
||||
@@ -473,7 +473,7 @@
|
||||
if(stackmaterial == null || stackmaterial <= 0 || !user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user)))
|
||||
return SECONDARY_ATTACK_CONTINUE_CHAIN
|
||||
split_stack(user, stackmaterial)
|
||||
to_chat(user, "<span class='notice'>You take [stackmaterial] sheets out of the stack.</span>")
|
||||
to_chat(user, span_notice("You take [stackmaterial] sheets out of the stack."))
|
||||
return SECONDARY_ATTACK_CANCEL_ATTACK_CHAIN
|
||||
|
||||
/** Splits the stack into two stacks.
|
||||
@@ -499,7 +499,7 @@
|
||||
if(can_merge(W))
|
||||
var/obj/item/stack/S = W
|
||||
if(merge(S))
|
||||
to_chat(user, "<span class='notice'>Your [S.name] stack now contains [S.get_amount()] [S.singular_name]\s.</span>")
|
||||
to_chat(user, span_notice("Your [S.name] stack now contains [S.get_amount()] [S.singular_name]\s."))
|
||||
else
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -21,32 +21,32 @@
|
||||
/obj/item/stack/sticky_tape/afterattack(obj/item/I, mob/living/user, proximity)
|
||||
if(!proximity)
|
||||
return
|
||||
|
||||
|
||||
if(!istype(I))
|
||||
return
|
||||
|
||||
if(I.embedding && I.embedding == conferred_embed)
|
||||
to_chat(user, "<span class='warning'>[I] is already coated in [src]!</span>")
|
||||
to_chat(user, span_warning("[I] is already coated in [src]!"))
|
||||
return
|
||||
|
||||
user.visible_message("<span class='notice'>[user] begins wrapping [I] with [src].</span>", "<span class='notice'>You begin wrapping [I] with [src].</span>")
|
||||
user.visible_message(span_notice("[user] begins wrapping [I] with [src]."), span_notice("You begin wrapping [I] with [src]."))
|
||||
|
||||
if(do_after(user, 30, target=I))
|
||||
use(1)
|
||||
if(istype(I, /obj/item/clothing/gloves/fingerless))
|
||||
var/obj/item/clothing/gloves/tackler/offbrand/O = new /obj/item/clothing/gloves/tackler/offbrand
|
||||
to_chat(user, "<span class='notice'>You turn [I] into [O] with [src].</span>")
|
||||
to_chat(user, span_notice("You turn [I] into [O] with [src]."))
|
||||
QDEL_NULL(I)
|
||||
user.put_in_hands(O)
|
||||
return
|
||||
|
||||
if(I.embedding && I.embedding == conferred_embed)
|
||||
to_chat(user, "<span class='warning'>[I] is already coated in [src]!</span>")
|
||||
to_chat(user, span_warning("[I] is already coated in [src]!"))
|
||||
return
|
||||
|
||||
I.embedding = conferred_embed
|
||||
I.updateEmbedding()
|
||||
to_chat(user, "<span class='notice'>You finish wrapping [I] with [src].</span>")
|
||||
to_chat(user, span_notice("You finish wrapping [I] with [src]."))
|
||||
I.name = "[prefix] [I.name]"
|
||||
|
||||
if(istype(I, /obj/item/grenade))
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
if(hidden_uplink)
|
||||
hidden_uplink.telecrystals += amount
|
||||
use(amount)
|
||||
to_chat(user, "<span class='notice'>You press [src] onto yourself and charge your hidden uplink.</span>")
|
||||
to_chat(user, span_notice("You press [src] onto yourself and charge your hidden uplink."))
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
@@ -69,13 +69,13 @@
|
||||
/obj/item/stack/tile/iron/attackby(obj/item/W, mob/user, params)
|
||||
if(W.tool_behaviour == TOOL_WELDER)
|
||||
if(get_amount() < 4)
|
||||
to_chat(user, "<span class='warning'>You need at least four tiles to do this!</span>")
|
||||
to_chat(user, span_warning("You need at least four tiles to do this!"))
|
||||
return
|
||||
if(W.use_tool(src, user, 0, volume=40))
|
||||
var/obj/item/stack/sheet/iron/new_item = new(user.loc)
|
||||
user.visible_message("<span class='notice'>[user] shaped [src] into [new_item] with [W].</span>", \
|
||||
"<span class='notice'>You shaped [src] into [new_item] with [W].</span>", \
|
||||
"<span class='hear'>You hear welding.</span>")
|
||||
user.visible_message(span_notice("[user] shaped [src] into [new_item] with [W]."), \
|
||||
span_notice("You shaped [src] into [new_item] with [W]."), \
|
||||
span_hear("You hear welding."))
|
||||
var/holding = user.is_holding(src)
|
||||
use(4)
|
||||
if(holding && QDELETED(src))
|
||||
|
||||
@@ -5,18 +5,18 @@
|
||||
/obj/item/stack/tile/mineral/attackby(obj/item/W, mob/user, params)
|
||||
if(W.tool_behaviour == TOOL_WELDER)
|
||||
if(get_amount() < 4)
|
||||
to_chat(user, "<span class='warning'>You need at least four tiles to do this!</span>")
|
||||
to_chat(user, span_warning("You need at least four tiles to do this!"))
|
||||
return
|
||||
if(!mineralType)
|
||||
to_chat(user, "<span class='warning'>You can not reform this!</span>")
|
||||
to_chat(user, span_warning("You can not reform this!"))
|
||||
stack_trace("A mineral tile of type [type] doesn't have its' mineralType set.")
|
||||
return
|
||||
if(W.use_tool(src, user, 0, volume=40))
|
||||
var/sheet_type = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
|
||||
var/obj/item/stack/sheet/mineral/new_item = new sheet_type(user.loc)
|
||||
user.visible_message("<span class='notice'>[user] shaped [src] into [new_item] with [W].</span>", \
|
||||
"<span class='notice'>You shaped [src] into [new_item] with [W].</span>", \
|
||||
"<span class='hear'>You hear welding.</span>")
|
||||
user.visible_message(span_notice("[user] shaped [src] into [new_item] with [W]."), \
|
||||
span_notice("You shaped [src] into [new_item] with [W]."), \
|
||||
span_hear("You hear welding."))
|
||||
var/holding = user.is_holding(src)
|
||||
use(4)
|
||||
if(holding && QDELETED(src))
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
/obj/item/stack/tile/examine(mob/user)
|
||||
. = ..()
|
||||
if(tile_reskin_types || tile_rotate_dirs)
|
||||
. += "<span class='notice'>Use while in your hand to change what type of [src] you want.</span>"
|
||||
. += span_notice("Use while in your hand to change what type of [src] you want.")
|
||||
if(throwforce && !is_cyborg) //do not want to divide by zero or show the message to borgs who can't throw
|
||||
var/verb
|
||||
switch(CEILING(MAX_LIVING_HEALTH / throwforce, 1)) //throws to crit a human
|
||||
@@ -53,7 +53,7 @@
|
||||
verb = "mediocre"
|
||||
if(!verb)
|
||||
return
|
||||
. += "<span class='notice'>Those could work as a [verb] throwing weapon.</span>"
|
||||
. += span_notice("Those could work as a [verb] throwing weapon.")
|
||||
|
||||
|
||||
/obj/item/stack/tile/proc/place_tile(turf/open/T)
|
||||
|
||||
@@ -75,7 +75,7 @@
|
||||
merge_type = /obj/item/stack/package_wrap
|
||||
|
||||
/obj/item/stack/package_wrap/suicide_act(mob/living/user)
|
||||
user.visible_message("<span class='suicide'>[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
user.visible_message(span_suicide("[user] begins wrapping [user.p_them()]self in \the [src]! It looks like [user.p_theyre()] trying to commit suicide!"))
|
||||
if(use(3))
|
||||
var/obj/structure/big_delivery/P = new /obj/structure/big_delivery(get_turf(user.loc))
|
||||
P.icon_state = "deliverypackage5"
|
||||
@@ -83,7 +83,7 @@
|
||||
P.add_fingerprint(user)
|
||||
return OXYLOSS
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need more paper!</span>")
|
||||
to_chat(user, span_warning("You need more paper!"))
|
||||
return SHAME
|
||||
|
||||
/obj/item/proc/can_be_package_wrapped() //can the item be wrapped with package wrapper into a delivery package
|
||||
@@ -134,7 +134,7 @@
|
||||
if(O.opened)
|
||||
return
|
||||
if(!O.delivery_icon) //no delivery icon means unwrappable closet (e.g. body bags)
|
||||
to_chat(user, "<span class='warning'>You can't wrap this!</span>")
|
||||
to_chat(user, span_warning("You can't wrap this!"))
|
||||
return
|
||||
if(use(3))
|
||||
var/obj/structure/big_delivery/P = new /obj/structure/big_delivery(get_turf(O.loc))
|
||||
@@ -143,13 +143,13 @@
|
||||
P.add_fingerprint(user)
|
||||
O.add_fingerprint(user)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need more paper!</span>")
|
||||
to_chat(user, span_warning("You need more paper!"))
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='warning'>The object you are trying to wrap is unsuitable for the sorting machinery!</span>")
|
||||
to_chat(user, span_warning("The object you are trying to wrap is unsuitable for the sorting machinery!"))
|
||||
return
|
||||
|
||||
user.visible_message("<span class='notice'>[user] wraps [target].</span>")
|
||||
user.visible_message(span_notice("[user] wraps [target]."))
|
||||
user.log_message("has used [name] on [key_name(target)]", LOG_ATTACK, color="blue")
|
||||
|
||||
/obj/item/stack/package_wrap/use(used, transfer = FALSE)
|
||||
|
||||
Reference in New Issue
Block a user