Merge branch 'master' of https://github.com/PolarisSS13/Polaris into aro-sync-04252018

# Conflicts:
#	README.md
#	code/game/jobs/job/job.dm
#	code/modules/client/preference_setup/loadout/loadout_utility.dm
#	code/modules/mob/living/carbon/human/examine.dm
#	code/modules/mob/living/carbon/human/npcs.dm
#	code/modules/mob/living/carbon/human/species/station/prometheans.dm
#	html/changelogs/.all_changelog.yml
#	maps/RandomZLevels/Academy.dmm
#	maps/RandomZLevels/beach.dmm
#	maps/RandomZLevels/blackmarketpackers.dmm
#	maps/RandomZLevels/challenge.dmm
#	maps/RandomZLevels/example.dmm
#	maps/RandomZLevels/jungle.dmm
#	maps/RandomZLevels/listeningpost.dmm
#	maps/RandomZLevels/spacebattle.dmm
#	maps/RandomZLevels/stationCollision.dmm
#	maps/RandomZLevels/wildwest.dmm
#	maps/RandomZLevels/zresearchlabs.dmm
#	maps/northern_star/polaris-1.dmm
#	maps/southern_cross/southern_cross-1.dmm
#	maps/southern_cross/southern_cross-3.dmm
#	maps/southern_cross/southern_cross-6.dmm
#	maps/southern_cross/southern_cross-7.dmm
#	maps/submaps/surface_submaps/mountains/CrashedMedShuttle1.dmm
#	maps/submaps/surface_submaps/plains/Boathouse.dmm
#	maps/submaps/surface_submaps/wilderness/Blackshuttledown.dmm
#	maps/submaps/surface_submaps/wilderness/Boombase.dmm
#	maps/submaps/surface_submaps/wilderness/DJOutpost1.dmm
#	maps/submaps/surface_submaps/wilderness/DecoupledEngine.dmm
#	maps/submaps/surface_submaps/wilderness/Drugden.dmm
#	maps/submaps/surface_submaps/wilderness/Rockybase.dmm
#	maps/submaps/surface_submaps/wilderness/Shack1.dmm
#	maps/virgo/virgo-6.dmm
#	vorestation.dme
This commit is contained in:
Arokha Sieyes
2018-04-25 17:23:33 -04:00
123 changed files with 13004 additions and 82912 deletions

View File

@@ -61,14 +61,40 @@ var/datum/controller/process/planet/planet_controller = null
//Sun light needs changing
if(P.needs_work & PLANET_PROCESS_SUN)
P.needs_work &= ~PLANET_PROCESS_SUN
//Redraw sun overlay
var/new_range = P.sun["range"]
// Remove old value from corners
var/list/sunlit_corners = P.sunlit_corners
var/old_lum_r = -P.sun["lum_r"]
var/old_lum_g = -P.sun["lum_g"]
var/old_lum_b = -P.sun["lum_b"]
if(old_lum_r || old_lum_g || old_lum_b)
for(var/C in P.sunlit_corners)
var/datum/lighting_corner/LC = C
LC.update_lumcount(old_lum_r, old_lum_g, old_lum_b)
SCHECK
sunlit_corners.Cut()
// Calculate new values to apply
var/new_brightness = P.sun["brightness"]
var/new_color = P.sun["color"]
for(var/T in P.planet_floors)
var/turf/simulated/turf = T
turf.set_light(new_range, new_brightness, new_color)
var/lum_r = new_brightness * GetRedPart (new_color) / 255
var/lum_g = new_brightness * GetGreenPart(new_color) / 255
var/lum_b = new_brightness * GetBluePart (new_color) / 255
var/static/update_gen = -1 // Used to prevent double-processing corners. Otherwise would happen when looping over adjacent turfs.
for(var/I in P.planet_floors)
var/turf/simulated/T = I
if(!T.lighting_corners_initialised)
T.generate_missing_corners()
for(var/C in T.get_corners())
var/datum/lighting_corner/LC = C
if(LC.update_gen != update_gen && LC.active)
sunlit_corners += LC
LC.update_gen = update_gen
LC.update_lumcount(lum_r, lum_g, lum_b)
SCHECK
update_gen--
P.sun["lum_r"] = lum_r
P.sun["lum_g"] = lum_g
P.sun["lum_b"] = lum_b
//Temperature needs updating
if(P.needs_work & PLANET_PROCESS_TEMP)

