@@ -18,10 +18,6 @@
if("Failsafe")
new /datum/controller/failsafe()
feedback_add_details("admin_verb","RFailsafe")
if("Lighting")
new /datum/controller/lighting()
lighting_controller.process()
feedback_add_details("admin_verb","RLighting")
if("Supply Shuttle")
supply_shuttle.process()
feedback_add_details("admin_verb","RSupply")
@@ -35,7 +31,7 @@
return


/client/proc/debug_controller(controller in list("Air", "Cameras", "Configuration", "Emergency Shuttle", "failsafe", "Garbage", "Jobs", "lighting", "master", "pAI", "Radio", "Scheduler", "Sun", "Supply Shuttle", "Ticker"))
/client/proc/debug_controller(controller in list("Air", "Cameras", "Configuration", "Emergency Shuttle", "failsafe", "Garbage", "Jobs", "master", "pAI", "Radio", "Scheduler", "Sun", "Supply Shuttle", "Ticker"))
set category = "Debug"
set name = "debug controller"
set desc = "debug the various periodic loop controllers for the game (be careful!)."
@@ -54,9 +50,6 @@
if("Ticker")
debug_variables(ticker)
feedback_add_details("admin_verb","DTicker")
if ("lighting")
debug_variables(lighting_controller)
feedback_add_details("admin_verb", "dlighting")
if("Air")
debug_variables(air_master)
feedback_add_details("admin_verb","DAir")
@@ -28,7 +28,7 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
icon_state = "unknown"
layer = 10
mouse_opacity = 0
invisibility = INVISIBILITY_LIGHTING
luminosity = 0
var/lightswitch = 1

var/eject = null
@@ -50,9 +50,6 @@ NOTE: there are two lists of areas in the end of this file: centcom and station
var/has_gravity = 1

var/no_air = null
var/area/master // master area used for power calcluations
// (original area before splitting due to sd_DAL)
var/list/related // the other areas of the same type as this
// var/list/lights // list of all lights on this area
var/list/all_doors = list() //Added by Strumpetplaya - Alarm Change - Contains a list of doors adjacent to this area

@@ -146,10 +143,9 @@ proc/process_adminbus_teleport_locs()
//place to another. Look at escape shuttle for example.
//All shuttles show now be under shuttle since we have smooth-wall code.

/area/shuttle //DO NOT TURN THE lighting_use_dynamic STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
/area/shuttle
requires_power = 0
luminosity = 1
lighting_use_dynamic = 0
lighting_use_dynamic = 0 //Lighting STILL disabled, even with the new bay engine, because lighting doesn't play nice with our shuttles, might just be our shuttle code, or the small changes in the lighting engine we have from bay.

/area/shuttle/arrival
name = "\improper Arrival Shuttle"
@@ -250,15 +246,11 @@ proc/process_adminbus_teleport_locs()
icon_state = "shuttle"
name = "\improper Alien Shuttle Base"
requires_power = 1
luminosity = 0
lighting_use_dynamic = 1

/area/shuttle/alien/mine
icon_state = "shuttle"
name = "\improper Alien Shuttle Mine"
requires_power = 1
luminosity = 0
lighting_use_dynamic = 1

/area/shuttle/prison/
name = "\improper Prison Shuttle"
@@ -337,8 +329,6 @@ proc/process_adminbus_teleport_locs()
name = "\improper Vox Skipjack"
icon_state = "yellow"
requires_power = 0
lighting_use_dynamic = 0
luminosity=1

/area/shuttle/salvage
name = "\improper Salvage Ship"
@@ -459,7 +449,6 @@ proc/process_adminbus_teleport_locs()
name = "start area"
icon_state = "start"
requires_power = 0
luminosity = 1
lighting_use_dynamic = 0
has_gravity = 1

@@ -476,6 +465,7 @@ proc/process_adminbus_teleport_locs()
name = "\improper Centcom"
icon_state = "centcom"
requires_power = 0
lighting_use_dynamic = 0

/area/centcom/control
name = "\improper Centcom Control"
@@ -513,6 +503,7 @@ proc/process_adminbus_teleport_locs()
name = "\improper Syndicate Mothership"
icon_state = "syndie-ship"
requires_power = 0
lighting_use_dynamic = 0

/area/syndicate_mothership/control
name = "\improper Syndicate Control Room"
@@ -1053,7 +1044,6 @@ proc/process_adminbus_teleport_locs()
/area/holodeck
name = "\improper Holodeck"
icon_state = "Holodeck"
luminosity = 1
lighting_use_dynamic = 0

/area/holodeck/alphadeck
@@ -1187,7 +1177,6 @@ proc/process_adminbus_teleport_locs()

/area/solar
requires_power = 0
luminosity = 1
lighting_use_dynamic = 0

/area/solar/fport
@@ -1888,25 +1877,21 @@ proc/process_adminbus_teleport_locs()
/area/turret_protected/AIsatextFP
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
lighting_use_dynamic = 0

/area/turret_protected/AIsatextFS
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
lighting_use_dynamic = 0

/area/turret_protected/AIsatextAS
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
lighting_use_dynamic = 0

/area/turret_protected/AIsatextAP
name = "\improper AI Sat Ext"
icon_state = "storage"
luminosity = 1
lighting_use_dynamic = 0

/area/turret_protected/NewAIMain
@@ -2061,31 +2046,26 @@ proc/process_adminbus_teleport_locs()
/area/awaymission/wwmines
name = "\improper Wild West Mines"
icon_state = "away1"
luminosity = 1
requires_power = 0

/area/awaymission/wwgov
name = "\improper Wild West Mansion"
icon_state = "away2"
luminosity = 1
requires_power = 0

/area/awaymission/wwrefine
name = "\improper Wild West Refinery"
icon_state = "away3"
luminosity = 1
requires_power = 0

/area/awaymission/wwvault
name = "\improper Wild West Vault"
icon_state = "away3"
luminosity = 0

/area/awaymission/wwvaultdoors
name = "\improper Wild West Vault Doors" // this is to keep the vault area being entirely lit because of requires_power
icon_state = "away2"
requires_power = 0
luminosity = 0

