mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
Multi-Z.
This commit is contained in:
@@ -1410,6 +1410,8 @@
|
||||
#include "code\modules\mob\new_player\preferences_setup.dm"
|
||||
#include "code\modules\mob\new_player\skill.dm"
|
||||
#include "code\modules\mob\new_player\sprite_accessories.dm"
|
||||
#include "code\modules\multiz\basic.dm"
|
||||
#include "code\modules\multiz\stubs.dm"
|
||||
#include "code\modules\nano\_JSON.dm"
|
||||
#include "code\modules\nano\JSON Reader.dm"
|
||||
#include "code\modules\nano\JSON Writer.dm"
|
||||
@@ -1783,8 +1785,6 @@
|
||||
#include "code\modules\virus2\items_devices.dm"
|
||||
#include "code\modules\xgm\xgm_gas_data.dm"
|
||||
#include "code\modules\xgm\xgm_gas_mixture.dm"
|
||||
#include "code\TriDimension\controller.dm"
|
||||
#include "code\TriDimension\controller_presets.dm"
|
||||
#include "code\TriDimension\Movement.dm"
|
||||
#include "code\TriDimension\Pipes.dm"
|
||||
#include "code\TriDimension\Structures.dm"
|
||||
|
||||
@@ -1,52 +1,51 @@
|
||||
/obj/item/weapon/tank/jetpack/verb/moveup()
|
||||
set name = "Move Upwards"
|
||||
set category = "Object"
|
||||
|
||||
. = 1
|
||||
if(allow_thrust(0.01, usr))
|
||||
var/turf/controllerlocation = locate(1, 1, usr.z)
|
||||
var/legal = 0
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
legal = controller.up
|
||||
if (controller.up)
|
||||
var/turf/T = locate(usr.x, usr.y, controller.up_target)
|
||||
if(T && (istype(T, /turf/space) || istype(T, /turf/simulated/floor/open)))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
usr << "<span class='warning'>Your [src] is disabled.</span>"
|
||||
return
|
||||
|
||||
var/turf/above = GetAbove(src)
|
||||
if(!istype(above))
|
||||
usr << "<span class='notice'>There is nothing of interest in this direction.</span>"
|
||||
return
|
||||
|
||||
if(!istype(above, /turf/space) && !istype(above, /turf/simulated/open))
|
||||
usr << "<span class='warning'>You bump against \the [above].</span>"
|
||||
return
|
||||
|
||||
for(var/atom/A in above)
|
||||
if(A.density)
|
||||
blocked = 1
|
||||
usr << "<span class='warning'>You bump into \the [A].</span>"
|
||||
break
|
||||
if(!blocked)
|
||||
usr.Move(T)
|
||||
usr << "You move upwards."
|
||||
else
|
||||
usr << "<span class='warning'>There is something in your way.</span>"
|
||||
if (legal == 0)
|
||||
usr << "There is nothing of interest in this direction."
|
||||
return 1
|
||||
usr << "<span class='warning'>\The [A] blocks you.</span>"
|
||||
return
|
||||
|
||||
usr.Move(above)
|
||||
usr << "<span class='notice'>You move upwards.</span>"
|
||||
|
||||
/obj/item/weapon/tank/jetpack/verb/movedown()
|
||||
set name = "Move Downwards"
|
||||
set category = "Object"
|
||||
|
||||
. = 1
|
||||
if(allow_thrust(0.01, usr))
|
||||
var/turf/controllerlocation = locate(1, 1, usr.z)
|
||||
var/legal = 0
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
legal = controller.down
|
||||
if (controller.down == 1)
|
||||
var/turf/T = locate(usr.x, usr.y, controller.down_target)
|
||||
var/turf/S = locate(usr.x, usr.y, usr.z)
|
||||
if(T && (istype(S, /turf/space) || istype(S, /turf/simulated/floor/open)))
|
||||
var/blocked = 0
|
||||
for(var/atom/A in T.contents)
|
||||
usr << "<span class='warning'>Your [src] is disabled.</span>"
|
||||
return
|
||||
|
||||
var/turf/above = GetBelow(src)
|
||||
if(!istype(above))
|
||||
usr << "<span class='notice'>There is nothing of interest in this direction.</span>"
|
||||
return
|
||||
|
||||
if(!istype(above, /turf/space) && !istype(above, /turf/simulated/open))
|
||||
usr << "<span class='warning'>You bump against \the [above].</span>"
|
||||
return
|
||||
|
||||
for(var/atom/A in above)
|
||||
if(A.density)
|
||||
blocked = 1
|
||||
usr << "<span class='warning'>You bump into \the [A].</span>"
|
||||
break
|
||||
if(!blocked)
|
||||
usr.Move(T)
|
||||
usr << "You move downwards."
|
||||
else
|
||||
usr << "<span class='warning'>You cant move through the floor.</span>"
|
||||
if (legal == 0)
|
||||
usr << "There is nothing of interest in this direction."
|
||||
return 1
|
||||
usr << "<span class='warning'>\The [A] blocks you.</span>"
|
||||
return
|
||||
|
||||
usr.Move(above)
|
||||
usr << "<span class='notice'>You move upwards.</span>"
|
||||
|
||||
@@ -136,10 +136,7 @@ obj/machinery/atmospherics/pipe/zpipe/up/initialize()
|
||||
node1 = target
|
||||
break
|
||||
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up)
|
||||
var/turf/above = locate(src.x, src.y, controller.up_target)
|
||||
var/turf/above = GetAbove(src)
|
||||
if(above)
|
||||
for(var/obj/machinery/atmospherics/target in above)
|
||||
if(target.initialize_directions && istype(target, /obj/machinery/atmospherics/pipe/zpipe/down))
|
||||
@@ -177,10 +174,7 @@ obj/machinery/atmospherics/pipe/zpipe/down/initialize()
|
||||
node1 = target
|
||||
break
|
||||
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
var/turf/below = GetBelow(src)
|
||||
if(below)
|
||||
for(var/obj/machinery/atmospherics/target in below)
|
||||
if(target.initialize_directions && istype(target, /obj/machinery/atmospherics/pipe/zpipe/up))
|
||||
|
||||
@@ -25,16 +25,11 @@
|
||||
proc/connect()
|
||||
if(icon_state == "ladderdown") // the upper will connect to the lower
|
||||
d_state = 1
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
for(var/obj/multiz/ladder/L in below)
|
||||
for(var/obj/multiz/ladder/L in GetBelow(src))
|
||||
if(L.icon_state == "ladderup")
|
||||
target = L
|
||||
L.target = src
|
||||
d_state = 0
|
||||
break
|
||||
return
|
||||
|
||||
/* ex_act(severity)
|
||||
@@ -210,12 +205,9 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
var/turf/cl= locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/c in cl)
|
||||
if(c.up)
|
||||
var/turf/O = locate(src.x, src.y, c.up_target)
|
||||
if(istype(O, /turf/space))
|
||||
O.ChangeTurf(/turf/simulated/floor/open)
|
||||
var/turf/above = GetAbove(src)
|
||||
if(istype(above, /turf/space))
|
||||
above.ChangeTurf(/turf/simulated/open)
|
||||
|
||||
spawn(1)
|
||||
var/turf/T
|
||||
@@ -262,13 +254,10 @@
|
||||
bottom.connected = top
|
||||
top.icon_state = "ramptop"
|
||||
top.density = 1
|
||||
var/turf/controllerlocation = locate(1, 1, top.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up)
|
||||
var/turf/above = locate(top.x, top.y, controller.up_target)
|
||||
if(istype(above,/turf/space) || istype(above,/turf/simulated/floor/open))
|
||||
var/turf/above = GetAbove(top)
|
||||
if(istype(above,/turf/space) || istype(above,/turf/simulated/open))
|
||||
top.target = above
|
||||
var/turf/above2 = locate(bottom.x, bottom.y, controller.up_target)
|
||||
if(istype(above2, /turf/space) || istype(above,/turf/simulated/floor/open))
|
||||
top.target2 = above2
|
||||
above = GetAbove(bottom)
|
||||
if(istype(above, /turf/space) || istype(above,/turf/simulated/open))
|
||||
top.target2 = above
|
||||
return
|
||||
|
||||
@@ -1,114 +1,100 @@
|
||||
/turf/simulated/floor/open
|
||||
/turf/simulated/open
|
||||
name = "open space"
|
||||
density = 0
|
||||
alpha = 0
|
||||
icon_state = "black"
|
||||
pathweight = 100000 //Seriously, don't try and path over this one numbnuts
|
||||
var/icon/darkoverlays = null
|
||||
var/turf/floorbelow
|
||||
var/icon/darkoverlays
|
||||
var/turf/below
|
||||
var/list/overlay_references
|
||||
|
||||
New()
|
||||
..()
|
||||
getbelow()
|
||||
// Unhide shit.
|
||||
for(var/obj/obj in src)
|
||||
if(obj.level == 1)
|
||||
obj.hide(0)
|
||||
|
||||
ASSERT(HasBelow(z))
|
||||
below = GetBelow(src)
|
||||
return
|
||||
|
||||
Enter(var/atom/movable/AM)
|
||||
if (..()) //TODO make this check if gravity is active (future use) - Sukasa
|
||||
spawn(1)
|
||||
Entered(var/atom/movable/mover)
|
||||
// only fall down in defined areas (read: areas with artificial gravitiy)
|
||||
if(!floorbelow) //make sure that there is actually something below
|
||||
if(!getbelow())
|
||||
if(!istype(below)) //make sure that there is actually something below
|
||||
below = GetBelow(src)
|
||||
if(!below)
|
||||
return
|
||||
if(AM)
|
||||
var/area/areacheck = get_area(src)
|
||||
var/blocked = 0
|
||||
|
||||
// No gravity in space, apparently.
|
||||
var/area/area = get_area(src)
|
||||
if(area.name == "Space")
|
||||
return
|
||||
|
||||
// Prevent pipes from falling into the void... if there is a pipe to support it.
|
||||
if(istype(mover, /obj/item/pipe) && \
|
||||
(locate(/obj/structure/disposalpipe/up) in below) || \
|
||||
locate(/obj/machinery/atmospherics/pipe/zpipe/up in below))
|
||||
return
|
||||
|
||||
// See if something prevents us from falling.
|
||||
var/soft = 0
|
||||
for(var/atom/A in floorbelow.contents)
|
||||
for(var/atom/A in below)
|
||||
if(A.density)
|
||||
if(istype(A, /obj/structure/window))
|
||||
var/obj/structure/window/W = A
|
||||
blocked = W.is_fulltile()
|
||||
if(blocked)
|
||||
break
|
||||
if(!istype(A, /obj/structure/window))
|
||||
return
|
||||
else
|
||||
blocked = 1
|
||||
break
|
||||
if(istype(A, /obj/machinery/atmospherics/pipe/zpipe/up) && istype(AM,/obj/item/pipe))
|
||||
blocked = 1
|
||||
break
|
||||
if(istype(A, /obj/structure/disposalpipe/up) && istype(AM,/obj/item/pipe))
|
||||
blocked = 1
|
||||
break
|
||||
var/obj/structure/window/W = A
|
||||
if(W.is_fulltile())
|
||||
return
|
||||
// Dont break here, since we still need to be sure that it isnt blocked
|
||||
if(istype(A, /obj/multiz/stairs))
|
||||
soft = 1
|
||||
//dont break here, since we still need to be sure that it isnt blocked
|
||||
|
||||
if (soft || (!blocked && !(areacheck.name == "Space")))
|
||||
AM.Move(floorbelow)
|
||||
if (!soft && istype(AM, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = AM
|
||||
var/damage = 5
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "head")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "chest")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "l_leg")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "r_leg")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "l_arm")
|
||||
H.apply_damage(min(rand(-damage,damage),0), BRUTE, "r_arm")
|
||||
H:weakened = max(H:weakened,2)
|
||||
H:updatehealth()
|
||||
return ..()
|
||||
// We've made sure we can move, now.
|
||||
mover.Move(below)
|
||||
|
||||
/turf/proc/hasbelow()
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/turf/simulated/floor/open/proc/getbelow()
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
// check if there is something to draw below
|
||||
if(!controller.down)
|
||||
src.ChangeTurf(get_base_turf(src.z))
|
||||
return 0
|
||||
if(!soft)
|
||||
if(!istype(mover, /mob))
|
||||
if(istype(below, /turf/simulated/open))
|
||||
below.visible_message("\The [mover] falls from the deck above through \the [below]!", "You hear a whoosh of displaced air.")
|
||||
else
|
||||
floorbelow = locate(src.x, src.y, controller.down_target)
|
||||
return 1
|
||||
return 1
|
||||
below.visible_message("\The [mover] falls from the deck above and slams into \the [below]!", "You hear something slam into the deck.")
|
||||
else
|
||||
var/mob/M = mover
|
||||
if(istype(below, /turf/simulated/open))
|
||||
below.visible_message("\The [mover] falls from the deck above through \the [below]!", "You hear a soft whoosh.[M.stat ? "" : ".. and some screaming."]")
|
||||
else
|
||||
M.visible_message("\The [mover] falls from the deck above and slams into \the [below]!", "You land on \the [below].", "You hear a soft whoosh and a crunch")
|
||||
|
||||
// Handle people getting hurt, it's funny!
|
||||
if (istype(mover, /mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = mover
|
||||
var/damage = 5
|
||||
H.apply_damage(rand(0, damage), BRUTE, "head")
|
||||
H.apply_damage(rand(0, damage), BRUTE, "chest")
|
||||
H.apply_damage(rand(0, damage), BRUTE, "l_leg")
|
||||
H.apply_damage(rand(0, damage), BRUTE, "r_leg")
|
||||
H.apply_damage(rand(0, damage), BRUTE, "l_arm")
|
||||
H.apply_damage(rand(0, damage), BRUTE, "r_arm")
|
||||
H.weakened = max(H.weakened,2)
|
||||
H.updatehealth()
|
||||
|
||||
// override to make sure nothing is hidden
|
||||
/turf/simulated/floor/open/levelupdate()
|
||||
/turf/simulated/open/levelupdate()
|
||||
for(var/obj/O in src)
|
||||
O.hide(0)
|
||||
|
||||
//overwrite the attackby of space to transform it to openspace if necessary
|
||||
/turf/space/attackby(obj/item/C as obj, mob/user as mob)
|
||||
if (istype(C, /obj/item/stack/cable_coil) && src.hasbelow())
|
||||
var/turf/simulated/floor/open/W = src.ChangeTurf(/turf/simulated/floor/open)
|
||||
W.attackby(C, user)
|
||||
return
|
||||
..()
|
||||
|
||||
/turf/simulated/floor/open/ex_act(severity)
|
||||
// cant destroy empty space with an ordinary bomb
|
||||
return
|
||||
|
||||
/turf/simulated/floor/open/attackby(obj/item/C as obj, mob/user as mob)
|
||||
(..)
|
||||
if (istype(C, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/cable = C
|
||||
cable.turf_place(src, user)
|
||||
return
|
||||
|
||||
// Straight copy from space.
|
||||
/turf/simulated/open/attackby(obj/item/C as obj, mob/user as mob)
|
||||
if (istype(C, /obj/item/stack/rods))
|
||||
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
||||
if(L)
|
||||
return
|
||||
var/obj/item/stack/rods/R = C
|
||||
if (R.use(1))
|
||||
user << "<span class='notice'>Constructing support lattice...</span>"
|
||||
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
user << "<span class='notice'>Constructing support lattice ...</span>"
|
||||
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
ReplaceWithLattice()
|
||||
return
|
||||
|
||||
@@ -119,7 +105,7 @@
|
||||
if (S.get_amount() < 1)
|
||||
return
|
||||
qdel(L)
|
||||
playsound(src.loc, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
playsound(src, 'sound/weapons/Genhit.ogg', 50, 1)
|
||||
S.use(1)
|
||||
ChangeTurf(/turf/simulated/floor/airless)
|
||||
return
|
||||
|
||||
@@ -119,10 +119,10 @@ atom/movable/Move() //Hackish
|
||||
T.overlays -= T.z_overlays
|
||||
T.z_overlays -= T.z_overlays
|
||||
|
||||
if(down && (istype(T, /turf/space) || istype(T, /turf/simulated/floor/open)))
|
||||
if(down && (istype(T, /turf/space) || istype(T, /turf/simulated/open)))
|
||||
var/turf/below = locate(T.x, T.y, down_target)
|
||||
if(below)
|
||||
if(!(istype(below, /turf/space) || istype(below, /turf/simulated/floor/open)))
|
||||
if(!(istype(below, /turf/space) || istype(below, /turf/simulated/open)))
|
||||
var/image/t_img = list()
|
||||
new_list = 1
|
||||
|
||||
|
||||
@@ -64,9 +64,9 @@ turf/c_airblock(turf/other)
|
||||
#ifdef ZLEVELS
|
||||
if(other.z != src.z)
|
||||
if(other.z < src.z)
|
||||
if(!istype(src, /turf/simulated/floor/open)) return BLOCKED
|
||||
if(!istype(src, /turf/simulated/open)) return BLOCKED
|
||||
else
|
||||
if(!istype(other, /turf/simulated/floor/open)) return BLOCKED
|
||||
if(!istype(other, /turf/simulated/open)) return BLOCKED
|
||||
#endif
|
||||
|
||||
var/result = 0
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
//TODO: Flash range does nothing currently
|
||||
|
||||
///// Z-Level Stuff
|
||||
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = 1)
|
||||
///// Z-Level Stuff
|
||||
proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = UP|DOWN)
|
||||
src = null //so we don't abort once src is deleted
|
||||
spawn(0)
|
||||
if(config.use_recursive_explosions)
|
||||
@@ -14,23 +12,19 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
epicenter = get_turf(epicenter)
|
||||
if(!epicenter) return
|
||||
|
||||
///// Z-Level Stuff
|
||||
if(z_transfer && (devastation_range > 0 || heavy_impact_range > 0))
|
||||
//transfer the explosion in both directions
|
||||
explosion_z_transfer(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
///// Z-Level Stuff
|
||||
// Handles recursive propagation of explosions.
|
||||
if(devastation_range > 2 || heavy_impact_range > 2)
|
||||
if(HasAbove(epicenter.z) && z_transfer & UP)
|
||||
explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, UP)
|
||||
if(HasBelow(epicenter.z) && z_transfer & DOWN)
|
||||
explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, DOWN)
|
||||
|
||||
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flash_range)
|
||||
//playsound(epicenter, 'sound/effects/explosionfar.ogg', 100, 1, round(devastation_range*2,1) )
|
||||
//playsound(epicenter, "explosion", 100, 1, round(devastation_range,1) )
|
||||
|
||||
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
|
||||
|
||||
// Stereo users will also hear the direction of the explosion!
|
||||
|
||||
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
|
||||
|
||||
// 3/7/14 will calculate to 80 + 35
|
||||
// Play sounds; we want sounds to be different depending on distance so we will manually do it ourselves.
|
||||
// Stereo users will also hear the direction of the explosion!
|
||||
// Calculate far explosion sound range. Only allow the sound effect for heavy/devastating explosions.
|
||||
// 3/7/14 will calculate to 80 + 35
|
||||
var/far_dist = 0
|
||||
far_dist += heavy_impact_range * 5
|
||||
far_dist += devastation_range * 20
|
||||
@@ -62,10 +56,6 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[epicenter.x];Y=[epicenter.y];Z=[epicenter.z]'>JMP</a>)")
|
||||
log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ")
|
||||
|
||||
// var/lighting_controller_was_processing = lighting_controller.processing //Pause the lighting updates for a bit
|
||||
// lighting_controller.processing = 0
|
||||
|
||||
|
||||
var/approximate_intensity = (devastation_range * 3) + (heavy_impact_range * 2) + light_impact_range
|
||||
var/powernet_rebuild_was_deferred_already = defer_powernet_rebuild
|
||||
// Large enough explosion. For performance reasons, powernets will be rebuilt manually
|
||||
@@ -107,7 +97,6 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
|
||||
sleep(8)
|
||||
|
||||
// if(!lighting_controller.processing) lighting_controller.processing = lighting_controller_was_processing
|
||||
if(!powernet_rebuild_was_deferred_already && defer_powernet_rebuild)
|
||||
makepowernets()
|
||||
defer_powernet_rebuild = 0
|
||||
@@ -119,20 +108,3 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa
|
||||
proc/secondaryexplosion(turf/epicenter, range)
|
||||
for(var/turf/tile in range(range, epicenter))
|
||||
tile.ex_act(2)
|
||||
|
||||
///// Z-Level Stuff
|
||||
proc/explosion_z_transfer(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, up = 1, down = 1)
|
||||
var/turf/controllerlocation = locate(1, 1, epicenter.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
//start the child explosion, no admin log and no additional transfers
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.down_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 0, 0)
|
||||
if(devastation_range - 2 > 0 || heavy_impact_range - 2 > 0) //only transfer further if the explosion is still big enough
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.down_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 0, 1)
|
||||
|
||||
if(controller.up)
|
||||
//start the child explosion, no admin log and no additional transfers
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.up_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 0, 0)
|
||||
if(devastation_range - 2 > 0 || heavy_impact_range - 2 > 0) //only transfer further if the explosion is still big enough
|
||||
explosion(locate(epicenter.x, epicenter.y, controller.up_target), max(devastation_range - 2, 0), max(heavy_impact_range - 2, 0), max(light_impact_range - 2, 0), max(flash_range - 2, 0), 1, 0)
|
||||
///// Z-Level Stuff
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
/obj/structure/lattice/New()
|
||||
..()
|
||||
///// Z-Level Stuff
|
||||
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/floor/open)))
|
||||
if(!(istype(src.loc, /turf/space) || istype(src.loc, /turf/simulated/open)))
|
||||
///// Z-Level Stuff
|
||||
qdel(src)
|
||||
for(var/obj/structure/lattice/LAT in src.loc)
|
||||
|
||||
@@ -14,19 +14,11 @@
|
||||
if (!N)
|
||||
return
|
||||
|
||||
///// Z-Level Stuff ///// This makes sure that turfs are not changed to space when one side is part of a zone
|
||||
// This makes sure that turfs are not changed to space when one side is part of a zone
|
||||
if(N == /turf/space)
|
||||
var/turf/controller = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/c in controller)
|
||||
if(c.down)
|
||||
var/turf/below = locate(src.x, src.y, c.down_target)
|
||||
if((air_master.has_valid_zone(below) || air_master.has_valid_zone(src)) && !istype(below, /turf/space)) // dont make open space into space, its pointless and makes people drop out of the station
|
||||
var/turf/W = src.ChangeTurf(/turf/simulated/floor/open)
|
||||
var/list/temp = list()
|
||||
temp += W
|
||||
c.add(temp,3,1) // report the new open space to the zcontroller
|
||||
return W
|
||||
///// Z-Level Stuff
|
||||
var/turf/below = GetBelow(src)
|
||||
if(istype(below) && (air_master.has_valid_zone(below) || air_master.has_valid_zone(src)))
|
||||
N = /turf/simulated/open
|
||||
|
||||
var/obj/fire/old_fire = fire
|
||||
var/old_opacity = opacity
|
||||
@@ -46,11 +38,11 @@
|
||||
if(S.zone) S.zone.rebuild()
|
||||
|
||||
if(ispath(N, /turf/simulated/floor))
|
||||
var/turf/simulated/floor/W = new N( locate(src.x, src.y, src.z) )
|
||||
var/turf/simulated/W = new N( locate(src.x, src.y, src.z) )
|
||||
if(old_fire)
|
||||
fire = old_fire
|
||||
|
||||
if (istype(W))
|
||||
if (istype(W,/turf/simulated/floor))
|
||||
W.RemoveLattice()
|
||||
|
||||
if(tell_universe)
|
||||
|
||||
31
code/modules/multiz/basic.dm
Normal file
31
code/modules/multiz/basic.dm
Normal file
@@ -0,0 +1,31 @@
|
||||
// If you add a more comprehensive system, just untick this file.
|
||||
// WARNING: Only works for up to 17 z-levels!
|
||||
var/z_levels = 0 // Each bit represents a connection between adjacent levels. So the first bit means levels 1 and 2 are connected.
|
||||
|
||||
// If the height is more than 1, we mark all contained levels as connected.
|
||||
/obj/effect/landmark/map_data/New()
|
||||
for(var/i = z - 1 to height - 2)
|
||||
z_levels |= 1 << i
|
||||
del src
|
||||
|
||||
HasAbove(z)
|
||||
if(z > world.maxz || z > 17 || z < 2)
|
||||
return 0
|
||||
return z_levels & (1 << (z - 1))
|
||||
|
||||
HasBelow(z)
|
||||
if(z >= world.maxz || z > 16 || z < 1)
|
||||
return 0
|
||||
return z_levels & (1 << z)
|
||||
|
||||
GetAbove(var/atom/thing)
|
||||
var/turf/turf = get_turf(thing)
|
||||
if(!istype(turf))
|
||||
return null
|
||||
return HasBelow(turf.z) ? locate(turf.z, turf.y, turf.z - 1) : null
|
||||
|
||||
GetBelow(var/atom/thing)
|
||||
var/turf/turf = get_turf(thing)
|
||||
if(!istype(turf))
|
||||
return null
|
||||
return HasBelow(turf.z) ? locate(turf.z, turf.y, turf.z + 1) : null
|
||||
16
code/modules/multiz/stubs.dm
Normal file
16
code/modules/multiz/stubs.dm
Normal file
@@ -0,0 +1,16 @@
|
||||
/obj/effect/landmark/map_data
|
||||
name = "Unknown"
|
||||
desc = "An unknown location."
|
||||
invisibility = 101
|
||||
|
||||
var/height = 1 ///< The number of Z-Levels in the map.
|
||||
var/turf/edge_type ///< What the map edge should be formed with. (null = world.turf)
|
||||
|
||||
// FOR THE LOVE OF GOD USE THESE. DO NOT FUCKING SPAGHETTIFY THIS.
|
||||
// Use the Has*() functions if you ONLY need to check.
|
||||
// If you need to do something, use Get*().
|
||||
proc/HasAbove(var/z)
|
||||
proc/HasBelow(var/z)
|
||||
// These give either the turf or null.
|
||||
proc/GetAbove(var/turf/turf)
|
||||
proc/GetBelow(var/turf/turf)
|
||||
@@ -126,11 +126,10 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/weapon/wirecutters))
|
||||
///// Z-Level Stuff
|
||||
if(src.d1 == 12 || src.d2 == 12)
|
||||
if(d1 == 12 || d2 == 12)
|
||||
user << "<span class='warning'>You must cut this cable from above.</span>"
|
||||
return
|
||||
///// Z-Level Stuff
|
||||
|
||||
if(breaker_box)
|
||||
user << "\red This cable is connected to nearby breaker box. Use breaker box to interact with it."
|
||||
return
|
||||
@@ -146,16 +145,13 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
for(var/mob/O in viewers(src, null))
|
||||
O.show_message("<span class='warning'>[user] cuts the cable.</span>", 1)
|
||||
|
||||
///// Z-Level Stuff
|
||||
if(src.d1 == 11 || src.d2 == 11)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
var/turf/below = locate(src.x, src.y, controller.down_target)
|
||||
for(var/obj/structure/cable/c in below)
|
||||
if(d1 == 11 || d2 == 11)
|
||||
var/turf/turf = GetBelow(src)
|
||||
if(turf)
|
||||
for(var/obj/structure/cable/c in turf)
|
||||
if(c.d1 == 12 || c.d2 == 12)
|
||||
qdel(c)
|
||||
///// Z-Level Stuff
|
||||
|
||||
investigate_log("was cut by [key_name(usr, usr.client)] in [user.loc.loc]","wires")
|
||||
|
||||
qdel(src)
|
||||
@@ -347,19 +343,20 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
. = list() // this will be a list of all connected power objects
|
||||
var/turf/T
|
||||
|
||||
///// Z-Level Stuff
|
||||
if (d1 == 11 || d1 == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up && d1 == 12)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 11, 1)
|
||||
if(controller.down && d1 == 11)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 12, 1)
|
||||
///// Z-Level Stuff
|
||||
// Handle z-level connections.
|
||||
if(d1 == 11 || d1 == 12)
|
||||
// Connections below.
|
||||
if(d1 == 11)
|
||||
var/turf/turf = GetBelow(src)
|
||||
if(turf)
|
||||
. += power_list(turf, src, 12, 1)
|
||||
|
||||
// Connections above.
|
||||
if(d1 == 12)
|
||||
var/turf/turf = GetAbove(src)
|
||||
if(turf)
|
||||
. += power_list(turf, src, 11, 1)
|
||||
|
||||
//get matching cables from the first direction
|
||||
else if(d1) //if not a node cable
|
||||
T = get_step(src, d1)
|
||||
@@ -376,19 +373,22 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
|
||||
. += power_list(loc, src, d1, powernetless_only) //get on turf matching cables
|
||||
|
||||
///// Z-Level Stuff
|
||||
|
||||
// Second direction.
|
||||
// Handle z-level connections.
|
||||
if(d2 == 11 || d2 == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up && d2 == 12)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 11, 1)
|
||||
if(controller.down && d2 == 11)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
if(T)
|
||||
. += power_list(T, src, 12, 1)
|
||||
///// Z-Level Stuff
|
||||
// Connections below.
|
||||
if(d2 == 11)
|
||||
var/turf/turf = GetBelow(src)
|
||||
if(turf)
|
||||
. += power_list(turf, src, 12, 1)
|
||||
|
||||
// Connections above.
|
||||
if(d2 == 12)
|
||||
var/turf/turf = GetAbove(src)
|
||||
if(turf)
|
||||
. += power_list(turf, src, 11, 1)
|
||||
|
||||
else
|
||||
//do the same on the second direction (which can't be 0)
|
||||
T = get_step(src, d2)
|
||||
@@ -672,15 +672,14 @@ obj/structure/cable/proc/cableColor(var/colorC)
|
||||
return
|
||||
///// Z-Level Stuff
|
||||
// check if the target is open space
|
||||
if(istype(F, /turf/simulated/floor/open))
|
||||
if(istype(F, /turf/simulated/open))
|
||||
for(var/obj/structure/cable/LC in F)
|
||||
if((LC.d1 == dirn && LC.d2 == 11 ) || ( LC.d2 == dirn && LC.d1 == 11))
|
||||
user << "<span class='warning'>There's already a cable at that position.</span>"
|
||||
return
|
||||
|
||||
var/turf/simulated/floor/open/temp = F
|
||||
var/obj/structure/cable/C = new(F)
|
||||
var/obj/structure/cable/D = new(temp.floorbelow)
|
||||
var/obj/structure/cable/D = new(GetBelow(F))
|
||||
|
||||
C.cableColor(color)
|
||||
|
||||
|
||||
@@ -985,12 +985,9 @@
|
||||
var/obj/structure/disposalpipe/P
|
||||
|
||||
if(nextdir == 12)
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.up)
|
||||
T = locate(src.x, src.y, controller.up_target)
|
||||
T = GetAbove(src)
|
||||
if(!T)
|
||||
H.loc = src.loc
|
||||
H.loc = loc
|
||||
return
|
||||
else
|
||||
for(var/obj/structure/disposalpipe/down/F in T)
|
||||
@@ -1038,10 +1035,7 @@
|
||||
var/obj/structure/disposalpipe/P
|
||||
|
||||
if(nextdir == 11)
|
||||
var/turf/controllerlocation = locate(1, 1, src.z)
|
||||
for(var/obj/effect/landmark/zcontroller/controller in controllerlocation)
|
||||
if(controller.down)
|
||||
T = locate(src.x, src.y, controller.down_target)
|
||||
T = GetBelow(src)
|
||||
if(!T)
|
||||
H.loc = src.loc
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user