mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-11 01:13:18 +00:00
* Refactors most spans into span procs * AA * a * AAAAAAAAAAAAAAAAAAAAAA * Update species.dm Co-authored-by: Watermelon914 <37270891+Watermelon914@users.noreply.github.com> Co-authored-by: Gandalf <jzo123@hotmail.com>
179 lines
5.4 KiB
Plaintext
179 lines
5.4 KiB
Plaintext
GLOBAL_DATUM_INIT(openspace_backdrop_one_for_all, /atom/movable/openspace_backdrop, new)
|
|
|
|
/atom/movable/openspace_backdrop
|
|
name = "openspace_backdrop"
|
|
anchored = TRUE
|
|
|
|
icon = 'icons/turf/floors.dmi'
|
|
icon_state = "grey"
|
|
plane = OPENSPACE_BACKDROP_PLANE
|
|
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
|
vis_flags = VIS_INHERIT_ID
|
|
|
|
/turf/open/openspace
|
|
name = "open space"
|
|
desc = "Watch your step!"
|
|
icon_state = "invisible"
|
|
baseturfs = /turf/open/openspace
|
|
CanAtmosPassVertical = ATMOS_PASS_YES
|
|
baseturfs = /turf/open/openspace
|
|
intact = FALSE //this means wires go on top
|
|
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
|
|
var/can_cover_up = TRUE
|
|
var/can_build_on = TRUE
|
|
|
|
/turf/open/openspace/airless
|
|
initial_gas_mix = AIRLESS_ATMOS
|
|
|
|
/turf/open/openspace/airless/planetary
|
|
planetary_atmos = TRUE
|
|
|
|
/turf/open/openspace/Initialize() // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker
|
|
. = ..()
|
|
overlays += GLOB.openspace_backdrop_one_for_all //Special grey square for projecting backdrop darkness filter on it.
|
|
return INITIALIZE_HINT_LATELOAD
|
|
|
|
/turf/open/openspace/LateInitialize()
|
|
. = ..()
|
|
AddElement(/datum/element/turf_z_transparency, FALSE)
|
|
|
|
/turf/open/openspace/can_have_cabling()
|
|
if(locate(/obj/structure/lattice/catwalk, src))
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/turf/open/openspace/zAirIn()
|
|
return TRUE
|
|
|
|
/turf/open/openspace/zAirOut()
|
|
return TRUE
|
|
|
|
/turf/open/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/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
|
|
|
|
/turf/open/openspace/proc/CanCoverUp()
|
|
return can_cover_up
|
|
|
|
/turf/open/openspace/proc/CanBuildHere()
|
|
return can_build_on
|
|
|
|
/turf/open/openspace/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, span_warning("There is already a catwalk here!"))
|
|
return
|
|
if(L)
|
|
if(R.use(1))
|
|
qdel(L)
|
|
to_chat(user, span_notice("You construct a catwalk."))
|
|
playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE)
|
|
new/obj/structure/lattice/catwalk(src)
|
|
else
|
|
to_chat(user, span_warning("You need two rods to build a catwalk!"))
|
|
return
|
|
if(R.use(1))
|
|
to_chat(user, span_notice("You construct a lattice."))
|
|
playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE)
|
|
ReplaceWithLattice()
|
|
else
|
|
to_chat(user, span_warning("You need one rod to build a lattice."))
|
|
return
|
|
if(istype(C, /obj/item/stack/tile/iron))
|
|
if(!CanCoverUp())
|
|
return
|
|
var/obj/structure/lattice/L = locate(/obj/structure/lattice, src)
|
|
if(L)
|
|
var/obj/item/stack/tile/iron/S = C
|
|
if(S.use(1))
|
|
qdel(L)
|
|
playsound(src, 'sound/weapons/genhit.ogg', 50, TRUE)
|
|
to_chat(user, span_notice("You build a floor."))
|
|
PlaceOnTop(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
|
|
else
|
|
to_chat(user, span_warning("You need one floor tile to build a floor!"))
|
|
else
|
|
to_chat(user, span_warning("The plating is going to need some support! Place iron rods first."))
|
|
|
|
/turf/open/openspace/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/openspace/rcd_act(mob/user, obj/item/construction/rcd/the_rcd, passed_mode)
|
|
switch(passed_mode)
|
|
if(RCD_FLOORWALL)
|
|
to_chat(user, span_notice("You build a floor."))
|
|
PlaceOnTop(/turf/open/floor/plating, flags = CHANGETURF_INHERIT_AIR)
|
|
return TRUE
|
|
return FALSE
|
|
|
|
/turf/open/openspace/icemoon
|
|
name = "ice chasm"
|
|
baseturfs = /turf/open/openspace/icemoon
|
|
initial_gas_mix = ICEMOON_DEFAULT_ATMOS
|
|
planetary_atmos = TRUE
|
|
var/replacement_turf = /turf/open/floor/plating/asteroid/snow/icemoon
|
|
/// Replaces itself with replacement_turf if the turf below this one is in a no ruins allowed area (usually ruins themselves)
|
|
var/protect_ruin = TRUE
|
|
/// If true mineral turfs below this openspace turf will be mined automatically
|
|
var/drill_below = TRUE
|
|
|
|
/turf/open/openspace/icemoon/Initialize()
|
|
. = ..()
|
|
var/turf/T = below()
|
|
if(T.turf_flags & NO_RUINS && protect_ruin)
|
|
ChangeTurf(replacement_turf, null, CHANGETURF_IGNORE_AIR)
|
|
return
|
|
if(!ismineralturf(T) || !drill_below)
|
|
return
|
|
var/turf/closed/mineral/M = T
|
|
M.mineralAmt = 0
|
|
M.gets_drilled()
|
|
baseturfs = /turf/open/openspace/icemoon //This is to ensure that IF random turf generation produces a openturf, there won't be other turfs assigned other than openspace.
|
|
|
|
/turf/open/openspace/icemoon/keep_below
|
|
drill_below = FALSE
|
|
|
|
/turf/open/openspace/icemoon/ruins
|
|
protect_ruin = FALSE
|
|
drill_below = FALSE
|