diff --git a/code/__DEFINES/colors.dm b/code/__DEFINES/colors.dm index fd29e892..90c73dac 100644 --- a/code/__DEFINES/colors.dm +++ b/code/__DEFINES/colors.dm @@ -17,6 +17,7 @@ #define COLOR_FLOORTILE_GRAY "#8D8B8B" #define COLOR_ALMOST_BLACK "#333333" +#define COLOR_SILVER "#C0C0C0" #define COLOR_BLACK "#000000" #define COLOR_RED "#FF0000" #define COLOR_RED_LIGHT "#FF3333" @@ -63,4 +64,4 @@ #define COLOR_ASSEMBLY_LBLUE "#5D99BE" #define COLOR_ASSEMBLY_BLUE "#38559E" #define COLOR_ASSEMBLY_PURPLE "#6F6192" -#define COLOR_ASSEMBLY_PINK "#ff4adc" \ No newline at end of file +#define COLOR_ASSEMBLY_PINK "#ff4adc" diff --git a/code/__DEFINES/layers.dm b/code/__DEFINES/layers.dm index 4598932b..c1648d34 100644 --- a/code/__DEFINES/layers.dm +++ b/code/__DEFINES/layers.dm @@ -6,6 +6,10 @@ #define PLANE_SPACE -95 #define PLANE_SPACE_PARALLAX -90 +#define OPENSPACE_LAYER 17 //Openspace layer over all +#define OPENSPACE_PLANE -4 //Openspace plane below all turfs +#define OPENSPACE_BACKDROP_PLANE -3 //Black square just over openspace plane to guaranteed cover all in openspace turf + #define FLOOR_PLANE -2 #define GAME_PLANE -1 #define BLACKNESS_PLANE 0 //To keep from conflicts with SEE_BLACKNESS internals @@ -87,9 +91,6 @@ #define ABOVE_LIGHTING_PLANE 16 #define ABOVE_LIGHTING_LAYER 16 -#define FLOOR_OPENSPACE_PLANE 17 -#define OPENSPACE_LAYER 17 - #define BYOND_LIGHTING_PLANE 18 #define BYOND_LIGHTING_LAYER 18 diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index 8592383a..c96d687e 100644 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -8,7 +8,7 @@ var/last_parallax_shift //world.time of last update var/parallax_throttle = 0 //ds between updates var/parallax_movedir = 0 - var/parallax_layers_max = 3 + var/parallax_layers_max = 4 var/parallax_animate_timer /datum/hud/proc/create_parallax(mob/viewmob) @@ -22,6 +22,8 @@ C.parallax_layers_cached += new /obj/screen/parallax_layer/layer_1(null, C.view) C.parallax_layers_cached += new /obj/screen/parallax_layer/layer_2(null, C.view) C.parallax_layers_cached += new /obj/screen/parallax_layer/planet(null, C.view) + if(SSparallax.random_layer) + C.parallax_layers_cached += new SSparallax.random_layer C.parallax_layers_cached += new /obj/screen/parallax_layer/layer_3(null, C.view) C.parallax_layers = C.parallax_layers_cached.Copy() @@ -64,12 +66,12 @@ switch(C.prefs.parallax) if (PARALLAX_INSANE) C.parallax_throttle = FALSE - C.parallax_layers_max = 4 + C.parallax_layers_max = 5 return TRUE if (PARALLAX_MED) C.parallax_throttle = PARALLAX_DELAY_MED - C.parallax_layers_max = 2 + C.parallax_layers_max = 3 return TRUE if (PARALLAX_LOW) @@ -81,7 +83,7 @@ return FALSE C.parallax_throttle = PARALLAX_DELAY_DEFAULT - C.parallax_layers_max = 3 + C.parallax_layers_max = 4 return TRUE /datum/hud/proc/update_parallax_pref(mob/viewmob) @@ -167,7 +169,7 @@ /datum/hud/proc/update_parallax() var/client/C = mymob.client var/turf/posobj = get_turf(C.eye) - if(!posobj) + if(!posobj) return var/area/areaobj = posobj.loc @@ -296,6 +298,20 @@ speed = 1.4 layer = 3 +/obj/screen/parallax_layer/random + blend_mode = BLEND_OVERLAY + speed = 3 + layer = 3 + +/obj/screen/parallax_layer/random/space_gas + icon_state = "space_gas" + +/obj/screen/parallax_layer/random/space_gas/Initialize(mapload, view) + src.add_atom_colour(SSparallax.random_parallax_color, ADMIN_COLOUR_PRIORITY) + +/obj/screen/parallax_layer/random/asteroids + icon_state = "asteroids" + /obj/screen/parallax_layer/planet icon_state = "planet" blend_mode = BLEND_OVERLAY @@ -304,11 +320,11 @@ layer = 30 /obj/screen/parallax_layer/planet/update_status(mob/M) - var/turf/T = get_turf(M) - if(is_station_level(T.z)) - invisibility = 0 - else - invisibility = INVISIBILITY_ABSTRACT + var/client/C = M.client + var/turf/posobj = get_turf(C.eye) + if(!posobj) + return + invisibility = is_station_level(posobj.z) ? 0 : INVISIBILITY_ABSTRACT /obj/screen/parallax_layer/planet/update_o() return //Shit wont move diff --git a/code/_onclick/hud/plane_master.dm b/code/_onclick/hud/plane_master.dm index b2bc0592..ac749409 100644 --- a/code/_onclick/hud/plane_master.dm +++ b/code/_onclick/hud/plane_master.dm @@ -18,7 +18,7 @@ /obj/screen/plane_master/openspace name = "open space plane master" - plane = FLOOR_OPENSPACE_PLANE + plane = OPENSPACE_BACKDROP_PLANE appearance_flags = PLANE_MASTER blend_mode = BLEND_MULTIPLY alpha = 255 diff --git a/code/controllers/subsystem/parallax.dm b/code/controllers/subsystem/parallax.dm index 64299fda..af5b13ce 100644 --- a/code/controllers/subsystem/parallax.dm +++ b/code/controllers/subsystem/parallax.dm @@ -7,9 +7,15 @@ SUBSYSTEM_DEF(parallax) var/list/currentrun var/planet_x_offset = 128 var/planet_y_offset = 128 + var/random_layer + var/random_parallax_color -/datum/controller/subsystem/parallax/Initialize(timeofday) +//These are cached per client so needs to be done asap so people joining at roundstart do not miss these. +/datum/controller/subsystem/parallax/PreInit() . = ..() + if(prob(70)) //70% chance to pick a special extra layer + random_layer = pick(/obj/screen/parallax_layer/random/space_gas, /obj/screen/parallax_layer/random/asteroids) + random_parallax_color = pick(COLOR_TEAL, COLOR_GREEN, COLOR_SILVER, COLOR_YELLOW, COLOR_CYAN, COLOR_ORANGE, COLOR_PURPLE)//Special color for random_layer1. Has to be done here so everyone sees the same color. planet_y_offset = rand(100, 160) planet_x_offset = rand(100, 160) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index d9948b8e..656bbc51 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -31,6 +31,8 @@ var/renamedByPlayer = FALSE //set when a player uses a pen on a renamable object + vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of obj in openspace. + /obj/vv_edit_var(vname, vval) switch(vname) if("anchored") diff --git a/code/game/turfs/openspace/openspace.dm b/code/game/turfs/openspace/openspace.dm index e68aabcd..ede97c0b 100644 --- a/code/game/turfs/openspace/openspace.dm +++ b/code/game/turfs/openspace/openspace.dm @@ -1,7 +1,20 @@ +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 + layer = SPLASHSCREEN_LAYER + /turf/open/openspace name = "open space" desc = "Watch your step!" - icon_state = "grey" + icon_state = "transparent" baseturfs = /turf/open/openspace CanAtmosPassVertical = ATMOS_PASS_YES //mouse_opacity = MOUSE_OPACITY_TRANSPARENT @@ -14,8 +27,11 @@ /turf/open/openspace/Initialize() // handle plane and layer here so that they don't cover other obs/turfs in Dream Maker . = ..() - plane = FLOOR_OPENSPACE_PLANE + plane = OPENSPACE_PLANE layer = OPENSPACE_LAYER + + vis_contents += GLOB.openspace_backdrop_one_for_all //Special grey square for projecting backdrop darkness filter on it. + return INITIALIZE_HINT_LATELOAD /turf/open/openspace/LateInitialize() diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 983f37d1..d415e230 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -18,7 +18,7 @@ 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 diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index d1394e7c..ff47a484 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -32,6 +32,8 @@ //IE if the turf is supposed to be water, set TRUE. var/tiled_dirt = FALSE // use smooth tiled dirt decal + + vis_flags = VIS_INHERIT_PLANE|VIS_INHERIT_ID //when this be added to vis_contents of something it inherit something.plane and be associated with something on clicking, important for visualisation of turf in openspace and interraction with openspace that show you turf. /turf/vv_edit_var(var_name, new_value) var/static/list/banned_edits = list("x", "y", "z") diff --git a/code/modules/atmospherics/gasmixtures/gas_types.dm b/code/modules/atmospherics/gasmixtures/gas_types.dm index 06a62f52..9bd41404 100644 --- a/code/modules/atmospherics/gasmixtures/gas_types.dm +++ b/code/modules/atmospherics/gasmixtures/gas_types.dm @@ -203,6 +203,7 @@ GLOBAL_LIST_INIT(nonreactive_gases, typecacheof(list(/datum/gas/oxygen, /datum/g anchored = TRUE // should only appear in vis_contents, but to be safe layer = FLY_LAYER appearance_flags = TILE_BOUND + vis_flags = NONE /obj/effect/overlay/gas/New(state, alph) . = ..() diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index ed901ee6..3a56fcff 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -142,3 +142,5 @@ var/typing_indicator_timerid /// Current state of our typing indicator. Used for cut overlay, DO NOT RUNTIME ASSIGN OTHER THAN FROM SHOW/CLEAR. Used to absolutely ensure we do not get stuck overlays. var/mutable_appearance/typing_indicator_current + + vis_flags = VIS_INHERIT_PLANE //when this be added to vis_contents of something it inherit something.plane, important for visualisation of mob in openspace. diff --git a/icons/effects/parallax.dmi b/icons/effects/parallax.dmi index 22f091ff..fb996d5e 100644 Binary files a/icons/effects/parallax.dmi and b/icons/effects/parallax.dmi differ