diff --git a/code/game/mecha/equipment/tools/repair_droid.dm b/code/game/mecha/equipment/tools/repair_droid.dm index f76eeed6f0..f4f9696aa5 100644 --- a/code/game/mecha/equipment/tools/repair_droid.dm +++ b/code/game/mecha/equipment/tools/repair_droid.dm @@ -27,16 +27,16 @@ /obj/item/mecha_parts/mecha_equipment/repair_droid/attach(obj/mecha/M as obj) ..() droid_overlay = new(src.icon, icon_state = "repair_droid") - M.overlays += droid_overlay + M.add_overlay(droid_overlay) return /obj/item/mecha_parts/mecha_equipment/repair_droid/destroy() - chassis.overlays -= droid_overlay + chassis.cut_overlay(droid_overlay) ..() return /obj/item/mecha_parts/mecha_equipment/repair_droid/detach() - chassis.overlays -= droid_overlay + chassis.cut_overlay(droid_overlay) pr_repair_droid.stop() ..() return @@ -49,7 +49,7 @@ /obj/item/mecha_parts/mecha_equipment/repair_droid/Topic(href, href_list) ..() if(href_list["toggle_repairs"]) - chassis.overlays -= droid_overlay + chassis.cut_overlay(droid_overlay) if(pr_repair_droid.toggle()) droid_overlay = new(src.icon, icon_state = "repair_droid_a") log_message("Activated.") @@ -57,7 +57,7 @@ droid_overlay = new(src.icon, icon_state = "repair_droid") log_message("Deactivated.") set_ready_state(1) - chassis.overlays += droid_overlay + chassis.add_overlay(droid_overlay) send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info()) return diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index d78053d6b2..780b713c5b 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -259,7 +259,9 @@ /obj/mecha/proc/check_for_support() - if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src))) + var/list/things = orange(1, src) + + if(locate(/obj/structure/grille in things) || locate(/obj/structure/lattice in things) || locate(/turf/simulated in things) || locate(/turf/unsimulated in things)) return 1 else return 0 @@ -397,21 +399,26 @@ /obj/mecha/relaymove(mob/user,direction) if(user != src.occupant) //While not "realistic", this piece is player friendly. if(istype(user,/mob/living/carbon/brain)) - to_chat(user, "You try to move, but you are not the pilot! The exosuit doesn't respond.") + to_chat(user, "You try to move, but you are not the pilot! The exosuit doesn't respond.") return 0 user.forceMove(get_turf(src)) to_chat(user, "You climb out from [src]") return 0 if(connected_port) if(world.time - last_message > 20) - src.occupant_message("Unable to move while connected to the air system port") + src.occupant_message("Unable to move while connected to the air system port") last_message = world.time return 0 if(state) - occupant_message("Maintenance protocols in effect") + occupant_message("Maintenance protocols in effect") return return domove(direction) +/obj/mecha/proc/can_ztravel() + for(var/obj/item/mecha_parts/mecha_equipment/tool/jetpack/jp in equipment) + return jp.equip_ready + return FALSE + /obj/mecha/proc/domove(direction) return call((proc_res["dyndomove"]||src), "dyndomove")(direction) @@ -423,20 +430,51 @@ return 0 if(!has_charge(step_energy_drain)) return 0 + var/move_result = 0 + if(hasInternalDamage(MECHA_INT_CONTROL_LOST)) move_result = mechsteprand() - else if(src.dir!=direction) + //Up/down zmove + else if(direction & UP || direction & DOWN) + if(!can_ztravel()) + occupant_message("Your vehicle lacks the capacity to move in that direction!") + return FALSE + + //We're using locs because some mecha are 2x2 turfs. So thicc! + var/result = TRUE + + for(var/turf/T in locs) + if(!T.CanZPass(src,direction)) + occupant_message("You can't move that direction from here!") + result = FALSE + break + var/turf/dest = direction & UP ? GetAbove(T) : GetBelow(T) + if(!dest) + occupant_message("There is nothing of interest in this direction.") + result = FALSE + break + if(!dest.CanZPass(src,direction)) + occupant_message("There's something blocking your movement in that direction!") + result = FALSE + break + if(result) + move_result = mechstep(direction) + //Turning + else if(src.dir != direction) move_result = mechturn(direction) + //Stepping else move_result = mechstep(direction) + + if(move_result) can_move = 0 use_power(step_energy_drain) if(istype(src.loc, /turf/space)) if(!src.check_for_support()) src.pr_inertial_movement.start(list(src,direction)) - src.log_message("Movement control lost. Inertial movement started.") + src.log_message("Movement control lost. Inertial movement started.") if(do_after(step_in)) can_move = 1 return 1 diff --git a/code/game/mecha/space/hoverpod.dm b/code/game/mecha/space/hoverpod.dm index 31558458d9..fc5fc1e739 100644 --- a/code/game/mecha/space/hoverpod.dm +++ b/code/game/mecha/space/hoverpod.dm @@ -26,11 +26,20 @@ max_universal_equip = 1 max_special_equip = 1 -/obj/mecha/working/hoverpod/New() - ..() +/obj/mecha/working/hoverpod/Initialize() + . = ..() ion_trail = new /datum/effect/effect/system/ion_trail_follow() ion_trail.set_up(src) - ion_trail.start() + +/obj/mecha/working/hoverpod/moved_inside(var/mob/living/carbon/human/H as mob) + . = ..(H) + if(.) + ion_trail.start() + +/obj/mecha/working/hoverpod/go_out() + . = ..() + if(!occupant) + ion_trail.stop() //Modified phazon code /obj/mecha/working/hoverpod/Topic(href, href_list) @@ -52,6 +61,9 @@ output += ..() return output +/obj/mecha/working/hoverpod/can_ztravel() + return (stabilization_enabled && has_charge(step_energy_drain)) + // No space drifting /obj/mecha/working/hoverpod/check_for_support() //does the hoverpod have enough charge left to stabilize itself? @@ -106,7 +118,7 @@ max_special_equip = 1 /obj/mecha/working/hoverpod/combatpod/Initialize() - ..() + . = ..() var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser ME.attach(src) ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive @@ -117,7 +129,7 @@ desc = "Who knew a tiny ball could fit three people?" /obj/mecha/working/hoverpod/shuttlepod/Initialize() - ..() + . = ..() var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger ME.attach(src) ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger diff --git a/code/game/mecha/space/shuttle.dm b/code/game/mecha/space/shuttle.dm index 7e361ece0c..bf9aec3476 100644 --- a/code/game/mecha/space/shuttle.dm +++ b/code/game/mecha/space/shuttle.dm @@ -41,44 +41,30 @@ max_universal_equip = 1 max_special_equip = 1 -/obj/mecha/working/hoverpod/Initialize() - ..() - ion_trail.stop() - -/obj/mecha/working/hoverpod/shuttlecraft/moved_inside(var/mob/living/carbon/human/H as mob) - . = ..(H) - if(.) - ion_trail.start() - -/obj/mecha/working/hoverpod/shuttlecraft/go_out() - . = ..() - if(!occupant) - ion_trail.stop() - /obj/mecha/working/hoverpod/shuttlecraft/update_icon() - overlays.Cut() + cut_overlays() ..() if(base_paint) if(!base_paint_mask) base_paint_mask = image(icon, "[initial_icon]-mask+base", src.layer + 1) base_paint_mask.color = base_paint - overlays |= base_paint_mask + add_overlay(base_paint_mask) if(front_paint) if(!front_paint_mask) front_paint_mask = image(icon, "[initial_icon]-mask+front", src.layer + 1) front_paint_mask.color = front_paint - overlays |= front_paint_mask + add_overlay(front_paint_mask) if(engine_paint) if(!engine_paint_mask) engine_paint_mask = image(icon, "[initial_icon]-mask+engine", src.layer + 1) engine_paint_mask.color = engine_paint - overlays |= engine_paint_mask + add_overlay(engine_paint_mask) if(central_paint) if(!engine_paint_mask) central_paint_mask = image(icon, "[initial_icon]-mask+central", src.layer + 2) central_paint_mask.color = central_paint - overlays |= central_paint_mask + add_overlay(central_paint_mask) /obj/mecha/working/hoverpod/shuttlecraft/attackby(obj/item/weapon/W as obj, mob/user as mob) if(istype(W,/obj/item/device/multitool) && state == 1) diff --git a/code/modules/multiz/movement.dm b/code/modules/multiz/movement.dm index b806f46dd3..a9f756469c 100644 --- a/code/modules/multiz/movement.dm +++ b/code/modules/multiz/movement.dm @@ -15,6 +15,10 @@ /mob/proc/zMove(direction) if(eyeobj) return eyeobj.zMove(direction) + if(istype(loc,/obj/mecha)) + var/obj/mecha/mech = loc + return mech.relaymove(src,direction) + if(!can_ztravel()) to_chat(src, "You lack means of travel in that direction.") return