mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2025-12-19 14:51:27 +00:00
* no more spaces * Matthew 10:22 * fixes * dgamerl review * Update code/modules/hydroponics/plant_genes.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * Update code/modules/mob/living/simple_animal/bot/ed209bot.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/mob/mob.dm * Update code/modules/pda/PDA.dm Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * fuck * bah * Update tools/ci/check_grep2.py Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com> * oops * guh --------- Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
55 lines
1.8 KiB
Plaintext
55 lines
1.8 KiB
Plaintext
SUBSYSTEM_DEF(parallax)
|
|
name = "Parallax"
|
|
wait = 2
|
|
flags = SS_POST_FIRE_TIMING | SS_BACKGROUND | SS_NO_INIT
|
|
priority = FIRE_PRIORITY_PARALLAX
|
|
runlevels = RUNLEVEL_LOBBY | RUNLEVELS_DEFAULT
|
|
offline_implications = "Space parallax will no longer move around. No immediate action is needed."
|
|
cpu_display = SS_CPUDISPLAY_HIGH
|
|
var/list/currentrun
|
|
var/planet_x_offset = 128
|
|
var/planet_y_offset = 128
|
|
var/random_layer
|
|
var/random_parallax_color
|
|
|
|
|
|
//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)
|
|
|
|
|
|
/datum/controller/subsystem/parallax/fire(resumed = 0)
|
|
if(!resumed)
|
|
src.currentrun = GLOB.clients.Copy()
|
|
|
|
//cache for sanic speed (lists are references anyways)
|
|
var/list/currentrun = src.currentrun
|
|
|
|
while(length(currentrun))
|
|
var/client/C = currentrun[currentrun.len]
|
|
currentrun.len--
|
|
if(!C || !C.eye)
|
|
if(MC_TICK_CHECK)
|
|
return
|
|
continue
|
|
var/atom/movable/A = C.eye
|
|
if(!istype(A))
|
|
continue
|
|
for(A; isatom(A.loc) && !isturf(A.loc); A = A.loc);
|
|
|
|
if(A != C.movingmob)
|
|
if(C.movingmob != null && C.movingmob.client_mobs_in_contents)
|
|
C.movingmob.client_mobs_in_contents -= C.mob
|
|
UNSETEMPTY(C.movingmob.client_mobs_in_contents)
|
|
LAZYINITLIST(A.client_mobs_in_contents)
|
|
A.client_mobs_in_contents += C.mob
|
|
C.movingmob = A
|
|
if(MC_TICK_CHECK)
|
|
return
|
|
currentrun = null
|