From f7fe3be7bd019ab51baa4bcfac927c09554e8895 Mon Sep 17 00:00:00 2001 From: Morrow Date: Sat, 18 Nov 2023 00:22:12 -0500 Subject: [PATCH] z handling for projectors/teleporters and multiz runtime --- code/controllers/subsystem/fz_transitions.dm | 5 +- code/datums/autocells/explosion.dm | 2 +- code/game/atoms.dm | 5 +- code/game/atoms_movable.dm | 6 +- code/game/objects/effects/projector.dm | 1 + code/game/objects/effects/step_triggers.dm | 5 +- code/game/objects/explosion_recursive.dm | 2 +- code/modules/mob/living/say.dm | 2 +- .../USS_Runtime_multiz/USS_Runtime_multiz.dmm | 898 ++++++++++++++++++ maps/runtime.json | 2 +- maps/runtime_multiz.json | 11 + 11 files changed, 927 insertions(+), 12 deletions(-) create mode 100644 maps/map_files/USS_Runtime_multiz/USS_Runtime_multiz.dmm create mode 100644 maps/runtime_multiz.json diff --git a/code/controllers/subsystem/fz_transitions.dm b/code/controllers/subsystem/fz_transitions.dm index fd41ce1ccb..f09f442090 100644 --- a/code/controllers/subsystem/fz_transitions.dm +++ b/code/controllers/subsystem/fz_transitions.dm @@ -24,16 +24,17 @@ SUBSYSTEM_DEF(fz_transitions) projectors -= P continue if(!P.loc.clone) - P.loc.create_clone(P.vector_x, P.vector_y) + P.loc.create_clone(P.vector_x, P.vector_y, P.vector_z) if(P.loc.contents) for(var/atom/movable/O in P.loc.contents) if(!istype(O, /obj/effect/projector) && !istype(O, /mob/dead/observer) && !istype(O, /obj/structure/stairs) && !istype(O, /obj/structure/catwalk) && O.type != /atom/movable/clone) if(!O.clone) //Create a clone if it's on a projector - O.create_clone_movable(P.vector_x, P.vector_y) + O.create_clone_movable(P.vector_x, P.vector_y, P.vector_z) else O.clone.proj_x = P.vector_x //Make sure projection is correct O.clone.proj_y = P.vector_y + O.clone.proj_z = P.vector_z for(var/atom/movable/clone/C in clones) diff --git a/code/datums/autocells/explosion.dm b/code/datums/autocells/explosion.dm index 42e1409d59..0b54a53a57 100644 --- a/code/datums/autocells/explosion.dm +++ b/code/datums/autocells/explosion.dm @@ -71,7 +71,7 @@ if(!V) return - var/turf/new_turf = locate(in_turf.x + V.vector_x, in_turf.y + V.vector_y, in_turf.z) + var/turf/new_turf = locate(in_turf.x + V.vector_x, in_turf.y + V.vector_y, in_turf.z + V.vector_z) transfer_turf(new_turf) /datum/automata_cell/explosion/death() diff --git a/code/game/atoms.dm b/code/game/atoms.dm index bce9693c45..22e8cd3093 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -415,10 +415,11 @@ Parameters are passed from New. /atom/clone var/proj_x = 0 var/proj_y = 0 + var/proj_z = 0 -/atom/proc/create_clone(shift_x, shift_y) //NOTE: Use only for turfs, otherwise use create_clone_movable +/atom/proc/create_clone(shift_x, shift_y, shift_z) //NOTE: Use only for turfs, otherwise use create_clone_movable var/turf/T = null - T = locate(src.x + shift_x, src.y + shift_y, src.z) + T = locate(src.x + shift_x, src.y + shift_y, src.z + shift_z) T.appearance = src.appearance T.setDir(src.dir) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b8a901ccf3..75ce7b2029 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -248,6 +248,7 @@ var/atom/movable/mstr = null //Used by clones for referral var/proj_x = 0 var/proj_y = 0 + var/proj_z = 0 unacidable = TRUE var/list/image/hud_list @@ -275,11 +276,12 @@ return src.mstr.bullet_act(P) ///////////////////// -/atom/movable/proc/create_clone_movable(shift_x, shift_y) +/atom/movable/proc/create_clone_movable(shift_x, shift_y, shift_z) var/atom/movable/clone/C = new /atom/movable/clone(src.loc) C.density = FALSE C.proj_x = shift_x C.proj_y = shift_y + C.proj_z = shift_z clones.Add(C) C.mstr = src //Link clone and master @@ -287,7 +289,7 @@ /atom/movable/proc/update_clone() ///---Var-Copy---//// - clone.forceMove(locate(x + clone.proj_x, y + clone.proj_y, z)) + clone.forceMove(locate(x + clone.proj_x, y + clone.proj_y, z + clone.proj_z)) //Translate clone position by projection factor //This is done first to reduce movement latency diff --git a/code/game/objects/effects/projector.dm b/code/game/objects/effects/projector.dm index d6eab23201..d48ef4100a 100644 --- a/code/game/objects/effects/projector.dm +++ b/code/game/objects/effects/projector.dm @@ -6,5 +6,6 @@ layer = TURF_LAYER var/vector_x = 0 var/vector_y = 0 + var/vector_z = 0 icon = 'icons/landmarks.dmi' icon_state = "projector"//for map editor diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm index 2499810cbd..3c7eeaa6f4 100644 --- a/code/game/objects/effects/step_triggers.dm +++ b/code/game/objects/effects/step_triggers.dm @@ -114,7 +114,7 @@ if(A && A.loc && A.type != /atom/movable/clone) //Prevent clones from teleporting var/lx = A.x var/ly = A.y - var/target = locate(A.x + vector_x, A.y + vector_y, A.z) + var/target = locate(A.x + vector_x, A.y + vector_y, A.z + vector_z) var/target_dir = get_dir(A, target) if(A.clone) //Clones have to be hard-synced both before and after the transition @@ -124,7 +124,7 @@ var/mob/AM = A sleep(AM.movement_delay() + 0.4) //Make the transition as seamless as possible - if(!Adjacent(A, locate(lx, ly, A.z))) //If the subject has moved too quickly, abort - this prevents double jumping + if(!(A in locate(lx, ly, A.z))) //If the subject has moved too quickly, abort - this prevents double jumping return for(var/mob/M in target) //If the target location is obstructed, abort @@ -138,6 +138,7 @@ if(A.clone) A.clone.proj_x *= -1 //Swap places with the clone A.clone.proj_y *= -1 + A.clone.proj_z *= -1 A.update_clone() //Update No. 2 diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 82566c8030..e1b35eb58c 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -112,7 +112,7 @@ explosion resistance exactly as much as their health //check for stair-teleporters. If there is a stair teleporter, switch to the teleported-to tile instead if(istype(A, /obj/effect/step_trigger/teleporter_vector)) var/obj/effect/step_trigger/teleporter_vector/V = A - var/turf/T = locate(V.x + V.vector_x, V.y + V.vector_y, V.z) + var/turf/T = locate(V.x + V.vector_x, V.y + V.vector_y, V.z + V.vector_z) if(T) spawn(0) T.explosion_spread(Controller, power, direction) diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm index 45eb43c917..0176478c71 100644 --- a/code/modules/mob/living/say.dm +++ b/code/modules/mob/living/say.dm @@ -85,7 +85,7 @@ var/list/department_radio_keys = list( for(var/dst=0; dst<=1; dst++) //Will run twice if src has a clone if(!dst && src.clone) //Will speak in src's location and the clone's - T = locate(src.loc.x + src.clone.proj_x, src.loc.y + src.clone.proj_y, src.loc.z) + T = locate(src.loc.x + src.clone.proj_x, src.loc.y + src.clone.proj_y, src.loc.z + src.clone.proj_z) else T = get_turf(src) dst++ //Only speak once diff --git a/maps/map_files/USS_Runtime_multiz/USS_Runtime_multiz.dmm b/maps/map_files/USS_Runtime_multiz/USS_Runtime_multiz.dmm new file mode 100644 index 0000000000..e19f398910 --- /dev/null +++ b/maps/map_files/USS_Runtime_multiz/USS_Runtime_multiz.dmm @@ -0,0 +1,898 @@ +//MAP CONVERTED BY dmm2tgm.py THIS HEADER COMMENT PREVENTS RECONVERSION, DO NOT REMOVE +"a" = ( +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"c" = ( +/obj/effect/landmark/start/marine/tl, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"d" = ( +/obj/structure/ladder{ + height = 2; + id = "run1" + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"e" = ( +/obj/effect/landmark/start/researcher, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"g" = ( +/obj/effect/landmark/start/intel, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"h" = ( +/obj/effect/landmark/start/pilot, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"j" = ( +/obj/effect/landmark/start/liaison, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"k" = ( +/obj/effect/landmark/start/captain, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"m" = ( +/obj/effect/projector{ + name = "runtime_down"; + vector_z = -1 + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"n" = ( +/obj/effect/landmark/start/executive, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"o" = ( +/obj/effect/landmark/start/marine/engineer, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"p" = ( +/obj/structure/stairs{ + dir = 8; + icon_state = "ramptop" + }, +/obj/effect/step_trigger/teleporter_vector{ + name = "runtime_up"; + vector_z = 1 + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"q" = ( +/obj/effect/step_trigger/clone_cleaner, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"r" = ( +/obj/effect/landmark/start/crew_chief, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"s" = ( +/obj/structure/stairs{ + dir = 1 + }, +/obj/structure/stairs{ + dir = 1 + }, +/obj/effect/step_trigger/teleporter_vector{ + name = "runtime_down"; + vector_z = -1 + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"u" = ( +/obj/effect/landmark/start/requisition, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"v" = ( +/obj/effect/landmark/start/police, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"w" = ( +/obj/effect/landmark/start/cargo, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"x" = ( +/obj/effect/landmark/start/maint, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"y" = ( +/obj/effect/landmark/start/working_joe, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"z" = ( +/obj/effect/landmark/start/marine/spec, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"A" = ( +/obj/effect/projector{ + name = "runtime_up"; + vector_z = 1 + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"B" = ( +/obj/structure/ladder{ + height = 2; + id = "run2" + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"C" = ( +/obj/effect/landmark/start/doctor, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"D" = ( +/obj/effect/landmark/start/marine/smartgunner, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"E" = ( +/obj/effect/landmark/start/professor, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"F" = ( +/turf/closed/wall/r_wall/bunker, +/area/event) +"G" = ( +/obj/effect/landmark/start/marine/leader, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"H" = ( +/obj/effect/landmark/start/marine, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"I" = ( +/obj/effect/landmark/start/synthetic, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"J" = ( +/obj/structure/stairs{ + dir = 8; + icon_state = "ramptop" + }, +/obj/effect/projector{ + name = "runtime_down"; + vector_z = -1 + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"L" = ( +/obj/structure/ladder{ + height = 1; + id = "run2" + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"M" = ( +/obj/effect/landmark/late_join, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"N" = ( +/obj/effect/landmark/start/senior, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"O" = ( +/obj/effect/landmark/start/marine/medic, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"P" = ( +/obj/effect/landmark/start/engineering, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"Q" = ( +/obj/effect/landmark/start/nurse, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"R" = ( +/obj/structure/stairs{ + dir = 1 + }, +/obj/effect/step_trigger/teleporter_vector{ + name = "runtime_down"; + vector_z = -1 + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"S" = ( +/obj/structure/stairs{ + dir = 1 + }, +/obj/effect/projector{ + name = "runtime_up"; + vector_z = 1 + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"T" = ( +/obj/effect/landmark/start/warrant, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"V" = ( +/obj/structure/ladder{ + height = 1; + id = "run1" + }, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"W" = ( +/obj/effect/landmark/start/bridge, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"X" = ( +/obj/effect/landmark/start/chef, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"Y" = ( +/obj/effect/landmark/start/warden, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) +"Z" = ( +/obj/effect/landmark/start/otech, +/turf/open/floor/almayer{ + icon_state = "plating" + }, +/area/event) + +(1,1,1) = {" +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +"} +(2,1,1) = {" +F +M +j +h +Y +a +a +V +a +a +a +a +a +a +a +F +"} +(3,1,1) = {" +F +k +H +v +T +a +a +a +a +a +a +a +a +a +a +F +"} +(4,1,1) = {" +F +n +o +E +y +a +a +a +a +a +a +a +a +a +a +F +"} +(5,1,1) = {" +F +W +G +u +r +a +a +a +a +a +a +a +a +a +a +F +"} +(6,1,1) = {" +F +w +O +e +a +a +a +q +q +F +F +F +F +F +F +F +"} +(7,1,1) = {" +F +X +c +N +a +a +a +q +q +q +S +S +S +A +A +F +"} +(8,1,1) = {" +F +C +D +I +a +a +a +q +q +q +S +S +S +A +A +F +"} +(9,1,1) = {" +F +P +z +g +a +a +a +q +q +F +F +F +F +p +p +F +"} +(10,1,1) = {" +F +x +Q +Z +a +a +a +a +a +a +a +a +F +p +p +F +"} +(11,1,1) = {" +F +a +a +a +a +a +a +a +a +a +a +a +F +p +p +F +"} +(12,1,1) = {" +F +a +a +a +a +a +a +a +a +a +a +a +F +F +F +F +"} +(13,1,1) = {" +F +a +a +a +a +a +a +a +a +a +a +a +a +a +a +F +"} +(14,1,1) = {" +F +a +a +a +a +a +a +a +a +a +a +a +a +a +a +F +"} +(15,1,1) = {" +F +a +a +a +a +a +a +L +a +a +a +a +a +a +a +F +"} +(16,1,1) = {" +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +"} + +(1,1,2) = {" +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +"} +(2,1,2) = {" +F +a +a +a +a +a +a +d +a +a +a +a +a +a +a +F +"} +(3,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +a +a +a +F +"} +(4,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +a +a +a +F +"} +(5,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +a +a +a +F +"} +(6,1,2) = {" +F +a +a +a +a +a +a +a +a +F +F +F +F +F +F +F +"} +(7,1,2) = {" +F +a +a +a +a +a +a +a +a +F +R +s +s +m +m +F +"} +(8,1,2) = {" +F +a +a +a +a +a +a +a +a +F +R +R +R +m +m +F +"} +(9,1,2) = {" +F +a +a +a +a +a +a +a +a +F +F +F +F +J +J +F +"} +(10,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +F +J +J +F +"} +(11,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +F +J +J +F +"} +(12,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +F +q +q +F +"} +(13,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +q +q +q +F +"} +(14,1,2) = {" +F +a +a +a +a +a +a +a +a +a +a +a +q +q +q +F +"} +(15,1,2) = {" +F +a +a +a +a +a +a +B +a +a +a +a +a +a +a +F +"} +(16,1,2) = {" +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +F +"} diff --git a/maps/runtime.json b/maps/runtime.json index 44aaea094d..a08f7bc22f 100644 --- a/maps/runtime.json +++ b/maps/runtime.json @@ -5,7 +5,7 @@ "survivor_types": [ "/datum/equipment_preset/survivor/scientist/lv" ], - "traits": [{"Marine Main Ship": true}], + "traits": [{"Ground": true}], "camouflage": "classic", "disable_ship_map": true } diff --git a/maps/runtime_multiz.json b/maps/runtime_multiz.json new file mode 100644 index 0000000000..c83946b066 --- /dev/null +++ b/maps/runtime_multiz.json @@ -0,0 +1,11 @@ +{ + "map_name": "USS Runtime", + "map_path": "map_files/USS_Runtime_multiz", + "map_file": "USS_Runtime_multiz.dmm", + "survivor_types": [ + "/datum/equipment_preset/survivor/scientist/lv" + ], + "traits": [{"Ground": true}, {"Ground": true}], + "camouflage": "classic", + "disable_ship_map": true +}