mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 19:44:58 +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:
@@ -62,7 +62,7 @@
|
||||
return
|
||||
var/next_message = dream_fragments[1]
|
||||
dream_fragments.Cut(1,2)
|
||||
to_chat(src, "<span class='notice'><i>... [next_message] ...</i></span>")
|
||||
to_chat(src, span_notice("<i>... [next_message] ...</i>"))
|
||||
if(LAZYLEN(dream_fragments))
|
||||
addtimer(CALLBACK(src, .proc/dream_sequence, dream_fragments), rand(10,30))
|
||||
else
|
||||
|
||||
@@ -254,7 +254,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
update_icon(ALL, "alienh_pounce")
|
||||
if(hit_atom == target && target.stat!=DEAD)
|
||||
target.Paralyze(100)
|
||||
target.visible_message("<span class='danger'>[target] flails around wildly.</span>","<span class='userdanger'>[name] pounces on you!</span>")
|
||||
target.visible_message(span_danger("[target] flails around wildly."),span_userdanger("[name] pounces on you!"))
|
||||
|
||||
// The numbers of seconds it takes to get to each stage of the xeno attack choreography
|
||||
#define XENO_ATTACK_STAGE_LEAP_AT_TARGET 1
|
||||
@@ -289,10 +289,10 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
if (time_processing >= stage)
|
||||
switch (time_processing)
|
||||
if (XENO_ATTACK_STAGE_FINISH to INFINITY)
|
||||
to_chat(target, "<span class='notice'>[xeno.name] scrambles into the ventilation ducts!</span>")
|
||||
to_chat(target, span_notice("[xeno.name] scrambles into the ventilation ducts!"))
|
||||
qdel(src)
|
||||
if (XENO_ATTACK_STAGE_CLIMB to XENO_ATTACK_STAGE_FINISH)
|
||||
to_chat(target, "<span class='notice'>[xeno.name] begins climbing into the ventilation system...</span>")
|
||||
to_chat(target, span_notice("[xeno.name] begins climbing into the ventilation system..."))
|
||||
stage = XENO_ATTACK_STAGE_FINISH
|
||||
if (XENO_ATTACK_STAGE_LEAP_AT_PUMP to XENO_ATTACK_STAGE_CLIMB)
|
||||
xeno.update_icon(ALL, "alienh_leap", 'icons/mob/alienleap.dmi', -32, -32)
|
||||
@@ -390,7 +390,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
target.adjustStaminaLoss(40)
|
||||
step_away(target, bubblegum)
|
||||
shake_camera(target, 4, 3)
|
||||
target.visible_message("<span class='warning'>[target] jumps backwards, falling on the ground!</span>","<span class='userdanger'>[bubblegum] slams into you!</span>")
|
||||
target.visible_message(span_warning("[target] jumps backwards, falling on the ground!"),span_userdanger("[bubblegum] slams into you!"))
|
||||
next_action = 0.2
|
||||
else
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
@@ -714,7 +714,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
A.override = 1
|
||||
if(target.client)
|
||||
if(wabbajack)
|
||||
to_chat(target, "<span class='hear'>...wabbajack...wabbajack...</span>")
|
||||
to_chat(target, span_hear("...wabbajack...wabbajack..."))
|
||||
target.playsound_local(target,'sound/magic/staff_change.ogg', 50, 1)
|
||||
delusion = A
|
||||
target.client.images |= A
|
||||
@@ -888,7 +888,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
if(other)
|
||||
if(close_other) //increase the odds
|
||||
for(var/i in 1 to 5)
|
||||
message_pool.Add("<span class='warning'>You feel a tiny prick!</span>")
|
||||
message_pool.Add(span_warning("You feel a tiny prick!"))
|
||||
var/obj/item/storage/equipped_backpack = other.get_item_by_slot(ITEM_SLOT_BACK)
|
||||
if(istype(equipped_backpack))
|
||||
for(var/i in 1 to 5) //increase the odds
|
||||
@@ -902,19 +902,19 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
|
||||
message_pool.Add("<B>[other]</B> [pick("sneezes","coughs")].")
|
||||
|
||||
message_pool.Add("<span class='notice'>You hear something squeezing through the ducts...</span>", \
|
||||
"<span class='notice'>Your [pick("arm", "leg", "back", "head")] itches.</span>",\
|
||||
"<span class='warning'>You feel [pick("hot","cold","dry","wet","woozy","faint")].</span>",
|
||||
"<span class='warning'>Your stomach rumbles.</span>",
|
||||
"<span class='warning'>Your head hurts.</span>",
|
||||
"<span class='warning'>You hear a faint buzz in your head.</span>",
|
||||
message_pool.Add(span_notice("You hear something squeezing through the ducts..."), \
|
||||
span_notice("Your [pick("arm", "leg", "back", "head")] itches."),\
|
||||
span_warning("You feel [pick("hot","cold","dry","wet","woozy","faint")]."),
|
||||
span_warning("Your stomach rumbles."),
|
||||
span_warning("Your head hurts."),
|
||||
span_warning("You hear a faint buzz in your head."),
|
||||
"<B>[target]</B> sneezes.")
|
||||
if(prob(10))
|
||||
message_pool.Add("<span class='warning'>Behind you.</span>",\
|
||||
"<span class='warning'>You hear a faint laughter.</span>",
|
||||
"<span class='warning'>You see something move.</span>",
|
||||
"<span class='warning'>You hear skittering on the ceiling.</span>",
|
||||
"<span class='warning'>You see an inhumanly tall silhouette moving in the distance.</span>")
|
||||
message_pool.Add(span_warning("Behind you."),\
|
||||
span_warning("You hear a faint laughter."),
|
||||
span_warning("You see something move."),
|
||||
span_warning("You hear skittering on the ceiling."),
|
||||
span_warning("You see an inhumanly tall silhouette moving in the distance."))
|
||||
if(prob(10))
|
||||
message_pool.Add("[pick_list_replacements(HAL_LINES_FILE, "advice")]")
|
||||
var/chosen = pick(message_pool)
|
||||
@@ -1050,7 +1050,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
switch(message)
|
||||
if("blob alert")
|
||||
to_chat(target, "<h1 class='alert'>Biohazard Alert</h1>")
|
||||
to_chat(target, "<br><br><span class='alert'>Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.</span><br><br>")
|
||||
to_chat(target, "<br><br>[span_alert("Confirmed outbreak of level 5 biohazard aboard [station_name()]. All personnel must contain the outbreak.")]<br><br>")
|
||||
SEND_SOUND(target, SSstation.announcer.event_sounds[ANNOUNCER_OUTBREAK5])
|
||||
if("ratvar")
|
||||
target.playsound_local(target, 'sound/machines/clockcult/ark_deathrattle.ogg', 50, FALSE, pressure_affected = FALSE)
|
||||
@@ -1069,19 +1069,19 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
), 27)
|
||||
if("shuttle dock")
|
||||
to_chat(target, "<h1 class='alert'>Priority Announcement</h1>")
|
||||
to_chat(target, "<br><br><span class='alert'>The Emergency Shuttle has docked with the station. You have 3 minutes to board the Emergency Shuttle.</span><br><br>")
|
||||
to_chat(target, "<br><br>[span_alert("The Emergency Shuttle has docked with the station. You have 3 minutes to board the Emergency Shuttle.")]<br><br>")
|
||||
SEND_SOUND(target, SSstation.announcer.event_sounds[ANNOUNCER_SHUTTLEDOCK])
|
||||
if("malf ai") //AI is doomsdaying!
|
||||
to_chat(target, "<h1 class='alert'>Anomaly Alert</h1>")
|
||||
to_chat(target, "<br><br><span class='alert'>Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.</span><br><br>")
|
||||
to_chat(target, "<br><br>[span_alert("Hostile runtimes detected in all station systems, please deactivate your AI to prevent possible damage to its morality core.")]<br><br>")
|
||||
SEND_SOUND(target, SSstation.announcer.event_sounds[ANNOUNCER_AIMALF])
|
||||
if("meteors") //Meteors inbound!
|
||||
to_chat(target, "<h1 class='alert'>Meteor Alert</h1>")
|
||||
to_chat(target, "<br><br><span class='alert'>Meteors have been detected on collision course with the station.</span><br><br>")
|
||||
to_chat(target, "<br><br>[span_alert("Meteors have been detected on collision course with the station.")]<br><br>")
|
||||
SEND_SOUND(target, SSstation.announcer.event_sounds[ANNOUNCER_METEORS])
|
||||
if("supermatter")
|
||||
SEND_SOUND(target, 'sound/magic/charge.ogg')
|
||||
to_chat(target, "<span class='boldannounce'>You feel reality distort for a moment...</span>")
|
||||
to_chat(target, span_boldannounce("You feel reality distort for a moment..."))
|
||||
|
||||
/datum/hallucination/hudscrew
|
||||
|
||||
@@ -1363,9 +1363,9 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
if(AM == target)
|
||||
if(istype(target, /obj/effect/dummy/phased_mob))
|
||||
return
|
||||
to_chat(target, "<span class='userdanger'>You fall into the chasm!</span>")
|
||||
to_chat(target, span_userdanger("You fall into the chasm!"))
|
||||
target.Paralyze(40)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/to_chat, target, "<span class='notice'>It's surprisingly shallow.</span>"), 15)
|
||||
addtimer(CALLBACK(GLOBAL_PROC, .proc/to_chat, target, span_notice("It's surprisingly shallow.")), 15)
|
||||
QDEL_IN(src, 30)
|
||||
|
||||
/obj/effect/hallucination/danger/anomaly
|
||||
@@ -1405,7 +1405,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
target.set_screwyhud(SCREWYHUD_DEAD)
|
||||
target.Paralyze(300)
|
||||
target.silent += 10
|
||||
to_chat(target, "<span class='deadsay'><b>[target.real_name]</b> has died at <b>[get_area_name(target)]</b>.</span>")
|
||||
to_chat(target, span_deadsay("<b>[target.real_name]</b> has died at <b>[get_area_name(target)]</b>."))
|
||||
|
||||
var/delay = 0
|
||||
|
||||
@@ -1453,7 +1453,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
fire_overlay = image('icons/mob/OnFire.dmi', target, "Standing", ABOVE_MOB_LAYER)
|
||||
if(target.client)
|
||||
target.client.images += fire_overlay
|
||||
to_chat(target, "<span class='userdanger'>You're set on fire!</span>")
|
||||
to_chat(target, span_userdanger("You're set on fire!"))
|
||||
target.throw_alert("fire", /atom/movable/screen/alert/fire, override = TRUE)
|
||||
times_to_lower_stamina = rand(5, 10)
|
||||
addtimer(CALLBACK(src, .proc/start_expanding), 20)
|
||||
@@ -1535,7 +1535,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
|
||||
shock_image.override = TRUE
|
||||
electrocution_skeleton_anim = image('icons/mob/human.dmi', target, icon_state = "electrocuted_base", layer=ABOVE_MOB_LAYER)
|
||||
electrocution_skeleton_anim.appearance_flags |= RESET_COLOR|KEEP_APART
|
||||
to_chat(target, "<span class='userdanger'>You feel a powerful shock course through your body!</span>")
|
||||
to_chat(target, span_userdanger("You feel a powerful shock course through your body!"))
|
||||
if(target.client)
|
||||
target.client.images |= shock_image
|
||||
target.client.images |= electrocution_skeleton_anim
|
||||
|
||||
Reference in New Issue
Block a user