mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-07-14 00:26:02 +01:00
Improves catwalks and railings
This commit is contained in:
@@ -6,9 +6,13 @@
|
||||
name = "catwalk"
|
||||
desc = "Cats really don't like these things."
|
||||
density = 0
|
||||
var/health = 100
|
||||
var/maxhealth = 100
|
||||
anchored = 1.0
|
||||
|
||||
/obj/structure/catwalk/initialize()
|
||||
for(var/obj/structure/catwalk/O in range(1))
|
||||
O.update_icon()
|
||||
for(var/obj/structure/catwalk/C in get_turf(src))
|
||||
if(C != src)
|
||||
warning("Duplicate [type] in [loc] ([x], [y], [z])")
|
||||
@@ -18,6 +22,7 @@
|
||||
/obj/structure/catwalk/Destroy()
|
||||
var/turf/location = loc
|
||||
. = ..()
|
||||
location.alpha = initial(location.alpha)
|
||||
for(var/obj/structure/catwalk/L in orange(location, 1))
|
||||
L.update_icon()
|
||||
|
||||
@@ -55,6 +60,8 @@
|
||||
qdel(src)
|
||||
if(2.0)
|
||||
qdel(src)
|
||||
if(3.0)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/structure/catwalk/attackby(obj/item/C as obj, mob/user as mob)
|
||||
@@ -67,6 +74,14 @@
|
||||
new /obj/item/stack/rods(src.loc)
|
||||
new /obj/structure/lattice(src.loc)
|
||||
qdel(src)
|
||||
if(istype(C, /obj/item/weapon/screwdriver))
|
||||
if(health < maxhealth)
|
||||
to_chat(user, "<span class='notice'>You begin repairing \the [src.name] with \the [C.name].</span>")
|
||||
if(do_after(user, 20, src))
|
||||
health = maxhealth
|
||||
else
|
||||
take_damage(C.force)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
return ..()
|
||||
|
||||
/obj/structure/catwalk/Crossed()
|
||||
@@ -79,4 +94,12 @@
|
||||
return 1
|
||||
if(target && target.z < src.z)
|
||||
return 0
|
||||
return 1
|
||||
return 1
|
||||
|
||||
/obj/structure/catwalk/proc/take_damage(amount)
|
||||
health -= amount
|
||||
if(health <= 0)
|
||||
visible_message("<span class='warning'>\The [src] breaks down!</span>")
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
new /obj/item/stack/rods(get_turf(src))
|
||||
Destroy()
|
||||
@@ -60,7 +60,7 @@
|
||||
if(health <= 0)
|
||||
visible_message("<span class='warning'>\The [src] breaks down!</span>")
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
new /obj/item/stack/rods(get_turf(usr))
|
||||
new /obj/item/stack/rods(get_turf(src))
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/railing/proc/NeighborsCheck(var/UpdateNeighbors = 1)
|
||||
@@ -134,6 +134,9 @@
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if (!can_touch(usr) || ismouse(usr))
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
||||
return 0
|
||||
@@ -150,6 +153,9 @@
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if (!can_touch(usr) || ismouse(usr))
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
||||
return 0
|
||||
@@ -166,6 +172,9 @@
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if (!can_touch(usr) || ismouse(usr))
|
||||
return
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "It is fastened to the floor therefore you can't flip it!")
|
||||
return 0
|
||||
@@ -249,6 +258,7 @@
|
||||
else
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
take_damage(W.force)
|
||||
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user