diff --git a/code/_onclick/hud/parallax.dm b/code/_onclick/hud/parallax.dm index da21f43ce7..43db4fa552 100755 --- a/code/_onclick/hud/parallax.dm +++ b/code/_onclick/hud/parallax.dm @@ -21,6 +21,7 @@ C.parallax_layers_cached = list() 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) C.parallax_layers_cached += new /obj/screen/parallax_layer/layer_3(null, C.view) C.parallax_layers = C.parallax_layers_cached.Copy() @@ -86,6 +87,7 @@ /datum/hud/proc/update_parallax_pref(mob/viewmob) remove_parallax(viewmob) create_parallax(viewmob) + update_parallax() // This sets which way the current shuttle is moving (returns true if the shuttle has stopped moving so the caller can append their animation) /datum/hud/proc/set_parallax_movedir(new_parallax_movedir, skip_windups) @@ -194,18 +196,27 @@ var/obj/screen/parallax_layer/L = thing if (L.view_sized != C.view) L.update_o(C.view) - var/change_x = offset_x * L.speed - L.offset_x -= change_x - var/change_y = offset_y * L.speed - L.offset_y -= change_y - if(L.offset_x > 240) - L.offset_x -= 480 - if(L.offset_x < -240) - L.offset_x += 480 - if(L.offset_y > 240) - L.offset_y -= 480 - if(L.offset_y < -240) - L.offset_y += 480 + + var/change_x + var/change_y + + if(L.absolute) + L.offset_x = -(posobj.x - SSparallax.planet_x_offset) * L.speed + L.offset_y = -(posobj.y - SSparallax.planet_y_offset) * L.speed + else + change_x = offset_x * L.speed + L.offset_x -= change_x + change_y = offset_y * L.speed + L.offset_y -= change_y + + if(L.offset_x > 240) + L.offset_x -= 480 + if(L.offset_x < -240) + L.offset_x += 480 + if(L.offset_y > 240) + L.offset_y -= 480 + if(L.offset_y < -240) + L.offset_y += 480 if(!areaobj.parallax_movedir && C.dont_animate_parallax <= world.time && (offset_x || offset_y) && abs(offset_x) <= max(C.parallax_throttle/world.tick_lag+1,1) && abs(offset_y) <= max(C.parallax_throttle/world.tick_lag+1,1) && (round(abs(change_x)) > 1 || round(abs(change_y)) > 1)) @@ -232,6 +243,7 @@ var/offset_x = 0 var/offset_y = 0 var/view_sized + var/absolute = FALSE blend_mode = BLEND_ADD plane = PLANE_SPACE_PARALLAX screen_loc = "CENTER-7,CENTER-7" @@ -247,7 +259,7 @@ /obj/screen/parallax_layer/proc/update_o(view) if (!view) view = world.view - + var/list/viewscales = getviewsize(view) var/countx = CEILING((viewscales[1]/2)/(480/world.icon_size), 1)+1 var/county = CEILING((viewscales[2]/2)/(480/world.icon_size), 1)+1 @@ -278,6 +290,16 @@ speed = 1.4 layer = 3 +/obj/screen/parallax_layer/planet + icon_state = "planet" + blend_mode = BLEND_OVERLAY + absolute = TRUE //Status of seperation + speed = 3 + layer = 30 + +/obj/screen/parallax_layer/planet/update_o() + return //Shit wont move + #undef LOOP_NONE #undef LOOP_NORMAL #undef LOOP_REVERSE diff --git a/code/controllers/subsystem/parallax.dm b/code/controllers/subsystem/parallax.dm index f8f2d463ba..64299fda38 100644 --- a/code/controllers/subsystem/parallax.dm +++ b/code/controllers/subsystem/parallax.dm @@ -1,10 +1,17 @@ SUBSYSTEM_DEF(parallax) name = "Parallax" wait = 2 - flags = SS_POST_FIRE_TIMING | SS_BACKGROUND | SS_NO_INIT + flags = SS_POST_FIRE_TIMING | SS_BACKGROUND priority = FIRE_PRIORITY_PARALLAX runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT var/list/currentrun + var/planet_x_offset = 128 + var/planet_y_offset = 128 + +/datum/controller/subsystem/parallax/Initialize(timeofday) + . = ..() + planet_y_offset = rand(100, 160) + planet_x_offset = rand(100, 160) /datum/controller/subsystem/parallax/fire(resumed = 0) if (!resumed) diff --git a/icons/effects/parallax.dmi b/icons/effects/parallax.dmi index 181b76007d..22f091ff11 100755 Binary files a/icons/effects/parallax.dmi and b/icons/effects/parallax.dmi differ