Also makes flipping tables block climbing.
This commit is contained in:
mwerezak
2014-11-01 21:38:04 -04:00
parent de41cfea4c
commit b2dc8f1142
2 changed files with 19 additions and 19 deletions

View File

@@ -78,13 +78,16 @@
do_climb(target)
/obj/structure/proc/do_climb(var/mob/living/user)
/obj/structure/proc/can_climb(var/mob/living/user)
if (!can_touch(user) || !climbable)
return
return 0
var/turf/T = src.loc
if(!T || !istype(T)) return
if(!T || !istype(T)) return 0
if (!user.Adjacent(src))
user << "\red You can't climb there, the way is blocked."
return 0
for(var/obj/O in T.contents)
if(istype(O,/obj/structure))
@@ -92,29 +95,24 @@
if(S.climbable)
continue
if(O && O.density)
usr << "\red There's \a [O] in the way."
return
if(O && O.density && !(O.flags & ON_BORDER)) //ON_BORDER structures are handled by the Adjacent() check.
user << "\red There's \a [O] in the way."
return 0
return 1
/obj/structure/proc/do_climb(var/mob/living/user)
if (!can_climb(user))
return
usr.visible_message("<span class='warning'>[user] starts climbing onto \the [src]!</span>")
if(!do_after(user,50))
return
if (!can_touch(user) || !climbable)
if (!can_climb(user))
return
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)
usr << "\red There's \a [O] in the way."
return
usr.loc = get_turf(src)
usr.forceMove(get_turf(src))
if (get_turf(user) == get_turf(src))
usr.visible_message("<span class='warning'>[user] climbs onto \the [src]!</span>")

View File

@@ -448,6 +448,7 @@
dir = direction
if(dir != NORTH)
layer = 5
climbable = 0 //flipping tables allows them to be used as makeshift barriers
flipped = 1
flags |= ON_BORDER
for(var/D in list(turn(direction, 90), turn(direction, -90)))
@@ -465,6 +466,7 @@
layer = initial(layer)
flipped = 0
climbable = initial(climbable)
flags &= ~ON_BORDER
for(var/D in list(turn(dir, 90), turn(dir, -90)))
var/obj/structure/table/T = locate() in get_step(src.loc,D)