mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-12 03:02:54 +00:00
Improves catwalks and railings
This commit is contained in:
@@ -22,6 +22,14 @@
|
|||||||
charge_costs = list(500)
|
charge_costs = list(500)
|
||||||
stacktype = /obj/item/stack/rods
|
stacktype = /obj/item/stack/rods
|
||||||
|
|
||||||
|
/obj/item/stack/rods/New()
|
||||||
|
..()
|
||||||
|
recipes = rods_recipes
|
||||||
|
|
||||||
|
var/global/list/datum/stack_recipe/rods_recipes = list( \
|
||||||
|
new/datum/stack_recipe("grille", /obj/structure/grille, 2, time = 10, one_per_turf = 1, on_floor = 1),
|
||||||
|
new/datum/stack_recipe("catwalk", /obj/structure/catwalk, 2, time = 80, one_per_turf = 1, on_floor = 1))
|
||||||
|
|
||||||
/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob)
|
/obj/item/stack/rods/attackby(obj/item/W as obj, mob/user as mob)
|
||||||
if (istype(W, /obj/item/weapon/weldingtool))
|
if (istype(W, /obj/item/weapon/weldingtool))
|
||||||
var/obj/item/weapon/weldingtool/WT = W
|
var/obj/item/weapon/weldingtool/WT = W
|
||||||
@@ -55,7 +63,7 @@
|
|||||||
|
|
||||||
..()
|
..()
|
||||||
|
|
||||||
|
/*
|
||||||
/obj/item/stack/rods/attack_self(mob/user as mob)
|
/obj/item/stack/rods/attack_self(mob/user as mob)
|
||||||
src.add_fingerprint(user)
|
src.add_fingerprint(user)
|
||||||
|
|
||||||
@@ -87,3 +95,4 @@
|
|||||||
F.add_fingerprint(usr)
|
F.add_fingerprint(usr)
|
||||||
use(2)
|
use(2)
|
||||||
return
|
return
|
||||||
|
*/
|
||||||
@@ -6,9 +6,13 @@
|
|||||||
name = "catwalk"
|
name = "catwalk"
|
||||||
desc = "Cats really don't like these things."
|
desc = "Cats really don't like these things."
|
||||||
density = 0
|
density = 0
|
||||||
|
var/health = 100
|
||||||
|
var/maxhealth = 100
|
||||||
anchored = 1.0
|
anchored = 1.0
|
||||||
|
|
||||||
/obj/structure/catwalk/initialize()
|
/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))
|
for(var/obj/structure/catwalk/C in get_turf(src))
|
||||||
if(C != src)
|
if(C != src)
|
||||||
warning("Duplicate [type] in [loc] ([x], [y], [z])")
|
warning("Duplicate [type] in [loc] ([x], [y], [z])")
|
||||||
@@ -18,6 +22,7 @@
|
|||||||
/obj/structure/catwalk/Destroy()
|
/obj/structure/catwalk/Destroy()
|
||||||
var/turf/location = loc
|
var/turf/location = loc
|
||||||
. = ..()
|
. = ..()
|
||||||
|
location.alpha = initial(location.alpha)
|
||||||
for(var/obj/structure/catwalk/L in orange(location, 1))
|
for(var/obj/structure/catwalk/L in orange(location, 1))
|
||||||
L.update_icon()
|
L.update_icon()
|
||||||
|
|
||||||
@@ -55,6 +60,8 @@
|
|||||||
qdel(src)
|
qdel(src)
|
||||||
if(2.0)
|
if(2.0)
|
||||||
qdel(src)
|
qdel(src)
|
||||||
|
if(3.0)
|
||||||
|
qdel(src)
|
||||||
return
|
return
|
||||||
|
|
||||||
/obj/structure/catwalk/attackby(obj/item/C as obj, mob/user as mob)
|
/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/item/stack/rods(src.loc)
|
||||||
new /obj/structure/lattice(src.loc)
|
new /obj/structure/lattice(src.loc)
|
||||||
qdel(src)
|
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 ..()
|
return ..()
|
||||||
|
|
||||||
/obj/structure/catwalk/Crossed()
|
/obj/structure/catwalk/Crossed()
|
||||||
@@ -80,3 +95,11 @@
|
|||||||
if(target && target.z < src.z)
|
if(target && target.z < src.z)
|
||||||
return 0
|
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)
|
if(health <= 0)
|
||||||
visible_message("<span class='warning'>\The [src] breaks down!</span>")
|
visible_message("<span class='warning'>\The [src] breaks down!</span>")
|
||||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
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)
|
qdel(src)
|
||||||
|
|
||||||
/obj/structure/railing/proc/NeighborsCheck(var/UpdateNeighbors = 1)
|
/obj/structure/railing/proc/NeighborsCheck(var/UpdateNeighbors = 1)
|
||||||
@@ -134,6 +134,9 @@
|
|||||||
if(usr.incapacitated())
|
if(usr.incapacitated())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if (!can_touch(usr) || ismouse(usr))
|
||||||
|
return
|
||||||
|
|
||||||
if(anchored)
|
if(anchored)
|
||||||
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
||||||
return 0
|
return 0
|
||||||
@@ -150,6 +153,9 @@
|
|||||||
if(usr.incapacitated())
|
if(usr.incapacitated())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if (!can_touch(usr) || ismouse(usr))
|
||||||
|
return
|
||||||
|
|
||||||
if(anchored)
|
if(anchored)
|
||||||
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
||||||
return 0
|
return 0
|
||||||
@@ -166,6 +172,9 @@
|
|||||||
if(usr.incapacitated())
|
if(usr.incapacitated())
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
if (!can_touch(usr) || ismouse(usr))
|
||||||
|
return
|
||||||
|
|
||||||
if(anchored)
|
if(anchored)
|
||||||
to_chat(usr, "It is fastened to the floor therefore you can't flip it!")
|
to_chat(usr, "It is fastened to the floor therefore you can't flip it!")
|
||||||
return 0
|
return 0
|
||||||
@@ -249,6 +258,7 @@
|
|||||||
else
|
else
|
||||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||||
take_damage(W.force)
|
take_damage(W.force)
|
||||||
|
user.setClickCooldown(DEFAULT_ATTACK_COOLDOWN)
|
||||||
|
|
||||||
return ..()
|
return ..()
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,13 @@
|
|||||||
if(flooring)
|
if(flooring)
|
||||||
if(istype(C, /obj/item/weapon/crowbar))
|
if(istype(C, /obj/item/weapon/crowbar))
|
||||||
if(broken || burnt)
|
if(broken || burnt)
|
||||||
user << "<span class='notice'>You remove the broken [flooring.descriptor].</span>"
|
to_chat(user, "<span class='notice'>You remove the broken [flooring.descriptor].</span>")
|
||||||
make_plating()
|
make_plating()
|
||||||
else if(flooring.flags & TURF_IS_FRAGILE)
|
else if(flooring.flags & TURF_IS_FRAGILE)
|
||||||
user << "<span class='danger'>You forcefully pry off the [flooring.descriptor], destroying them in the process.</span>"
|
to_chat(user, "<span class='danger'>You forcefully pry off the [flooring.descriptor], destroying them in the process.</span>")
|
||||||
make_plating()
|
make_plating()
|
||||||
else if(flooring.flags & TURF_REMOVE_CROWBAR)
|
else if(flooring.flags & TURF_REMOVE_CROWBAR)
|
||||||
user << "<span class='notice'>You lever off the [flooring.descriptor].</span>"
|
to_chat(user, "<span class='notice'>You lever off the [flooring.descriptor].</span>")
|
||||||
make_plating(1)
|
make_plating(1)
|
||||||
else
|
else
|
||||||
return
|
return
|
||||||
@@ -21,35 +21,35 @@
|
|||||||
else if(istype(C, /obj/item/weapon/screwdriver) && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
|
else if(istype(C, /obj/item/weapon/screwdriver) && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
|
||||||
if(broken || burnt)
|
if(broken || burnt)
|
||||||
return
|
return
|
||||||
user << "<span class='notice'>You unscrew and remove the [flooring.descriptor].</span>"
|
to_chat(user, "<span class='notice'>You unscrew and remove the [flooring.descriptor].</span>")
|
||||||
make_plating(1)
|
make_plating(1)
|
||||||
playsound(src, C.usesound, 80, 1)
|
playsound(src, C.usesound, 80, 1)
|
||||||
return
|
return
|
||||||
else if(istype(C, /obj/item/weapon/wrench) && (flooring.flags & TURF_REMOVE_WRENCH))
|
else if(istype(C, /obj/item/weapon/wrench) && (flooring.flags & TURF_REMOVE_WRENCH))
|
||||||
user << "<span class='notice'>You unwrench and remove the [flooring.descriptor].</span>"
|
to_chat(user, "<span class='notice'>You unwrench and remove the [flooring.descriptor].</span>")
|
||||||
make_plating(1)
|
make_plating(1)
|
||||||
playsound(src, C.usesound, 80, 1)
|
playsound(src, C.usesound, 80, 1)
|
||||||
return
|
return
|
||||||
else if(istype(C, /obj/item/weapon/shovel) && (flooring.flags & TURF_REMOVE_SHOVEL))
|
else if(istype(C, /obj/item/weapon/shovel) && (flooring.flags & TURF_REMOVE_SHOVEL))
|
||||||
user << "<span class='notice'>You shovel off the [flooring.descriptor].</span>"
|
to_chat(user, "<span class='notice'>You shovel off the [flooring.descriptor].</span>")
|
||||||
make_plating(1)
|
make_plating(1)
|
||||||
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
|
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
|
||||||
return
|
return
|
||||||
else if(istype(C, /obj/item/stack/cable_coil))
|
else if(istype(C, /obj/item/stack/cable_coil))
|
||||||
user << "<span class='warning'>You must remove the [flooring.descriptor] first.</span>"
|
to_chat(user, "<span class='warning'>You must remove the [flooring.descriptor] first.</span>")
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
|
|
||||||
if(istype(C, /obj/item/stack/cable_coil))
|
if(istype(C, /obj/item/stack/cable_coil))
|
||||||
if(broken || burnt)
|
if(broken || burnt)
|
||||||
user << "<span class='warning'>This section is too damaged to support anything. Use a welder to fix the damage.</span>"
|
to_chat(user, "<span class='warning'>This section is too damaged to support anything. Use a welder to fix the damage.</span>")
|
||||||
return
|
return
|
||||||
var/obj/item/stack/cable_coil/coil = C
|
var/obj/item/stack/cable_coil/coil = C
|
||||||
coil.turf_place(src, user)
|
coil.turf_place(src, user)
|
||||||
return
|
return
|
||||||
else if(istype(C, /obj/item/stack))
|
else if(istype(C, /obj/item/stack))
|
||||||
if(broken || burnt)
|
if(broken || burnt)
|
||||||
user << "<span class='warning'>This section is too damaged to support anything. Use a welder to fix the damage.</span>"
|
to_chat(user, "<span class='warning'>This section is too damaged to support anything. Use a welder to fix the damage.</span>")
|
||||||
return
|
return
|
||||||
var/obj/item/stack/S = C
|
var/obj/item/stack/S = C
|
||||||
var/decl/flooring/use_flooring
|
var/decl/flooring/use_flooring
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
return
|
return
|
||||||
// Do we have enough?
|
// Do we have enough?
|
||||||
if(use_flooring.build_cost && S.amount < use_flooring.build_cost)
|
if(use_flooring.build_cost && S.amount < use_flooring.build_cost)
|
||||||
user << "<span class='warning'>You require at least [use_flooring.build_cost] [S.name] to complete the [use_flooring.descriptor].</span>"
|
to_chat(user, "<span class='warning'>You require at least [use_flooring.build_cost] [S.name] to complete the [use_flooring.descriptor].</span>")
|
||||||
return
|
return
|
||||||
// Stay still and focus...
|
// Stay still and focus...
|
||||||
if(use_flooring.build_time && !do_after(user, use_flooring.build_time))
|
if(use_flooring.build_time && !do_after(user, use_flooring.build_time))
|
||||||
@@ -81,10 +81,10 @@
|
|||||||
if(welder.isOn() && (is_plating()))
|
if(welder.isOn() && (is_plating()))
|
||||||
if(broken || burnt)
|
if(broken || burnt)
|
||||||
if(welder.remove_fuel(0,user))
|
if(welder.remove_fuel(0,user))
|
||||||
user << "<span class='notice'>You fix some dents on the broken plating.</span>"
|
to_chat(user, "<span class='notice'>You fix some dents on the broken plating.</span>")
|
||||||
playsound(src, welder.usesound, 80, 1)
|
playsound(src, welder.usesound, 80, 1)
|
||||||
icon_state = "plating"
|
icon_state = "plating"
|
||||||
burnt = null
|
burnt = null
|
||||||
broken = null
|
broken = null
|
||||||
else
|
else
|
||||||
user << "<span class='warning'>You need more welding fuel to complete this task.</span>"
|
to_chat(user, "<span class='warning'>You need more welding fuel to complete this task.</span>")
|
||||||
@@ -501,6 +501,10 @@
|
|||||||
if(!dense_object && (locate(/obj/structure/lattice) in oview(1, src)))
|
if(!dense_object && (locate(/obj/structure/lattice) in oview(1, src)))
|
||||||
dense_object++
|
dense_object++
|
||||||
|
|
||||||
|
if(!dense_object && (locate(/obj/structure/catwalk) in oview(1, src)))
|
||||||
|
dense_object++
|
||||||
|
|
||||||
|
|
||||||
//Lastly attempt to locate any dense objects we could push off of
|
//Lastly attempt to locate any dense objects we could push off of
|
||||||
//TODO: If we implement objects drifing in space this needs to really push them
|
//TODO: If we implement objects drifing in space this needs to really push them
|
||||||
//Due to a few issues only anchored and dense objects will now work.
|
//Due to a few issues only anchored and dense objects will now work.
|
||||||
|
|||||||
Reference in New Issue
Block a user