mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-22 04:30:44 +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:
@@ -12,7 +12,7 @@
|
||||
/datum/smite/berforate/effect(client/user, mob/living/target)
|
||||
. = ..()
|
||||
if (!iscarbon(target))
|
||||
to_chat(user, "<span class='warning'>This must be used on a carbon mob.</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
||||
return
|
||||
|
||||
var/repetitions
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
/datum/smite/bloodless/effect(client/user, mob/living/target)
|
||||
. = ..()
|
||||
if (!iscarbon(target))
|
||||
to_chat(user, "<span class='warning'>This must be used on a carbon mob.</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
||||
return
|
||||
var/mob/living/carbon/carbon_target = target
|
||||
for(var/_limb in carbon_target.bodyparts)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
. = ..()
|
||||
|
||||
if (!iscarbon(target))
|
||||
to_chat(user, "<span class='warning'>This must be used on a carbon mob.</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
||||
return
|
||||
|
||||
var/mob/living/carbon/carbon_target = target
|
||||
|
||||
@@ -5,24 +5,24 @@
|
||||
/datum/smite/dock_pay/effect(client/user, mob/living/target)
|
||||
. = ..()
|
||||
if (!iscarbon(target))
|
||||
to_chat(user, "<span class='warning'>This must be used on a carbon mob.</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
||||
return
|
||||
var/mob/living/carbon/dude = target
|
||||
var/obj/item/card/id/card = dude.get_idcard(TRUE)
|
||||
if (!card)
|
||||
to_chat(user, "<span class='warning'>[dude] does not have an ID card on!</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("[dude] does not have an ID card on!"), confidential = TRUE)
|
||||
return
|
||||
if (!card.registered_account)
|
||||
to_chat(user, "<span class='warning'>[dude] does not have an ID card with an account!</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("[dude] does not have an ID card with an account!"), confidential = TRUE)
|
||||
return
|
||||
if (card.registered_account.account_balance == 0)
|
||||
to_chat(user, "<span class='warning'>ID Card lacks any funds. No pay to dock.</span>")
|
||||
to_chat(user, span_warning("ID Card lacks any funds. No pay to dock."))
|
||||
return
|
||||
var/new_cost = input("How much pay are we docking? Current balance: [card.registered_account.account_balance] credits.", "BUDGET CUTS") as num|null
|
||||
if (!new_cost)
|
||||
return
|
||||
if (!(card.registered_account.has_money(new_cost)))
|
||||
to_chat(user, "<span class='warning'>ID Card lacked funds. Emptying account.</span>")
|
||||
to_chat(user, span_warning("ID Card lacked funds. Emptying account."))
|
||||
card.registered_account.bank_card_talk("[new_cost] credits deducted from your account based on performance review.")
|
||||
card.registered_account.account_balance = 0
|
||||
else
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
/datum/smite/knot_shoes/effect(client/user, mob/living/target)
|
||||
. = ..()
|
||||
if (!iscarbon(target))
|
||||
to_chat(user, "<span class='warning'>This must be used on a carbon mob.</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
||||
return
|
||||
var/mob/living/carbon/dude = target
|
||||
var/obj/item/clothing/shoes/sick_kicks = dude.shoes
|
||||
if (!sick_kicks?.can_be_tied)
|
||||
to_chat(user, "<span class='warning'>[dude] does not have knottable shoes!</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("[dude] does not have knottable shoes!"), confidential = TRUE)
|
||||
return
|
||||
sick_kicks.adjust_laces(SHOES_KNOTTED)
|
||||
|
||||
@@ -11,4 +11,4 @@
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/human_target = target
|
||||
human_target.electrocution_animation(LIGHTNING_BOLT_ELECTROCUTION_ANIMATION_LENGTH)
|
||||
to_chat(target, "<span class='userdanger'>The gods have punished you for your sins!</span>", confidential = TRUE)
|
||||
to_chat(target, span_userdanger("The gods have punished you for your sins!"), confidential = TRUE)
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
. = ..()
|
||||
|
||||
if (!iscarbon(target))
|
||||
to_chat(user, "<span class='warning'>This must be used on a carbon mob.</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
||||
return
|
||||
|
||||
var/mob/living/carbon/carbon_target = target
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
/datum/smite/puzzle/effect(client/user, mob/living/target)
|
||||
. = ..()
|
||||
if(!puzzle_imprison(target))
|
||||
to_chat(user, "<span class='warning'>Imprisonment failed!</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("Imprisonment failed!"), confidential = TRUE)
|
||||
|
||||
@@ -5,8 +5,8 @@
|
||||
/datum/smite/scarify/effect(client/user, mob/living/target)
|
||||
. = ..()
|
||||
if(!iscarbon(target))
|
||||
to_chat(user, "<span class='warning'>This must be used on a carbon mob.</span>", confidential = TRUE)
|
||||
to_chat(user, span_warning("This must be used on a carbon mob."), confidential = TRUE)
|
||||
return
|
||||
var/mob/living/carbon/dude = target
|
||||
dude.generate_fake_scars(rand(1, 4))
|
||||
to_chat(dude, "<span class='warning'>You feel your body grow jaded and torn...</span>")
|
||||
to_chat(dude, span_warning("You feel your body grow jaded and torn..."))
|
||||
|
||||
Reference in New Issue
Block a user