mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-15 18:14:22 +01:00
Glass tables shatter more often
- Glass tables do not break if they have the NODECONSTRUCT flag - Glass tables break if any living mob crosses them above small size and under the effects of gravity.
This commit is contained in:
@@ -264,23 +264,27 @@
|
||||
canSmoothWith = null
|
||||
health = 50
|
||||
|
||||
/obj/structure/table/glass/tablepush(obj/item/I, mob/user)
|
||||
if(..())
|
||||
visible_message("<span class='warning'>[src] breaks!</span>")
|
||||
playsound(src.loc, "shatter", 50, 1)
|
||||
new frame(src.loc)
|
||||
new /obj/item/weapon/shard(src.loc)
|
||||
qdel(src)
|
||||
/obj/structure/table/glass/Crossed(atom/movable/AM)
|
||||
. = ..()
|
||||
if(flags & NODECONSTRUCT)
|
||||
return
|
||||
// Don't break if they're just flying past
|
||||
if(AM.throwing)
|
||||
return
|
||||
|
||||
if(istype(AM, /mob/living))
|
||||
var/mob/living/M = AM
|
||||
if(has_gravity(M) && M.mob_size > MOB_SIZE_SMALL)
|
||||
table_shatter(M)
|
||||
|
||||
/obj/structure/table/glass/climb_structure(mob/user)
|
||||
if(..())
|
||||
visible_message("<span class='warning'>[src] breaks!</span>")
|
||||
playsound(src.loc, "shatter", 50, 1)
|
||||
new frame(src.loc)
|
||||
new /obj/item/weapon/shard(src.loc)
|
||||
qdel(src)
|
||||
user.Weaken(5)
|
||||
/obj/structure/table/glass/proc/table_shatter(mob/M)
|
||||
visible_message("<span class='warning'>[src] breaks!</span>")
|
||||
playsound(src.loc, "shatter", 50, 1)
|
||||
new frame(src.loc)
|
||||
var/obj/item/weapon/shard/S = new(src.loc)
|
||||
S.throw_impact(M)
|
||||
M.Weaken(5)
|
||||
qdel(src)
|
||||
|
||||
/*
|
||||
* Wooden tables
|
||||
|
||||
Reference in New Issue
Block a user