/area/awaymission/desert
name = "Mars"
@@ -2143,7 +2123,6 @@ proc/process_adminbus_teleport_locs()
/area/awaymission/beach
name = "Beach"
icon_state = "null"
luminosity = 1
lighting_use_dynamic = 0
requires_power = 0
var/sound/mysound = null
@@ -2269,7 +2248,6 @@ var/list/the_station_areas = list (
/area/beach/
name = "The metaclub's private beach"
icon_state = "null"
luminosity = 1
lighting_use_dynamic = 0
requires_power = 0
var/sound/mysound = null
@@ -10,9 +10,7 @@
/area/New()
icon_state = ""
layer = 10
master = src //moved outside the spawn(1) to avoid runtimes in lighting.dm when it references loc.loc.master ~Carn
uid = ++global_uid
related = list(src)
areas |= src

if(type == /area) // override defaults for space. TODO: make space areas of type /area/space rather than /area
@@ -25,25 +23,18 @@
// lighting_state = 4
//has_gravity = 0 // Space has gravity. Because.. because.

if(requires_power)
luminosity = 0
else
if(!requires_power)
power_light = 0 //rastaf0
power_equip = 0 //rastaf0
power_environ = 0 //rastaf0
luminosity = 1
lighting_use_dynamic = 0

..()

// spawn(15)
power_change() // all machines set to current power level, also updates lighting icon
InitializeLighting()

/area/Destroy()
..()
for(var/area/A in src.related)
A.related -= src
areaapc = null

/*
@@ -54,18 +45,14 @@
* If you want to find machines, mobs, etc, in the same logical area,
* you will need to check all the related areas.
* This returns a master contents list to assist in that.
* NOTE: Due to a new lighting engine this is now deprecated, but we're keeping this because I can't be bothered to relace everything that references this.
*/
/proc/area_contents(const/area/A)
//writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/area_contents() called tick#: [world.time]")
if (!isarea(A))
return

var/list/contents = list()

for(var/area/LSA in A.related)
contents |= LSA.contents

return contents
return A.contents

/area/proc/poweralert(var/state, var/obj/source as obj)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/poweralert() called tick#: [world.time]")
@@ -74,21 +61,20 @@
poweralm = state
if(istype(source)) //Only report power alarms on the z-level where the source is located.
var/list/cameras = list()
for (var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
cameras += C
if(state == 1)
C.network.Remove("Power Alarms")
else
C.network.Add("Power Alarms")
for(var/obj/machinery/camera/C in src)
cameras += C
if(state == 1)
C.network.Remove("Power Alarms")
else
C.network.Add("Power Alarms")
for (var/mob/living/silicon/aiPlayer in player_list)
if(aiPlayer.z == source.z)
if (state == 1)
aiPlayer.cancelAlarm("Power", src, source)
else
aiPlayer.triggerAlarm("Power", src, cameras, source)
for(var/obj/machinery/computer/station_alert/a in machines)
if(master in (a.covered_areas))
if(src in (a.covered_areas))
if(state == 1)
a.cancelAlarm("Power", src, source)
else
@@ -109,16 +95,15 @@
var/danger_level = 0

// Determine what the highest DL reported by air alarms is
for (var/area/RA in related)
for(var/obj/machinery/alarm/AA in RA)
if((AA.stat & (NOPOWER|BROKEN)) || AA.shorted || AA.buildstage != 2)
continue
var/reported_danger_level=AA.local_danger_level
if(AA.alarmActivated)
reported_danger_level=2
if(reported_danger_level>danger_level)
danger_level=reported_danger_level
//testing("Danger level at [AA.name]: [AA.local_danger_level] (reported [reported_danger_level])")
for(var/obj/machinery/alarm/AA in src)
if((AA.stat & (NOPOWER|BROKEN)) || AA.shorted || AA.buildstage != 2)
continue
var/reported_danger_level=AA.local_danger_level
if(AA.alarmActivated)
reported_danger_level=2
if(reported_danger_level>danger_level)
danger_level=reported_danger_level
//testing("Danger level at [AA.name]: [AA.local_danger_level] (reported [reported_danger_level])")

//testing("Danger level decided upon in [name]: [danger_level] (from [atmosalm])")

@@ -127,27 +112,25 @@
// Going to danger level 2 from something else
if (danger_level == 2)
var/list/cameras = list()
for(var/area/RA in related)
//updateicon()
for(var/obj/machinery/camera/C in RA)
cameras += C
C.network.Add("Atmosphere Alarms")
//updateicon()
for(var/obj/machinery/camera/C in src)
cameras += C
C.network.Add("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.triggerAlarm("Atmosphere", src, cameras, src)
for(var/obj/machinery/computer/station_alert/a in machines)
if(master in (a.covered_areas))
if(src in (a.covered_areas))
a.triggerAlarm("Atmosphere", src, cameras, src)
door_alerts |= DOORALERT_ATMOS
UpdateFirelocks()
// Dropping from danger level 2.
else if (atmosalm == 2)
for(var/area/RA in related)
for(var/obj/machinery/camera/C in RA)
C.network.Remove("Atmosphere Alarms")
for(var/obj/machinery/camera/C in src)
C.network.Remove("Atmosphere Alarms")
for(var/mob/living/silicon/aiPlayer in player_list)
aiPlayer.cancelAlarm("Atmosphere", src, src)
for(var/obj/machinery/computer/station_alert/a in machines)
if(master in (a.covered_areas))
if(src in (a.covered_areas))
a.cancelAlarm("Atmosphere", src, src)
door_alerts &= ~DOORALERT_ATMOS
UpdateFirelocks()
@@ -163,15 +146,14 @@
var/danger_level = 0

// Determine what the highest DL reported by air alarms is
for (var/area/RA in related)
for(var/obj/machinery/alarm/AA in RA)
if((AA.stat & (NOPOWER|BROKEN)) || AA.shorted || AA.buildstage != 2)
continue
var/reported_danger_level=AA.local_danger_level
if(AA.alarmActivated)
reported_danger_level=2
if(reported_danger_level>danger_level)
danger_level=reported_danger_level
for(var/obj/machinery/alarm/AA in src)
if((AA.stat & (NOPOWER|BROKEN)) || AA.shorted || AA.buildstage != 2)
continue
var/reported_danger_level=AA.local_danger_level
if(AA.alarmActivated)
reported_danger_level=2
if(reported_danger_level>danger_level)
danger_level=reported_danger_level

if (danger_level == 2)
a.triggerAlarm("Atmosphere", src, null, src)
@@ -223,14 +205,13 @@
door_alerts |= DOORALERT_FIRE
UpdateFirelocks()
var/list/cameras = list()
for(var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
cameras.Add(C)
C.network.Add("Fire Alarms")
for (var/obj/machinery/camera/C in src)
cameras.Add(C)
C.network.Add("Fire Alarms")
for (var/mob/living/silicon/ai/aiPlayer in player_list)
aiPlayer.triggerAlarm("Fire", src, cameras, src)
for (var/obj/machinery/computer/station_alert/a in machines)
if(master in (a.covered_areas))
if(src in (a.covered_areas))
a.triggerAlarm("Fire", src, cameras, src)

/area/proc/send_firealert(var/obj/machinery/computer/station_alert/a)//sending alerts to newly built Station Alert Computers.
@@ -244,13 +225,12 @@
fire = 0
mouse_opacity = 0
updateicon()
for(var/area/RA in related)
for (var/obj/machinery/camera/C in RA)
C.network.Remove("Fire Alarms")
for (var/obj/machinery/camera/C in src)
C.network.Remove("Fire Alarms")
for (var/mob/living/silicon/ai/aiPlayer in player_list)
aiPlayer.cancelAlarm("Fire", src, src)
for (var/obj/machinery/computer/station_alert/a in machines)
if(master in (a.covered_areas))
if(src in (a.covered_areas))
a.cancelAlarm("Fire", src, src)
door_alerts &= ~DOORALERT_FIRE
UpdateFirelocks()
@@ -327,12 +307,6 @@
// new lighting behaviour with obj lights
icon_state = null

// We're master, Update children.
for(var/area/A in related)
if(A && A!=src)
// Propogate
A.icon_state=icon_state


/*
#define EQUIP 1
@@ -344,17 +318,17 @@

//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/powered() called tick#: [world.time]")

if(!master.requires_power)
if(!requires_power)
return 1
if(master.always_unpowered)
if(always_unpowered)
return 0
switch(chan)
if(EQUIP)
return master.power_equip
return power_equip
if(LIGHT)
return master.power_light
return power_light
if(ENVIRON)
return master.power_environ
return power_environ

return 0

@@ -363,29 +337,28 @@
*/
/area/proc/power_change()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/power_change() called tick#: [world.time]")
for(var/area/RA in related)
for(var/obj/machinery/M in RA) // for each machine in the area
M.power_change() // reverify power status (to update icons etc.)
if (fire || eject || party)
RA.updateicon()
for(var/obj/machinery/M in src) // for each machine in the area
M.power_change() // reverify power status (to update icons etc.)
if (fire || eject || party)
updateicon()

/area/proc/usage(const/chan)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/usage() called tick#: [world.time]")
switch (chan)
if (LIGHT)
return master.used_light
return used_light
if (EQUIP)
return master.used_equip
return used_equip
if (ENVIRON)
return master.used_environ
return used_environ
if (TOTAL)
return master.used_light + master.used_equip + master.used_environ
return used_light + used_equip + used_environ
if(STATIC_EQUIP)
return master.static_equip
return static_equip
if(STATIC_LIGHT)
return master.static_light
return static_light
if(STATIC_ENVIRON)
return master.static_environ
return static_environ
return 0

/area/proc/addStaticPower(value, powerchannel)
@@ -399,36 +372,36 @@
static_environ += value

/area/proc/clear_usage()
master.used_equip = 0
master.used_light = 0
master.used_environ = 0
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/clear_usage() called tick#: [world.time]")
used_equip = 0
used_light = 0
used_environ = 0

/area/proc/use_power(const/amount, const/chan)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/use_power() called tick#: [world.time]")
switch (chan)
if(EQUIP)
master.used_equip += amount
used_equip += amount
if(LIGHT)
master.used_light += amount
used_light += amount
if(ENVIRON)
master.used_environ += amount
used_environ += amount

/area/Entered(atom/movable/Obj, atom/OldLoc)
var/area/oldAreaMaster = Obj.areaMaster
Obj.areaMaster = master

var/area/oldArea = Obj.areaMaster
Obj.areaMaster = src
if (!ismob(Obj))
return

var/mob/M = Obj

// /vg/ - EVENTS!
CallHook("MobAreaChange", list("mob" = M, "new" = Obj.areaMaster, "old" = oldAreaMaster))
CallHook("MobAreaChange", list("mob" = M, "new" = Obj.areaMaster, "old" = oldArea))

// Being ready when you change areas gives you a chance to avoid falling all together.
if(!oldAreaMaster || !M.areaMaster)
if(!oldArea || !M.areaMaster)
thunk(M)
else if (!oldAreaMaster.has_gravity && M.areaMaster.has_gravity && M.m_intent == "run")
else if (!oldArea.has_gravity && M.areaMaster.has_gravity && M.m_intent == "run")
thunk(M)

if (isnull(M.client))
@@ -478,12 +451,11 @@

A.has_gravity = gravitystate

for(var/area/SubA in A.related)
SubA.has_gravity = gravitystate
A.has_gravity = gravitystate

if(gravitystate)
for(var/mob/living/carbon/human/M in SubA)
thunk(M)
if(gravitystate)
for(var/mob/living/carbon/human/M in A)
thunk(M)

/area/proc/thunk(mob)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/thunk() called tick#: [world.time]")
@@ -506,11 +478,9 @@

/area/proc/set_apc(var/obj/machinery/power/apc/apctoset)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/set_apc() called tick#: [world.time]")
for(var/area/A in src.related)
A.areaapc = apctoset
areaapc = apctoset

/area/proc/remove_apc(var/obj/machinery/power/apc/apctoremove)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/area/proc/remove_apc() called tick#: [world.time]")
for(var/area/A in src.related)
if(A.areaapc == apctoremove)
A.areaapc = null
if(areaapc == apctoremove)
areaapc = null
@@ -20,7 +20,6 @@ var/global/list/ghdel_profiling = list()
var/throwpass = 0
var/germ_level = 0 // The higher the germ level, the more germ on the atom.
var/pressure_resistance = ONE_ATMOSPHERE
var/simulated = 1 //filter for actions - used by lighting overlays

///Chemistry.
var/datum/reagents/reagents = null
@@ -118,8 +117,6 @@ var/global/list/ghdel_profiling = list()
..()

/atom/Destroy()
SetOpacity(0)

if(reagents)
reagents.Destroy()
reagents = null
@@ -32,11 +32,6 @@
getFromPool(/mob/virtualhearer, src)

/atom/movable/Destroy()
if(opacity)
if(isturf(loc))
if(loc:lighting_lumcount > 1)
UpdateAffectingLights()

if(flags & HEAR && !ismob(src))
for(var/mob/virtualhearer/VH in virtualhearers)
if(VH.attached == src)
@@ -51,13 +51,10 @@
var/obj/item/weapon/reagent_containers/glass/beaker = null
machine_flags = SCREWTOGGLE | CROWDESTROY

l_color = "#7BF9FF"
power_change()
..()
if(!(stat & (BROKEN|NOPOWER)) && src.occupant)
SetLuminosity(2)
else
SetLuminosity(0)
light_color = LIGHT_COLOR_CYAN
use_auto_lights = 1
light_range_on = 3
light_power_on = 2

/obj/machinery/dna_scannernew/New()
. = ..()
@@ -351,7 +348,7 @@
// Fix for #274 (Mash create block injector without answering dialog to make unlimited injectors) - N3X.
var/waiting_for_user_input = 0

l_color = "#0000FF"
light_color = LIGHT_COLOR_BLUE

/obj/machinery/computer/scan_consolenew/attackby(obj/O as obj, mob/user as mob)
..()
@@ -383,17 +380,6 @@
if(prob(75))
qdel(src)

/obj/machinery/computer/scan_consolenew/power_change()
if(stat & BROKEN)
icon_state = "broken"
else if(powered())
icon_state = initial(icon_state)
stat &= ~NOPOWER
else
spawn(rand(0, 15))
src.icon_state = "c_unpowered"
stat |= NOPOWER

/obj/machinery/computer/scan_consolenew/New()
..()
for(var/i=0;i<3;i++)
@@ -22,8 +22,8 @@
desc = "A floating crystal that hums with an unearthly energy"
icon_state = "pylon"
var/isbroken = 0
luminosity = 5
l_color = "#3e0000"
light_range = 5
light_color = LIGHT_COLOR_RED
var/obj/item/wepon = null

/obj/structure/cult/pylon/attack_hand(mob/M as mob)
@@ -48,7 +48,7 @@
isbroken = 1
density = 0
icon_state = "pylon-broken"
SetLuminosity(0)
set_light(0)
else
user << "You hit the pylon!"
playsound(get_turf(src), 'sound/effects/Glasshit.ogg', 75, 1)
@@ -68,14 +68,14 @@
isbroken = 0
density = 1
icon_state = "pylon"
SetLuminosity(5)
set_light(5)

/obj/structure/cult/tome
name = "Desk"
desc = "A desk covered in arcane manuscripts and tomes in unknown languages. Looking at the text makes your skin crawl"
icon_state = "tomealtar"
luminosity = 2
l_color = "#3e0000"
light_range = 2
light_color = LIGHT_COLOR_RED

/obj/structure/cult/tome/attackby(obj/item/weapon/W as obj, mob/user as mob)
user.drop_item(W, src.loc)
@@ -113,7 +113,7 @@

/obj/effect/gateway/active
luminosity=5
l_color="#ff0000"
light_color = LIGHT_COLOR_RED
spawnable=list(
/mob/living/simple_animal/hostile/scarybat,
/mob/living/simple_animal/hostile/creature,
@@ -122,7 +122,7 @@

/obj/effect/gateway/active/cult
luminosity=5
l_color="#ff0000"
light_color = LIGHT_COLOR_RED
spawnable=list(
/mob/living/simple_animal/hostile/scarybat/cult,
/mob/living/simple_animal/hostile/creature/cult,
@@ -71,8 +71,7 @@ In short:

/datum/universal_state/hell/proc/AreaSet()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/datum/universal_state/hell/proc/AreaSet() called tick#: [world.time]")
for(var/area/ca in areas)
var/area/A=get_area_master(ca)
for(var/area/A in areas)
if(!istype(A,/area) || A.name=="Space")
continue

@@ -110,8 +109,12 @@ In short:
T.overlays += "hell01"
else
T.underlays += "hell01"
T.update_lumcount(1, 255, 0, 0, 0)
tcheck(85,1)

for(var/atom/movable/lighting_overlay/L in all_lighting_overlays)
L.update_lumcount(0.5, 0, 0)
tcheck(80,1)

/datum/universal_state/hell/proc/MiscSet()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/datum/universal_state/hell/proc/MiscSet() called tick#: [world.time]")
for(var/turf/simulated/floor/T in turfs)
@@ -32,8 +32,8 @@ var/global/list/narsie_list = list()
// Pixel stuff centers Narsie.
pixel_x = -236
pixel_y = -256
luminosity = 1
l_color = "#3e0000"
light_range = 1
light_color = LIGHT_COLOR_RED

current_size = 12
consume_range = 12 // How many tiles out do we eat.
@@ -24,6 +24,7 @@
// Simulates stuff getting broken due to molecular bonds decaying.
var/decay_rate = 0


// Actually decay the turf.
/datum/universal_state/proc/DecayTurf(var/turf/T)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/datum/universal_state/proc/DecayTurf() called tick#: [world.time]")
@@ -45,7 +46,7 @@
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/datum/universal_state/proc/OnShuttleCall() called tick#: [world.time]")
return 1

// Processed per tick
// This gets called by lighting overlay updates, lighting_overlays.dm line #62.
/datum/universal_state/proc/OnTurfTick(var/turf/T)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/datum/universal_state/proc/OnTurfTick() called tick#: [world.time]")
if(decay_rate && prob(decay_rate))
@@ -7,21 +7,22 @@
icon_state = "bluespace"

//luminosity = 5
//l_color="#0066FF"
layer = LIGHTING_LAYER+1
//light_color="#0066FF"
layer = LIGHTING_LAYER + 1

var/spawned=0 // DIR mask
var/next_check=0
var/list/avail_dirs = list(NORTH,SOUTH,EAST,WEST)

dynamic_lighting = 0

/turf/unsimulated/wall/supermatter/New()
..()
processing_objects.Add(src)
next_check = world.time+5 SECONDS
processing_objects |= src
return ..()

/turf/unsimulated/wall/supermatter/Destroy()
processing_objects.Remove(src)
..()
processing_objects -= src
return ..()

/turf/unsimulated/wall/supermatter/process()
// Only check infrequently.
@@ -116,4 +117,4 @@
if(istype(user,/mob/dead/observer))
return

del(user)
qdel(user)
@@ -10,7 +10,7 @@
announce=0
narnar=0

layer=LIGHTING_LAYER+2 // ITS SO BRIGHT
layer = LIGHTING_LAYER + 2 // ITS SO BRIGHT

consume_range = 6

@@ -3,7 +3,7 @@
name = "Supermatter Cascade"
desc = "Unknown harmonance affecting universal substructure, converting nearby matter to supermatter."

decay_rate = 5 // 5% chance of a turf decaying on lighting update/airflow (there's no actual tick for turfs)
decay_rate = 5 // 5% chance of a turf decaying on lighting update (there's no actual tick for turfs). Code that triggers this is lighting_overlays.dm, line #62.

/datum/universal_state/supermatter_cascade/OnShuttleCall(var/mob/user)
if(user)
@@ -16,8 +16,6 @@
T.underlays -= "end01"
else
T.overlays -= "end01"
if(!T.color_lighting_lumcount)
T.update_lumcount(1, 160, 255, 0, 0)

/datum/universal_state/supermatter_cascade/DecayTurf(var/turf/T)
if(istype(T,/turf/simulated/wall))
@@ -151,8 +149,13 @@ The access requirements on the Asteroid Shuttles' consoles have now been revoked
else
if(T.z != map.zCentcomm)
T.underlays += "end01"
T.update_lumcount(1, 160, 255, 0, 0)
tcheck(80,1)

for(var/atom/movable/lighting_overlay/L in all_lighting_overlays)
if(L.z != map.zCentcomm)
L.update_lumcount(0.15, 0.5, 0)
tcheck(80,1)

/datum/universal_state/supermatter_cascade/proc/MiscSet()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/datum/universal_state/supermatter_cascade/proc/MiscSet() called tick#: [world.time]")
for (var/obj/machinery/firealarm/alm in machines)
@@ -201,10 +201,9 @@
for(var/type in typesof(/area/hallway))
var/area/Hallway = locate(type)

for(var/area/Related in Hallway.related)
for(var/turf/simulated/floor/Floor in Related.contents)
if(Floor.contents.len <= 0)
Floors += Floor
for(var/turf/simulated/floor/Floor in Hallway.contents)
if(Floor.contents.len <= 0)
Floors += Floor

if(Floors.len) // pick a floor to spawn at
var/turf/simulated/floor/Floor = pick(Floors)
@@ -7,10 +7,9 @@
var/list/turf/simulated/floor/turfs = list() //list of all the empty floor turfs in the hallway areas
for(var/areapath in typesof(/area/hallway))
var/area/A = locate(areapath)
for(var/area/B in A.related)
for(var/turf/simulated/floor/F in B.contents)
if(!F.contents.len)
turfs += F
for(var/turf/simulated/floor/F in A.contents)
if(!F.contents.len)
turfs += F

if(turfs.len) //Pick a turf to spawn at if we can
var/turf/simulated/floor/T = pick(turfs)
@@ -638,9 +638,10 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha
if(VAMP_MATURE in mind.vampire.powers)
smitetemp -= 1
if(VAMP_SHADOW in mind.vampire.powers)
var/turf/simulated/T = get_turf(src)
if(T.lighting_lumcount < 2)
var/turf/T = get_turf(src)
if((T.get_lumcount() * 10) < 2)
smitetemp -= 1

if(VAMP_UNDYING in mind.vampire.powers)
smitetemp -= 1

@@ -36,8 +36,8 @@
src << "<span class='warning'>Your powers are useless on this holy ground.</span>"
return 0
if(check_holy(src) && !fullpower)
var/turf/simulated/T = get_turf(src)
if(T.lighting_lumcount > 2)
var/turf/T = get_turf(src)
if((T.get_lumcount() * 10) > 2)
src << "<span class='warning'>This ground has been blessed and illuminated, suppressing your abilities.</span>"
return 0
return 1
@@ -349,16 +349,15 @@
alpha = 255
color = "#FFFFFF"
return
var/turf/simulated/T = get_turf(src)

if(!istype(T))
return 0
var/turf/T = get_turf(src)

if(!mind.vampire.iscloaking)
alpha = 255
color = "#FFFFFF"
return 0
if(T.lighting_lumcount <= 2)

if((T.get_lumcount() * 10) <= 2)
alpha = round((255 * 0.15))
if(VAMP_SHADOW in mind.vampire.powers)
color = "#000000"
@@ -494,9 +493,7 @@
if(T.density) continue
if(T.x>world.maxx-outer_tele_radius || T.x<outer_tele_radius) continue //putting them at the edge is dumb
if(T.y>world.maxy-outer_tele_radius || T.y<outer_tele_radius) continue

// LIGHTING CHECK
if(T.lighting_lumcount > max_lum) continue
if((T.get_lumcount() * 10) > max_lum) continue
turfs += T

if(!turfs.len)
@@ -543,15 +540,14 @@
if(!mind || !mind.vampire || !ishuman(src))
mind.vampire.ismenacing = 0
return
var/turf/simulated/T = get_turf(src)

if(!istype(T))
return 0

if(!mind.vampire.ismenacing)
mind.vampire.ismenacing = 0
return 0
if(T.lighting_lumcount > 2)

var/turf/T = get_turf(src)

if(T.get_lumcount() > 2)
mind.vampire.ismenacing = 0
return 0

@@ -160,13 +160,15 @@
/obj/item/weapon/stock_parts/manipulator,
/obj/item/weapon/stock_parts/manipulator
)
l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN
light_range_on = 3
light_power_on = 2
power_change()
..()
if(!(stat & (BROKEN|NOPOWER)) && occupant)
SetLuminosity(2)
set_light(light_range_on, light_power_on)
else
SetLuminosity(0)
set_light(0)

/obj/machinery/sleeper/New()
..()
@@ -278,7 +280,7 @@
if(user.pulling == L)
user.stop_pulling()
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
set_light(light_range_on, light_power_on)
sedativeblock = 1
sleep(SLEEPER_SOPORIFIC_DELAY)
sedativeblock = 0
@@ -327,7 +329,7 @@
for(var/atom/movable/A as mob|obj in src)
A.loc = src.loc
A.blob_act()
del(src)
qdel(src)
return

/obj/machinery/sleeper/crowbarDestroy(mob/user)
@@ -385,7 +387,7 @@
src.add_fingerprint(user)
qdel(G)
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
set_light(light_range_on, light_power_on)
sedativeblock = 1
spawn(SLEEPER_SOPORIFIC_DELAY)
sedativeblock = 0
@@ -504,6 +506,7 @@
return
src.go_out()
add_fingerprint(usr)
set_light(0)
return


@@ -540,9 +543,11 @@
update_icon()

for(var/obj/O in src)
del(O)
qdel(O)
src.add_fingerprint(usr)
if(!(stat & (BROKEN|NOPOWER)))
set_light(light_range_on, light_power_on)
return
return

#undef SLEEPER_SOPORIFIC_DELAY
#undef SLEEPER_SOPORIFIC_DELAY
@@ -22,7 +22,9 @@
var/mob/living/carbon/occupant
var/locked

l_color = "#00FF00"
light_color = LIGHT_COLOR_GREEN
light_range_on = 3
light_power_on = 2

/obj/machinery/bodyscanner/New()
..()
@@ -81,9 +83,9 @@
/obj/machinery/bodyscanner/power_change()
..()
if(!(stat & (BROKEN|NOPOWER)) && src.occupant)
SetLuminosity(2)
set_light(light_range_on, light_power_on)
else
SetLuminosity(0)
set_light(0)

/obj/machinery/bodyscanner/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
if(!ismob(O)) //humans only
@@ -131,6 +133,8 @@
OO.loc = src.loc
//Foreach goto(154)
src.add_fingerprint(user)
if(!(stat & (BROKEN|NOPOWER)))
set_light(light_range_on, light_power_on)
return

/obj/machinery/bodyscanner/MouseDrop(over_object, src_location, var/turf/over_location, src_control, over_control, params)
@@ -203,6 +207,8 @@
for(var/obj/O in src)
qdel(O)
src.add_fingerprint(usr)
if(!(stat & (BROKEN|NOPOWER)))
set_light(light_range_on, light_power_on)
return

/obj/machinery/bodyscanner/proc/go_out(var/exit = loc)
@@ -216,6 +222,7 @@
src.occupant.reset_view()
src.occupant = null
update_icon()
set_light(0)
return

/obj/machinery/bodyscanner/crowbarDestroy(mob/user)
@@ -266,6 +273,8 @@
O.loc = src.loc
src.add_fingerprint(user)
qdel(G)
if(!(stat & (BROKEN|NOPOWER)))
set_light(light_range_on, light_power_on)
return

/obj/machinery/bodyscanner/ex_act(severity)
@@ -94,11 +94,10 @@
/obj/machinery/alarm/proc/apply_preset(var/no_cycle_after=0)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/alarm/proc/apply_preset() called tick#: [world.time]")
// Propogate settings.
for (var/area/A in areaMaster.related)
for (var/obj/machinery/alarm/AA in A)
if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.preset != src.preset)
AA.preset=preset
apply_preset(1) // Only this air alarm should send a cycle.
for (var/obj/machinery/alarm/AA in areaMaster)
if ( !(AA.stat & (NOPOWER|BROKEN)) && !AA.shorted && AA.preset != src.preset)
AA.preset=preset
apply_preset(1) // Only this air alarm should send a cycle.

TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa
TLV["nitrogen"] = list(-1, -1, -1, -1) // Partial pressure, kpa
@@ -300,11 +299,10 @@

/obj/machinery/alarm/proc/elect_master()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/alarm/proc/elect_master() called tick#: [world.time]")
for (var/area/A in areaMaster.related)
for (var/obj/machinery/alarm/AA in A)
if (!(AA.stat & (NOPOWER|BROKEN)))
areaMaster.master_air_alarm = AA
return 1
for (var/obj/machinery/alarm/AA in areaMaster)
if (!(AA.stat & (NOPOWER|BROKEN)))
areaMaster.master_air_alarm = AA
return 1
return 0

/obj/machinery/alarm/proc/get_danger_level(const/current_value, const/list/danger_levels)
@@ -122,7 +122,7 @@
var/list/sensor_information = list()
var/datum/radio_frequency/radio_connection

l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN

/obj/machinery/computer/general_air_control/attack_hand(mob/user)
if(..(user))
@@ -9,13 +9,8 @@

var/range = 25

l_color = "#7BF9FF"
power_change()
..()
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
else
SetLuminosity(0)
light_color = LIGHT_COLOR_CYAN
light_range_on = 2

//Simple variable to prevent me from doing attack_hand in both this and the child computer
var/zone = "This computer is working on a wireless range, the range is currently limited to 25 meters."
@@ -153,14 +148,10 @@
var/turf/T_src = get_turf(src)
if(!T_src.loc) return 0
var/area/A_src = T_src.loc
if (A_src.master)
A_src = A_src.master

var/turf/T_scrub = get_turf(scrubber)
if(!T_scrub.loc) return 0
var/area/A_scrub = T_scrub.loc
if (A_scrub.master)
A_scrub = A_scrub.master

if(A_scrub != A_src)
return 0
@@ -179,7 +170,7 @@
var/turf/T2 = get_turf(scrubber)
if(T2 && T2.loc)
var/area/A2 = T2.loc
if(istype(A2) && A2.master && A2.master == A )
if(istype(A2) && A2 == A )
connectedscrubbers += scrubber
found = 1

@@ -16,7 +16,7 @@
var/max_external_pressure=10000 // 10,000kPa ought to do it.
var/internal_pressure=4500 // Bottleneck

var/light_color = "#FFFFFF"
var/overlay_color = "#FFFFFF"

machine_flags = WRENCHMOVE | FIXED2WORK

@@ -72,7 +72,7 @@
return
if(on)
var/new_icon_state="on"
var/new_color = light_color
var/new_color = overlay_color
if(stat & BROKEN)
new_icon_state="broken"
new_color="#FF0000"
@@ -118,7 +118,7 @@

/obj/machinery/atmospherics/miner/sleeping_agent
name = "\improper N2O Gas Miner"
light_color = "#FFCCCC"
overlay_color = "#FFCCCC"

AddAir()
var/datum/gas/sleeping_agent/trace_gas = new
@@ -127,28 +127,28 @@

/obj/machinery/atmospherics/miner/nitrogen
name = "\improper N2 Gas Miner"
light_color = "#CCFFCC"
overlay_color = "#CCFFCC"

AddAir()
air_contents.nitrogen = internal_pressure*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)

/obj/machinery/atmospherics/miner/oxygen
name = "\improper O2 Gas Miner"
light_color = "#007FFF"
overlay_color = "#007FFF"

AddAir()
air_contents.oxygen = internal_pressure*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)

/obj/machinery/atmospherics/miner/toxins
name = "\improper Plasma Gas Miner"
light_color = "#FF0000"
overlay_color = "#FF0000"

AddAir()
air_contents.toxins = internal_pressure*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)

/obj/machinery/atmospherics/miner/carbon_dioxide
name = "\improper CO2 Gas Miner"
light_color = "#CDCDCD"
overlay_color = "#CDCDCD"

AddAir()
air_contents.carbon_dioxide = internal_pressure*air_contents.volume/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
@@ -157,7 +157,7 @@
/obj/machinery/atmospherics/miner/air
name = "\improper Air Miner"
desc = "You fucking <em>cheater</em>."
light_color = "#70DBDB"
overlay_color = "#70DBDB"

on = 0

@@ -29,7 +29,7 @@

research_flags = NANOTOUCH | TAKESMATIN | HASOUTPUT | IGNORE_CHEMS | HASMAT_OVER

l_color = LIGHT_COLOR_CYAN
light_color = LIGHT_COLOR_CYAN

part_sets = list(
"Tools"=list(
@@ -221,14 +221,10 @@

machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK

l_color = "#7BF9FF"

/obj/machinery/biogenerator/power_change()
..()
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
else
SetLuminosity(0)
light_color = LIGHT_COLOR_CYAN
light_range_on = 3
light_power_on = 2
use_auto_lights = 1

/obj/machinery/biogenerator/on_reagent_change() //When the reagents change, change the icon as well.
update_icon()
@@ -12,14 +12,10 @@
use_power = 1
idle_power_usage = 50

l_color = "#7BF9FF"

power_change()
..()
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
else
SetLuminosity(0)
light_color = LIGHT_COLOR_CYAN
light_range_on = 3
light_power_on = 2
use_auto_lights = 1

var/prints_prosthetics
var/stored_matter = 200
@@ -32,13 +32,13 @@
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/bot/proc/turn_on() called tick#: [world.time]")
if(stat) return 0
on = 1
SetLuminosity(initial(luminosity))
set_light(initial(luminosity))
return 1

/obj/machinery/bot/proc/turn_off()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/bot/proc/turn_off() called tick#: [world.time]")
on = 0
SetLuminosity(0)
set_light(0)

/obj/machinery/bot/proc/explode()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/bot/proc/explode() called tick#: [world.time]")
@@ -58,13 +58,13 @@
/obj/item/weapon/gun/energy/laser/bluetag,\
/obj/item/weapon/gun/energy/laser/redtag,\
/obj/item/weapon/gun/energy/laser/practice)
l_color = "#B40000"
light_color = LIGHT_COLOR_RED
power_change()
..()
if(src.on)
SetLuminosity(2)
set_light(2)
else
SetLuminosity(0)
set_light(0)


/obj/machinery/bot/secbot/beepsky
@@ -99,7 +99,7 @@ var/list/camera_names=list()
network = list()
cameranet.removeCamera(src)
stat |= EMPED
SetLuminosity(0)
set_light(0)
triggerCameraAlarm()
update_icon()
spawn(900)
@@ -9,7 +9,7 @@
var/damaged = 0
var/last_change = 0

l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN

/obj/machinery/computer/HolodeckControl/attack_ai(var/mob/user as mob)
add_hiddenprint(user)
@@ -9,7 +9,7 @@
var/mob/living/carbon/human/victim = null
var/obj/machinery/optable/optable = null

l_color = "#0000FF"
light_color = LIGHT_COLOR_BLUE

/obj/machinery/computer/operating/New()
..()
@@ -6,7 +6,7 @@
var/mob/living/silicon/ai/occupant = null
var/active = 0

l_color = "#CD00CD"
light_color = LIGHT_COLOR_PINK

/obj/machinery/computer/aifixer/New()
..()
@@ -16,7 +16,7 @@
machine_flags = EMAGGABLE | SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK
emag_cost = 0 // because fun

l_color = "#00FF00"
light_color = LIGHT_COLOR_GREEN

var/list/prizes = list( /obj/item/weapon/storage/box/snappops = 2,
/obj/item/toy/cards = 2,
@@ -11,7 +11,7 @@
var/receive_frequency = 1437
var/datum/radio_frequency/radio_connection

l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN


/obj/machinery/computer/atmos_alert/initialize()
@@ -11,7 +11,7 @@
var/list/network = list("SS13")
var/mapping = 0//For the overview file, interesting bit of code.

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

/obj/machinery/computer/security/attack_ai(var/mob/user as mob)
src.add_hiddenprint(user)
@@ -93,7 +93,7 @@
density = 0
circuit = null

l_color = "#000000"
light_color = null

/obj/machinery/computer/security/telescreen/update_icon()
icon_state = initial(icon_state)
@@ -110,14 +110,14 @@
density = 0
circuit = null

l_color = "#000000"
light_color = null

/obj/machinery/computer/security/wooden_tv
name = "Security Cameras"
desc = "An old TV hooked into the stations camera network."
icon_state = "security_det"

l_color = "#000000"
light_color = null

/obj/machinery/computer/security/mining
name = "Outpost Cameras"
@@ -126,11 +126,13 @@
network = list("MINE")
circuit = "/obj/item/weapon/circuitboard/mining"

l_color = "#CD00CD"
light_color = LIGHT_COLOR_PINK

/obj/machinery/computer/security/engineering
name = "Engineering Cameras"
desc = "Used to monitor fires and breaches."
icon_state = "engineeringcameras"
network = list("Power Alarms","Atmosphere Alarms","Fire Alarms")
circuit = "/obj/item/weapon/circuitboard/security/engineering"

light_color = LIGHT_COLOR_YELLOW
@@ -43,7 +43,7 @@
"ERT_medical",
)

l_color = "#0000FF"
light_color = LIGHT_COLOR_BLUE

proc/is_centcom()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\proc/is_centcom() called tick#: [world.time]")
@@ -57,7 +57,7 @@ var/shuttle_call/shuttle_calls[0]
var/stat_msg2
var/display_type="blank"

l_color = "#0000FF"
light_color = LIGHT_COLOR_BLUE

/obj/machinery/computer/communications/Topic(href, href_list)
if(..(href, href_list))
@@ -10,6 +10,10 @@
var/processing = 0
machine_flags = EMAGGABLE | SCREWTOGGLE | WRENCHMOVE | FIXED2WORK | MULTITOOL_MENU

use_auto_lights = 1
light_power_on = 2
light_range_on = 3

/obj/machinery/computer/cultify()
new /obj/structure/cult/tome(loc)
..()
@@ -59,7 +63,6 @@
set_broken()
..()


/obj/machinery/computer/blob_act()
if (prob(75))
for(var/x in verbs)
@@ -78,16 +81,9 @@
else if(stat & NOPOWER)
icon_state = "[initial(icon_state)]0"



/obj/machinery/computer/power_change()
..()
. = ..()
update_icon()
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
else
SetLuminosity(0)


/obj/machinery/computer/proc/set_broken()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/computer/proc/set_broken() called tick#: [world.time]")
@@ -8,7 +8,7 @@
var/mob/living/silicon/ai/current = null
var/opened = 0

l_color = "#FFFFFF"
light_color = "#555555"


verb/AccessInternals()
@@ -140,7 +140,7 @@
circuit = "/obj/item/weapon/circuitboard/borgupload"
var/mob/living/silicon/robot/current = null

l_color = "#FFFFFF"
light_color = "#555555"

proc/announce_law_changes()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\proc/announce_law_changes() called tick#: [world.time]")
@@ -16,7 +16,7 @@
var/temp = null
var/printing = null

l_color = "#0000FF"
light_color = LIGHT_COLOR_BLUE

/obj/machinery/computer/med_data/attack_ai(user as mob)
src.add_hiddenprint(user)
@@ -524,6 +524,6 @@
anchored = 0
density = 0

l_color = "#00FF00"
light_color = LIGHT_COLOR_GREEN


@@ -32,7 +32,7 @@
var/customjob = "Admin"
var/custommessage = "This is a test, please ignore."

l_color = "#50AB00"
light_color = LIGHT_COLOR_GREEN


/obj/machinery/computer/message_monitor/attackby(obj/item/weapon/O as obj, mob/living/user as mob)
@@ -3,7 +3,7 @@
desc = "It can be used to download Apps on your PDA."
icon_state = "pdaterm"
circuit = "/obj/item/weapon/circuitboard/pda_terminal"
l_color = "#993300"
light_color = LIGHT_COLOR_ORANGE

var/obj/item/device/pda/pda_device = null

@@ -17,7 +17,7 @@
var/default_loop = 0
var/default_timings = 0

l_color = "#555555"
light_color = LIGHT_COLOR_CYAN

/obj/machinery/computer/pod/New()
..()
@@ -290,7 +290,7 @@
desc = "The Syndicate operate on a tight budget. Operates external airlocks."
req_access = list(access_syndicate)
circuit = /obj/item/weapon/circuitboard/syndicatedoor
l_color = "#000000"
light_color = null

/obj/machinery/computer/pod/old/syndicate/attack_hand(var/mob/user as mob)
if(!allowed(user))
@@ -13,7 +13,7 @@
var/stop = 0.0
var/screen = 0 // 0 - No Access Denied, 1 - Access allowed

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

attack_ai(var/mob/user as mob)
src.add_hiddenprint(user)
@@ -19,7 +19,7 @@ var/prison_shuttle_timeleft = 0
var/temp = null
var/allowedtocall = 0
var/prison_break = 0

light_color = LIGHT_COLOR_CYAN

attackby(I as obj, user as mob)
if(!..())
@@ -67,7 +67,7 @@ var/prison_shuttle_timeleft = 0
if(..())
return 1

else
else
usr.set_machine(src)

if (href_list["sendtodock"])
@@ -16,7 +16,7 @@
var/stop = 0.0
var/screen = 0 // 0 - Main Menu, 1 - Cyborg Status, 2 - Kill 'em All! -- In text

l_color = "#CD00CD"
light_color = LIGHT_COLOR_PINK


/obj/machinery/computer/robotics/attack_ai(var/mob/user as mob)
@@ -10,7 +10,7 @@
var/moving = 0
var/lastMove = 0

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

/obj/machinery/computer/salvage_ship/New()
curr_location= locate(/area/shuttle/salvage/start)
@@ -22,7 +22,7 @@
var/sortBy = "name"
var/order = 1 // -1 = Descending - 1 = Ascending

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

/obj/machinery/computer/secure_data/attackby(obj/item/O as obj, user as mob)
if(istype(O, /obj/item/weapon/card/id) && !scan)
@@ -603,4 +603,4 @@ What a mess.*/
icon = 'icons/obj/computer.dmi'
icon_state = "messyfiles"

l_color = "#000000"
light_color = null
@@ -5,7 +5,7 @@
var/auth_need = 3.0
var/list/authorized = list( )

l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN

attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob)
if(stat & (BROKEN|NOPOWER)) return
@@ -21,7 +21,7 @@ var/specops_shuttle_timeleft = 0
var/allowedtocall = 0
var/specops_shuttle_timereset = 0

l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN

/proc/specops_return()
//writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/specops_return() called tick#: [world.time]")
@@ -320,8 +320,6 @@ var/specops_shuttle_timeleft = 0

var/area/centcom/specops/special_ops = locate()
if(special_ops)
if(special_ops.master)
special_ops=special_ops.master
special_ops.readyalert()//Trigger alarm for the spec ops area.
specops_shuttle_moving_to_station = 1

@@ -4,7 +4,7 @@
desc = "Used to access the station's automated alert system."
icon_state = "alert:0"
circuit = "/obj/item/weapon/circuitboard/stationalert"
l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN

var/alarms = list("Fire"=list(), "Atmosphere"=list(), "Power"=list())

@@ -4,7 +4,7 @@
icon_state = "store"
circuit = "/obj/item/weapon/circuitboard/merch"

l_color = "#993300"
light_color = LIGHT_COLOR_ORANGE

/obj/item/weapon/circuitboard/merch
name = "\improper Merchandise Computer Circuitboard"
@@ -10,7 +10,7 @@
var/moving = 0
var/lastMove = 0

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

/obj/machinery/computer/syndicate_station/New()
curr_location= locate(/area/syndicate_station/start)
@@ -19,7 +19,7 @@ var/syndicate_elite_shuttle_timeleft = 0
var/hacked = 0
var/allowedtocall = 0

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

/proc/syndicate_elite_process()
//writepanic("[__FILE__].[__LINE__] (no type)([usr ? usr.ckey : ""]) \\/proc/syndicate_elite_process() called tick#: [world.time]")
@@ -240,8 +240,6 @@ var/syndicate_elite_shuttle_timeleft = 0

var/area/syndicate_mothership/elite_squad/elite_squad = locate()
if(elite_squad)
if(elite_squad.master)
elite_squad=elite_squad.master
elite_squad.readyalert()//Trigger alarm for the spec ops area.
syndicate_elite_shuttle_moving_to_station = 1

@@ -20,7 +20,7 @@ var/global/list/taxi_computers = list()
var/letter = ""
var/list/connected_buttons = list()

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

/obj/machinery/computer/taxi_shuttle/New()
..()
@@ -12,7 +12,7 @@ var/global/vox_shuttle_location
var/moving = FALSE
var/lastMove = 0

l_color = "#B40000"
light_color = LIGHT_COLOR_RED

/obj/machinery/computer/vox_station/proc/vox_move_to(var/destination)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/computer/vox_station/proc/vox_move_to() called tick#: [world.time]")
@@ -22,14 +22,10 @@ var/global/list/cryo_health_indicator = list( "full" = image("icon" = 'icons/obj

machine_flags = SCREWTOGGLE | CROWDESTROY

l_color = "#00FF00"

/obj/machinery/atmospherics/unary/cryo_cell/power_change()
..()
if(!(stat & (BROKEN|NOPOWER)) && on)
SetLuminosity(2)
else
SetLuminosity(0)
light_color = LIGHT_COLOR_GREEN
light_range_on = 1
light_power_on = 2
use_auto_lights = 1

/obj/machinery/atmospherics/unary/cryo_cell/New()
. = ..()
@@ -29,8 +29,6 @@
var/alert = signal.data["alert"]

var/area/our_area = get_area(src)
if (our_area.master)
our_area = our_area.master

if(alarm_area == our_area.name)
switch(alert)
@@ -253,13 +253,13 @@ var/list/all_doors = list()
if(!operating) operating = 1

door_animate("opening")
src.SetOpacity(0)
src.set_opacity(0)
sleep(10)
src.layer = base_layer
src.density = 0
explosion_resistance = 0
update_icon()
SetOpacity(0)
set_opacity(0)
update_nearby_tiles()
//update_freelook_sight()

@@ -289,7 +289,7 @@ var/list/all_doors = list()
update_icon()

if (!glass)
src.SetOpacity(1)
src.set_opacity(1)
// Copypasta!!!
var/obj/effect/beam/B = locate() in loc
if(B)
@@ -48,7 +48,7 @@ var/list/poddoors = list()
src.operating = 1
flick("pdoorc0", src)
src.icon_state = "pdoor0"
src.SetOpacity(0)
src.set_opacity(0)
sleep(15)
src.density = 0
src.operating = 0
@@ -64,7 +64,7 @@ var/list/poddoors = list()
src.operating = 1
flick("pdoorc0", src)
src.icon_state = "pdoor0"
src.SetOpacity(0)
src.set_opacity(0)
sleep(10)
layer = initial(layer)
src.density = 0
@@ -85,7 +85,7 @@ var/list/poddoors = list()
flick("pdoorc1", src)
src.icon_state = "pdoor1"
src.density = 1
src.SetOpacity(initial(opacity))
src.set_opacity(initial(opacity))
update_nearby_tiles()

sleep(10)
@@ -24,7 +24,7 @@
icon_state = "shutter0"
sleep(15)
density = 0
SetOpacity(0)
set_opacity(0)
operating = 0
return
return
@@ -41,7 +41,7 @@
icon_state = "shutter0"
sleep(10)
density = 0
SetOpacity(0)
set_opacity(0)
update_nearby_tiles()

if(operating == 1) //emag again
@@ -60,7 +60,7 @@
icon_state = "shutter1"
density = 1
if(visible)
SetOpacity(1)
set_opacity(1)
update_nearby_tiles()

sleep(10)
@@ -26,14 +26,14 @@
if(cell.charge < powercost)
on = 0
update_icon()
SetLuminosity(0)
set_light(0)
visible_message("<span class='warning'>\The [src] shuts down!</span>")
return

else
on = 0
update_icon()
SetLuminosity(0)
set_light(0)
visible_message("<span class='warning'>\The [src] shuts down!</span>")
return

@@ -58,12 +58,12 @@

if(on)
on = 0
SetLuminosity(0)
set_light(0)
else
if(!cell || !cell.charge > powercost)
return
on = 1
SetLuminosity(brightness_on)
set_light(brightness_on)

user.visible_message("<span class='notice'>[user] turns \the [src] [on ? "on":"off"]</span>", \
"<span class='notice'>You turn \the [src] [on ? "on":"off"]</span>")
@@ -98,8 +98,8 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
hologram.anchored = 1//So space wind cannot drag it.
hologram.name = "[A.name] (Hologram)"//If someone decides to right click.
hologram.SetLuminosity(2) //hologram lighting
SetLuminosity(2) //pad lighting
hologram.set_light(2) //hologram lighting
set_light(2) //pad lighting
icon_state = "holopad1"
A.current = src
master = A//AI is the master.
@@ -113,7 +113,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if(master.current == src)
master.current = null
master = null//Null the master, since no-one is using it now.
SetLuminosity(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted)
set_light(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted)
icon_state = "holopad0"
use_power = 1//Passive power usage.
return 1
@@ -130,7 +130,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
var/area/holo_area = get_area(src)
var/area/eye_area = get_area(master.eyeobj)

if(eye_area in holo_area.master.related)
if(eye_area == holo_area)
return 1

clear_holo()//If not, we want to get rid of the hologram.
@@ -26,13 +26,13 @@

machine_flags = SCREWTOGGLE | CROWDESTROY | EJECTNOTDEL

l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN
power_change()
..()
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
set_light(2)
else
SetLuminosity(0)
set_light(0)


/********************************************************************
@@ -72,7 +72,7 @@

accepted_types = list(/obj/item/seeds)

l_color = "#000000"
light_color = null

/obj/machinery/smartfridge/seeds/New()
. = ..()
@@ -13,13 +13,13 @@

machine_flags = SCREWTOGGLE | CROWDESTROY | WRENCHMOVE | FIXED2WORK

l_color = "#7BF9FF"
light_color = LIGHT_COLOR_CYAN
power_change()
..()
if(!(stat & (BROKEN|NOPOWER)))
SetLuminosity(2)
set_light(2)
else
SetLuminosity(0)
set_light(0)

/********************************************************************
** Adding Stock Parts to VV so preconstructed shit has its candy **
@@ -99,13 +99,12 @@
if(buildstage != 2) return
on = !on

for(var/area/A in areaMaster.related)
A.lightswitch = on
A.updateicon()
areaMaster.lightswitch = on
areaMaster.updateicon()

for(var/obj/machinery/light_switch/L in A)
L.on = on
L.updateicon()
for(var/obj/machinery/light_switch/L in areaMaster)
L.on = on
L.updateicon()

areaMaster.power_change()

@@ -133,6 +133,11 @@ Class Procs:
var/panel_open = 0
var/state = 0 //0 is unanchored, 1 is anchored and unwelded, 2 is anchored and welded for most things

//These are some values to automatically set the light power/range on machines if they have power
var/light_range_on = 0
var/light_power_on = 0
var/use_auto_lights = 0//Incase you want to use it, set this to 0, defaulting to 1 so machinery with no lights doesn't call set_light()

/**
* Machine construction/destruction/emag flags.
*/
@@ -185,7 +185,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
if (Console.department == department)
Console.newmessagepriority = 0
Console.icon_state = "req_comp0"
Console.SetLuminosity(1)
Console.set_light(1)
newmessagepriority = 0
icon_state = "req_comp0"
for(var/msg in messages)
@@ -332,7 +332,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
Console.messages += "<B>Message from <A href='?src=\ref[Console];write=[ckey(department)]'>[department]</A></FONT></B><BR>[message]"

screen = 6
Console.SetLuminosity(2)
Console.set_light(2)
messages += "<B>Message sent to [dpt]</B><BR>[message]"
else
say(text("\icon[src] *The Requests Console beeps: 'NOTICE: No server detected!'"))
@@ -1,7 +1,7 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
/obj/machinery/computer/telecomms

l_color = "#50AB00"
light_color = LIGHT_COLOR_GREEN

/obj/machinery/computer/telecomms/server
name = "Telecommunications Server Monitor"
@@ -20,7 +20,7 @@

var/temp = "" // temporary feedback messages

l_color = "#50AB00"
light_color = LIGHT_COLOR_GREEN

/obj/machinery/computer/telecomms/monitor/attack_hand(mob/user as mob)
if(stat & (BROKEN|NOPOWER))
@@ -18,7 +18,7 @@
var/list/access_log = list()
var/process = 0

l_color = "#50AB00"
light_color = LIGHT_COLOR_GREEN

req_access = list(access_tcomsat)

@@ -9,7 +9,7 @@
//Setting this to 1 will set src.locked to null after a player enters the portal and will not allow hand-teles to open portals to that location.
ghost_write=0

l_color = "#0000FF"
light_color = LIGHT_COLOR_BLUE

/obj/machinery/computer/teleporter/New()
. = ..()
@@ -14,8 +14,6 @@

/area/turret_protected/Entered(O)
..()
if( master && master != src )
return master.Entered(O)

if( iscarbon(O) )
turretTargets |= O
@@ -31,9 +29,6 @@
return 1

/area/turret_protected/Exited(O)
if( master && master != src )
return master.Exited(O)

if( ismob(O) && !issilicon(O) )
turretTargets -= O
// /vg/ vehicles
@@ -129,8 +124,6 @@
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/turret/proc/get_protected_area() called tick#: [world.time]")
var/area/turret_protected/TP = get_area(src)
if(istype(TP))
if(TP.master && TP.master != TP)
TP = TP.master
return TP
return

@@ -353,7 +346,7 @@
var/enabled = 1
var/lethal = 0
var/locked = 1
var/control_area //can be area name, path or nothing.
var/area/turret_protected/control_area //can be area name, path or nothing.
var/ailock = 0 // AI cannot use this
req_access = list(access_ai_upload)

@@ -364,11 +357,7 @@
/obj/machinery/turretid/New()
..()
if(!control_area)
var/area/CA = get_area(src)
if(CA.master && CA.master != CA)
control_area = CA.master
else
control_area = CA
control_area = get_area(src)
else if(istext(control_area))
for(var/area/A in areas)
if(A.name && A.name==control_area)
@@ -497,7 +486,8 @@
/obj/machinery/turretid/proc/updateTurrets()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/turretid/proc/updateTurrets() called tick#: [world.time]")
if(control_area)
for (var/obj/machinery/turret/aTurret in get_area_all_atoms(control_area))
//ASSERT(istype(control_area))
for(var/obj/machinery/turret/aTurret in control_area.contents)
aTurret.setState(enabled, lethal)
src.update_icons()

@@ -1876,7 +1876,7 @@
src.build_inventory(contraband, 1)
emagged = 1
overlays = 0
var/image/dangerlay = image(icon,"[icon_state]-dangermode",LIGHTING_LAYER+1)
var/image/dangerlay = image(icon,"[icon_state]-dangermode", LIGHTING_LAYER + 1)
overlays_vending[2] = dangerlay
update_icon()
return 1
@@ -1906,7 +1906,7 @@
..()
emagged = 1
overlays = 0
var/image/dangerlay = image(icon,"[icon_state]-dangermode",LIGHTING_LAYER+1)
var/image/dangerlay = image(icon,"[icon_state]-dangermode", LIGHTING_LAYER + 1)
overlays_vending[2] = dangerlay
update_icon()

@@ -1949,7 +1949,7 @@
src.build_inventory(contraband, 1)
emagged = 1
overlays = 0
var/image/dangerlay = image(icon,"[icon_state]-dangermode",LIGHTING_LAYER+1)
var/image/dangerlay = image(icon,"[icon_state]-dangermode", LIGHTING_LAYER + 1)
overlays_vending[2] = dangerlay
update_icon()
return 1
@@ -1982,7 +1982,7 @@
..()
emagged = 1
overlays = 0
var/image/dangerlay = image(icon,"[icon_state]-dangermode",LIGHTING_LAYER+1)
var/image/dangerlay = image(icon,"[icon_state]-dangermode", LIGHTING_LAYER + 1)
overlays_vending[2] = dangerlay
update_icon()

@@ -926,7 +926,7 @@
var/pow_chan
if(A)
for(var/c in use_channels)
if(A.master && A.master.powered(c))
if(A.powered(c))
pow_chan = c
break
return pow_chan
@@ -971,13 +971,13 @@
if(A)
var/pow_chan
for(var/c in list(EQUIP,ENVIRON,LIGHT))
if(A.master.powered(c))
if(A.powered(c))
pow_chan = c
break
if(pow_chan)
var/delta = min(12, ER.chassis.cell.maxcharge-cur_charge)
ER.chassis.give_power(delta)
A.master.use_power(delta*ER.coeff, pow_chan)
A.use_power(delta*ER.coeff, pow_chan)
return


@@ -160,7 +160,7 @@
var/obj/machinery/mech_bay_recharge_floor/recharge_floor
var/obj/machinery/mech_bay_recharge_port/recharge_port

l_color = "#CD00CD"
light_color = LIGHT_COLOR_PINK

/obj/machinery/computer/mech_bay_power_console/proc/mecha_in(var/obj/mecha/mecha)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/machinery/computer/mech_bay_power_console/proc/mecha_in() called tick#: [world.time]")
@@ -1050,8 +1050,8 @@
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/mecha/verb/toggle_lights() called tick#: [world.time]")
if(usr!=occupant) return
lights = !lights
if(lights) SetLuminosity(luminosity + lights_power)
else SetLuminosity(luminosity - lights_power)
if(lights) set_light(luminosity + lights_power)
else set_light(luminosity - lights_power)
src.occupant_message("Toggled lights [lights?"on":"off"].")
log_message("Toggled lights [lights?"on":"off"].")
return
@@ -8,7 +8,7 @@
var/screen = 0
var/stored_data

l_color = "#CD00CD"
light_color = LIGHT_COLOR_PINK

/obj/machinery/computer/mecha/attack_ai(var/mob/user as mob)
src.add_hiddenprint(user)
@@ -6,7 +6,7 @@
icon_state = "slagcold"
anchored = 1
melt_temperature=0
l_color="#FFA500"
light_color = LIGHT_COLOR_ORANGE

starting_materials = list()

@@ -25,10 +25,10 @@
molten=1
icon_state="slaghot"
processing_objects.Add(src)
SetLuminosity(2)
set_light(2)

/obj/effect/decal/slag/Destroy()
SetLuminosity(0)
set_light(0)
processing_objects.Remove(src)
..()

@@ -63,11 +63,11 @@

/obj/effect/decal/slag/solidify()
icon_state="slagcold"
SetLuminosity(0)
set_light(0)

/obj/effect/decal/slag/melt()
icon_state="slaghot"
SetLuminosity(2)
set_light(2)

/obj/effect/decal/slag/Crossed(M as mob)
..()
@@ -40,7 +40,7 @@
icon_state = "glowshroomf"

spawn(delay)
SetLuminosity(round(potency/10))
set_light(round(potency/10))
// Spread() - Methinks this is broken - N3X

/obj/effect/glowshroom/proc/Spread()
@@ -29,7 +29,9 @@

/obj/item/blueprints/Topic(href, href_list)
. = ..()
if(.) return 1
if(.)
return

switch(href_list["action"])
if ("create_area")
if (get_area_type()!=AREA_SPACE)
@@ -79,7 +81,7 @@ move an amendment</a> to the drawing.</p>

/obj/item/blueprints/proc/get_area_type(var/area/A = get_area())
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/item/blueprints/proc/get_area_type() called tick#: [world.time]")
if (A.name == "Space" && A.tag)
if (A.name == "Space")
return AREA_SPACE
var/list/SPECIALS = list(
/area/shuttle,
@@ -124,8 +126,6 @@ move an amendment</a> to the drawing.</p>
var/area/oldarea = get_area(usr)
newarea.name = str
newarea.tag = "[newarea.type]/[md5(str)]"
newarea.tagbase = "[newarea.type]_[md5(str)]" // without this dynamic light system ruin everithing
newarea.master = newarea
newarea.power_equip = 0
newarea.power_light = 0
newarea.power_environ = 0
@@ -137,7 +137,6 @@ move an amendment</a> to the drawing.</p>
for(var/atom/allthings in T.contents)
allthings.change_area(oldarea,newarea)
newarea.addSorted()
newarea.SetDynamicLighting()

sleep(5)
interact()
@@ -6,7 +6,7 @@
item_state = "candle1"
w_class = 1
heat_production = 1000
l_color = LIGHT_COLOR_FIRE
light_color = LIGHT_COLOR_FIRE

var/wax = 200
var/lit = 0
@@ -31,7 +31,7 @@
if(!src.lit)
src.lit = 1
visible_message(flavor_text)
SetLuminosity(CANDLE_LUM)
set_light(CANDLE_LUM)
processing_objects.Add(src)

/obj/item/candle/process()
@@ -52,18 +52,7 @@
if(lit)
lit = 0
update_icon()
SetLuminosity(0)
user.SetLuminosity(user.luminosity - CANDLE_LUM)

/obj/item/candle/pickup(mob/user)
if(lit)
SetLuminosity(0)
user.SetLuminosity(user.luminosity + CANDLE_LUM)

/obj/item/candle/dropped(mob/user)
if(lit && !luminosity)
user.SetLuminosity(user.luminosity - CANDLE_LUM)
SetLuminosity(CANDLE_LUM)
set_light(0)

/obj/item/candle/is_hot()
if(lit)
@@ -553,15 +553,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
/*
* The Actual PDA
*/
/obj/item/device/pda/pickup(mob/user)
if(fon)
SetLuminosity(0)
user.SetLuminosity(user.luminosity + f_lum)

/obj/item/device/pda/dropped(mob/user)
if(fon && !luminosity)
user.SetLuminosity(user.luminosity - f_lum)
SetLuminosity(f_lum)

/obj/item/device/pda/New()
..()
@@ -1626,12 +1617,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Light")
if(fon)
fon = 0
if(src in U.contents) U.SetLuminosity(U.luminosity - f_lum)
else SetLuminosity(0)
set_light(0)
else
fon = 1
if(src in U.contents) U.SetLuminosity(U.luminosity + f_lum)
else SetLuminosity(f_lum)
set_light(f_lum)
if("Medical Scan")
if(scanmode == 1)
scanmode = 0
@@ -45,7 +45,7 @@ var/global/list/pda_app_menus = list(
..()
pda_device.f_lum = 3
if(pda_device.fon)
pda_device.SetLuminosity(pda_device.f_lum)
pda_device.set_light(pda_device.f_lum)

/datum/pda_app/spam_filter
name = "Spam Filter"
@@ -19,25 +19,19 @@
..()
if(on)
icon_state = "[initial(icon_state)]-on"
SetLuminosity(brightness_on)
set_light(brightness_on)
else
icon_state = initial(icon_state)
SetLuminosity(0)
set_light(0)

/obj/item/device/flashlight/proc/update_brightness(var/mob/user = null)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/item/device/flashlight/proc/update_brightness() called tick#: [world.time]")
if(on)
icon_state = "[initial(icon_state)]-on"
if(user && loc == user)
user.SetLuminosity(user.luminosity + brightness_on)
else
SetLuminosity(brightness_on)
set_light(brightness_on)
else
icon_state = initial(icon_state)
if(user && loc == user)
user.SetLuminosity(user.luminosity - brightness_on)
else
SetLuminosity(0)
set_light(0)

/obj/item/device/flashlight/attack_self(mob/user)
if(!isturf(user.loc))
@@ -92,19 +86,6 @@
else
return ..()


/obj/item/device/flashlight/pickup(mob/user)
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
SetLuminosity(0)


/obj/item/device/flashlight/dropped(mob/user)
if(on && !luminosity)
user.SetLuminosity(user.luminosity - brightness_on)
SetLuminosity(brightness_on)


/obj/item/device/flashlight/pen
name = "penlight"
desc = "A pen-sized light, used by medical staff."
@@ -156,6 +137,7 @@
desc = "A red Nanotrasen issued flare. There are instructions on the side, it reads 'pull cord, make light'."
w_class = 2.0
brightness_on = 4 // Pretty bright.
light_power = 2.5
icon_state = "flare"
item_state = "flare"
action_button_name = null //just pull it manually, neckbeard.
@@ -164,7 +146,7 @@
var/produce_heat = 1500
var/H_color = ""

l_color = "#AA0033"
light_color = LIGHT_COLOR_FLARE

/obj/item/device/flashlight/flare/New()
fuel = rand(300, 500) // Sorry for changing this so much but I keep under-estimating how long X number of ticks last in seconds.
@@ -215,29 +197,22 @@
src.damtype = "fire"
processing_objects += src
if(user)
user.l_color = l_color
update_brightness(user)
else
update_brightness()

/obj/item/device/flashlight/flare/pickup(mob/user)
..()
if(on)
user.l_color = l_color


/obj/item/device/flashlight/flare/dropped(mob/user)
..()
user.l_color = initial(user.l_color)

/obj/item/device/flashlight/flare/ever_bright/New()
. = ..()
fuel = INFINITY
Light()

// SLIME LAMP
/obj/item/device/flashlight/lamp/slime
name = "slime lamp"
desc = "A lamp powered by a slime core. You can adjust its brightness by touching it."
icon_state = "slimelamp"
item_state = ""
l_color = "#333300"
light_color = LIGHT_COLOR_SLIME_LAMP
on = 0
luminosity = 2
var/brightness_max = 6
@@ -247,25 +222,19 @@
..()
if(on)
icon_state = "[initial(icon_state)]-on"
SetLuminosity(brightness_max)
set_light(brightness_max)
else
icon_state = initial(icon_state)
SetLuminosity(brightness_min)
set_light(brightness_min)

/obj/item/device/flashlight/lamp/slime/proc/slime_brightness(var/mob/user = null)
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/item/device/flashlight/lamp/slime/proc/slime_brightness() called tick#: [world.time]")
if(on)
icon_state = "[initial(icon_state)]-on"
if(user && loc == user)
user.SetLuminosity(user.luminosity + brightness_max - brightness_min)
else if(isturf(loc))
SetLuminosity(brightness_max)
set_light(brightness_max)
else
icon_state = initial(icon_state)
if(user && loc == user)
user.SetLuminosity(user.luminosity - brightness_max + brightness_min)
else if(isturf(loc))
SetLuminosity(brightness_min)
set_light(brightness_min)

/obj/item/device/flashlight/lamp/slime/attack_self(mob/user)
if(!isturf(user.loc))
@@ -274,23 +243,3 @@
on = !on
slime_brightness(user)
return 1

/obj/item/device/flashlight/lamp/slime/pickup(mob/user)
user.l_color = l_color
if(on)
user.SetLuminosity(user.luminosity + brightness_max)
SetLuminosity(0)
else
user.SetLuminosity(user.luminosity + brightness_min)
SetLuminosity(0)


/obj/item/device/flashlight/lamp/slime/dropped(mob/user)
user.l_color = initial(user.l_color)
if(on && !luminosity)
user.SetLuminosity(user.luminosity - brightness_max)
SetLuminosity(brightness_max)
else
if(!luminosity)
user.SetLuminosity(user.luminosity - brightness_min)
SetLuminosity(brightness_min)
@@ -154,7 +154,9 @@
var/obj/item/weapon/light/L1 = new target.light_type(target.loc)
L1.status = target.status
L1.rigged = target.rigged
L1.brightness = target.brightness
L1.brightness_range = target.brightness_range
L1.brightness_power = target.brightness_power
L1.brightness_color = target.brightness_color
L1.switchcount = target.switchcount
target.switchcount = 0
L1.update()
@@ -167,7 +169,9 @@
target.status = L2.status
target.switchcount = L2.switchcount
target.rigged = emagged
target.brightness = L2.brightness
target.brightness_range = L2.brightness_range
target.brightness_power = L2.brightness_power
target.brightness_color = L2.brightness_color
target.on = target.has_power()
target.update()
del(L2)
@@ -55,15 +55,15 @@
for(var/mob/M in viewers(user))
if(M == user) continue
M << "[user] detaches the power sink from the cable."
SetLuminosity(0)
set_light(0)
icon_state = "powersink0"

return
else
..()

Destroy()
SetLuminosity(0)
set_light(0)
processing_objects.Remove(src)
attached.attached = null
attached = null
@@ -96,7 +96,7 @@
if(M == user) continue
M << "[user] deactivates the power sink!"
mode = 1
SetLuminosity(0)
set_light(0)
icon_state = "powersink0"
playsound(get_turf(src), 'sound/effects/teleport.ogg', 50, 1)
processing_objects.Remove(src)
@@ -105,7 +105,7 @@
if(attached)
var/datum/powernet/PN = attached.get_powernet()
if(PN)
SetLuminosity(12)
set_light(12)

// found a powernet, so drain up to max power from it

@@ -253,7 +253,7 @@ var/global/list/datum/stack_recipe/cable_recipes = list ( \

if(C.shock(user, 50))
if(prob(50)) //fail
getFromPool(/obj/item/stack/cable_coil, C.loc, 1, C.l_color)
getFromPool(/obj/item/stack/cable_coil, C.loc, 1, C.light_color)
returnToPool(C)
return

@@ -30,7 +30,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM
w_class = 1.0
origin_tech = "materials=1"
attack_verb = list("burnt", "singed")
l_color = LIGHT_COLOR_FIRE
light_color = LIGHT_COLOR_FIRE

/obj/item/weapon/match/New()

@@ -74,18 +74,10 @@ MATCHBOXES ARE ALSO IN FANCY.DM

if(lit == 1) //I wish I didn't need the == 1 part, but Dreamkamer is a dumb puppy
processing_objects.Add(src)
if(ismob(loc))
var/mob/carrier = loc
carrier.SetLuminosity(carrier.luminosity + brightness_on)
else if(isturf(loc))
SetLuminosity(brightness_on)
set_light(brightness_on)
else
processing_objects.Remove(src)
if(ismob(loc))
var/mob/carrier = loc
carrier.SetLuminosity(carrier.luminosity - brightness_on)
else if(isturf(loc))
SetLuminosity(0)
set_light(0)
update_icon()

/obj/item/weapon/match/process()
@@ -99,16 +91,6 @@ MATCHBOXES ARE ALSO IN FANCY.DM
location.hotspot_expose(heat_production, 5, surfaces = istype(loc, /turf))
return

/obj/item/weapon/match/pickup(mob/user)
if(lit == 1)
user.SetLuminosity(user.luminosity + brightness_on)
SetLuminosity(0)

/obj/item/weapon/match/dropped(mob/user)
if(lit == 1)
user.SetLuminosity(user.luminosity - brightness_on)
SetLuminosity(brightness_on)

/obj/item/weapon/match/is_hot()
if(lit == 1)
return heat_production
@@ -169,7 +151,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM
body_parts_covered = null
attack_verb = list("burnt", "singed")
heat_production = 1000
l_color = LIGHT_COLOR_FIRE
light_color = LIGHT_COLOR_FIRE
var/lit = 0
var/overlay_on = "ciglit" //Apparently not used
var/type_butt = /obj/item/weapon/cigbutt
@@ -210,30 +192,12 @@ MATCHBOXES ARE ALSO IN FANCY.DM

if(lit)
processing_objects.Add(src)
if(ismob(loc))
var/mob/carrier = loc
carrier.SetLuminosity(carrier.luminosity + brightness_on)
else if(isturf(loc))
SetLuminosity(brightness_on)
set_light(brightness_on)
else
processing_objects.Remove(src)
if(ismob(loc))
var/mob/carrier = loc
carrier.SetLuminosity(carrier.luminosity - brightness_on)
else if(isturf(loc))
SetLuminosity(0)
set_light(0)
update_icon()

/obj/item/clothing/mask/cigarette/pickup(mob/user)
if(lit)
user.SetLuminosity(user.luminosity + brightness_on)
SetLuminosity(0)

/obj/item/clothing/mask/cigarette/dropped(mob/user)
if(lit)
user.SetLuminosity(user.luminosity - brightness_on)
SetLuminosity(brightness_on)

/obj/item/clothing/mask/cigarette/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(lit)
return
@@ -618,7 +582,7 @@ MATCHBOXES ARE ALSO IN FANCY.DM
heat_production = 1500
slot_flags = SLOT_BELT
attack_verb = list("burnt", "singed")
l_color = LIGHT_COLOR_FIRE
light_color = LIGHT_COLOR_FIRE
var/lit = 0

/obj/item/weapon/lighter/zippo
@@ -662,30 +626,12 @@ MATCHBOXES ARE ALSO IN FANCY.DM

if(lit)
processing_objects.Add(src)
if(ismob(loc))
var/mob/carrier = loc
carrier.SetLuminosity(carrier.luminosity + brightness_on)
else if(isturf(loc))
SetLuminosity(brightness_on)
set_light(brightness_on)
else
processing_objects.Remove(src)
if(ismob(loc))
var/mob/carrier = loc
carrier.SetLuminosity(carrier.luminosity - brightness_on)
else if(isturf(loc))
SetLuminosity(0)
set_light(0)
update_icon()

/obj/item/weapon/lighter/pickup(mob/user)
if(lit)
user.SetLuminosity(user.luminosity + brightness_on)
SetLuminosity(0)

/obj/item/weapon/lighter/dropped(mob/user)
if(lit)
user.SetLuminosity(user.luminosity - brightness_on)
SetLuminosity(brightness_on)

/obj/item/weapon/lighter/afterattack(obj/O, mob/user, proximity)
if(!proximity)
return 0
@@ -9,41 +9,41 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "glowstick"

l_color = GLOW_GREEN
light_color = GLOW_GREEN
w_class = 2

suicide_act(mob/user)
viewers(user) << "<span class='danger'>[user] is breaking open the [src.name] and eating the liquid inside! It looks like \he's trying to commit suicide!</span>"
return (TOXLOSS)


/obj/item/weapon/glowstick/New()
. = ..()
SetLuminosity(2)
set_light(2, l_color = light_color)

/obj/item/weapon/glowstick/red
desc = "A plastic stick filled with luminescent liquid, this one is red."
color = GLOW_RED

l_color = GLOW_RED
light_color = GLOW_RED

/obj/item/weapon/glowstick/blue
desc = "A plastic stick filled with luminescent liquid, this one is blue."
color = GLOW_BLUE

l_color = GLOW_BLUE
light_color = GLOW_BLUE

/obj/item/weapon/glowstick/yellow
desc = "A plastic stick filled with luminescent liquid, this one is yellow."
color = "#FFFF00"

l_color = "#FFFF00"
light_color = "#FFFF00"

/obj/item/weapon/glowstick/magenta
desc = "A plastic stick filled with luminescent liquid, this one is magenta."
color = "#FF00FF"

l_color = "#FF00FF"
light_color = "#FF00FF"

#undef GLOW_GREEN
#undef GLOW_RED
@@ -105,7 +105,7 @@

/obj/effect/effect/smoke/flashbang/New()
..()
SetLuminosity(15)
set_light(15)

/obj/item/weapon/grenade/flashbang/clusterbang//Created by Polymorph, fixed by Sieve
desc = "Use of this weapon may constiute a war crime in your area, consult your local captain."
@@ -155,16 +155,12 @@ var/global/list/reagents_to_log = list("fuel" = "welder fuel", "plasma"= "pla
return

/obj/singularity_act()
if(!simulated)
return 0
ex_act(1)
if(src)
qdel(src)
return 2

/obj/singularity_pull(S, current_size)
if(!simulated)
return 0
if(anchored)
if(current_size >= STAGE_FIVE)
anchored = 0
@@ -128,15 +128,15 @@
flick("[mineral]fwall_opening", src)
sleep(15)
src.density = 0
SetOpacity(0)
set_opacity(0)
opening = 0
else
opening = 1
flick("[mineral]fwall_closing", src)
icon_state = "[mineral]0"
density = 1
sleep(15)
SetOpacity(1)
set_opacity(1)
src.relativewall()
opening = 0

@@ -241,15 +241,15 @@
flick("frwall_opening", src)
sleep(15)
density = 0
SetOpacity(0)
set_opacity(0)
opening = 0
else
opening = 1
icon_state = "r_wall"
flick("frwall_closing", src)
density = 1
sleep(15)
SetOpacity(1)
set_opacity(1)
relativewall()
opening = 0

@@ -149,9 +149,9 @@
update_lightsource()
handle_mob_bumping()
if(warp)
warp.loc = src.loc
warp.forceMove(loc)
if(busjuke)
busjuke.loc = src.loc
busjuke.forceMove(loc)
busjuke.dir = dir
if(busjuke.icon_state)
busjuke.repack()
@@ -161,51 +161,51 @@
var/atom/A = passengers[i]
if(isliving(A))
var/mob/living/M = A
M.loc = src.loc
M.forceMove(loc)
else if(isbot(A))
var/obj/machinery/bot/B = A
B.loc = src.loc
B.forceMove(loc)
for(var/obj/structure/hookshot/H in hookshot)
H.forceMove(get_step(H,src.dir))

/obj/structure/stool/bed/chair/vehicle/adminbus/proc/update_lightsource()
//writepanic("[__FILE__].[__LINE__] ([src.type])([usr ? usr.ckey : ""]) \\/obj/structure/stool/bed/chair/vehicle/adminbus/proc/update_lightsource() called tick#: [world.time]")
var/turf/T = get_step(src,src.dir)
if(T.opacity)
lightsource.loc = T
lightsource.forceMove(T)
switch(roadlights) //if the bus is right against a wall, only the wall's tile is lit
if(0)
if(lightsource.luminosity != 0)
lightsource.SetLuminosity(0)
if(lightsource.light_range != 0)
lightsource.set_light(0)
if(1,2)
if(lightsource.luminosity != 1)
lightsource.SetLuminosity(1)
if(lightsource.light_range != 1)
lightsource.set_light(1)
else
T = get_step(T,src.dir) //if there is a wall two tiles in front of the bus, the lightsource is right in front of the bus, though weaker
if(T.opacity)
lightsource.loc = get_step(src,src.dir)
lightsource.forceMove(get_step(src,src.dir))
switch(roadlights)
if(0)
if(lightsource.luminosity != 0)
lightsource.SetLuminosity(0)
if(lightsource.light_range != 0)
lightsource.set_light(0)
if(1)
if(lightsource.luminosity != 1)
lightsource.SetLuminosity(1)
if(lightsource.light_range != 1)
lightsource.set_light(1)
if(2)
if(lightsource.luminosity != 2)
lightsource.SetLuminosity(2)
if(lightsource.light_range != 2)
lightsource.set_light(2)
else
lightsource.loc = T
switch(roadlights) //otherwise, the lightsource position itself two tiles in front of the bus and with regular luminosity
lightsource.forceMove(T)
switch(roadlights) //otherwise, the lightsource position itself two tiles in front of the bus and with regular light_range
if(0)
if(lightsource.luminosity != 0)
lightsource.SetLuminosity(0)
if(lightsource.light_range != 0)
lightsource.set_light(0)
if(1)
if(lightsource.luminosity != 2)
lightsource.SetLuminosity(2)
if(lightsource.light_range != 2)
lightsource.set_light(2)
if(2)
if(lightsource.luminosity != 3)
lightsource.SetLuminosity(3)
if(lightsource.light_range != 3)
lightsource.set_light(3)


/obj/structure/stool/bed/chair/vehicle/adminbus/proc/handle_mob_bumping()
@@ -508,7 +508,7 @@
forceMove(get_step_towards(src,abus))
max_distance++
if(max_distance >= 7)
del(src)
qdel(src)
return
sleep(2)
.()
@@ -527,7 +527,7 @@
if(abus.buckled_mob)
abus.buckled_mob.gui_icons.adminbus_hook.icon_state = "icon_hook"
abus.hook = 1
del(src)
qdel(src)
return
sleep(2)
.()
@@ -18,7 +18,7 @@
freed(L)
else if(isbot(A))
var/obj/machinery/bot/B = A
B.loc = get_step(src,turn(src.dir,-90))
B.forceMove(get_step(src,turn(src.dir,-90)))
B.turn_on()
B.flags &= ~INVULNERABLE
B.anchored = 0
@@ -165,18 +165,18 @@
bususer.gui_icons.adminbus_hook.icon_state = "icon_hook-push"
var/obj/structure/singulo_chain/anchor/A = locate(/obj/structure/singulo_chain/anchor) in chain
if(A)
del(A)//so we don't drag the singulo back to us along with the rest of the chain.
qdel(A)//so we don't drag the singulo back to us along with the rest of the chain.
singulo.on_release()
singulo = null
while(chain_base)
var/obj/structure/singulo_chain/C = chain_base
C.move_child(get_turf(src))
chain_base = C.child
del(C)
qdel(C)
sleep(2)

for(var/obj/structure/singulo_chain/N in chain)//Just in case some bits of the chain were detached from the bus for whatever reason
del(N)
qdel(N)
chain.len = 0

if(!singulo)
@@ -226,25 +226,25 @@
bususer.gui_icons.adminbus_roadlights_0.icon_state = "icon_lights_0-on"
bususer.gui_icons.adminbus_roadlights_1.icon_state = "icon_lights_1-off"
bususer.gui_icons.adminbus_roadlights_2.icon_state = "icon_lights_2-off"
lightsource.SetLuminosity(0)
lightsource.set_light(0)
if(roadlights == 1 || roadlights == 2)
overlays -= image(icon,"roadlights",LIGHTING_LAYER+1)
overlays -= image(icon,"roadlights", LIGHTING_LAYER + 1)
roadlights = 0
if(1)
bususer.gui_icons.adminbus_roadlights_0.icon_state = "icon_lights_0-off"
bususer.gui_icons.adminbus_roadlights_1.icon_state = "icon_lights_1-on"
bususer.gui_icons.adminbus_roadlights_2.icon_state = "icon_lights_2-off"
lightsource.SetLuminosity(2)
lightsource.set_light(2)
if(roadlights == 0)
overlays += image(icon,"roadlights",LIGHTING_LAYER+1)
overlays += image(icon,"roadlights", LIGHTING_LAYER + 1)
roadlights = 1
if(2)
bususer.gui_icons.adminbus_roadlights_0.icon_state = "icon_lights_0-off"
bususer.gui_icons.adminbus_roadlights_1.icon_state = "icon_lights_1-off"
bususer.gui_icons.adminbus_roadlights_2.icon_state = "icon_lights_2-on"
lightsource.SetLuminosity(3)
lightsource.set_light(3)
if(roadlights == 0)
overlays += image(icon,"roadlights",LIGHTING_LAYER+1)
overlays += image(icon,"roadlights", LIGHTING_LAYER + 1)
roadlights = 2

update_lightsource()
@@ -605,17 +605,17 @@

*/

M.loc = pick(tdomeobserve)
M.forceMove(pick(tdomeobserve))
M << "<span class='notice'>You have been sent to the Thunderdome. Thank you for riding with us and enjoy your games.</span>"

else if(isbot(A))
var/obj/machinery/bot/B = A
B.loc = get_step(src,turn(src.dir,-90))
B.forceMove(get_step(src,turn(src.dir,-90)))
B.turn_on()
B.flags &= ~INVULNERABLE
B.anchored = 0
passengers -= B
B.loc = pick(tdomeobserve)
B.forceMove(pick(tdomeobserve))

var/turf/TD = get_turf(A)
if(TD)
@@ -826,7 +826,7 @@

else if(isbot(A))
var/obj/machinery/bot/B = A
B.loc = get_step(src,turn(src.dir,-90))
B.forceMove(get_step(src,turn(src.dir,-90)))
B.turn_on()
B.flags &= ~INVULNERABLE
B.anchored = 0
@@ -19,20 +19,16 @@ var/list/mechtoys = list(
/obj/item/toy/prize/odysseus,
/obj/item/toy/prize/phazon
)

/area/supply/station //DO NOT TURN THE lighting_use_dynamic STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
//Lighting STILL disabled, even with the new bay engine, because lighting doesn't play nice with our shuttles, might just be our shuttle code, or the small changes in the lighting engine we have from bay.
/area/supply/station
name = "supply shuttle"
icon_state = "shuttle3"
luminosity = 1
lighting_use_dynamic = 0
requires_power = 0


/area/supply/dock //DO NOT TURN THE lighting_use_dynamic STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
/area/supply/dock
name = "supply shuttle"
icon_state = "shuttle3"
luminosity = 1
lighting_use_dynamic = 0
requires_power = 0

//SUPPLY PACKS MOVED TO /code/defines/obj/supplypacks.dm
@@ -126,7 +122,7 @@ var/list/mechtoys = list(
var/last_viewed_group = "categories"
var/datum/money_account/current_acct

l_color = "#87421F"
light_color = LIGHT_COLOR_BROWN

/obj/machinery/computer/ordercomp
name = "Supply ordering console"
@@ -138,7 +134,7 @@ var/list/mechtoys = list(
var/last_viewed_group = "categories"
var/datum/money_account/current_acct

l_color = "#87421F"
light_color = LIGHT_COLOR_BROWN

/*
/obj/effect/marker/supplymarker
@@ -339,7 +335,7 @@ var/list/mechtoys = list(
if(T.density) continue
var/contcount
for(var/atom/A in T.contents)
if(!A.simulated)
if(islightingoverlay(A))
continue
contcount++
if(contcount)
@@ -11,6 +11,7 @@
var/drying = 0 // tracking if something is currently drying
/turf/simulated/New()
..()

if(istype(loc, /area/chapel))
holy = 1
levelupdate()