Showing with 53 additions and 9 deletions.
  1. +21 −0 code/_onclick/other_mobs.dm
  2. +32 −9 code/modules/multiz/movement.dm
@@ -29,6 +29,27 @@
return

/mob/living/carbon/human/RangedAttack(var/atom/A)
//Climbing up open spaces
if((istype(A, /turf/simulated/floor) || istype(A, /turf/unsimulated/floor) || istype(A, /obj/structure/lattice) || istype(A, /obj/structure/catwalk)) && isturf(loc) && shadow && !is_physically_disabled()) //Climbing through openspace
var/turf/T = get_turf(A)
var/turf/above = shadow.loc
if(T.Adjacent(shadow) && above.CanZPass(src, UP)) //Certain structures will block passage from below, others not

var/area/location = get_area(loc)
if(location.has_gravity && !can_overcome_gravity())
return

visible_message("<span class='notice'>[src] starts climbing onto \the [A]!</span>", "<span class='notice'>You start climbing onto \the [A]!</span>")
shadow.visible_message("<span class='notice'>[shadow] starts climbing onto \the [A]!</span>")
if(do_after(src, 50, A))
visible_message("<span class='notice'>[src] climbs onto \the [A]!</span>", "<span class='notice'>You climb onto \the [A]!</span>")
shadow.visible_message("<span class='notice'>[shadow] climbs onto \the [A]!</span>")
src.Move(T)
else
visible_message("<span class='warning'>[src] gives up on trying to climb onto \the [A]!</span>", "<span class='warning'>You give up on trying to climb onto \the [A]!</span>")
shadow.visible_message("<span class='warning'>[shadow] gives up on trying to climb onto \the [A]!</span>")
return

if(!gloves && !mutations.len) return
var/obj/item/clothing/gloves/G = gloves
if((LASER in mutations) && a_intent == I_HURT)
@@ -45,14 +45,35 @@
if(!A.CanPass(src, start, 1.5, 0))
to_chat(src, "<span class='warning'>\The [A] blocks you.</span>")
return 0

if(can_fall(FALSE, destination))
to_chat(src, "<span class='warning'>You see nothing to hold on to.</span>")
return 0

Move(destination)
return 1

/mob/proc/can_overcome_gravity()
return FALSE

/mob/living/carbon/human/can_overcome_gravity()
return species && species.can_overcome_gravity(src)
//First do species check
if(species && species.can_overcome_gravity(src))
return 1
else
for(var/atom/a in src.loc)
if(a.flags & OBJ_CLIMBABLE)
return 1

//Last check, list of items that could plausibly be used to climb but aren't climbable themselves
var/list/objects_to_stand_on = list(
/obj/item/weapon/stool,
/obj/structure/bed,
)
for(var/type in objects_to_stand_on)
if(locate(type) in src.loc)
return 1
return 0

/mob/observer/zMove(direction)
var/turf/destination = (direction == UP) ? GetAbove(src) : GetBelow(src)
@@ -124,22 +145,24 @@
handle_fall(below)

//For children to override
/atom/movable/proc/can_fall(var/anchor_bypass = FALSE)
/atom/movable/proc/can_fall(var/anchor_bypass = FALSE, var/turf/location_override = src.loc)
if(!simulated)
return FALSE

if(anchored && !anchor_bypass)
return FALSE

if(locate(/obj/structure/lattice, loc) || locate(/obj/structure/catwalk, 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))
//Override will make checks from different location used for prediction
if(location_override)
if(locate(/obj/structure/lattice, location_override) || locate(/obj/structure/catwalk, location_override))
return FALSE

var/turf/below = GetBelow(location_override)
for(var/atom/A in below)
if(!A.CanPass(src, location_override))
return FALSE


return TRUE

/obj/can_fall()