mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-14 16:46:28 +01:00
refactors most spans
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
var/parts
|
||||
var/list/climbers
|
||||
var/block_turf_edges = FALSE // If true, turf edge icons will not be made on the turf this occupies.
|
||||
|
||||
|
||||
var/list/connections
|
||||
var/list/other_connections
|
||||
var/list/blend_objects = newlist() // Objects which to blend with
|
||||
@@ -36,8 +36,8 @@
|
||||
attack_generic(user,1,"slices")
|
||||
|
||||
if(LAZYLEN(climbers) && !(user in climbers))
|
||||
user.visible_message("<span class='warning'>[user.name] shakes \the [src].</span>", \
|
||||
"<span class='notice'>You shake \the [src].</span>")
|
||||
user.visible_message(span_warning("[user.name] shakes \the [src]."), \
|
||||
span_notice("You shake \the [src]."))
|
||||
structure_shaken()
|
||||
|
||||
return ..()
|
||||
@@ -77,12 +77,12 @@
|
||||
return 0
|
||||
|
||||
if (!user.Adjacent(src))
|
||||
to_chat(user, "<span class='danger'>You can't climb there, the way is blocked.</span>")
|
||||
to_chat(user, span_danger("You can't climb there, the way is blocked."))
|
||||
return 0
|
||||
|
||||
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 0
|
||||
return 1
|
||||
|
||||
@@ -104,7 +104,7 @@
|
||||
if (!can_climb(user))
|
||||
return
|
||||
|
||||
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
|
||||
usr.visible_message(span_warning("[user] starts climbing onto \the [src]!"))
|
||||
LAZYDISTINCTADD(climbers, user)
|
||||
|
||||
if(!do_after(user,(issmall(user) ? climb_delay * 0.6 : climb_delay)))
|
||||
@@ -118,7 +118,7 @@
|
||||
usr.forceMove(climb_to(user))
|
||||
|
||||
if (get_turf(user) == get_turf(src))
|
||||
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")
|
||||
usr.visible_message(span_warning("[user] climbs onto \the [src]!"))
|
||||
LAZYREMOVE(climbers, user)
|
||||
|
||||
/obj/structure/proc/climb_to(var/mob/living/user)
|
||||
@@ -127,21 +127,21 @@
|
||||
/obj/structure/proc/structure_shaken()
|
||||
for(var/mob/living/M in climbers)
|
||||
M.Weaken(1)
|
||||
to_chat(M, "<span class='danger'>You topple as you are shaken off \the [src]!</span>")
|
||||
to_chat(M, span_danger("You topple as you are shaken off \the [src]!"))
|
||||
climbers.Cut(1,2)
|
||||
|
||||
for(var/mob/living/M in get_turf(src))
|
||||
if(M.lying) return //No spamming this on people.
|
||||
|
||||
M.Weaken(3)
|
||||
to_chat(M, "<span class='danger'>You topple as \the [src] moves under you!</span>")
|
||||
to_chat(M, span_danger("You topple as \the [src] moves under you!"))
|
||||
|
||||
if(prob(25))
|
||||
|
||||
var/damage = rand(15,30)
|
||||
var/mob/living/carbon/human/H = M
|
||||
if(!istype(H))
|
||||
to_chat(H, "<span class='danger'>You land heavily!</span>")
|
||||
to_chat(H, span_danger("You land heavily!"))
|
||||
M.adjustBruteLoss(damage)
|
||||
return
|
||||
|
||||
@@ -160,12 +160,12 @@
|
||||
affecting = H.get_organ(BP_HEAD)
|
||||
|
||||
if(affecting)
|
||||
to_chat(M, "<span class='danger'>You land heavily on your [affecting.name]!</span>")
|
||||
to_chat(M, span_danger("You land heavily on your [affecting.name]!"))
|
||||
affecting.take_damage(damage, 0)
|
||||
if(affecting.parent)
|
||||
affecting.parent.add_autopsy_data("Misadventure", damage)
|
||||
else
|
||||
to_chat(H, "<span class='danger'>You land heavily!</span>")
|
||||
to_chat(H, span_danger("You land heavily!"))
|
||||
H.adjustBruteLoss(damage)
|
||||
|
||||
H.UpdateDamageIcon()
|
||||
@@ -178,19 +178,19 @@
|
||||
if(!Adjacent(user))
|
||||
return 0
|
||||
if (user.restrained() || user.buckled)
|
||||
to_chat(user, "<span class='notice'>You need your hands and legs free for this.</span>")
|
||||
to_chat(user, span_notice("You need your hands and legs free for this."))
|
||||
return 0
|
||||
if (user.stat || user.paralysis || user.sleeping || user.lying || user.weakened)
|
||||
return 0
|
||||
if (isAI(user))
|
||||
to_chat(user, "<span class='notice'>You need hands for this.</span>")
|
||||
to_chat(user, span_notice("You need hands for this."))
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/attack_generic(var/mob/user, var/damage, var/attack_verb)
|
||||
if(!breakable || damage < STRUCTURE_MIN_DAMAGE_THRESHOLD)
|
||||
return 0
|
||||
visible_message("<span class='danger'>[user] [attack_verb] the [src] apart!</span>")
|
||||
visible_message(span_danger("[user] [attack_verb] the [src] apart!"))
|
||||
user.do_attack_animation(src)
|
||||
spawn(1) qdel(src)
|
||||
return 1
|
||||
|
||||
Reference in New Issue
Block a user