View File

@@ -385,7 +385,7 @@ var/datum/controller/master/Master = new()
if (SS_flags & SS_NO_FIRE)
subsystemstocheck -= SS
continue
if (!(SS_flags & SS_TICKER) && (SS_flags & SS_KEEP_TIMING) && SS.last_fire + (SS.wait * 0.75) > world.time)
if ((SS_flags & (SS_TICKER|SS_KEEP_TIMING)) == SS_KEEP_TIMING && SS.last_fire + (SS.wait * 0.75) > world.time)
continue
SS.enqueue()
. = 1
@@ -428,7 +428,7 @@ var/datum/controller/master/Master = new()
// in those cases, so we just let them run)
if (queue_node_flags & SS_NO_TICK_CHECK)
if (queue_node.tick_usage > TICK_LIMIT_RUNNING - TICK_USAGE && ran_non_ticker)
queue_node.queued_priority += queue_priority_count * 0.10
queue_node.queued_priority += queue_priority_count * 0.1
queue_priority_count -= queue_node_priority
queue_priority_count += queue_node.queued_priority
current_tick_budget -= queue_node_priority
@@ -446,26 +446,32 @@ var/datum/controller/master/Master = new()
else
tick_precentage = tick_remaining
current_ticklimit = TICK_USAGE + tick_precentage
// Reduce tick allocation for subsystems that overran on their last tick.
tick_precentage = max(tick_precentage*0.5, tick_precentage-queue_node.tick_overrun)
current_ticklimit = round(TICK_USAGE + tick_precentage)
if (!(queue_node_flags & SS_TICKER))
ran_non_ticker = TRUE
ran = TRUE
tick_usage = TICK_USAGE
queue_node_paused = (queue_node.state == SS_PAUSED || queue_node.state == SS_PAUSING)
last_type_processed = queue_node
queue_node.state = SS_RUNNING
tick_usage = TICK_USAGE
var/state = queue_node.ignite(queue_node_paused)
tick_usage = TICK_USAGE - tick_usage
if (state == SS_RUNNING)
state = SS_IDLE
current_tick_budget -= queue_node_priority
tick_usage = TICK_USAGE - tick_usage
if (tick_usage < 0)
tick_usage = 0
queue_node.tick_overrun = max(0, MC_AVG_FAST_UP_SLOW_DOWN(queue_node.tick_overrun, tick_usage-tick_precentage))
queue_node.state = state
if (state == SS_PAUSED)
@@ -494,11 +500,11 @@ var/datum/controller/master/Master = new()
if (queue_node_flags & SS_TICKER)
queue_node.next_fire = world.time + (world.tick_lag * queue_node.wait)
else if (queue_node_flags & SS_POST_FIRE_TIMING)
queue_node.next_fire = world.time + queue_node.wait
queue_node.next_fire = world.time + queue_node.wait + (world.tick_lag * (queue_node.tick_overrun/100))
else if (queue_node_flags & SS_KEEP_TIMING)
queue_node.next_fire += queue_node.wait
else
queue_node.next_fire = queue_node.queued_time + queue_node.wait
queue_node.next_fire = queue_node.queued_time + queue_node.wait + (world.tick_lag * (queue_node.tick_overrun/100))
queue_node.queued_time = 0

View File

