mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Catwalks and Railings
Added catwalks and railings. Ported from Vorestation who ported them from Eris. Note, catwalks can be placed on plating (as is seen on the vorestation map Tether) and is done so here as well. However it doesn't seem like it is possible to build said catwalks on plating. Did not bother to adjust this at this time. Something to sort in the future. Adjusted SC station dmm to use both the railing and catwalks as well as a couple fixes for the floor tile adjustment in a earlier commit.
This commit is contained in:
82
code/game/objects/structures/catwalk.dm
Normal file
82
code/game/objects/structures/catwalk.dm
Normal file
@@ -0,0 +1,82 @@
|
||||
// Based on catwalk.dm from https://github.com/Endless-Horizon/CEV-Eris
|
||||
/obj/structure/catwalk
|
||||
layer = TURF_LAYER + 0.5
|
||||
icon = 'icons/turf/catwalks.dmi'
|
||||
icon_state = "catwalk"
|
||||
name = "catwalk"
|
||||
desc = "Cats really don't like these things."
|
||||
density = 0
|
||||
anchored = 1.0
|
||||
|
||||
/obj/structure/catwalk/initialize()
|
||||
for(var/obj/structure/catwalk/C in get_turf(src))
|
||||
if(C != src)
|
||||
warning("Duplicate [type] in [loc] ([x], [y], [z])")
|
||||
qdel(C)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/catwalk/Destroy()
|
||||
var/turf/location = loc
|
||||
. = ..()
|
||||
for(var/obj/structure/catwalk/L in orange(location, 1))
|
||||
L.update_icon()
|
||||
|
||||
/obj/structure/catwalk/update_icon()
|
||||
var/connectdir = 0
|
||||
for(var/direction in cardinal)
|
||||
if(locate(/obj/structure/catwalk, get_step(src, direction)))
|
||||
connectdir |= direction
|
||||
|
||||
//Check the diagonal connections for corners, where you have, for example, connections both north and east. In this case it checks for a north-east connection to determine whether to add a corner marker or not.
|
||||
var/diagonalconnect = 0 //1 = NE; 2 = SE; 4 = NW; 8 = SW
|
||||
//NORTHEAST
|
||||
if(connectdir & NORTH && connectdir & EAST)
|
||||
if(locate(/obj/structure/catwalk, get_step(src, NORTHEAST)))
|
||||
diagonalconnect |= 1
|
||||
//SOUTHEAST
|
||||
if(connectdir & SOUTH && connectdir & EAST)
|
||||
if(locate(/obj/structure/catwalk, get_step(src, SOUTHEAST)))
|
||||
diagonalconnect |= 2
|
||||
//NORTHWEST
|
||||
if(connectdir & NORTH && connectdir & WEST)
|
||||
if(locate(/obj/structure/catwalk, get_step(src, NORTHWEST)))
|
||||
diagonalconnect |= 4
|
||||
//SOUTHWEST
|
||||
if(connectdir & SOUTH && connectdir & WEST)
|
||||
if(locate(/obj/structure/catwalk, get_step(src, SOUTHWEST)))
|
||||
diagonalconnect |= 8
|
||||
|
||||
icon_state = "catwalk[connectdir]-[diagonalconnect]"
|
||||
|
||||
|
||||
/obj/structure/catwalk/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
if(2.0)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
/obj/structure/catwalk/attackby(obj/item/C as obj, mob/user as mob)
|
||||
if (istype(C, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/WT = C
|
||||
if(WT.isOn())
|
||||
if(WT.remove_fuel(0, user))
|
||||
to_chat(user, "<span class='notice'>Slicing lattice joints ...</span>")
|
||||
new /obj/item/stack/rods(src.loc)
|
||||
new /obj/item/stack/rods(src.loc)
|
||||
new /obj/structure/lattice(src.loc)
|
||||
qdel(src)
|
||||
return ..()
|
||||
|
||||
/obj/structure/catwalk/Crossed()
|
||||
. = ..()
|
||||
if(isliving(usr))
|
||||
playsound(src, pick('sound/effects/footstep/catwalk1.ogg', 'sound/effects/footstep/catwalk2.ogg', 'sound/effects/footstep/catwalk3.ogg', 'sound/effects/footstep/catwalk4.ogg', 'sound/effects/footstep/catwalk5.ogg'), 25, 1)
|
||||
|
||||
/obj/structure/catwalk/CheckExit(atom/movable/O, turf/target)
|
||||
if(O.checkpass(PASSGRILLE))
|
||||
return 1
|
||||
if(target && target.z < src.z)
|
||||
return 0
|
||||
return 1
|
||||
@@ -67,7 +67,18 @@
|
||||
user << "<span class='notice'>Slicing lattice joints ...</span>"
|
||||
new /obj/item/stack/rods(src.loc)
|
||||
qdel(src)
|
||||
|
||||
return
|
||||
// VOREStation Edit - Added Catwalks
|
||||
if (istype(C, /obj/item/stack/rods))
|
||||
var/obj/item/stack/rods/R = C
|
||||
if(R.use(2))
|
||||
user << "<span class='notice'>You start connecting \the [R.name] to \the [src.name] ...</span>"
|
||||
if(do_after(user, 5 SECONDS))
|
||||
src.alpha = 0 // Note: I don't know why this is set, Eris did it, just trusting for now. ~Leshana
|
||||
new /obj/structure/catwalk(src.loc)
|
||||
qdel(src)
|
||||
return
|
||||
// VOREStation Edit End
|
||||
return
|
||||
|
||||
/obj/structure/lattice/proc/updateOverlays()
|
||||
|
||||
319
code/game/objects/structures/railing.dm
Normal file
319
code/game/objects/structures/railing.dm
Normal file
@@ -0,0 +1,319 @@
|
||||
// Based on railing.dmi from https://github.com/Endless-Horizon/CEV-Eris
|
||||
/obj/structure/railing
|
||||
name = "railing"
|
||||
desc = "A standard steel railing. Play stupid games win stupid prizes."
|
||||
icon = 'icons/obj/railing.dmi'
|
||||
density = 1
|
||||
throwpass = 1
|
||||
climbable = 1
|
||||
layer = 3.2 //Just above doors
|
||||
anchored = 1
|
||||
flags = ON_BORDER
|
||||
icon_state = "railing0"
|
||||
var/broken = FALSE
|
||||
var/health = 70
|
||||
var/maxhealth = 70
|
||||
var/check = 0
|
||||
|
||||
/obj/structure/railing/New(loc, constructed = 0)
|
||||
..()
|
||||
// TODO - "constructed" is not passed to us. We need to find a way to do this safely.
|
||||
if (constructed) // player-constructed railings
|
||||
anchored = 0
|
||||
if(climbable)
|
||||
verbs += /obj/structure/proc/climb_on
|
||||
|
||||
/obj/structure/railing/initialize()
|
||||
..()
|
||||
if(src.anchored)
|
||||
update_icon(0)
|
||||
|
||||
/obj/structure/railing/Destroy()
|
||||
var/turf/location = loc
|
||||
. = ..()
|
||||
for(var/obj/structure/railing/R in orange(location, 1))
|
||||
R.update_icon()
|
||||
|
||||
/obj/structure/railing/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
|
||||
if(!mover)
|
||||
return 1
|
||||
if(istype(mover) && mover.checkpass(PASSTABLE))
|
||||
return 1
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/structure/railing/examine(mob/user)
|
||||
. = ..()
|
||||
if(health < maxhealth)
|
||||
switch(health / maxhealth)
|
||||
if(0.0 to 0.5)
|
||||
to_chat(user, "<span class='warning'>It looks severely damaged!</span>")
|
||||
if(0.25 to 0.5)
|
||||
to_chat(user, "<span class='warning'>It looks damaged!</span>")
|
||||
if(0.5 to 1.0)
|
||||
to_chat(user, "<span class='notice'>It has a few scrapes and dents.</span>")
|
||||
|
||||
/obj/structure/railing/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(usr))
|
||||
qdel(src)
|
||||
|
||||
/obj/structure/railing/proc/NeighborsCheck(var/UpdateNeighbors = 1)
|
||||
check = 0
|
||||
//if (!anchored) return
|
||||
var/Rturn = turn(src.dir, -90)
|
||||
var/Lturn = turn(src.dir, 90)
|
||||
|
||||
for(var/obj/structure/railing/R in src.loc)
|
||||
if ((R.dir == Lturn) && R.anchored)
|
||||
check |= 32
|
||||
if (UpdateNeighbors)
|
||||
R.update_icon(0)
|
||||
if ((R.dir == Rturn) && R.anchored)
|
||||
check |= 2
|
||||
if (UpdateNeighbors)
|
||||
R.update_icon(0)
|
||||
|
||||
for (var/obj/structure/railing/R in get_step(src, Lturn))
|
||||
if ((R.dir == src.dir) && R.anchored)
|
||||
check |= 16
|
||||
if (UpdateNeighbors)
|
||||
R.update_icon(0)
|
||||
for (var/obj/structure/railing/R in get_step(src, Rturn))
|
||||
if ((R.dir == src.dir) && R.anchored)
|
||||
check |= 1
|
||||
if (UpdateNeighbors)
|
||||
R.update_icon(0)
|
||||
|
||||
for (var/obj/structure/railing/R in get_step(src, (Lturn + src.dir)))
|
||||
if ((R.dir == Rturn) && R.anchored)
|
||||
check |= 64
|
||||
if (UpdateNeighbors)
|
||||
R.update_icon(0)
|
||||
for (var/obj/structure/railing/R in get_step(src, (Rturn + src.dir)))
|
||||
if ((R.dir == Lturn) && R.anchored)
|
||||
check |= 4
|
||||
if (UpdateNeighbors)
|
||||
R.update_icon(0)
|
||||
|
||||
/obj/structure/railing/update_icon(var/UpdateNeighgors = 1)
|
||||
NeighborsCheck(UpdateNeighgors)
|
||||
//layer = (dir == SOUTH) ? FLY_LAYER : initial(layer) // Vorestation edit because wtf does this even do
|
||||
overlays.Cut()
|
||||
if (!check || !anchored)//|| !anchored
|
||||
icon_state = "railing0"
|
||||
else
|
||||
icon_state = "railing1"
|
||||
if (check & 32)
|
||||
overlays += image ('icons/obj/railing.dmi', src, "corneroverlay")
|
||||
if ((check & 16) || !(check & 32) || (check & 64))
|
||||
overlays += image ('icons/obj/railing.dmi', src, "frontoverlay_l")
|
||||
if (!(check & 2) || (check & 1) || (check & 4))
|
||||
overlays += image ('icons/obj/railing.dmi', src, "frontoverlay_r")
|
||||
if(check & 4)
|
||||
switch (src.dir)
|
||||
if (NORTH)
|
||||
overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_x = 32)
|
||||
if (SOUTH)
|
||||
overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_x = -32)
|
||||
if (EAST)
|
||||
overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_y = -32)
|
||||
if (WEST)
|
||||
overlays += image ('icons/obj/railing.dmi', src, "mcorneroverlay", pixel_y = 32)
|
||||
|
||||
/obj/structure/railing/verb/rotate()
|
||||
set name = "Rotate Railing Counter-Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
||||
return 0
|
||||
|
||||
set_dir(turn(dir, 90))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/structure/railing/verb/revrotate()
|
||||
set name = "Rotate Railing Clockwise"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "It is fastened to the floor therefore you can't rotate it!")
|
||||
return 0
|
||||
|
||||
set_dir(turn(dir, -90))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/structure/railing/verb/flip() // This will help push railing to remote places, such as open space turfs
|
||||
set name = "Flip Railing"
|
||||
set category = "Object"
|
||||
set src in oview(1)
|
||||
|
||||
if(usr.incapacitated())
|
||||
return 0
|
||||
|
||||
if(anchored)
|
||||
to_chat(usr, "It is fastened to the floor therefore you can't flip it!")
|
||||
return 0
|
||||
|
||||
var/obj/occupied = neighbor_turf_impassable()
|
||||
if(occupied)
|
||||
to_chat(usr, "You can't flip \the [src] because there's \a [occupied] in the way.")
|
||||
return 0
|
||||
|
||||
src.loc = get_step(src, src.dir)
|
||||
set_dir(turn(dir, 180))
|
||||
update_icon()
|
||||
return
|
||||
|
||||
/obj/structure/railing/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
if(istype(O) && O.checkpass(PASSTABLE))
|
||||
return 1
|
||||
if(get_dir(O.loc, target) == dir)
|
||||
return 0
|
||||
return 1
|
||||
|
||||
/obj/structure/railing/attackby(obj/item/W as obj, mob/user as mob)
|
||||
// Dismantle
|
||||
if(istype(W, /obj/item/weapon/wrench) && !anchored)
|
||||
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
|
||||
if(do_after(user, 20, src))
|
||||
user.visible_message("<span class='notice'>\The [user] dismantles \the [src].</span>", "<span class='notice'>You dismantle \the [src].</span>")
|
||||
new /obj/item/stack/material/steel(get_turf(usr), 2)
|
||||
qdel(src)
|
||||
return
|
||||
|
||||
// Repair
|
||||
if(health < maxhealth && istype(W, /obj/item/weapon/weldingtool))
|
||||
var/obj/item/weapon/weldingtool/F = W
|
||||
if(F.welding)
|
||||
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
|
||||
if(do_after(user, 20, src))
|
||||
user.visible_message("<span class='notice'>\The [user] repairs some damage to \the [src].</span>", "<span class='notice'>You repair some damage to \the [src].</span>")
|
||||
health = min(health+(maxhealth/5), maxhealth) // 20% repair per application
|
||||
return
|
||||
|
||||
// Install
|
||||
if(istype(W, /obj/item/weapon/screwdriver))
|
||||
user.visible_message(anchored ? "<span class='notice'>\The [user] begins unscrewing \the [src].</span>" : "<span class='notice'>\The [user] begins fasten \the [src].</span>" )
|
||||
playsound(loc, 'sound/items/Screwdriver.ogg', 75, 1)
|
||||
if(do_after(user, 10, src))
|
||||
to_chat(user, (anchored ? "<span class='notice'>You have unfastened \the [src] from the floor.</span>" : "<span class='notice'>You have fastened \the [src] to the floor.</span>"))
|
||||
anchored = !anchored
|
||||
update_icon()
|
||||
return
|
||||
|
||||
// Handle harm intent grabbing/tabling.
|
||||
if(istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
|
||||
var/obj/item/weapon/grab/G = W
|
||||
if (istype(G.affecting, /mob/living))
|
||||
var/mob/living/M = G.affecting
|
||||
var/obj/occupied = turf_is_crowded()
|
||||
if(occupied)
|
||||
to_chat(user, "<span class='danger'>There's \a [occupied] in the way.</span>")
|
||||
return
|
||||
if (G.state < 2)
|
||||
if(user.a_intent == I_HURT)
|
||||
if (prob(15)) M.Weaken(5)
|
||||
M.apply_damage(8,def_zone = "head")
|
||||
take_damage(8)
|
||||
visible_message("<span class='danger'>[G.assailant] slams [G.affecting]'s face against \the [src]!</span>")
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
else
|
||||
to_chat(user, "<span class='danger'>You need a better grip to do that!</span>")
|
||||
return
|
||||
else
|
||||
if (get_turf(G.affecting) == get_turf(src))
|
||||
G.affecting.forceMove(get_step(src, src.dir))
|
||||
else
|
||||
G.affecting.forceMove(get_turf(src))
|
||||
G.affecting.Weaken(5)
|
||||
visible_message("<span class='danger'>[G.assailant] throws [G.affecting] over \the [src]!</span>")
|
||||
qdel(W)
|
||||
return
|
||||
|
||||
else
|
||||
playsound(loc, 'sound/effects/grillehit.ogg', 50, 1)
|
||||
take_damage(W.force)
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/structure/railing/ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
qdel(src)
|
||||
return
|
||||
if(2.0)
|
||||
qdel(src)
|
||||
return
|
||||
if(3.0)
|
||||
qdel(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
// Duplicated from structures.dm, but its a bit different.
|
||||
/obj/structure/railing/do_climb(var/mob/living/user)
|
||||
if(!can_climb(user))
|
||||
return
|
||||
|
||||
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
|
||||
climbers |= user
|
||||
|
||||
if(!do_after(user,(issmall(user) ? 20 : 34)))
|
||||
climbers -= user
|
||||
return
|
||||
|
||||
if(!can_climb(user, post_climb_check=1))
|
||||
climbers -= user
|
||||
return
|
||||
|
||||
if(get_turf(user) == get_turf(src))
|
||||
usr.forceMove(get_step(src, src.dir))
|
||||
else
|
||||
usr.forceMove(get_turf(src))
|
||||
|
||||
usr.visible_message("<span class='warning'>[user] climbed over \the [src]!</span>")
|
||||
if(!anchored) take_damage(maxhealth) // Fatboy
|
||||
climbers -= user
|
||||
|
||||
/obj/structure/railing/can_climb(var/mob/living/user, post_climb_check=0)
|
||||
if(!..())
|
||||
return 0
|
||||
|
||||
// Normal can_climb() handles climbing from adjacent turf onto our turf. But railings also allow climbing
|
||||
// from our turf onto an adjacent! If that is the case we need to do checks for that too...
|
||||
if(get_turf(user) == get_turf(src))
|
||||
var/obj/occupied = neighbor_turf_impassable()
|
||||
if(occupied)
|
||||
to_chat(user, "<span class='danger'>You can't climb there, there's \a [occupied] in the way.</span>")
|
||||
return 0
|
||||
return 1
|
||||
|
||||
// TODO - This here might require some investigation
|
||||
/obj/structure/proc/neighbor_turf_impassable()
|
||||
var/turf/T = get_step(src, src.dir)
|
||||
if(!T || !istype(T))
|
||||
return 0
|
||||
if(T.density == 1)
|
||||
return T
|
||||
for(var/obj/O in T.contents)
|
||||
if(istype(O,/obj/structure))
|
||||
var/obj/structure/S = O
|
||||
if(S.climbable) continue
|
||||
if(O && O.density && !(O.flags & ON_BORDER && !(turn(O.dir, 180) & dir)))
|
||||
return O
|
||||
@@ -55,6 +55,7 @@
|
||||
recipes += new/datum/stack_recipe("fire extinguisher cabinet frame", /obj/item/frame/extinguisher_cabinet, 4, time = 5, one_per_turf = 0, on_floor = 1)
|
||||
//recipes += new/datum/stack_recipe("fire axe cabinet frame", /obj/item/frame/fireaxe_cabinet, 4, time = 5, one_per_turf = 0, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe("wall girders", /obj/structure/girder, 2, time = 50, one_per_turf = 1, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe("railing", /obj/structure/railing, 2, time = 50, one_per_turf = 0, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe("turret frame", /obj/machinery/porta_turret_construct, 5, time = 25, one_per_turf = 1, on_floor = 1)
|
||||
recipes += new/datum/stack_recipe_list("airlock assemblies", list( \
|
||||
new/datum/stack_recipe("standard airlock assembly", /obj/structure/door_assembly, 4, time = 50, one_per_turf = 1, on_floor = 1), \
|
||||
|
||||
@@ -57,7 +57,10 @@
|
||||
if(!A.CanPass(src, start, 1.5, 0))
|
||||
to_chat(src, "<span class='warning'>\The [A] blocks you.</span>")
|
||||
return 0
|
||||
Move(destination)
|
||||
//VOREStation Edit
|
||||
if(!Move(destination))
|
||||
return 0
|
||||
//VOREStation Edit End
|
||||
return 1
|
||||
|
||||
/mob/observer/zMove(direction)
|
||||
@@ -103,6 +106,17 @@
|
||||
if(T.density)
|
||||
return 1
|
||||
|
||||
// TODO - Leshana Experimental
|
||||
|
||||
//Execution by grand piano!
|
||||
/atom/movable/proc/get_fall_damage()
|
||||
return 42
|
||||
|
||||
//If atom stands under open space, it can prevent fall, or not
|
||||
/atom/proc/can_prevent_fall(var/atom/movable/mover, var/turf/coming_from)
|
||||
return (!CanPass(mover, coming_from))
|
||||
|
||||
////////////////////////////
|
||||
|
||||
|
||||
|
||||
@@ -130,22 +144,21 @@
|
||||
return
|
||||
|
||||
if(can_fall())
|
||||
handle_fall(below)
|
||||
// We spawn here to let the current move operation complete before we start falling. fall() is normally called from
|
||||
// Entered() which is part of Move(), by spawn()ing we let that complete. But we want to preserve if we were in client movement
|
||||
// or normal movement so other move behavior can continue.
|
||||
var/mob/M = src
|
||||
var/is_client_moving = (ismob(M) && M.client && M.client.moving)
|
||||
spawn(0)
|
||||
if(is_client_moving) M.client.moving = 1
|
||||
handle_fall(below)
|
||||
if(is_client_moving) M.client.moving = 0
|
||||
// TODO - handle fall on damage!
|
||||
|
||||
//For children to override
|
||||
/atom/movable/proc/can_fall()
|
||||
if(anchored)
|
||||
return FALSE
|
||||
|
||||
if(locate(/obj/structure/lattice, loc))
|
||||
return FALSE
|
||||
|
||||
// See if something prevents us from falling.
|
||||
var/turf/below = GetBelow(src)
|
||||
for(var/atom/A in below)
|
||||
if(!A.CanPass(src, src.loc))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/effect/can_fall()
|
||||
@@ -160,31 +173,15 @@
|
||||
|
||||
// Mechas are anchored, so we need to override.
|
||||
/obj/mecha/can_fall()
|
||||
var/obj/structure/lattice/lattice = locate(/obj/structure/lattice, loc)
|
||||
if(lattice)
|
||||
var/area/area = get_area(src)
|
||||
if(area.has_gravity())
|
||||
// Lattices seem a bit too flimsy to hold up a massive exosuit.
|
||||
lattice.visible_message("<span class='danger'>\The [lattice] collapses under the weight of \the [src]!</span>")
|
||||
qdel(lattice)
|
||||
|
||||
// See if something prevents us from falling.
|
||||
var/turf/below = GetBelow(src)
|
||||
for(var/atom/A in below)
|
||||
if(!A.CanPass(src, src.loc))
|
||||
return FALSE
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/pipe/can_fall()
|
||||
var/turf/simulated/open/below = loc
|
||||
below = below.below
|
||||
|
||||
. = ..()
|
||||
|
||||
if(anchored)
|
||||
return FALSE
|
||||
|
||||
var/turf/below = GetBelow(src)
|
||||
if((locate(/obj/structure/disposalpipe/up) in below) || locate(/obj/machinery/atmospherics/pipe/zpipe/up in below))
|
||||
return FALSE
|
||||
|
||||
@@ -194,22 +191,113 @@
|
||||
/mob/living/simple_animal/hostile/carp/can_fall() // So can carp apparently.
|
||||
return FALSE
|
||||
|
||||
// Check if this atom prevents things standing on it from falling. Return TRUE to allow the fall.
|
||||
/obj/proc/CanFallThru(atom/movable/mover as mob|obj, turf/target as turf)
|
||||
return TRUE
|
||||
|
||||
// Things that prevent objects standing on them from falling into turf below
|
||||
/obj/structure/catwalk/CanFallThru(atom/movable/mover as mob|obj, turf/target as turf)
|
||||
if(target.z < z)
|
||||
return FALSE // TODO - Technically should be density = 1 and flags |= ON_BORDER
|
||||
if(!isturf(mover.loc)) // VORESTATION EDIT. Feel free to do an upstream suggestion as well.
|
||||
return FALSE // Only let loose floor items fall. No more snatching things off people's hands.
|
||||
else
|
||||
return TRUE
|
||||
|
||||
// So you'll slam when falling onto a catwalk
|
||||
/obj/structure/catwalk/CheckFall(var/atom/movable/falling_atom)
|
||||
return falling_atom.fall_impact(src)
|
||||
|
||||
/obj/structure/lattice/CanFallThru(atom/movable/mover as mob|obj, turf/target as turf)
|
||||
if(target.z >= z)
|
||||
return TRUE // We don't block sideways or upward movement.
|
||||
else if(istype(mover) && mover.checkpass(PASSGRILLE))
|
||||
return TRUE // Anything small enough to pass a grille will pass a lattice
|
||||
if(!isturf(mover.loc)) // VORESTATION EDIT. Feel free to do an upstream suggestion as well.
|
||||
return FALSE // Only let loose floor items fall. No more snatching things off people's hands.
|
||||
else
|
||||
return FALSE // TODO - Technically should be density = 1 and flags |= ON_BORDER
|
||||
|
||||
// So you'll slam when falling onto a grille
|
||||
/obj/structure/lattice/CheckFall(var/atom/movable/falling_atom)
|
||||
if(istype(falling_atom) && falling_atom.checkpass(PASSGRILLE))
|
||||
return FALSE
|
||||
return falling_atom.fall_impact(src)
|
||||
|
||||
|
||||
// Actually process the falling movement and impacts.
|
||||
/atom/movable/proc/handle_fall(var/turf/landing)
|
||||
Move(landing)
|
||||
var/turf/oldloc = loc
|
||||
|
||||
// Check if there is anything in our turf we are standing on to prevent falling.
|
||||
for(var/obj/O in loc)
|
||||
if(!O.CanFallThru(src, landing))
|
||||
return FALSE
|
||||
// See if something in turf below prevents us from falling into it.
|
||||
for(var/atom/A in landing)
|
||||
if(!A.CanPass(src, src.loc, 1, 0))
|
||||
return FALSE
|
||||
// TODO - Stairs should operate thru a different mechanism, not falling, to allow side-bumping.
|
||||
|
||||
// Now lets move there!
|
||||
if(!Move(landing))
|
||||
return 1
|
||||
|
||||
// Detect if we made a silent landing.
|
||||
if(locate(/obj/structure/stairs) in landing)
|
||||
return 1
|
||||
|
||||
if(istype(landing, /turf/simulated/open))
|
||||
visible_message("\The [src] falls from the deck above through \the [landing]!", "You hear a whoosh of displaced air.")
|
||||
else
|
||||
visible_message("\The [src] falls from the deck above and slams into \the [landing]!", "You hear something slam into the deck.")
|
||||
if(isopenspace(oldloc))
|
||||
oldloc.visible_message("\The [src] falls down through \the [oldloc]!", "You hear something falling through the air.")
|
||||
|
||||
/mob/living/carbon/human/handle_fall(var/turf/landing)
|
||||
if(..())
|
||||
// If the turf has density, we give it first dibs
|
||||
if (landing.density && landing.CheckFall(src))
|
||||
return
|
||||
to_chat(src, "<span class='danger'>You fall off and hit \the [landing]!</span>")
|
||||
|
||||
// First hit objects in the turf!
|
||||
for(var/atom/movable/A in landing)
|
||||
if(A != src && A.CheckFall(src))
|
||||
return
|
||||
|
||||
// If none of them stopped us, then hit the turf itself
|
||||
landing.CheckFall(src)
|
||||
|
||||
|
||||
// ## THE FALLING PROCS ###
|
||||
|
||||
// Called on everything that falling_atom might hit. Return 1 if you're handling it so handle_fall() will stop checking.
|
||||
// If you're soft and break the fall gently, just return 1
|
||||
// If the falling atom will hit you hard, call fall_impact() and return its result.
|
||||
/atom/proc/CheckFall(var/atom/movable/falling_atom)
|
||||
if(density && !(flags & ON_BORDER))
|
||||
return falling_atom.fall_impact(src)
|
||||
|
||||
// By default all turfs are gonna let you hit them regardless of density.
|
||||
/turf/CheckFall(var/atom/movable/falling_atom)
|
||||
return falling_atom.fall_impact(src)
|
||||
|
||||
// Obviously you can't really hit open space.
|
||||
/turf/simulated/open/CheckFall(var/atom/movable/falling_atom)
|
||||
// Don't need to print this, the open space it falls into will print it for us!
|
||||
// visible_message("\The [falling_atom] falls from above through \the [src]!", "You hear a whoosh of displaced air.")
|
||||
return 0
|
||||
|
||||
// We return 1 without calling fall_impact in order to provide a soft landing. So nice.
|
||||
// Note this really should never even get this far
|
||||
/obj/structure/stairs/CheckFall(var/atom/movable/falling_atom)
|
||||
return 1
|
||||
|
||||
// Called by CheckFall when we actually hit something. Oof
|
||||
/atom/movable/proc/fall_impact(var/atom/hit_atom)
|
||||
visible_message("\The [src] falls from above and slams into \the [hit_atom]!", "You hear something slam into \the [hit_atom].")
|
||||
|
||||
// Take damage from falling and hitting the ground
|
||||
/mob/living/carbon/human/fall_impact(var/turf/landing)
|
||||
visible_message("<span class='warning'>\The [src] falls from above and slams into \the [landing]!</span>", \
|
||||
"<span class='danger'>You fall off and hit \the [landing]!</span>", \
|
||||
"You hear something slam into \the [landing].")
|
||||
playsound(loc, "punch", 25, 1, -1)
|
||||
var/damage = 20 // Because wounds heal rather quickly, 20 should be enough to discourage jumping off but not be enough to ruin you, at least for the first time.
|
||||
var/damage = 15 // Because wounds heal rather quickly, 15 should be enough to discourage jumping off but not be enough to ruin you, at least for the first time.
|
||||
apply_damage(rand(0, damage), BRUTE, BP_HEAD)
|
||||
apply_damage(rand(0, damage), BRUTE, BP_TORSO)
|
||||
apply_damage(rand(0, damage), BRUTE, BP_L_LEG)
|
||||
@@ -220,15 +308,23 @@
|
||||
updatehealth()
|
||||
|
||||
/obj/mecha/handle_fall(var/turf/landing)
|
||||
if(..())
|
||||
return
|
||||
// First things first, break any lattice
|
||||
var/obj/structure/lattice/lattice = locate(/obj/structure/lattice, loc)
|
||||
if(lattice)
|
||||
// Lattices seem a bit too flimsy to hold up a massive exosuit.
|
||||
lattice.visible_message("<span class='danger'>\The [lattice] collapses under the weight of \the [src]!</span>")
|
||||
qdel(lattice)
|
||||
|
||||
// Then call parent to have us actually fall
|
||||
return ..()
|
||||
|
||||
/obj/mecha/fall_impact(var/atom/hit_atom)
|
||||
// Tell the pilot that they just dropped down with a superheavy mecha.
|
||||
if(occupant)
|
||||
to_chat(occupant, "<span class='warning'>\The [src] crashed down onto \the [landing]!</span>")
|
||||
to_chat(occupant, "<span class='warning'>\The [src] crashed down onto \the [hit_atom]!</span>")
|
||||
|
||||
// Anything on the same tile as the landing tile is gonna have a bad day.
|
||||
for(var/mob/living/L in landing.contents)
|
||||
for(var/mob/living/L in hit_atom.contents)
|
||||
L.visible_message("<span class='danger'>\The [src] crushes \the [L] as it lands on them!</span>")
|
||||
L.adjustBruteLoss(rand(70, 100))
|
||||
L.Weaken(8)
|
||||
@@ -237,6 +333,6 @@
|
||||
take_damage(rand(15, 30))
|
||||
|
||||
// And hurt the floor.
|
||||
if(istype(landing, /turf/simulated/floor))
|
||||
var/turf/simulated/floor/ground = landing
|
||||
ground.break_tile()
|
||||
if(istype(hit_atom, /turf/simulated/floor))
|
||||
var/turf/simulated/floor/ground = hit_atom
|
||||
ground.break_tile()
|
||||
|
||||
37
html/changelogs/Woodrat - Railings Catwalks.yml
Normal file
37
html/changelogs/Woodrat - Railings Catwalks.yml
Normal file
@@ -0,0 +1,37 @@
|
||||
################################
|
||||
# Example Changelog File
|
||||
#
|
||||
# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb.
|
||||
#
|
||||
# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.)
|
||||
# When it is, any changes listed below will disappear.
|
||||
#
|
||||
# Valid Prefixes:
|
||||
# bugfix
|
||||
# wip (For works in progress)
|
||||
# tweak
|
||||
# soundadd
|
||||
# sounddel
|
||||
# rscadd (general adding of nice things)
|
||||
# rscdel (general deleting of nice things)
|
||||
# imageadd
|
||||
# imagedel
|
||||
# maptweak
|
||||
# spellcheck (typo fixes)
|
||||
# experiment
|
||||
#################################
|
||||
|
||||
# Your name.
|
||||
author: Woodrat
|
||||
|
||||
# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again.
|
||||
delete-after: True
|
||||
|
||||
# Any changes you've made. See valid prefix list above.
|
||||
# INDENT WITH TWO SPACES. NOT TABS. SPACES.
|
||||
# SCREW THIS UP AND IT WON'T WORK.
|
||||
# Also, all entries are changed into a single [] after a master changelog generation. Just remove the brackets when you add new entries.
|
||||
# Please surround your changes in double quotes ("), as certain characters otherwise screws up compiling. The quotes will not show up in the changelog.
|
||||
changes:
|
||||
- maptweak: "Added catwalks and railings to SC station. Fixed first Z-level."
|
||||
- rscadd: "Added the ability to make catwalks and railings as ported from vore."
|
||||
BIN
icons/obj/railing.dmi
Normal file
BIN
icons/obj/railing.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 815 B |
BIN
icons/turf/catwalks.dmi
Normal file
BIN
icons/turf/catwalks.dmi
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.0 KiB |
File diff suppressed because it is too large
Load Diff
@@ -956,6 +956,7 @@
|
||||
#include "code\game\objects\random\random.dm"
|
||||
#include "code\game\objects\structures\barsign.dm"
|
||||
#include "code\game\objects\structures\bedsheet_bin.dm"
|
||||
#include "code\game\objects\structures\catwalk.dm"
|
||||
#include "code\game\objects\structures\coathanger.dm"
|
||||
#include "code\game\objects\structures\curtains.dm"
|
||||
#include "code\game\objects\structures\displaycase.dm"
|
||||
@@ -974,6 +975,7 @@
|
||||
#include "code\game\objects\structures\morgue.dm"
|
||||
#include "code\game\objects\structures\musician.dm"
|
||||
#include "code\game\objects\structures\noticeboard.dm"
|
||||
#include "code\game\objects\structures\railing.dm"
|
||||
#include "code\game\objects\structures\safe.dm"
|
||||
#include "code\game\objects\structures\signs.dm"
|
||||
#include "code\game\objects\structures\simple_doors.dm"
|
||||
@@ -2259,6 +2261,7 @@
|
||||
#include "interface\interface.dm"
|
||||
#include "interface\skin.dmf"
|
||||
#include "maps\northern_star\northern_star.dm"
|
||||
#include "maps\northern_star\northern_star_defines.dm"
|
||||
#include "maps\submaps\_readme.dm"
|
||||
#include "maps\submaps\cave_submaps\cave.dm"
|
||||
#include "maps\submaps\space_submaps\space.dm"
|
||||
|
||||
BIN
sound/effects/footstep/catwalk1.ogg
Normal file
BIN
sound/effects/footstep/catwalk1.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/catwalk2.ogg
Normal file
BIN
sound/effects/footstep/catwalk2.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/catwalk3.ogg
Normal file
BIN
sound/effects/footstep/catwalk3.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/catwalk4.ogg
Normal file
BIN
sound/effects/footstep/catwalk4.ogg
Normal file
Binary file not shown.
BIN
sound/effects/footstep/catwalk5.ogg
Normal file
BIN
sound/effects/footstep/catwalk5.ogg
Normal file
Binary file not shown.
Reference in New Issue
Block a user