Rudimentary Mech Z-level Travel and Hoverpods (#7739)

This commit is contained in:
Geeves
2020-01-01 16:28:30 +01:00
committed by Matt Atlas
parent 9a55c2dd91
commit c5c459c5ec
9 changed files with 103 additions and 14 deletions
+23
View File
@@ -77,6 +77,10 @@
return TRUE
/mob/living/carbon/human/zMove(direction)
if(istype(loc, /mob/living/heavy_vehicle))
var/mob/living/heavy_vehicle/mech = loc
mech.zMove(direction)
return
. = ..()
if(.)
for(var/obj/item/grab/G in list(l_hand, r_hand))
@@ -315,6 +319,19 @@
if((locate(/obj/structure/disposalpipe/up) in below) || (locate(/obj/machinery/atmospherics/pipe/zpipe/up) in below))
return FALSE
/mob/living/heavy_vehicle/can_ztravel(var/direction)
if(legs)
if(legs.hover && legs.motivator.is_functional())
if(get_cell().charge < ((legs.power_use * CELLRATE) / 2))
return FALSE
return TRUE
return FALSE
/mob/living/heavy_vehicle/CanAvoidGravity()
if(can_ztravel())
return TRUE
return FALSE
/mob/living/heavy_vehicle/can_fall(turf/below, turf/simulated/open/dest = src.loc)
// The var/climbers API is implemented here.
if (LAZYLEN(dest.climbers) && (src in dest.climbers))
@@ -328,6 +345,12 @@
if(!A.CanPass(src, dest))
return FALSE
// Hover thrusters
if(legs)
if(legs.hover && legs.motivator.is_functional())
get_cell().use((legs.power_use * CELLRATE) / 2)
return FALSE
// True otherwise.
return TRUE