mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
Lavaland / Lavaplanet is now visible from space (#36419)
* adds lava planet * fixes oldcode * im dumb * Random position * UHHHH, I'll take a diet lavaplanet please, no ice. * fixes init
This commit is contained in:
committed by
yogstation13-bot
parent
6773bd39ba
commit
2c3e250fde
@@ -21,6 +21,7 @@
|
|||||||
C.parallax_layers_cached = list()
|
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_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/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_cached += new /obj/screen/parallax_layer/layer_3(null, C.view)
|
||||||
|
|
||||||
C.parallax_layers = C.parallax_layers_cached.Copy()
|
C.parallax_layers = C.parallax_layers_cached.Copy()
|
||||||
@@ -86,6 +87,7 @@
|
|||||||
/datum/hud/proc/update_parallax_pref(mob/viewmob)
|
/datum/hud/proc/update_parallax_pref(mob/viewmob)
|
||||||
remove_parallax(viewmob)
|
remove_parallax(viewmob)
|
||||||
create_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)
|
// 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)
|
/datum/hud/proc/set_parallax_movedir(new_parallax_movedir, skip_windups)
|
||||||
@@ -194,18 +196,27 @@
|
|||||||
var/obj/screen/parallax_layer/L = thing
|
var/obj/screen/parallax_layer/L = thing
|
||||||
if (L.view_sized != C.view)
|
if (L.view_sized != C.view)
|
||||||
L.update_o(C.view)
|
L.update_o(C.view)
|
||||||
var/change_x = offset_x * L.speed
|
|
||||||
L.offset_x -= change_x
|
var/change_x
|
||||||
var/change_y = offset_y * L.speed
|
var/change_y
|
||||||
L.offset_y -= change_y
|
|
||||||
if(L.offset_x > 240)
|
if(L.absolute)
|
||||||
L.offset_x -= 480
|
L.offset_x = -(posobj.x - SSparallax.planet_x_offset) * L.speed
|
||||||
if(L.offset_x < -240)
|
L.offset_y = -(posobj.y - SSparallax.planet_y_offset) * L.speed
|
||||||
L.offset_x += 480
|
else
|
||||||
if(L.offset_y > 240)
|
change_x = offset_x * L.speed
|
||||||
L.offset_y -= 480
|
L.offset_x -= change_x
|
||||||
if(L.offset_y < -240)
|
change_y = offset_y * L.speed
|
||||||
L.offset_y += 480
|
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))
|
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_x = 0
|
||||||
var/offset_y = 0
|
var/offset_y = 0
|
||||||
var/view_sized
|
var/view_sized
|
||||||
|
var/absolute = FALSE
|
||||||
blend_mode = BLEND_ADD
|
blend_mode = BLEND_ADD
|
||||||
plane = PLANE_SPACE_PARALLAX
|
plane = PLANE_SPACE_PARALLAX
|
||||||
screen_loc = "CENTER-7,CENTER-7"
|
screen_loc = "CENTER-7,CENTER-7"
|
||||||
@@ -247,7 +259,7 @@
|
|||||||
/obj/screen/parallax_layer/proc/update_o(view)
|
/obj/screen/parallax_layer/proc/update_o(view)
|
||||||
if (!view)
|
if (!view)
|
||||||
view = world.view
|
view = world.view
|
||||||
|
|
||||||
var/list/viewscales = getviewsize(view)
|
var/list/viewscales = getviewsize(view)
|
||||||
var/countx = CEILING((viewscales[1]/2)/(480/world.icon_size), 1)+1
|
var/countx = CEILING((viewscales[1]/2)/(480/world.icon_size), 1)+1
|
||||||
var/county = CEILING((viewscales[2]/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
|
speed = 1.4
|
||||||
layer = 3
|
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_NONE
|
||||||
#undef LOOP_NORMAL
|
#undef LOOP_NORMAL
|
||||||
#undef LOOP_REVERSE
|
#undef LOOP_REVERSE
|
||||||
|
|||||||
@@ -1,10 +1,17 @@
|
|||||||
SUBSYSTEM_DEF(parallax)
|
SUBSYSTEM_DEF(parallax)
|
||||||
name = "Parallax"
|
name = "Parallax"
|
||||||
wait = 2
|
wait = 2
|
||||||
flags = SS_POST_FIRE_TIMING | SS_BACKGROUND | SS_NO_INIT
|
flags = SS_POST_FIRE_TIMING | SS_BACKGROUND
|
||||||
priority = FIRE_PRIORITY_PARALLAX
|
priority = FIRE_PRIORITY_PARALLAX
|
||||||
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
||||||
var/list/currentrun
|
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)
|
/datum/controller/subsystem/parallax/fire(resumed = 0)
|
||||||
if (!resumed)
|
if (!resumed)
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 160 KiB |
Reference in New Issue
Block a user