@@ -1,9 +1,9 @@
/datum/controller/subsystem
// Metadata; you should define these.
name = "fire coderbus" //name of the subsystem
var/init_order = 0 //order of initialization. Higher numbers are initialized first, lower numbers later. Can be decimal and negative values.
var/init_order = INIT_ORDER_DEFAULT //order of initialization. Higher numbers are initialized first, lower numbers later. Can be decimal and negative values.
var/wait = 20 //time to wait (in deciseconds) between each call to fire(). Must be a positive integer.
var/priority = 50 //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep
var/priority = FIRE_PRIORITY_DEFAULT //When mutiple subsystems need to run in the same tick, higher priority subsystems will run first and be given a higher share of the tick before MC_TICK_CHECK triggers a sleep
var/flags = 0 //see MC.dm in __DEFINES Most flags must be set on world start to take full effect. (You can also restart the mc to force them to process again)
var/runlevels = RUNLEVELS_DEFAULT //points of the game at which the SS can fire
@@ -17,6 +17,7 @@
var/next_fire = 0 //scheduled world.time for next fire()
var/cost = 0 //average time to execute
var/tick_usage = 0 //average tick usage
var/tick_overrun = 0 //average tick overrun
var/state = SS_IDLE //tracks the current state of the ss, running, paused, etc.
var/paused_ticks = 0 //ticks this ss is taking to run right now.
var/paused_tick_usage //total tick_usage of all of our runs while pausing this run
@@ -167,7 +168,7 @@
if(can_fire && !(SS_NO_FIRE & flags))
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%|[round(ticks,0.1)]\t[msg]"
msg = "[round(cost,1)]ms|[round(tick_usage,1)]%([round(tick_overrun,1)]%)|[round(ticks,0.1)]\t[msg]"
else
msg = "OFFLINE\t[msg]"

View File

@@ -9,7 +9,7 @@
SUBSYSTEM_DEF(air)
name = "Air"
init_order = INIT_ORDER_AIR
priority = 35
priority = FIRE_PRIORITY_AIR
wait = 2 SECONDS // seconds (We probably can speed this up actually)
flags = SS_BACKGROUND // TODO - Should this really be background? It might be important.
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME

View File

@@ -14,7 +14,7 @@ SUBSYSTEM_DEF(airflow)
wait = 2
flags = SS_NO_INIT
runlevels = RUNLEVEL_GAME | RUNLEVEL_POSTGAME
priority = 30
priority = FIRE_PRIORITY_AIRFLOW
var/list/processing = list()
var/list/currentrun = list()

View File

@@ -3,7 +3,7 @@
//
SUBSYSTEM_DEF(garbage)
name = "Garbage"
priority = 15
priority = FIRE_PRIORITY_GARBAGE
wait = 2 SECONDS
flags = SS_POST_FIRE_TIMING|SS_BACKGROUND|SS_NO_INIT
runlevels = RUNLEVELS_DEFAULT | RUNLEVEL_LOBBY

View File

@@ -12,7 +12,7 @@
SUBSYSTEM_DEF(machines)
name = "Machines"
priority = 100
priority = FIRE_PRIORITY_MACHINES
init_order = INIT_ORDER_MACHINES
flags = SS_KEEP_TIMING
runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME

View File

@@ -1,6 +1,6 @@
SUBSYSTEM_DEF(orbit)
name = "Orbits"
priority = 8 // FIRE_PRIORITY_ORBIT
priority = FIRE_PRIORITY_ORBIT
wait = 2
flags = SS_NO_INIT|SS_TICKER

View File

@@ -8,7 +8,7 @@ var/global/datum/controller/subsystem/shuttles/shuttle_controller
SUBSYSTEM_DEF(shuttles)
name = "Shuttles"
wait = 2 SECONDS
priority = 5
priority = FIRE_PRIORITY_SHUTTLES
init_order = INIT_ORDER_SHUTTLES
flags = SS_KEEP_TIMING|SS_NO_TICK_CHECK
runlevels = RUNLEVEL_GAME|RUNLEVEL_POSTGAME