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

This commit is contained in:
Geeves
2020-01-01 17:28:30 +02:00
committed by Matt Atlas
parent 9a55c2dd91
commit c5c459c5ec
9 changed files with 103 additions and 14 deletions

View File

@@ -1524,6 +1524,7 @@
#include "code\modules\heavy_vehicle\premade\_premade.dm"
#include "code\modules\heavy_vehicle\premade\combat.dm"
#include "code\modules\heavy_vehicle\premade\heavy.dm"
#include "code\modules\heavy_vehicle\premade\hoverpod.dm"
#include "code\modules\heavy_vehicle\premade\light.dm"
#include "code\modules\heavy_vehicle\premade\misc.dm"
#include "code\modules\heavy_vehicle\premade\powerloader.dm"

View File

@@ -9,6 +9,7 @@
var/mech_turn_sound = 'sound/mecha/mechturn.ogg'
var/mech_step_sound = 'sound/mecha/mechstep.ogg'
var/trample_damage = 5
var/hover = FALSE // Can this leg allow you to easily travel z-levels?
/obj/item/mech_component/propulsion/Destroy()
QDEL_NULL(motivator)

View File

@@ -470,7 +470,7 @@
if(!isliving(H))
return
if(legs)
if(legs?.trample_damage)
if(ishuman(H))
var/mob/living/carbon/human/D = H
if(D.lying)

View File

@@ -0,0 +1,54 @@
/mob/living/heavy_vehicle/premade/hoverpod
name = "hoverpod"
desc = "An aging exosuit, produced to be a cheap variant to traditional space transport."
icon_state = "engineering_pod"
/mob/living/heavy_vehicle/premade/hoverpod/Initialize()
if(!arms)
arms = new /obj/item/mech_component/manipulators/ripley(src)
arms.color = COLOR_BLUE_GRAY
if(!legs)
legs = new /obj/item/mech_component/propulsion/hover(src)
legs.color = COLOR_BLUE_GRAY
if(!head)
head = new /obj/item/mech_component/sensors/ripley(src)
head.color = COLOR_BLUE_GRAY
if(!body)
body = new /obj/item/mech_component/chassis/pod(src)
body.color = COLOR_BLUE_GRAY
. = ..()
/mob/living/heavy_vehicle/premade/hoverpod/spawn_mech_equipment()
..()
install_system(new /obj/item/mecha_equipment/drill(src), HARDPOINT_LEFT_HAND)
install_system(new /obj/item/mecha_equipment/clamp(src), HARDPOINT_RIGHT_HAND)
/obj/item/mech_component/propulsion/hover
name = "hover thrusters"
exosuit_desc_string = "hover thrusters"
desc = "An ancient set of hover thrusters capable of keeping a exosuit aloft."
icon_state = "hoverlegs"
max_damage = 40
move_delay = 4
turn_delay = 2
power_use = 3000
trample_damage = 0
hover = TRUE
/obj/item/mech_component/chassis/pod
name = "spherical exosuit chassis"
hatch_descriptor = "window"
pilot_coverage = 100
transparent_cabin = TRUE
hide_pilot = TRUE
exosuit_desc_string = "a spherical chassis"
icon_state = "pod_body"
max_damage = 70
power_use = 5
has_hardpoints = list(HARDPOINT_BACK)
desc = "A simple spherical exosuit cockpit commonly used in space pods."
/obj/item/mech_component/chassis/pod/prebuild()
. = ..()
mech_armor = new /obj/item/robot_parts/robot_component/armor/mech/radproof(src)

View File

@@ -20,16 +20,4 @@
power_use = 7500
color = COLOR_WHITE
mech_step_sound = 'sound/mecha/tanktread.ogg'
trample_damage = 25
/obj/item/mech_component/chassis/pod
name = "spherical exosuit chassis"
hatch_descriptor = "hatch"
pilot_coverage = 100
transparent_cabin = TRUE
exosuit_desc_string = "a spherical chassis"
icon_state = "pod_body"
max_damage = 70
power_use = 5
has_hardpoints = list(HARDPOINT_BACK)
desc = "A simple spherical exosuit cockpit commonly used in space pods."
trample_damage = 25

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

View File

@@ -213,6 +213,20 @@
build_path = /obj/item/mech_component/propulsion/spider
req_tech = list(TECH_ENGINEERING = 2)
/datum/design/item/mechfab/exosuit/hover_torso
name = "hoverpod torso"
id = "hoverpod_body"
time = 40
materials = list(DEFAULT_WALL_MATERIAL = 30000)
build_path = /obj/item/mech_component/chassis/pod
/datum/design/item/mechfab/exosuit/hover_legs
name = "hover thrusters"
id = "hover_thrusters"
time = 35
materials = list(DEFAULT_WALL_MATERIAL = 14000)
build_path = /obj/item/mech_component/propulsion/hover
/datum/design/item/mechfab/exosuit/track
name = "armored treads"
id = "treads"

View File

@@ -0,0 +1,8 @@
author: Geeves
delete-after: True
changes:
- rscadd: "Added a hoverpod mech."
- bugfix: "Jetpacking downwards while in a mech no longer teleports you through the floor."
- rscadd: "Mechs with hover thrusters can now float over open turfs, as well as move up and down z-levels."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 14 KiB