mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[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:
@@ -22,10 +22,10 @@
|
||||
return
|
||||
|
||||
if(flipped < 0 || !flip(get_cardinal_dir(usr,src)))
|
||||
to_chat(usr, "<span class='notice'>It won't budge.</span>")
|
||||
to_chat(usr, span_notice("It won't budge."))
|
||||
return
|
||||
|
||||
usr.visible_message("<span class='warning'>[usr] flips \the [src]!</span>")
|
||||
usr.visible_message(span_warning("[usr] flips \the [src]!"))
|
||||
|
||||
if(climbable)
|
||||
structure_shaken()
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
var/obj/occupied = turf_is_crowded()
|
||||
if(occupied)
|
||||
to_chat(usr, "<span class='filter_notice'>There's \a [occupied] in the way.</span>")
|
||||
to_chat(usr, span_filter_notice("There's \a [occupied] in the way."))
|
||||
return 0
|
||||
|
||||
var/list/L = list()
|
||||
@@ -65,7 +65,7 @@
|
||||
return
|
||||
|
||||
if (!unflipping_check())
|
||||
to_chat(usr, "<span class='notice'>It won't budge.</span>")
|
||||
to_chat(usr, span_notice("It won't budge."))
|
||||
return
|
||||
unflip()
|
||||
|
||||
|
||||
@@ -52,10 +52,10 @@
|
||||
if(prob(chance))
|
||||
health -= P.damage/2
|
||||
if (health > 0)
|
||||
visible_message("<span class='warning'>[P] hits \the [src]!</span>")
|
||||
visible_message(span_warning("[P] hits \the [src]!"))
|
||||
return 0
|
||||
else
|
||||
visible_message("<span class='warning'>[src] breaks down!</span>")
|
||||
visible_message(span_warning("[src] breaks down!"))
|
||||
break_to_parts()
|
||||
return 1
|
||||
return 1
|
||||
@@ -96,7 +96,7 @@
|
||||
var/mob/living/M = G.affecting
|
||||
var/obj/occupied = turf_is_crowded()
|
||||
if(occupied)
|
||||
to_chat(user, "<span class='danger'>There's \a [occupied] in the way.</span>")
|
||||
to_chat(user, span_danger("There's \a [occupied] in the way."))
|
||||
return
|
||||
if(!user.Adjacent(M))
|
||||
return
|
||||
@@ -104,7 +104,7 @@
|
||||
if(user.a_intent == I_HURT)
|
||||
if (prob(15)) M.Weaken(5)
|
||||
M.apply_damage(8,def_zone = BP_HEAD)
|
||||
visible_message("<span class='danger'>[G.assailant] slams [G.affecting]'s face against \the [src]!</span>")
|
||||
visible_message(span_danger("[G.assailant] slams [G.affecting]'s face against \the [src]!"))
|
||||
if(material)
|
||||
playsound(src, material.tableslam_noise, 50, 1)
|
||||
else
|
||||
@@ -113,18 +113,18 @@
|
||||
// Shards. Extra damage, plus potentially the fact YOU LITERALLY HAVE A PIECE OF GLASS/METAL/WHATEVER IN YOUR FACE
|
||||
for(var/obj/item/material/shard/S in L)
|
||||
if(prob(50))
|
||||
M.visible_message("<span class='danger'>\The [S] slices [M]'s face messily!</span>",
|
||||
"<span class='danger'>\The [S] slices your face messily!</span>")
|
||||
M.visible_message(span_danger("\The [S] slices [M]'s face messily!"),
|
||||
span_danger("\The [S] slices your face messily!"))
|
||||
M.apply_damage(10, def_zone = BP_HEAD)
|
||||
if(prob(2))
|
||||
M.embed(S, def_zone = BP_HEAD)
|
||||
else
|
||||
to_chat(user, "<span class='danger'>You need a better grip to do that!</span>")
|
||||
to_chat(user, span_danger("You need a better grip to do that!"))
|
||||
return
|
||||
else if(G.state > GRAB_AGGRESSIVE || world.time >= (G.last_action + UPGRADE_COOLDOWN))
|
||||
M.forceMove(get_turf(src))
|
||||
M.Weaken(5)
|
||||
visible_message("<span class='danger'>[G.assailant] puts [G.affecting] on \the [src].</span>")
|
||||
visible_message(span_danger("[G.assailant] puts [G.affecting] on \the [src]."))
|
||||
qdel(W)
|
||||
return
|
||||
|
||||
@@ -141,17 +141,17 @@
|
||||
spark_system.start()
|
||||
playsound(src, 'sound/weapons/blade1.ogg', 50, 1)
|
||||
playsound(src, "sparks", 50, 1)
|
||||
user.visible_message("<span class='danger'>\The [src] was sliced apart by [user]!</span>")
|
||||
user.visible_message(span_danger("\The [src] was sliced apart by [user]!"))
|
||||
break_to_parts()
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/melee/changeling/arm_blade))
|
||||
user.visible_message("<span class='danger'>\The [src] was sliced apart by [user]!</span>")
|
||||
user.visible_message(span_danger("\The [src] was sliced apart by [user]!"))
|
||||
break_to_parts()
|
||||
return
|
||||
|
||||
if(can_plate && !material)
|
||||
to_chat(user, "<span class='warning'>There's nothing to put \the [W] on! Try adding plating to \the [src] first.</span>")
|
||||
to_chat(user, span_warning("There's nothing to put \the [W] on! Try adding plating to \the [src] first."))
|
||||
return
|
||||
|
||||
// Placing stuff on tables
|
||||
|
||||
@@ -138,7 +138,7 @@
|
||||
..()
|
||||
|
||||
/obj/structure/table/alien/dismantle(obj/item/tool/wrench/W, mob/user)
|
||||
to_chat(user, "<span class='warning'>You cannot dismantle \the [src].</span>")
|
||||
to_chat(user, span_warning("You cannot dismantle \the [src]."))
|
||||
return
|
||||
|
||||
//BENCH PRESETS
|
||||
@@ -246,4 +246,4 @@
|
||||
/obj/structure/table/bench/wooden/holotable/New()
|
||||
material = get_material_by_name("holowood")
|
||||
..()
|
||||
*/
|
||||
*/
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
..()
|
||||
|
||||
/obj/structure/table/darkglass/dismantle(obj/item/tool/wrench/W, mob/user)
|
||||
to_chat(user, "<span class='warning'>You cannot dismantle \the [src].</span>")
|
||||
to_chat(user, span_warning("You cannot dismantle \the [src]."))
|
||||
return
|
||||
/obj/structure/table/alien/blue
|
||||
icon = 'icons/turf/shuttle_alien_blue.dmi'
|
||||
@@ -38,7 +38,7 @@
|
||||
..()
|
||||
|
||||
/obj/structure/table/fancyblack/dismantle(obj/item/tool/wrench/W, mob/user)
|
||||
to_chat(user, "<span class='warning'>You cannot dismantle \the [src].</span>")
|
||||
to_chat(user, span_warning("You cannot dismantle \the [src]."))
|
||||
return
|
||||
|
||||
/obj/structure/table/gold
|
||||
@@ -47,4 +47,4 @@
|
||||
|
||||
/obj/structure/table/gold/New()
|
||||
material = get_material_by_name(MAT_GOLD)
|
||||
..()
|
||||
..()
|
||||
|
||||
@@ -24,5 +24,5 @@
|
||||
return
|
||||
|
||||
/obj/structure/table/rack/holorack/dismantle(obj/item/tool/wrench/W, mob/user)
|
||||
to_chat(user, "<span class='warning'>You cannot dismantle \the [src].</span>")
|
||||
to_chat(user, span_warning("You cannot dismantle \the [src]."))
|
||||
return
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user