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:
Qustinnus
2018-03-16 19:30:13 +01:00
committed by yogstation13-bot
parent 6773bd39ba
commit 2c3e250fde
3 changed files with 43 additions and 14 deletions

View File

@@ -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