Corners aren't cosmetic anymore

This commit is contained in:
Vi3trice
2021-09-24 13:04:04 -04:00
parent 8fc35630a9
commit b145ab1f4c
+33 -4
View File
@@ -9,6 +9,7 @@
climbable = TRUE
layer = ABOVE_MOB_LAYER
var/currently_climbed = FALSE
var/mover_dir = null
/obj/structure/railing/corner //aesthetic corner sharp edges hurt oof ouch
icon_state = "railing_corner"
@@ -73,7 +74,21 @@
return TRUE
if(mover.throwing)
return TRUE
if(get_dir(loc, target) != dir)
mover_dir = get_dir(loc, target)
switch(dir)
if(5)
if(mover_dir == 1 || mover_dir == 4)
return FALSE
if(6)
if(mover_dir == 2 || mover_dir == 4)
return FALSE
if(9)
if(mover_dir == 1 || mover_dir == 8)
return FALSE
if(10)
if(mover_dir == 2 || mover_dir == 8)
return FALSE
if(mover_dir != dir)
return density
return FALSE
@@ -92,8 +107,22 @@
return TRUE
if(currently_climbed)
return TRUE
if(get_dir(O.loc, target) == dir)
mover_dir = get_dir(O.loc, target)
if(mover_dir == dir)
return FALSE
switch(dir)
if(5)
if(mover_dir == 1 || mover_dir == 4)
return FALSE
if(6)
if(mover_dir == 2 || mover_dir == 4)
return FALSE
if(9)
if(mover_dir == 1 || mover_dir == 8)
return FALSE
if(10)
if(mover_dir == 2 || mover_dir == 8)
return FALSE
return TRUE
/obj/structure/railing/do_climb(mob/living/user)
@@ -112,7 +141,7 @@
to_chat(user, "<span class='warning'>[src] cannot be rotated while it is fastened to the floor!</span>")
return FALSE
var/target_dir = turn(dir, -90)
var/target_dir = turn(dir, -45)
if(!valid_window_location(loc, target_dir)) //Expanded to include rails, as well!
to_chat(user, "<span class='warning'>[src] cannot be rotated in that direction!</span>")
@@ -133,4 +162,4 @@
if(!Adjacent(user))
return
if(can_be_rotated(user))
setDir(turn(dir, 90))
setDir(turn(dir, 45))