mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Improves catwalks and railings
This commit is contained in:
@@ -22,6 +22,14 @@
|
||||
charge_costs = list(500)
|
||||
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)
|
||||
if (istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = W
|
||||
@@ -55,7 +63,7 @@
|
||||
|
||||
..()
|
||||
|
||||
|
||||
/*
|
||||
/obj/item/stack/rods/attack_self(mob/user as mob)
|
||||
src.add_fingerprint(user)
|
||||
|
||||
@@ -87,3 +95,4 @@
|
||||
F.add_fingerprint(usr)
|
||||
use(2)
|
||||
return
|
||||
*/
|
||||
@@ -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 ..()
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@
|
||||
if(flooring)
|
||||
if(istype(C, /obj/item/weapon/crowbar))
|
||||
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()
|
||||
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()
|
||||
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)
|
||||
else
|
||||
return
|
||||
@@ -21,35 +21,35 @@
|
||||
else if(istype(C, /obj/item/weapon/screwdriver) && (flooring.flags & TURF_REMOVE_SCREWDRIVER))
|
||||
if(broken || burnt)
|
||||
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)
|
||||
playsound(src, C.usesound, 80, 1)
|
||||
return
|
||||
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)
|
||||
playsound(src, C.usesound, 80, 1)
|
||||
return
|
||||
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)
|
||||
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
|
||||
return
|
||||
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
|
||||
else
|
||||
|
||||
if(istype(C, /obj/item/stack/cable_coil))
|
||||
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
|
||||
var/obj/item/stack/cable_coil/coil = C
|
||||
coil.turf_place(src, user)
|
||||
return
|
||||
else if(istype(C, /obj/item/stack))
|
||||
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
|
||||
var/obj/item/stack/S = C
|
||||
var/decl/flooring/use_flooring
|
||||
@@ -64,7 +64,7 @@
|
||||
return
|
||||
// Do we have enough?
|
||||
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
|
||||
// Stay still and focus...
|
||||
if(use_flooring.build_time && !do_after(user, use_flooring.build_time))
|
||||
@@ -81,10 +81,10 @@
|
||||
if(welder.isOn() && (is_plating()))
|
||||
if(broken || burnt)
|
||||
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)
|
||||
icon_state = "plating"
|
||||
burnt = null
|
||||
broken = null
|
||||
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)))
|
||||
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
|
||||
//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.
|
||||
|
||||
Reference in New Issue
Block a user