mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-27 06:00:23 +01:00
Port Bay's Catwalks
Allows for various new funtimes.
This commit is contained in:
@@ -8,11 +8,21 @@
|
||||
var/parts
|
||||
var/list/climbers = list()
|
||||
var/block_turf_edges = FALSE // If true, turf edge icons will not be made on the turf this occupies.
|
||||
|
||||
var/list/connections = list("0", "0", "0", "0")
|
||||
var/list/other_connections = list("0", "0", "0", "0")
|
||||
var/list/blend_objects = newlist() // Objects which to blend with
|
||||
var/list/noblend_objects = newlist() //Objects to avoid blending with (such as children of listed blend objects.
|
||||
|
||||
/obj/structure/Initialize()
|
||||
. = ..()
|
||||
if(climbable)
|
||||
verbs += /obj/structure/proc/climb_on
|
||||
|
||||
/obj/structure/Destroy()
|
||||
if(parts)
|
||||
new parts(loc)
|
||||
. = ..()
|
||||
return ..()
|
||||
|
||||
/obj/structure/attack_hand(mob/user)
|
||||
if(breakable)
|
||||
@@ -46,13 +56,7 @@
|
||||
if(3.0)
|
||||
return
|
||||
|
||||
/obj/structure/New()
|
||||
..()
|
||||
if(climbable)
|
||||
verbs += /obj/structure/proc/climb_on
|
||||
|
||||
/obj/structure/proc/climb_on()
|
||||
|
||||
set name = "Climb structure"
|
||||
set desc = "Climbs onto a structure."
|
||||
set category = "Object"
|
||||
@@ -61,7 +65,6 @@
|
||||
do_climb(usr)
|
||||
|
||||
/obj/structure/MouseDrop_T(mob/target, mob/user)
|
||||
|
||||
var/mob/living/H = user
|
||||
if(istype(H) && can_climb(H) && target == user)
|
||||
do_climb(target)
|
||||
@@ -185,3 +188,72 @@
|
||||
user.do_attack_animation(src)
|
||||
spawn(1) qdel(src)
|
||||
return 1
|
||||
|
||||
/obj/structure/proc/can_visually_connect()
|
||||
return anchored
|
||||
|
||||
/obj/structure/proc/can_visually_connect_to(var/obj/structure/S)
|
||||
return istype(S, src)
|
||||
|
||||
/obj/structure/proc/update_connections(propagate = 0)
|
||||
var/list/dirs = list()
|
||||
var/list/other_dirs = list()
|
||||
|
||||
for(var/obj/structure/S in orange(src, 1))
|
||||
if(can_visually_connect_to(S))
|
||||
if(S.can_visually_connect())
|
||||
if(propagate)
|
||||
//S.update_connections() //Not here
|
||||
S.update_icon()
|
||||
dirs += get_dir(src, S)
|
||||
|
||||
if(!can_visually_connect())
|
||||
connections = list("0", "0", "0", "0")
|
||||
other_connections = list("0", "0", "0", "0")
|
||||
return FALSE
|
||||
|
||||
for(var/direction in cardinal)
|
||||
var/turf/T = get_step(src, direction)
|
||||
var/success = 0
|
||||
for(var/b_type in blend_objects)
|
||||
if(istype(T, b_type))
|
||||
success = 1
|
||||
if(propagate)
|
||||
var/turf/simulated/wall/W = T
|
||||
if(istype(W))
|
||||
W.update_connections(1)
|
||||
if(success)
|
||||
break
|
||||
if(success)
|
||||
break
|
||||
if(!success)
|
||||
for(var/obj/O in T)
|
||||
for(var/b_type in blend_objects)
|
||||
if(istype(O, b_type))
|
||||
success = 1
|
||||
for(var/obj/structure/S in T)
|
||||
if(istype(S, src))
|
||||
success = 0
|
||||
for(var/nb_type in noblend_objects)
|
||||
if(istype(O, nb_type))
|
||||
success = 0
|
||||
|
||||
if(success)
|
||||
break
|
||||
if(success)
|
||||
break
|
||||
|
||||
if(success)
|
||||
dirs += get_dir(src, T)
|
||||
other_dirs += get_dir(src, T)
|
||||
|
||||
refresh_neighbors()
|
||||
|
||||
connections = dirs_to_corner_states(dirs)
|
||||
other_connections = dirs_to_corner_states(other_dirs)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/proc/refresh_neighbors()
|
||||
for(var/thing in RANGE_TURFS(1, src))
|
||||
var/turf/T = thing
|
||||
T.update_icon()
|
||||
|
||||
Reference in New Issue
Block a user