[MIRROR] refactors most spans (#9139)

Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com>
Co-authored-by: Kashargul <KashL@t-online.de>
This commit is contained in:
CHOMPStation2
2024-10-04 06:00:17 -07:00
committed by GitHub
parent 43ee646816
commit ab154b48b2
1511 changed files with 12497 additions and 12357 deletions

View File

@@ -53,7 +53,7 @@ var/list/table_icon_cache = list()
amount *= TABLE_BRITTLE_MATERIAL_MULTIPLIER
health -= amount
if(health <= 0)
visible_message("<span class='warning'>\The [src] breaks down!</span>")
visible_message(span_warning("\The [src] breaks down!"))
return break_to_parts() // if we break and form shards, return them to the caller to do !FUN! things with
/obj/structure/table/blob_act()
@@ -91,11 +91,11 @@ var/list/table_icon_cache = list()
if(health < maxhealth)
switch(health / maxhealth)
if(0.0 to 0.5)
. += "<span class='warning'>It looks severely damaged!</span>"
. += span_warning("It looks severely damaged!")
if(0.25 to 0.5)
. += "<span class='warning'>It looks damaged!</span>"
. += span_warning("It looks damaged!")
if(0.5 to 1.0)
. += "<span class='notice'>It has a few scrapes and dents.</span>"
. += span_notice("It has a few scrapes and dents.")
/obj/structure/table/attackby(obj/item/W, mob/user)
@@ -109,7 +109,7 @@ var/list/table_icon_cache = list()
if(carpeted && W.has_tool_quality(TOOL_CROWBAR))
user.visible_message("<b>\The [user]</b> removes the carpet from \the [src].",
"<span class='notice'>You remove the carpet from \the [src].</span>")
span_notice("You remove the carpet from \the [src]."))
new carpeted_type(loc)
carpeted = 0
update_icon()
@@ -119,13 +119,13 @@ var/list/table_icon_cache = list()
var/obj/item/stack/tile/carpet/C = W
if(C.use(1))
user.visible_message("<b>\The [user]</b> adds \the [C] to \the [src].",
"<span class='notice'>You add \the [C] to \the [src].</span>")
span_notice("You add \the [C] to \the [src]."))
carpeted = 1
carpeted_type = W.type
update_icon()
return 1
else
to_chat(user, "<span class='warning'>You don't have enough carpet!</span>")
to_chat(user, span_warning("You don't have enough carpet!"))
if(!reinforced && !carpeted && material && W.has_tool_quality(TOOL_WRENCH))
remove_material(W, user)
@@ -145,12 +145,12 @@ var/list/table_icon_cache = list()
if(health < maxhealth && W.has_tool_quality(TOOL_WELDER))
var/obj/item/weldingtool/F = W.get_welder()
if(F.welding)
to_chat(user, "<span class='notice'>You begin reparing damage to \the [src].</span>")
to_chat(user, span_notice("You begin reparing damage to \the [src]."))
playsound(src, F.usesound, 50, 1)
if(!do_after(user, 20 * F.toolspeed) || !F.remove_fuel(1, user))
return
user.visible_message("<b>\The [user]</b> repairs some damage to \the [src].",
"<span class='notice'>You repair some damage to \the [src].</span>")
span_notice("You repair some damage to \the [src]."))
health = max(health+(maxhealth/5), maxhealth) // 20% repair per application
return 1
@@ -174,18 +174,18 @@ var/list/table_icon_cache = list()
..()
/obj/structure/table/attack_alien(mob/user as mob)
visible_message("<span class='danger'>\The [user] tears apart \the [src]!</span>")
visible_message(span_danger("\The [user] tears apart \the [src]!"))
src.break_to_parts()
/obj/structure/table/attack_generic(mob/user as mob, var/damage)
if(damage >= 10)
if(reinforced && prob(70))
visible_message("<span class='danger'>\The [user] smashes against \the [src]!</span>")
visible_message(span_danger("\The [user] smashes against \the [src]!"))
take_damage(damage/2)
user.do_attack_animation(src)
..()
else
visible_message("<span class='danger'>\The [user] tears apart \the [src]!</span>")
visible_message(span_danger("\The [user] tears apart \the [src]!"))
src.break_to_parts()
user.do_attack_animation(src)
return 1
@@ -200,19 +200,19 @@ var/list/table_icon_cache = list()
/obj/structure/table/proc/reinforce_table(obj/item/stack/material/S, mob/user)
if(reinforced)
to_chat(user, "<span class='warning'>\The [src] is already reinforced!</span>")
to_chat(user, span_warning("\The [src] is already reinforced!"))
return
if(!can_reinforce)
to_chat(user, "<span class='warning'>\The [src] cannot be reinforced!</span>")
to_chat(user, span_warning("\The [src] cannot be reinforced!"))
return
if(!material)
to_chat(user, "<span class='warning'>Plate \the [src] before reinforcing it!</span>")
to_chat(user, span_warning("Plate \the [src] before reinforcing it!"))
return
if(flipped)
to_chat(user, "<span class='warning'>Put \the [src] back in place before reinforcing it!</span>")
to_chat(user, span_warning("Put \the [src] back in place before reinforcing it!"))
return
reinforced = common_material_add(S, user, "reinforc")
@@ -237,36 +237,36 @@ var/list/table_icon_cache = list()
/obj/structure/table/proc/common_material_add(obj/item/stack/material/S, mob/user, verb) // Verb is actually verb without 'e' or 'ing', which is added. Works for 'plate'/'plating' and 'reinforce'/'reinforcing'.
var/datum/material/M = S.get_material()
if(!istype(M))
to_chat(user, "<span class='warning'>You cannot [verb]e \the [src] with \the [S].</span>")
to_chat(user, span_warning("You cannot [verb]e \the [src] with \the [S]."))
return null
if(manipulating) return M
manipulating = 1
to_chat(user, "<span class='notice'>You begin [verb]ing \the [src] with [M.display_name].</span>")
to_chat(user, span_notice("You begin [verb]ing \the [src] with [M.display_name]."))
if(!do_after(user, 20) || !S.use(1))
manipulating = 0
return null
user.visible_message("<span class='notice'>\The [user] [verb]es \the [src] with [M.display_name].</span>", "<span class='notice'>You finish [verb]ing \the [src].</span>")
user.visible_message(span_notice("\The [user] [verb]es \the [src] with [M.display_name]."), span_notice("You finish [verb]ing \the [src]."))
manipulating = 0
return M
// Returns the material to set the table to.
/obj/structure/table/proc/common_material_remove(mob/user, datum/material/M, delay, what, type_holding, sound)
if(!M.stack_type)
to_chat(user, "<span class='warning'>You are unable to remove the [what] from this [src]!</span>")
to_chat(user, span_warning("You are unable to remove the [what] from this [src]!"))
return M
if(manipulating) return M
manipulating = 1
user.visible_message("<b>\The [user]</b> begins removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place.",
"<span class='notice'>You begin removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place.</span>")
span_notice("You begin removing the [type_holding] holding \the [src]'s [M.display_name] [what] in place."))
if(sound)
playsound(src, sound, 50, 1)
if(!do_after(user, delay))
manipulating = 0
return M
user.visible_message("<b>\The [user]</b> removes the [M.display_name] [what] from \the [src].",
"<span class='notice'>You remove the [M.display_name] [what] from \the [src].</span>")
span_notice("You remove the [M.display_name] [what] from \the [src]."))
new M.stack_type(src.loc)
manipulating = 0
return null
@@ -281,13 +281,13 @@ var/list/table_icon_cache = list()
if(manipulating) return
manipulating = 1
user.visible_message("<b>\The [user]</b> begins dismantling \the [src].",
"<span class='notice'>You begin dismantling \the [src].</span>")
span_notice("You begin dismantling \the [src]."))
playsound(src, W.usesound, 50, 1)
if(!do_after(user, 20 * W.toolspeed))
manipulating = 0
return
user.visible_message("<b>\The [user]</b> dismantles \the [src].",
"<span class='notice'>You dismantle \the [src].</span>")
span_notice("You dismantle \the [src]."))
new /obj/item/stack/material/steel(src.loc)
qdel(src)
return