/turf/open/space icon = 'icons/turf/space.dmi' icon_state = "0" name = "\proper space" intact = 0 dirt_buildup_allowed = FALSE initial_temperature = TCMB thermal_conductivity = 0 heat_capacity = 700000 wave_explosion_multiply = EXPLOSION_DAMPEN_SPACE wave_explosion_block = EXPLOSION_BLOCK_SPACE var/destination_z var/destination_x var/destination_y var/static/datum/gas_mixture/immutable/space/space_gas plane = PLANE_SPACE layer = SPACE_LAYER light_power = 0.25 dynamic_lighting = DYNAMIC_LIGHTING_DISABLED bullet_bounce_sound = null vis_flags = VIS_INHERIT_ID //when this be added to vis_contents of something it be associated with something on clicking, important for visualisation of turf in openspace and interraction with openspace that show you turf. /turf/open/space/basic/New() //Do not convert to Initialize //This is used to optimize the map loader return /** * Space Initialize * * Doesn't call parent, see [/atom/proc/Initialize] */ /turf/open/space/Initialize(mapload) SHOULD_CALL_PARENT(FALSE) icon_state = SPACE_ICON_STATE if(!space_gas) space_gas = new air = space_gas update_air_ref(0) vis_contents.Cut() //removes inherited overlays visibilityChanged() if(flags_1 & INITIALIZED_1) stack_trace("Warning: [src]([type]) initialized multiple times!") flags_1 |= INITIALIZED_1 // if (length(smoothing_groups)) // sortTim(smoothing_groups) //In case it's not properly ordered, let's avoid duplicate entries with the same values. // SET_BITFLAG_LIST(smoothing_groups) // if (length(canSmoothWith)) // sortTim(canSmoothWith) // if(canSmoothWith[length(canSmoothWith)] > MAX_S_TURF) //If the last element is higher than the maximum turf-only value, then it must scan turf contents for smoothing targets. // smoothing_flags |= SMOOTH_OBJ // SET_BITFLAG_LIST(canSmoothWith) var/area/A = loc if(!IS_DYNAMIC_LIGHTING(src) && IS_DYNAMIC_LIGHTING(A)) add_overlay(/obj/effect/fullbright) if (light_power && light_range) update_light() if (opacity) has_opaque_atom = TRUE var/turf/T = SSmapping.get_turf_above(src) if(T) T.multiz_turf_new(src, DOWN) T = SSmapping.get_turf_below(src) if(T) T.multiz_turf_new(src, UP) ComponentInitialize() return INITIALIZE_HINT_NORMAL //ATTACK GHOST IGNORING PARENT RETURN VALUE /turf/open/space/attack_ghost(mob/dead/observer/user) if(destination_z) var/turf/T = locate(destination_x, destination_y, destination_z) user.forceMove(T) /turf/open/space/Initalize_Atmos(times_fired) return /turf/open/space/TakeTemperature(temp) /turf/open/space/RemoveLattice() return /turf/open/space/AfterChange() ..() atmos_overlay_types = null /turf/open/space/Assimilate_Air() return //IT SHOULD RETURN NULL YOU MONKEY, WHY IN TARNATION WHAT THE FUCKING FUCK /turf/open/space/remove_air(amount) return null /turf/open/space/remove_air_ratio(amount) return null /turf/open/space/proc/update_starlight() if(CONFIG_GET(flag/starlight)) for(var/t in RANGE_TURFS(1,src)) //RANGE_TURFS is in code\__HELPERS\game.dm if(isspaceturf(t)) //let's NOT update this that much pls continue set_light(2) return set_light(0) /turf/open/space/attack_paw(mob/user) return attack_hand(user) /turf/open/space/proc/CanBuildHere() return TRUE /turf/open/space/handle_slip() return // no lube bullshit, this is space /turf/open/space/attackby(obj/item/C, mob/user, params) ..() if(!CanBuildHere()) return if(istype(C, /obj/item/stack/rods)) var/obj/item/stack/rods/R = C var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) var/obj/structure/lattice/catwalk/W = locate(/obj/structure/lattice/catwalk, src) if(W) to_chat(user, "There is already a catwalk here!") return if(L) if(R.use(1)) qdel(L) to_chat(user, "You construct a catwalk.") playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE) new/obj/structure/lattice/catwalk(src) else to_chat(user, "You need two rods to build a catwalk!") return if(R.use(1)) to_chat(user, "You construct a lattice.") playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE) ReplaceWithLattice() else to_chat(user, "You need one rod to build a lattice.") return if(istype(C, /obj/item/stack/tile/plasteel)) var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) var/obj/item/stack/tile/plasteel/S = C if(S.use(1)) qdel(L) playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE) to_chat(user, "You build a floor.") PlaceOnTop(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR) else to_chat(user, "You need one floor tile to build a floor!") else to_chat(user, "The plating is going to need some support! Place metal rods first.") /turf/open/space/Entered(atom/movable/A) ..() if ((!(A) || src != A.loc)) return if(destination_z && destination_x && destination_y && !(A.pulledby || !A.can_be_z_moved)) var/tx = destination_x var/ty = destination_y var/turf/DT = locate(tx, ty, destination_z) var/itercount = 0 while(DT.density || istype(DT.loc,/area/shuttle)) // Extend towards the center of the map, trying to look for a better place to arrive if (itercount++ >= 100) log_game("SPACE Z-TRANSIT ERROR: Could not find a safe place to land [A] within 100 iterations.") break if (tx < 128) tx++ else tx-- if (ty < 128) ty++ else ty-- DT = locate(tx, ty, destination_z) var/atom/movable/pulling = A.pulling var/atom/movable/puller = A A.forceMove(DT) while (pulling != null) var/next_pulling = pulling.pulling if(next_pulling == pulling) break // no loops var/turf/T = get_step(puller.loc, turn(puller.dir, 180)) pulling.can_be_z_moved = FALSE pulling.forceMove(T) puller.start_pulling(pulling) pulling.can_be_z_moved = TRUE puller = pulling pulling = next_pulling //now we're on the new z_level, proceed the space drifting stoplag()//Let a diagonal move finish, if necessary A.newtonian_move(A.inertia_dir) A.inertia_moving = TRUE /turf/open/space/Exited(atom/movable/AM, atom/OldLoc) . = ..() var/turf/old = get_turf(OldLoc) if(!isspaceturf(old) && ismob(AM)) var/mob/M = AM M.update_gravity(M.mob_has_gravity()) /turf/open/space/MakeSlippery(wet_setting, min_wet_time, wet_time_to_add, max_wet_time, permanent) return /turf/open/space/singularity_act() return /turf/open/space/can_have_cabling() if(locate(/obj/structure/lattice/catwalk, src)) return TRUE return FALSE /turf/open/space/is_transition_turf() if(destination_x || destination_y || destination_z) return TRUE /turf/open/space/acid_act(acidpwr, acid_volume) return FALSE /turf/open/space/get_smooth_underlay_icon(mutable_appearance/underlay_appearance, turf/asking_turf, adjacency_dir) underlay_appearance.icon = 'icons/turf/space.dmi' underlay_appearance.icon_state = SPACE_ICON_STATE underlay_appearance.plane = PLANE_SPACE return TRUE /turf/open/space/rcd_vals(mob/user, obj/item/construction/rcd/the_rcd) if(!CanBuildHere()) return FALSE switch(the_rcd.mode) if(RCD_FLOORWALL) var/obj/structure/lattice/L = locate(/obj/structure/lattice, src) if(L) return list("mode" = RCD_FLOORWALL, "delay" = 0, "cost" = 1) else return list("mode" = RCD_FLOORWALL, "delay" = 0, "cost" = 3) return FALSE /turf/open/space/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode) switch(passed_mode) if(RCD_FLOORWALL) to_chat(user, "You build a floor.") PlaceOnTop(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR) return TRUE return FALSE /turf/open/space/ReplaceWithLattice() var/dest_x = destination_x var/dest_y = destination_y var/dest_z = destination_z ..() destination_x = dest_x destination_y = dest_y destination_z = dest_z /turf/open/space/get_yelling_resistance(power) return INFINITY // no sound through space for crying out loud /turf/open/space/transparent baseturfs = /turf/open/space/transparent/openspace intact = FALSE //this means wires go on top /turf/open/space/transparent/Initialize(mapload) // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker ..() plane = OPENSPACE_PLANE layer = OPENSPACE_LAYER icon_state = "transparent" return INITIALIZE_HINT_LATELOAD /turf/open/space/transparent/LateInitialize() update_multiz(TRUE, TRUE) /turf/open/space/transparent/Destroy() vis_contents.len = 0 return ..() /turf/open/space/transparent/update_multiz(prune_on_fail = FALSE, init = FALSE) . = ..() var/turf/T = below() if(!T) vis_contents.len = 0 if(!show_bottom_level() && prune_on_fail) //If we cant show whats below, and we prune on fail, change the turf to space as a fallback ChangeTurf(/turf/open/space) return FALSE if(init) vis_contents += T return TRUE /turf/open/space/transparent/multiz_turf_del(turf/T, dir) if(dir != DOWN) return update_multiz() /turf/open/space/transparent/multiz_turf_new(turf/T, dir) if(dir != DOWN) return update_multiz() ///Called when there is no real turf below this turf /turf/open/space/transparent/proc/show_bottom_level() var/turf/path = get_z_base_turf() var/mutable_appearance/underlay_appearance = mutable_appearance(initial(path.icon), initial(path.icon_state), layer = TURF_LAYER, plane = PLANE_SPACE) underlays += underlay_appearance return TRUE /turf/open/space/transparent/openspace name = "open space" desc = "Watch your step!" icon_state = "transparent" baseturfs = /turf/open/space/transparent/openspace CanAtmosPassVertical = ATMOS_PASS_YES //mouse_opacity = MOUSE_OPACITY_TRANSPARENT ///No bottom level for openspace. /turf/open/space/transparent/openspace/show_bottom_level() return FALSE /turf/open/space/transparent/openspace/Initialize(mapload) // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker . = ..() icon_state = "transparent" vis_contents += GLOB.openspace_backdrop_one_for_all //Special grey square for projecting backdrop darkness filter on it. /turf/open/space/transparent/openspace/zAirIn() return TRUE /turf/open/space/transparent/openspace/zAirOut() return TRUE /turf/open/space/transparent/openspace/zPassIn(atom/movable/A, direction, turf/source) if(direction == DOWN) for(var/obj/O in contents) if(O.obj_flags & BLOCK_Z_IN_DOWN) return FALSE return TRUE if(direction == UP) for(var/obj/O in contents) if(O.obj_flags & BLOCK_Z_IN_UP) return FALSE return TRUE return FALSE /turf/open/space/transparent/openspace/zPassOut(atom/movable/A, direction, turf/destination) if(A.anchored) return FALSE if(direction == DOWN) for(var/obj/O in contents) if(O.obj_flags & BLOCK_Z_OUT_DOWN) return FALSE return TRUE if(direction == UP) for(var/obj/O in contents) if(O.obj_flags & BLOCK_Z_OUT_UP) return FALSE return TRUE return FALSE