Working UL

This commit is contained in:
SkyMarshal
2012-06-13 18:59:52 -07:00
parent f1f5338a4f
commit aeb850fef0
52 changed files with 622 additions and 633 deletions

View File

@@ -1076,7 +1076,6 @@
#include "code\modules\power\lighting.dm" #include "code\modules\power\lighting.dm"
#include "code\modules\power\port_gen.dm" #include "code\modules\power\port_gen.dm"
#include "code\modules\power\power.dm" #include "code\modules\power\power.dm"
#include "code\modules\power\sd_DynamicAreaLighting.dm"
#include "code\modules\power\smes.dm" #include "code\modules\power\smes.dm"
#include "code\modules\power\solar.dm" #include "code\modules\power\solar.dm"
#include "code\modules\power\switch.dm" #include "code\modules\power\switch.dm"
@@ -1204,6 +1203,7 @@
#include "code\WorkInProgress\SkyMarshal\coatrack.dm" #include "code\WorkInProgress\SkyMarshal\coatrack.dm"
#include "code\WorkInProgress\SkyMarshal\portalathe.dm" #include "code\WorkInProgress\SkyMarshal\portalathe.dm"
#include "code\WorkInProgress\SkyMarshal\traitoritems.dm" #include "code\WorkInProgress\SkyMarshal\traitoritems.dm"
#include "code\WorkInProgress\SkyMarshal\Ultralight.dm"
#include "code\WorkInProgress\SkyMarshal\wardrobes.dm" #include "code\WorkInProgress\SkyMarshal\wardrobes.dm"
#include "code\WorkInProgress\Tastyfish\Eliza.dm" #include "code\WorkInProgress\Tastyfish\Eliza.dm"
#include "code\WorkInProgress\Tastyfish\Eliza_Data.dm" #include "code\WorkInProgress\Tastyfish\Eliza_Data.dm"

View File

@@ -156,13 +156,13 @@ obj
New() New()
..() ..()
dir = pick(cardinal) dir = pick(cardinal)
sd_SetLuminosity(3) ul_SetLuminosity(3)
Del() Del()
if (istype(loc, /turf/simulated)) if (istype(loc, /turf/simulated))
var/turf/simulated/T = loc var/turf/simulated/T = loc
loc:active_hotspot = null loc:active_hotspot = null
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)

View File

@@ -30,7 +30,7 @@
New() New()
..() ..()
spawn(1) spawn(1)
sd_SetLuminosity(4) ul_SetLuminosity(4,6,0)
bullet_act(var/obj/item/projectile/Proj) bullet_act(var/obj/item/projectile/Proj)
if(Proj.flag != "bullet") if(Proj.flag != "bullet")

View File

@@ -1,14 +1,13 @@
//UltraLight system, by Sukasa //UltraLight system, by Sukasa
#define UL_I_FALLOFF_SQUARE 0
#define UL_I_FALLOFF_ROUND 1
#define UL_I_LIT 0
#define UL_I_EXTINGUISHED 1
#define UL_I_ONZERO 2
var var
const
UL_I_FALLOFF_SQUARE = 0
UL_I_FALLOFF_ROUND = 1
UL_I_LIT = 0
UL_I_EXTINGUISHED = 1
UL_I_ONZERO = 2
ul_LightingEnabled = 1 ul_LightingEnabled = 1
ul_LightingResolution = 1 ul_LightingResolution = 1
ul_Steps = 7 ul_Steps = 7
@@ -21,6 +20,15 @@ var
5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7) 7, 7)
var/list/light_to_instantiate = list()
var/UL_setup = 0
proc/setup_UL()
UL_setup = 1
world << "\red <b>Setting up UltraLight...</b>"
for(var/atom/A in light_to_instantiate)
if(A.ul_IsLuminous())
A.ul_Illuminate()
proc/ul_Clamp(var/Value) proc/ul_Clamp(var/Value)
return min(max(Value, 0), ul_Steps) return min(max(Value, 0), ul_Steps)
@@ -212,14 +220,15 @@ atom/proc/ul_LightLevelChanged()
//Designed for client projects to use. Called on items when the turf they are in has its light level changed //Designed for client projects to use. Called on items when the turf they are in has its light level changed
return return
atom/proc/New() atom/New()
..() ..()
if(UL_setup)
if(ul_IsLuminous()) if(ul_IsLuminous())
spawn(1)
ul_Illuminate() ul_Illuminate()
return else
light_to_instantiate |= src
atom/proc/Del() atom/Del()
if(ul_IsLuminous()) if(ul_IsLuminous())
ul_Extinguish() ul_Extinguish()

View File

@@ -157,14 +157,14 @@ obj
New(newLoc,fl) New(newLoc,fl)
..() ..()
dir = pick(cardinal) dir = pick(cardinal)
sd_SetLuminosity(3) ul_SetLuminosity(3)
firelevel = fl firelevel = fl
for(var/mob/living/carbon/human/M in loc) for(var/mob/living/carbon/human/M in loc)
M.FireBurn(min(max(0.1,firelevel / 20),10)) //Burn the humans! M.FireBurn(min(max(0.1,firelevel / 20),10)) //Burn the humans!
Del() Del()
if (istype(loc, /turf/simulated)) if (istype(loc, /turf/simulated))
src.sd_SetLuminosity(0) ul_SetLuminosity(0)
loc = null loc = null
@@ -267,7 +267,7 @@ datum/gas_mixture/proc/zburn(obj/liquid_fuel/liquid)
temperature = max( 1700*log(0.4*firelevel + 1.23) , temperature ) temperature = max( 1700*log(0.4*firelevel + 1.23) , temperature )
//Consume some gas. //Consume some gas.
var/consumed_gas = min(oxygen,0.005*firelevel,total_fuel) / fuel_sources var/consumed_gas = min(oxygen,0.05*firelevel,total_fuel) / fuel_sources
oxygen = max(0,oxygen-consumed_gas) oxygen = max(0,oxygen-consumed_gas)

View File

@@ -95,7 +95,7 @@ zone/proc/process()
AirflowSpace(src) AirflowSpace(src)
ShareSpace(air,total_space*(zone_share_percent/100)) ShareSpace(air,total_space*(zone_share_percent/100))
if(!(last_update%20)) //every 20 processes. /* if(!(last_update%20)) //every 20 processes.
if(connections) if(connections)
connections.Remove(null) connections.Remove(null)
if(!connections.len) if(!connections.len)
@@ -103,7 +103,7 @@ zone/proc/process()
if(connected_zones) if(connected_zones)
connected_zones.Remove(null) connected_zones.Remove(null)
if(!connected_zones.len) if(!connected_zones.len)
del connected_zones del connected_zones*/
//React the air here. //React the air here.
//air.react(null,0) //air.react(null,0)

View File

@@ -124,7 +124,7 @@
playSpecials(destturf,effectout,soundout) playSpecials(destturf,effectout,soundout)
// Re-Apply lum // Re-Apply lum
teleatom.sd_SetLuminosity(prevlum) teleatom.ul_SetLuminosity(prevlum)
destarea.Entered(teleatom) destarea.Entered(teleatom)

View File

@@ -126,10 +126,8 @@ proc/process_ghost_teleport_locs()
//place to another. Look at escape shuttle for example. //place to another. Look at escape shuttle for example.
//All shuttles show now be under shuttle since we have smooth-wall code. //All shuttles show now be under shuttle since we have smooth-wall code.
/area/shuttle //DO NOT TURN THE SD_LIGHTING STUFF ON FOR SHUTTLES. IT BREAKS THINGS. /area/shuttle //DO NOT TURN THE ul_Lighting STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
requires_power = 0 requires_power = 0
luminosity = 1
sd_lighting = 0
/area/shuttle/arrival /area/shuttle/arrival
name = "\improper Arrival Shuttle" name = "\improper Arrival Shuttle"
@@ -233,15 +231,11 @@ proc/process_ghost_teleport_locs()
icon_state = "shuttle" icon_state = "shuttle"
name = "\improper Alien Shuttle Base" name = "\improper Alien Shuttle Base"
requires_power = 1 requires_power = 1
luminosity = 0
sd_lighting = 1
/area/shuttle/alien/mine /area/shuttle/alien/mine
icon_state = "shuttle" icon_state = "shuttle"
name = "\improper Alien Shuttle Mine" name = "\improper Alien Shuttle Mine"
requires_power = 1 requires_power = 1
luminosity = 0
sd_lighting = 1
/area/shuttle/prison/ /area/shuttle/prison/
name = "\improper Prison Shuttle" name = "\improper Prison Shuttle"
@@ -313,7 +307,7 @@ proc/process_ghost_teleport_locs()
icon_state = "start" icon_state = "start"
requires_power = 0 requires_power = 0
luminosity = 1 luminosity = 1
sd_lighting = 0 ul_Lighting = 0
has_gravity = 1 has_gravity = 1
// === end remove // === end remove
@@ -808,8 +802,6 @@ proc/process_ghost_teleport_locs()
/area/holodeck /area/holodeck
name = "\improper Holodeck" name = "\improper Holodeck"
icon_state = "Holodeck" icon_state = "Holodeck"
luminosity = 1
sd_lighting = 0
/area/holodeck/alphadeck /area/holodeck/alphadeck
name = "\improper Holodeck Alpha" name = "\improper Holodeck Alpha"
@@ -966,8 +958,6 @@ proc/process_ghost_teleport_locs()
/area/solar /area/solar
requires_power = 0 requires_power = 0
luminosity = 1
sd_lighting = 0
auxport auxport
name = "\improper Port Auxiliary Solar Array" name = "\improper Port Auxiliary Solar Array"
@@ -1483,26 +1473,18 @@ proc/process_ghost_teleport_locs()
/area/turret_protected/AIsatextFP /area/turret_protected/AIsatextFP
name = "\improper AI Sat Ext" name = "\improper AI Sat Ext"
icon_state = "storage" icon_state = "storage"
luminosity = 1
sd_lighting = 0
/area/turret_protected/AIsatextFS /area/turret_protected/AIsatextFS
name = "\improper AI Sat Ext" name = "\improper AI Sat Ext"
icon_state = "storage" icon_state = "storage"
luminosity = 1
sd_lighting = 0
/area/turret_protected/AIsatextAS /area/turret_protected/AIsatextAS
name = "\improper AI Sat Ext" name = "\improper AI Sat Ext"
icon_state = "storage" icon_state = "storage"
luminosity = 1
sd_lighting = 0
/area/turret_protected/AIsatextAP /area/turret_protected/AIsatextAP
name = "\improper AI Sat Ext" name = "\improper AI Sat Ext"
icon_state = "storage" icon_state = "storage"
luminosity = 1
sd_lighting = 0
/area/turret_protected/NewAIMain /area/turret_protected/NewAIMain
name = "\improper AI Main New" name = "\improper AI Main New"
@@ -1580,7 +1562,7 @@ proc/process_ghost_teleport_locs()
/area/turret_protected/AssistantRoom /area/turret_protected/AssistantRoom
name = "\improper Assistant Room" name = "\improper Assistant Room"
icon_state = "storage" icon_state = "storage"
sd_lighting = 0 ul_Lighting = 0
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
/* /*
@@ -1653,7 +1635,7 @@ var/list/the_station_areas = list (
name = "Keelin's private beach" name = "Keelin's private beach"
icon_state = "null" icon_state = "null"
luminosity = 1 luminosity = 1
sd_lighting = 0 ul_Lighting = 0
requires_power = 0 requires_power = 0
var/sound/mysound = null var/sound/mysound = null

View File

@@ -52,8 +52,8 @@
f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,EAST)) f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,EAST))
f1.density = density f1.density = density
f2.density = density f2.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1
@@ -71,8 +71,8 @@
f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,NORTH)) f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,NORTH))
f1.density = density f1.density = density
f2.density = density f2.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1
@@ -96,10 +96,10 @@
f2.density = density f2.density = density
f3.density = density f3.density = density
f4.density = density f4.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
f4.sd_SetOpacity(opacity) f4.ul_SetOpacity(opacity)
f3.sd_SetOpacity(opacity) f3.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1
@@ -125,10 +125,10 @@
f2.density = density f2.density = density
f3.density = density f3.density = density
f4.density = density f4.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
f4.sd_SetOpacity(opacity) f4.ul_SetOpacity(opacity)
f3.sd_SetOpacity(opacity) f3.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1

View File

@@ -1149,16 +1149,16 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/Del() /obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/Del()
if(istype(loc,/mob)) if(istype(loc,/mob))
loc.sd_SetLuminosity(loc.luminosity - potency/5) loc.ul_SetLuminosity(loc.LuminosityRed - potency/5, loc.LuminosityGreen - potency/5, loc.LuminosityBlue - potency/5)
..() ..()
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/pickup(mob/user) /obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/pickup(mob/user)
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
user.total_luminosity += potency/5 user.ul_SetLuminosity(user.LuminosityRed + potency/5, user.LuminosityGreen + potency/5, user.LuminosityBlue + potency/5)
/obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/dropped(mob/user) /obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/dropped(mob/user)
user.total_luminosity -= potency/5 user.ul_SetLuminosity(user.LuminosityRed - potency/5, user.LuminosityGreen - potency/5, user.LuminosityBlue - potency/5)
src.sd_SetLuminosity(potency/5) src.ul_SetLuminosity(potency/5)
/obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod /obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod
seed = "/obj/item/seeds/cocoapodseed" seed = "/obj/item/seeds/cocoapodseed"
@@ -1621,7 +1621,7 @@
if(istype(src.loc,/mob)) if(istype(src.loc,/mob))
pickup(src.loc) pickup(src.loc)
else else
src.sd_SetLuminosity(potency/10) src.ul_SetLuminosity(potency/10)
lifespan = 120 //ten times that is the delay lifespan = 120 //ten times that is the delay
endurance = 30 endurance = 30
maturation = 15 maturation = 15
@@ -1646,16 +1646,16 @@
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/Del() /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/Del()
if(istype(loc,/mob)) if(istype(loc,/mob))
loc.sd_SetLuminosity(loc.luminosity - potency/10) loc.ul_SetLuminosity(loc.LuminosityRed - potency/10, loc.LuminosityGreen - potency/10, loc.LuminosityBlue - potency/10)
..() ..()
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user) /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/pickup(mob/user)
src.sd_SetLuminosity(0) ul_SetLuminosity(0)
user.total_luminosity += potency/10 user.ul_SetLuminosity(user.LuminosityRed + potency/10, user.LuminosityGreen + potency/10, user.LuminosityBlue + potency/10)
/obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user) /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/dropped(mob/user)
user.total_luminosity -= potency/10 user.ul_SetLuminosity(user.LuminosityRed - potency/10, user.LuminosityGreen - potency/10, user.LuminosityBlue - potency/10)
src.sd_SetLuminosity(potency/10) ul_SetLuminosity(potency/10)
// ********************** // **********************
// Other harvested materials from plants (that are not food) // Other harvested materials from plants (that are not food)

View File

@@ -1515,9 +1515,9 @@ proc/listclearnulls(list/list)
var/area/AR = X.loc var/area/AR = X.loc
if(AR.sd_lighting) if(AR.ul_Lighting)
X.opacity = !X.opacity X.opacity = !X.opacity
X.sd_SetOpacity(!X.opacity) X.ul_SetOpacity(!X.opacity)
toupdate += X toupdate += X
@@ -1526,9 +1526,9 @@ proc/listclearnulls(list/list)
var/area/AR2 = ttl.loc var/area/AR2 = ttl.loc
if(AR2.sd_lighting) if(AR2.ul_Lighting)
ttl.opacity = !ttl.opacity ttl.opacity = !ttl.opacity
ttl.sd_SetOpacity(!ttl.opacity) ttl.ul_SetOpacity(!ttl.opacity)
fromupdate += ttl fromupdate += ttl
@@ -1687,9 +1687,9 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0)
var/area/AR = X.loc var/area/AR = X.loc
if(AR.sd_lighting) if(AR.ul_Lighting)
X.opacity = !X.opacity X.opacity = !X.opacity
X.sd_SetOpacity(!X.opacity) X.ul_SetOpacity(!X.opacity)
toupdate += X toupdate += X

View File

@@ -45,6 +45,8 @@
thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT
heat_capacity = 700000 heat_capacity = 700000
LightLevelBlue = 5
transit transit
var/pushdirection // push things that get caught in the transit tile this direction var/pushdirection // push things that get caught in the transit tile this direction
@@ -311,7 +313,7 @@
New() New()
..() ..()
sd_SetLuminosity(3) ul_SetLuminosity(3)
/turf/simulated/wall/mineral/gold /turf/simulated/wall/mineral/gold
walltype = "gold" walltype = "gold"

View File

@@ -14,9 +14,9 @@
uid = ++global_uid uid = ++global_uid
spawn(1) spawn(1)
//world.log << "New: [src] [tag]" //world.log << "New: [src] [tag]"
var/sd_created = findtext(tag,"sd_L") var/ul_created = findtext(tag,":UL")
sd_New(sd_created) ul_Prep()
if(sd_created) if(ul_created)
related += src related += src
return return
related = list(src) related = list(src)
@@ -27,7 +27,7 @@
if(name == "Space") // override defaults for space if(name == "Space") // override defaults for space
requires_power = 1 requires_power = 1
always_unpowered = 1 always_unpowered = 1
sd_SetLuminosity(1) ul_SetLuminosity(1)
power_light = 0 power_light = 0
power_equip = 0 power_equip = 0
power_environ = 0 power_environ = 0
@@ -38,11 +38,11 @@
power_equip = 0//rastaf0 power_equip = 0//rastaf0
power_environ = 0//rastaf0 power_environ = 0//rastaf0
luminosity = 1 luminosity = 1
sd_lighting = 0 // *DAL* ul_Lighting = 0 // *DAL*
else else
luminosity = 0 luminosity = 0
area_lights_luminosity = rand(6,9) area_lights_luminosity = rand(6,9)
//sd_SetLuminosity(0) // *DAL* //ul_SetLuminosity(0) // *DAL*

View File

@@ -477,7 +477,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
update_icon() update_icon()
if (!istype(src, /obj/machinery/door/airlock/glass)) if (!istype(src, /obj/machinery/door/airlock/glass))
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
src.operating = 0 src.operating = 0
return return
user << "\red You need to be wielding the Fire axe to do that." user << "\red You need to be wielding the Fire axe to do that."
@@ -494,7 +494,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
update_icon() update_icon()
if (!istype(src, /obj/machinery/door/airlock/glass)) if (!istype(src, /obj/machinery/door/airlock/glass))
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
src.operating = 0 src.operating = 0
return return
@@ -513,7 +513,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
update_icon() update_icon()
if ((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass))) if ((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass)))
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
src.operating = 0 src.operating = 0
else else
user << "\red You need to be wielding the Fire axe to do that." user << "\red You need to be wielding the Fire axe to do that."
@@ -527,7 +527,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
update_icon() update_icon()
if ((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass))) if ((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass)))
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
src.operating = 0 src.operating = 0
else else

View File

@@ -249,12 +249,12 @@
if(!src.operating) //in case of emag if(!src.operating) //in case of emag
src.operating = 1 src.operating = 1
animate("opening") animate("opening")
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
sleep(10) sleep(10)
src.layer = 2.7 src.layer = 2.7
src.density = 0 src.density = 0
update_icon() update_icon()
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
if(operating == 1) //emag again if(operating == 1) //emag again
@@ -332,7 +332,7 @@
update_icon() update_icon()
if(src.visible && (!src.glass)) if(src.visible && (!src.glass))
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
if(operating == 1) if(operating == 1)
operating = 0 operating = 0
update_nearby_tiles() update_nearby_tiles()

View File

@@ -22,7 +22,7 @@
src.icon_state = "pdoor0" src.icon_state = "pdoor0"
sleep(15) sleep(15)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
src.operating = 0 src.operating = 0
return return
return return
@@ -38,7 +38,7 @@
src.icon_state = "pdoor0" src.icon_state = "pdoor0"
sleep(10) sleep(10)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
if(operating == 1) //emag again if(operating == 1) //emag again
@@ -56,7 +56,7 @@
src.icon_state = "pdoor1" src.icon_state = "pdoor1"
src.density = 1 src.density = 1
if (src.visible) if (src.visible)
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
update_nearby_tiles() update_nearby_tiles()
sleep(10) sleep(10)
@@ -74,12 +74,12 @@
src.icon_state = "pdoor0" src.icon_state = "pdoor0"
sleep(10) sleep(10)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
f1.density = 0 f1.density = 0
f1.sd_SetOpacity(0) f1.ul_SetOpacity(0)
f2.density = 0 f2.density = 0
f2.sd_SetOpacity(0) f2.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
@@ -99,12 +99,12 @@
src.density = 1 src.density = 1
f1.density = 1 f1.density = 1
f1.sd_SetOpacity(1) f1.ul_SetOpacity(1)
f2.density = 1 f2.density = 1
f2.sd_SetOpacity(1) f2.ul_SetOpacity(1)
if (src.visible) if (src.visible)
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
update_nearby_tiles() update_nearby_tiles()
sleep(10) sleep(10)
@@ -122,16 +122,16 @@
src.icon_state = "pdoor0" src.icon_state = "pdoor0"
sleep(10) sleep(10)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
f1.density = 0 f1.density = 0
f1.sd_SetOpacity(0) f1.ul_SetOpacity(0)
f2.density = 0 f2.density = 0
f2.sd_SetOpacity(0) f2.ul_SetOpacity(0)
f3.density = 0 f3.density = 0
f3.sd_SetOpacity(0) f3.ul_SetOpacity(0)
f4.density = 0 f4.density = 0
f4.sd_SetOpacity(0) f4.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
@@ -151,16 +151,16 @@
src.density = 1 src.density = 1
f1.density = 1 f1.density = 1
f1.sd_SetOpacity(1) f1.ul_SetOpacity(1)
f2.density = 1 f2.density = 1
f2.sd_SetOpacity(1) f2.ul_SetOpacity(1)
f3.density = 1 f3.density = 1
f3.sd_SetOpacity(1) f3.ul_SetOpacity(1)
f4.density = 1 f4.density = 1
f4.sd_SetOpacity(1) f4.ul_SetOpacity(1)
if (src.visible) if (src.visible)
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
update_nearby_tiles() update_nearby_tiles()
sleep(10) sleep(10)
@@ -178,12 +178,12 @@
src.icon_state = "pdoor0" src.icon_state = "pdoor0"
sleep(10) sleep(10)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
f1.density = 0 f1.density = 0
f1.sd_SetOpacity(0) f1.ul_SetOpacity(0)
f2.density = 0 f2.density = 0
f2.sd_SetOpacity(0) f2.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
@@ -203,12 +203,12 @@
src.density = 1 src.density = 1
f1.density = 1 f1.density = 1
f1.sd_SetOpacity(1) f1.ul_SetOpacity(1)
f2.density = 1 f2.density = 1
f2.sd_SetOpacity(1) f2.ul_SetOpacity(1)
if (src.visible) if (src.visible)
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
update_nearby_tiles() update_nearby_tiles()
sleep(10) sleep(10)
@@ -226,16 +226,16 @@
src.icon_state = "pdoor0" src.icon_state = "pdoor0"
sleep(10) sleep(10)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
f1.density = 0 f1.density = 0
f1.sd_SetOpacity(0) f1.ul_SetOpacity(0)
f2.density = 0 f2.density = 0
f2.sd_SetOpacity(0) f2.ul_SetOpacity(0)
f3.density = 0 f3.density = 0
f3.sd_SetOpacity(0) f3.ul_SetOpacity(0)
f4.density = 0 f4.density = 0
f4.sd_SetOpacity(0) f4.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
@@ -255,16 +255,16 @@
src.density = 1 src.density = 1
f1.density = 1 f1.density = 1
f1.sd_SetOpacity(1) f1.ul_SetOpacity(1)
f2.density = 1 f2.density = 1
f2.sd_SetOpacity(1) f2.ul_SetOpacity(1)
f3.density = 1 f3.density = 1
f3.sd_SetOpacity(1) f3.ul_SetOpacity(1)
f4.density = 1 f4.density = 1
f4.sd_SetOpacity(1) f4.ul_SetOpacity(1)
if (src.visible) if (src.visible)
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
update_nearby_tiles() update_nearby_tiles()
sleep(10) sleep(10)
@@ -285,8 +285,8 @@
f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,EAST)) f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,EAST))
f1.density = density f1.density = density
f2.density = density f2.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1
@@ -304,8 +304,8 @@
f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,NORTH)) f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,NORTH))
f1.density = density f1.density = density
f2.density = density f2.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1
@@ -329,10 +329,10 @@
f2.density = density f2.density = density
f3.density = density f3.density = density
f4.density = density f4.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
f4.sd_SetOpacity(opacity) f4.ul_SetOpacity(opacity)
f3.sd_SetOpacity(opacity) f3.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1
@@ -358,10 +358,10 @@
f2.density = density f2.density = density
f3.density = density f3.density = density
f4.density = density f4.density = density
f1.sd_SetOpacity(opacity) f1.ul_SetOpacity(opacity)
f2.sd_SetOpacity(opacity) f2.ul_SetOpacity(opacity)
f4.sd_SetOpacity(opacity) f4.ul_SetOpacity(opacity)
f3.sd_SetOpacity(opacity) f3.ul_SetOpacity(opacity)
Del() Del()
del f1 del f1

View File

@@ -18,7 +18,7 @@
src.icon_state = "shutter0" src.icon_state = "shutter0"
sleep(15) sleep(15)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
src.operating = 0 src.operating = 0
return return
return return
@@ -34,7 +34,7 @@
src.icon_state = "shutter0" src.icon_state = "shutter0"
sleep(10) sleep(10)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
if(operating == 1) //emag again if(operating == 1) //emag again
@@ -52,7 +52,7 @@
src.icon_state = "shutter1" src.icon_state = "shutter1"
src.density = 1 src.density = 1
if (src.visible) if (src.visible)
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
update_nearby_tiles() update_nearby_tiles()
sleep(10) sleep(10)

View File

@@ -94,7 +94,7 @@
sleep(10) sleep(10)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
update_nearby_tiles() update_nearby_tiles()
if(operating == 1) //emag again if(operating == 1) //emag again
@@ -111,7 +111,7 @@
src.density = 1 src.density = 1
if (src.visible) if (src.visible)
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
update_nearby_tiles() update_nearby_tiles()
sleep(10) sleep(10)

View File

@@ -24,17 +24,17 @@
/obj/machinery/flasher/New() /obj/machinery/flasher/New()
sleep(4) sleep(4)
src.sd_SetLuminosity(2) src.ul_SetLuminosity(2)
/obj/machinery/flasher/power_change() /obj/machinery/flasher/power_change()
if ( powered() ) if ( powered() )
stat &= ~NOPOWER stat &= ~NOPOWER
icon_state = "[base_state]1" icon_state = "[base_state]1"
src.sd_SetLuminosity(2) src.ul_SetLuminosity(2)
else else
stat |= ~NOPOWER stat |= ~NOPOWER
icon_state = "[base_state]1-p" icon_state = "[base_state]1-p"
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
//Don't want to render prison breaks impossible //Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob)

View File

@@ -16,17 +16,17 @@
if (!on) if (!on)
if (luminosity) if (luminosity)
updateicon() updateicon()
sd_SetLuminosity(0) ul_SetLuminosity(0)
return return
if(!luminosity && cell && cell.charge > 0) if(!luminosity && cell && cell.charge > 0)
sd_SetLuminosity(10) ul_SetLuminosity(10)
updateicon() updateicon()
if(!cell && luminosity) if(!cell && luminosity)
on = 0 on = 0
updateicon() updateicon()
sd_SetLuminosity(0) ul_SetLuminosity(0)
return return
cell.charge -= use cell.charge -= use
@@ -34,7 +34,7 @@
if(cell.charge <= 0 && luminosity) if(cell.charge <= 0 && luminosity)
on = 0 on = 0
updateicon() updateicon()
sd_SetLuminosity(0) ul_SetLuminosity(0)
return return
/obj/machinery/floodlight/attack_hand(mob/user as mob) /obj/machinery/floodlight/attack_hand(mob/user as mob)

View File

@@ -72,20 +72,20 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
hologram.icon = A.holo_icon hologram.icon = A.holo_icon
hologram.mouse_opacity = 0//So you can't click on it. hologram.mouse_opacity = 0//So you can't click on it.
hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them. hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
hologram.sd_SetLuminosity(1)//To make it glowy. hologram.ul_SetLuminosity(1)//To make it glowy.
hologram.anchored = 1//So space wind cannot drag it. hologram.anchored = 1//So space wind cannot drag it.
hologram.name = "AI hologram"//If someone decides to right click. hologram.name = "AI hologram"//If someone decides to right click.
sd_SetLuminosity(1)//To make the pad glowy. ul_SetLuminosity(0,0,1)//To make the pad glowy.
icon_state = "holopad1" icon_state = "holopad1"
master = A//AI is the master. master = A//AI is the master.
use_power = 2//Active power usage. use_power = 2//Active power usage.
return 1 return 1
/obj/machinery/hologram/holopad/proc/clear_holo() /obj/machinery/hologram/holopad/proc/clear_holo()
hologram.sd_SetLuminosity(0)//Clear lighting. hologram.ul_SetLuminosity(0)//Clear lighting.
del(hologram)//Get rid of hologram. del(hologram)//Get rid of hologram.
master = null//Null the master, since no-one is using it now. master = null//Null the master, since no-one is using it now.
sd_SetLuminosity(0)//Clear lighting for the parent. ul_SetLuminosity(0)//Clear lighting for the parent.
icon_state = "holopad0" icon_state = "holopad0"
use_power = 1//Passive power usage. use_power = 1//Passive power usage.
return 1 return 1

View File

@@ -179,12 +179,12 @@ obj/machinery/hydroponics/proc/updateicon()
if(myseed) if(myseed)
if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom)) //revert luminosity to 0 if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom)) //revert luminosity to 0
sd_SetLuminosity(0) ul_SetLuminosity(0)
else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom)) //update luminosity else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom)) //update luminosity
sd_SetLuminosity(myseed.potency/10) ul_SetLuminosity(myseed.potency/10)
else else
if(luminosity) if(luminosity)
sd_SetLuminosity(0) ul_SetLuminosity(0)
return return
@@ -1014,10 +1014,10 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob)
if(myseed) if(myseed)
if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom)) if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom))
sd_SetLuminosity(0) ul_SetLuminosity(0)
else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom)) else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom))
sd_SetLuminosity(myseed.potency/10) ul_SetLuminosity(myseed.potency/10)
else else
if(luminosity) if(luminosity)
sd_SetLuminosity(0) ul_SetLuminosity(0)
return return

View File

@@ -53,11 +53,11 @@
if ( powered() && disable == 0 ) if ( powered() && disable == 0 )
stat &= ~NOPOWER stat &= ~NOPOWER
icon_state = "[base_state]" icon_state = "[base_state]"
src.sd_SetLuminosity(2) src.ul_SetLuminosity(2)
else else
stat |= ~NOPOWER stat |= ~NOPOWER
icon_state = "[base_state]-p" icon_state = "[base_state]-p"
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob) /obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/device/detective_scanner)) if(istype(W, /obj/item/device/detective_scanner))

View File

@@ -427,7 +427,7 @@
if(A && B) if(A && B)
needs_power = 1 needs_power = 1
spawn(1) spawn(1)
src.sd_SetLuminosity(3) src.ul_SetLuminosity(3)
/* for(var/mob/M as mob in src.loc) //does not work for some reason. /* for(var/mob/M as mob in src.loc) //does not work for some reason.
if(istype(M,/mob/living/carbon)) if(istype(M,/mob/living/carbon))

View File

@@ -55,12 +55,12 @@ datum/controller/game_controller
// Now that the game is world is fully initialized, pause server until a user connects. // Now that the game is world is fully initialized, pause server until a user connects.
world.sleep_offline = 1 world.sleep_offline = 1
setup_objects()
setupgenetics() setupgenetics()
setupdooralarms() setupdooralarms()
setup_objects()
// for(var/i = 0, i < max_secret_rooms, i++) // for(var/i = 0, i < max_secret_rooms, i++)
// make_mining_asteroid_secret() // make_mining_asteroid_secret()
// Because energy cutlasses, facehuggers, and empty rooms are silly. FOR NOW. - Erthilo // Because energy cutlasses, facehuggers, and empty rooms are silly. FOR NOW. - Erthilo
@@ -104,6 +104,8 @@ datum/controller/game_controller
new /obj/structure/closet/emcloset(loc) new /obj/structure/closet/emcloset(loc)
emclosetcount-- emclosetcount--
setup_UL()
world << "\red \b Initializations complete." world << "\red \b Initializations complete."

View File

@@ -942,9 +942,9 @@
return return
lights = !lights lights = !lights
if(lights) if(lights)
src.sd_SetLuminosity(src.luminosity + src.lights_power) src.ul_SetLuminosity(src.luminosity + src.lights_power)
else else
src.sd_SetLuminosity(src.luminosity - src.lights_power) src.ul_SetLuminosity(src.luminosity - src.lights_power)
src.log_message("Toggled lights.") src.log_message("Toggled lights.")
return return

View File

@@ -13,7 +13,7 @@
/obj/effect/alien/weeds/node/New() /obj/effect/alien/weeds/node/New()
..() ..()
sd_SetLuminosity(NODERANGE) ul_SetLuminosity(NODERANGE)
return return
/obj/effect/alien/weeds/proc/Life() /obj/effect/alien/weeds/proc/Life()

View File

@@ -63,7 +63,7 @@
New() New()
..() ..()
sd_SetLuminosity(1) ul_SetLuminosity(1)
spawn(1200) // 2 minutes spawn(1200) // 2 minutes
del(src) del(src)

View File

@@ -173,13 +173,13 @@
*/ */
/obj/item/device/pda/pickup(mob/user) /obj/item/device/pda/pickup(mob/user)
if (fon) if (fon)
sd_SetLuminosity(0) ul_SetLuminosity(0)
user.total_luminosity += f_lum user.ul_SetLuminosity(user.LuminosityRed + (f_lum - 1), user.LuminosityGreen + (f_lum - 1), user.LuminosityBlue + (f_lum + 1))
/obj/item/device/pda/dropped(mob/user) /obj/item/device/pda/dropped(mob/user)
if (fon) if (fon)
user.total_luminosity -= f_lum user.ul_SetLuminosity(user.LuminosityRed - (f_lum - 1), user.LuminosityGreen - (f_lum - 1), user.LuminosityBlue - (f_lum + 1))
sd_SetLuminosity(f_lum) ul_SetLuminosity(f_lum - 1, f_lum - 1, f_lum + 1)
/obj/item/device/pda/New() /obj/item/device/pda/New()
..() ..()
@@ -468,11 +468,11 @@
fon = (!fon) fon = (!fon)
if (src in U.contents) if (src in U.contents)
if (fon) if (fon)
U.total_luminosity += f_lum U.ul_SetLuminosity(U.LuminosityRed + (f_lum - 1), U.LuminosityGreen + (f_lum - 1), U.LuminosityBlue + (f_lum + 1))
else else
U.total_luminosity -= f_lum U.ul_SetLuminosity(U.LuminosityRed - (f_lum - 1), U.LuminosityGreen - (f_lum - 1), U.LuminosityBlue - (f_lum + 1))
else else
sd_SetLuminosity(fon * f_lum) ul_SetLuminosity(fon * f_lum)
if("Medical Scan") if("Medical Scan")
if(scanmode == 1) if(scanmode == 1)
scanmode = 0 scanmode = 0
@@ -939,7 +939,7 @@
if (src in M.contents) if (src in M.contents)
if(fon) if(fon)
fon = 0 fon = 0
M.total_luminosity -= f_lum M.ul_SetLuminosity(M.LuminosityRed + (f_lum - 1), M.LuminosityGreen + (f_lum - 1), M.LuminosityBlue + (f_lum + 1))
if(T) if(T)
T.hotspot_expose(700,125) T.hotspot_expose(700,125)

View File

@@ -17,30 +17,30 @@
..() ..()
if (on) if (on)
icon_state = icon_on icon_state = icon_on
src.sd_SetLuminosity(brightness_on) src.ul_SetLuminosity(brightness_on, brightness_on, 0)
else else
icon_state = icon_off icon_state = icon_off
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
/obj/item/device/flashlight/proc/update_brightness(var/mob/user = null) /obj/item/device/flashlight/proc/update_brightness(var/mob/user = null)
if (on) if (on)
icon_state = icon_on icon_state = icon_on
if(src.loc == user) if(src.loc == user)
user.total_luminosity += brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + brightness_on, user.LuminosityBlue)
else if (isturf(src.loc)) else if (isturf(src.loc))
src.sd_SetLuminosity(brightness_on) src.ul_SetLuminosity(brightness_on, brightness_on, 0)
else else
icon_state = icon_off icon_state = icon_off
if(src.loc == user) if(src.loc == user)
user.total_luminosity -= brightness_on user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - brightness_on, user.LuminosityBlue)
else if (isturf(src.loc)) else if (isturf(src.loc))
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
/obj/item/device/flashlight/attack_self(mob/user) /obj/item/device/flashlight/attack_self(mob/user)
if(!isturf(user.loc)) // if(!isturf(user.loc))
user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. // user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities.
return // return
on = !on on = !on
update_brightness(user) update_brightness(user)
return return
@@ -82,14 +82,14 @@
/obj/item/device/flashlight/pickup(mob/user) /obj/item/device/flashlight/pickup(mob/user)
if(on) if(on)
user.total_luminosity += brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + brightness_on, user.LuminosityBlue)
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
/obj/item/device/flashlight/dropped(mob/user) /obj/item/device/flashlight/dropped(mob/user)
if(on) if(on)
user.total_luminosity -= brightness_on user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - brightness_on, user.LuminosityBlue)
src.sd_SetLuminosity(brightness_on) src.ul_SetLuminosity(brightness_on)
/obj/item/device/flashlight/pen /obj/item/device/flashlight/pen
@@ -148,21 +148,19 @@
item_state = "hardhat[on]_[color]" item_state = "hardhat[on]_[color]"
if(on) if(on)
user.total_luminosity += brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue)
else else
user.total_luminosity -= brightness_on user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - (brightness_on - 1), user.LuminosityBlue)
/obj/item/clothing/head/helmet/hardhat/pickup(mob/user) /obj/item/clothing/head/helmet/hardhat/pickup(mob/user)
if(on) if(on)
user.total_luminosity += brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue)
user.UpdateLuminosity() ul_SetLuminosity(0)
src.sd_SetLuminosity(0)
/obj/item/clothing/head/helmet/hardhat/dropped(mob/user) /obj/item/clothing/head/helmet/hardhat/dropped(mob/user)
if(on) if(on)
user.total_luminosity -= brightness_on user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - (brightness_on - 1), user.LuminosityBlue)
user.UpdateLuminosity() ul_SetLuminosity(brightness_on, brightness_on - 1, 0)
src.sd_SetLuminosity(brightness_on)
//RIG helmet light //RIG helmet light
/obj/item/clothing/head/helmet/space/rig/attack_self(mob/user) /obj/item/clothing/head/helmet/space/rig/attack_self(mob/user)
@@ -174,21 +172,19 @@
item_state = "rig[on]-[color]" item_state = "rig[on]-[color]"
if(on) if(on)
user.total_luminosity += brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue)
else else
user.total_luminosity -= brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue)
/obj/item/clothing/head/helmet/space/rig/pickup(mob/user) /obj/item/clothing/head/helmet/space/rig/pickup(mob/user)
if(on) if(on)
user.total_luminosity += brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue)
user.UpdateLuminosity() ul_SetLuminosity(0)
src.sd_SetLuminosity(0)
/obj/item/clothing/head/helmet/space/rig/dropped(mob/user) /obj/item/clothing/head/helmet/space/rig/dropped(mob/user)
if(on) if(on)
user.total_luminosity -= brightness_on user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue)
user.UpdateLuminosity() ul_SetLuminosity(brightness_on, brightness_on-1, 0)
src.sd_SetLuminosity(brightness_on)
// the desk lamps are a bit special // the desk lamps are a bit special
/obj/item/device/flashlight/lamp /obj/item/device/flashlight/lamp

View File

@@ -50,7 +50,7 @@
for(var/mob/M in viewers(user)) for(var/mob/M in viewers(user))
if(M == user) continue if(M == user) continue
M << "[user] detaches the power sink from the cable." M << "[user] detaches the power sink from the cable."
sd_SetLuminosity(0) ul_SetLuminosity(0)
icon_state = "powersink0" icon_state = "powersink0"
return return
@@ -85,7 +85,7 @@
if(M == user) continue if(M == user) continue
M << "[user] deactivates the power sink!" M << "[user] deactivates the power sink!"
mode = 1 mode = 1
sd_SetLuminosity(0) ul_SetLuminosity(0)
icon_state = "powersink0" icon_state = "powersink0"
processing_objects.Remove(src) processing_objects.Remove(src)
@@ -94,7 +94,7 @@
var/datum/powernet/PN = attached.get_powernet() var/datum/powernet/PN = attached.get_powernet()
if(PN) if(PN)
if(!luminosity) if(!luminosity)
sd_SetLuminosity(12) ul_SetLuminosity(12)
// found a powernet, so drain up to max power from it // found a powernet, so drain up to max power from it

View File

@@ -975,10 +975,10 @@ steam.start() -- spawns the effect
..() ..()
update_nearby_tiles(1) update_nearby_tiles(1)
spawn(1) spawn(1)
sd_NewOpacity(1) ul_SetOpacity(1)
Del() Del()
sd_NewOpacity(0) ul_SetOpacity(0)
density = 0 density = 0
update_nearby_tiles(1) update_nearby_tiles(1)
..() ..()

View File

@@ -41,7 +41,7 @@
icon_state = "glowshroomf" icon_state = "glowshroomf"
spawn(2) //allows the luminosity and spread rate to be affected by potency at the moment of creation spawn(2) //allows the luminosity and spread rate to be affected by potency at the moment of creation
sd_SetLuminosity(potency/10) ul_SetLuminosity(potency/10)
spawn(delay) spawn(delay)
if(src) if(src)
Spread() Spread()

View File

@@ -51,7 +51,7 @@
//src.damtype = "fire" //src.damtype = "fire"
for(var/mob/O in viewers(usr, null)) for(var/mob/O in viewers(usr, null))
O.show_message(flavor_text, 1) O.show_message(flavor_text, 1)
sd_SetLuminosity(CANDLE_LUM) ul_SetLuminosity(CANDLE_LUM, CANDLE_LUM -2, 0)
processing_objects.Add(src) processing_objects.Add(src)
@@ -74,20 +74,19 @@
if(lit) if(lit)
lit = 0 lit = 0
update_icon() update_icon()
sd_SetLuminosity(0) ul_SetLuminosity(0)
user.total_luminosity -= CANDLE_LUM user.ul_SetLuminosity(user.LuminosityRed - CANDLE_LUM, user.LuminosityGreen - (CANDLE_LUM - 2), user.LuminosityBlue)
pickup(mob/user) pickup(mob/user)
if(lit) if(lit)
src.sd_SetLuminosity(0) ul_SetLuminosity(0)
user.total_luminosity += CANDLE_LUM user.ul_SetLuminosity(user.LuminosityRed + CANDLE_LUM, user.LuminosityGreen + (CANDLE_LUM - 2), user.LuminosityBlue)
dropped(mob/user) dropped(mob/user)
if(lit) if(lit)
user.total_luminosity -= CANDLE_LUM user.ul_SetLuminosity(user.LuminosityRed - CANDLE_LUM, user.LuminosityGreen - (CANDLE_LUM - 2), user.LuminosityBlue)
src.sd_SetLuminosity(CANDLE_LUM) src.ul_SetLuminosity(CANDLE_LUM, CANDLE_LUM, 0)

View File

@@ -441,7 +441,7 @@ ZIPPO
for(var/mob/O in viewers(user, null)) for(var/mob/O in viewers(user, null))
O.show_message("\red After a few attempts, \the [user] manages to light \the [src], they however burn themself in the process.", 1) O.show_message("\red After a few attempts, \the [user] manages to light \the [src], they however burn themself in the process.", 1)
user.total_luminosity += 2 user.ul_SetLuminosity(user.LuminosityRed + 2, user.LuminosityGreen + 1, user.LuminosityBlue)
processing_objects.Add(src) processing_objects.Add(src)
else else
src.lit = 0 src.lit = 0
@@ -454,7 +454,7 @@ ZIPPO
for(var/mob/O in viewers(user, null)) for(var/mob/O in viewers(user, null))
O.show_message("\red [user] quietly shuts off the [src].", 1) O.show_message("\red [user] quietly shuts off the [src].", 1)
user.total_luminosity -= 2 user.ul_SetLuminosity(user.LuminosityRed - 2, user.LuminosityGreen - 1, user.LuminosityBlue)
processing_objects.Remove(src) processing_objects.Remove(src)
else else
return ..() return ..()
@@ -483,13 +483,13 @@ ZIPPO
pickup(mob/user) pickup(mob/user)
if(lit) if(lit)
src.sd_SetLuminosity(0) ul_SetLuminosity(0)
user.total_luminosity += 2 user.ul_SetLuminosity(user.LuminosityRed + 2, user.LuminosityGreen + 1, user.LuminosityBlue)
return return
dropped(mob/user) dropped(mob/user)
if(lit) if(lit)
user.total_luminosity -= 2 user.ul_SetLuminosity(user.LuminosityRed - 2, user.LuminosityGreen - 1, user.LuminosityBlue)
src.sd_SetLuminosity(2) ul_SetLuminosity(2)
return return

View File

@@ -37,9 +37,9 @@ NOTEBOOK
M << "\red \the [src] burns up." M << "\red \the [src] burns up."
if(istype(src.loc,/mob)) if(istype(src.loc,/mob))
var/mob/M = src.loc var/mob/M = src.loc
M.total_luminosity -= 8 M.ul_SetLuminosity(M.LuminosityRed - 8, M.LuminosityGreen - 6, M.LuminosityBlue)
else else
src.sd_SetLuminosity(0) ul_SetLuminosity(0)
processing_objects.Remove(src) processing_objects.Remove(src)
del(src) del(src)
@@ -53,13 +53,13 @@ NOTEBOOK
/obj/item/weapon/paper/pickup(mob/user) /obj/item/weapon/paper/pickup(mob/user)
if(burning) if(burning)
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
user.total_luminosity += 8 user.ul_SetLuminosity(user.LuminosityRed + 8, user.LuminosityGreen + 6, user.LuminosityBlue)
/obj/item/weapon/paper/dropped(mob/user) /obj/item/weapon/paper/dropped(mob/user)
if(burning) if(burning)
user.total_luminosity -= 8 user.ul_SetLuminosity(user.LuminosityRed - 8, user.LuminosityGreen - 6, user.LuminosityBlue)
src.sd_SetLuminosity(8) src.ul_SetLuminosity(8,6,0)
/obj/item/weapon/paper/examine() /obj/item/weapon/paper/examine()
set src in view() set src in view()
@@ -163,7 +163,7 @@ NOTEBOOK
if(is_burn(P)) if(is_burn(P))
for(var/mob/M in viewers(5, get_turf(src))) for(var/mob/M in viewers(5, get_turf(src)))
M << "\red [user] sets \the [src] on fire." M << "\red [user] sets \the [src] on fire."
user.total_luminosity += 8 user.ul_SetLuminosity(user.LuminosityRed + 8, user.LuminosityGreen + 6, user.LuminosityBlue)
burning = 1 burning = 1
processing_objects.Add(src) processing_objects.Add(src)
update_icon() update_icon()

View File

@@ -170,7 +170,7 @@
New() New()
..() ..()
sd_SetLuminosity(3) ul_SetLuminosity(3)
/obj/structure/mineral_door/sandstone /obj/structure/mineral_door/sandstone
mineralType = "sandstone" mineralType = "sandstone"

View File

@@ -191,20 +191,20 @@
flick("fwall_opening", src) flick("fwall_opening", src)
sleep(15) sleep(15)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
var/turf/T = src.loc var/turf/T = src.loc
T.sd_LumReset() T.ul_Recalculate()
else else
icon_state = "wall" icon_state = "wall"
flick("fwall_closing", src) flick("fwall_closing", src)
sleep(15) sleep(15)
src.density = 1 src.density = 1
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
var/turf/T = src.loc var/turf/T = src.loc
//T.sd_LumUpdate() //T.sd_LumUpdate()
src.relativewall() src.relativewall()
T.sd_LumReset() T.ul_Recalculate()
attackby(obj/item/weapon/W as obj, mob/user as mob) attackby(obj/item/weapon/W as obj, mob/user as mob)
@@ -235,20 +235,20 @@
flick("frwall_opening", src) flick("frwall_opening", src)
sleep(15) sleep(15)
src.density = 0 src.density = 0
src.sd_SetOpacity(0) src.ul_SetOpacity(0)
var/turf/T = src.loc var/turf/T = src.loc
T.sd_LumReset() T.ul_Recalculate()
else else
icon_state = "r_wall" icon_state = "r_wall"
flick("frwall_closing", src) flick("frwall_closing", src)
sleep(15) sleep(15)
src.density = 1 src.density = 1
src.sd_SetOpacity(1) src.ul_SetOpacity(1)
var/turf/T = src.loc var/turf/T = src.loc
//T.sd_LumUpdate() //T.sd_LumUpdate()
src.relativewall() src.relativewall()
T.sd_LumReset() T.ul_Recalculate()
attackby(obj/item/weapon/W as obj, mob/user as mob) attackby(obj/item/weapon/W as obj, mob/user as mob)

View File

@@ -20,18 +20,18 @@ var/supply_shuttle_points = 50
var/ordernum=0 var/ordernum=0
var/list/supply_groups = new() var/list/supply_groups = new()
/area/supply/station //DO NOT TURN THE SD_LIGHTING STUFF ON FOR SHUTTLES. IT BREAKS THINGS. /area/supply/station //DO NOT TURN THE ul_Lighting STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
name = "supply shuttle" name = "supply shuttle"
icon_state = "shuttle3" icon_state = "shuttle3"
luminosity = 1 luminosity = 1
sd_lighting = 0 ul_Lighting = 0
requires_power = 0 requires_power = 0
/area/supply/dock //DO NOT TURN THE SD_LIGHTING STUFF ON FOR SHUTTLES. IT BREAKS THINGS. /area/supply/dock //DO NOT TURN THE ul_Lighting STUFF ON FOR SHUTTLES. IT BREAKS THINGS.
name = "supply shuttle" name = "supply shuttle"
icon_state = "shuttle3" icon_state = "shuttle3"
luminosity = 1 luminosity = 1
sd_lighting = 0 ul_Lighting = 0
requires_power = 0 requires_power = 0
//SUPPLY PACKS MOVED TO /code/defines/obj/supplypacks.dm //SUPPLY PACKS MOVED TO /code/defines/obj/supplypacks.dm

View File

@@ -162,7 +162,7 @@
if (!explode) if (!explode)
W.opacity = 1 W.opacity = 1
W.sd_SetOpacity(0) W.ul_SetOpacity(0)
//This is probably gonna make lighting go a bit wonky in bombed areas, but sd_SetOpacity was the primary reason bombs have been so laggy. --NEO //This is probably gonna make lighting go a bit wonky in bombed areas, but sd_SetOpacity was the primary reason bombs have been so laggy. --NEO
W.levelupdate() W.levelupdate()
air_master.tiles_to_update |= W air_master.tiles_to_update |= W
@@ -191,7 +191,7 @@
if(prior_icon) W.icon_state = prior_icon if(prior_icon) W.icon_state = prior_icon
else W.icon_state = "plating" else W.icon_state = "plating"
W.opacity = 1 W.opacity = 1
W.sd_SetOpacity(0) W.ul_SetOpacity(0)
W.levelupdate() W.levelupdate()
air_master.tiles_to_update |= W air_master.tiles_to_update |= W
@@ -327,7 +327,7 @@
var/turf/simulated/wall/S = new /turf/simulated/wall( locate(src.x, src.y, src.z) ) var/turf/simulated/wall/S = new /turf/simulated/wall( locate(src.x, src.y, src.z) )
S.icon_old = old_icon S.icon_old = old_icon
S.opacity = 0 S.opacity = 0
S.sd_NewOpacity(1) S.ul_SetOpacity(1)
levelupdate() levelupdate()
air_master.tiles_to_update |= S air_master.tiles_to_update |= S
@@ -349,7 +349,7 @@
var/turf/simulated/wall/r_wall/S = new /turf/simulated/wall/r_wall( locate(src.x, src.y, src.z) ) var/turf/simulated/wall/r_wall/S = new /turf/simulated/wall/r_wall( locate(src.x, src.y, src.z) )
S.icon_old = old_icon S.icon_old = old_icon
S.opacity = 0 S.opacity = 0
S.sd_NewOpacity(1) S.ul_SetOpacity(1)
levelupdate() levelupdate()
air_master.tiles_to_update |= S air_master.tiles_to_update |= S
@@ -851,7 +851,7 @@
spawn(100) spawn(100)
if(O) del(O) if(O) del(O)
F.sd_LumReset() F.ul_Recalculate()
return return
/turf/simulated/wall/meteorhit(obj/M as obj) /turf/simulated/wall/meteorhit(obj/M as obj)
@@ -1055,19 +1055,19 @@ turf/simulated/floor/proc/update_icon()
switch(T.state) switch(T.state)
if(0) if(0)
icon_state = "light_on" icon_state = "light_on"
sd_SetLuminosity(5) ul_SetLuminosity(5)
if(1) if(1)
var/num = pick("1","2","3","4") var/num = pick("1","2","3","4")
icon_state = "light_on_flicker[num]" icon_state = "light_on_flicker[num]"
sd_SetLuminosity(5) ul_SetLuminosity(5)
if(2) if(2)
icon_state = "light_on_broken" icon_state = "light_on_broken"
sd_SetLuminosity(5) ul_SetLuminosity(5)
if(3) if(3)
icon_state = "light_off" icon_state = "light_off"
sd_SetLuminosity(0) ul_SetLuminosity(0)
else else
sd_SetLuminosity(0) ul_SetLuminosity(0)
icon_state = "light_off" icon_state = "light_off"
if(is_grass_floor()) if(is_grass_floor())
if(!broken && !burnt) if(!broken && !burnt)
@@ -1215,7 +1215,7 @@ turf/simulated/floor/return_siding_icon_state()
if(!floor_tile) return if(!floor_tile) return
del(floor_tile) del(floor_tile)
icon_plating = "plating" icon_plating = "plating"
sd_SetLuminosity(0) ul_SetLuminosity(0)
floor_tile = null floor_tile = null
intact = 0 intact = 0
broken = 0 broken = 0
@@ -1231,7 +1231,7 @@ turf/simulated/floor/return_siding_icon_state()
broken = 0 broken = 0
burnt = 0 burnt = 0
intact = 1 intact = 1
sd_SetLuminosity(0) ul_SetLuminosity(0)
if(T) if(T)
if(istype(T,/obj/item/stack/tile/plasteel)) if(istype(T,/obj/item/stack/tile/plasteel))
floor_tile = T floor_tile = T

View File

@@ -213,7 +213,7 @@
if(new_value == null) return if(new_value == null) return
if(variable=="luminosity") if(variable=="luminosity")
O.sd_SetLuminosity(new_value) O.ul_SetLuminosity(new_value)
else else
O.vars[variable] = new_value O.vars[variable] = new_value
@@ -222,7 +222,7 @@
for(var/mob/M in world) for(var/mob/M in world)
if ( istype(M , O.type) ) if ( istype(M , O.type) )
if(variable=="luminosity") if(variable=="luminosity")
M.sd_SetLuminosity(new_value) M.ul_SetLuminosity(new_value)
else else
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -230,7 +230,7 @@
for(var/obj/A in world) for(var/obj/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
if(variable=="luminosity") if(variable=="luminosity")
A.sd_SetLuminosity(new_value) A.ul_SetLuminosity(new_value)
else else
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
@@ -238,7 +238,7 @@
for(var/turf/A in world) for(var/turf/A in world)
if ( istype(A , O.type) ) if ( istype(A , O.type) )
if(variable=="luminosity") if(variable=="luminosity")
A.sd_SetLuminosity(new_value) A.ul_SetLuminosity(new_value)
else else
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
@@ -247,7 +247,7 @@
for(var/mob/M in world) for(var/mob/M in world)
if (M.type == O.type) if (M.type == O.type)
if(variable=="luminosity") if(variable=="luminosity")
M.sd_SetLuminosity(new_value) M.ul_SetLuminosity(new_value)
else else
M.vars[variable] = O.vars[variable] M.vars[variable] = O.vars[variable]
@@ -255,7 +255,7 @@
for(var/obj/A in world) for(var/obj/A in world)
if (A.type == O.type) if (A.type == O.type)
if(variable=="luminosity") if(variable=="luminosity")
A.sd_SetLuminosity(new_value) A.ul_SetLuminosity(new_value)
else else
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]
@@ -263,7 +263,7 @@
for(var/turf/A in world) for(var/turf/A in world)
if (A.type == O.type) if (A.type == O.type)
if(variable=="luminosity") if(variable=="luminosity")
A.sd_SetLuminosity(new_value) A.ul_SetLuminosity(new_value)
else else
A.vars[variable] = O.vars[variable] A.vars[variable] = O.vars[variable]

View File

@@ -531,7 +531,7 @@ var/list/forbidden_varedit_object_types = list(
if(variable=="luminosity") if(variable=="luminosity")
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
if(var_new == null) return if(var_new == null) return
O.sd_SetLuminosity(var_new) O.ul_SetLuminosity(var_new)
else else
var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num
if(var_new==null) return if(var_new==null) return

View File

@@ -199,8 +199,8 @@
if(old_icon) W.icon_state = old_icon if(old_icon) W.icon_state = old_icon
*/ */
W.opacity = 1 W.opacity = 1
W.sd_SetOpacity(0) W.ul_SetOpacity(0)
W.sd_LumReset() W.ul_Recalculate()
W.levelupdate() W.levelupdate()
return W return W

View File

@@ -125,8 +125,8 @@
G.process() G.process()
if(isturf(loc) && rand(1,1000) == 1) //0.1% chance of playing a scary sound to someone who's in complete darkness if(isturf(loc) && rand(1,1000) == 1) //0.1% chance of playing a scary sound to someone who's in complete darkness
var/turf/currentTurf = loc var/turf/currentTurf = get_turf(src)
if(!currentTurf.sd_lumcount) if(!max(currentTurf.ul_GetRed(), currentTurf.ul_GetGreen(), currentTurf.ul_GetBlue()))
playsound_local(src,pick(scarySounds),50, 1, -1) playsound_local(src,pick(scarySounds),50, 1, -1)
src.moved_recently = max(0, moved_recently-1) src.moved_recently = max(0, moved_recently-1)
@@ -825,7 +825,8 @@
if(mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist if(mutantrace == "plant") //couldn't think of a better place to place it, since it handles nutrition -- Urist
var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing var/light_amount = 0 //how much light there is in the place, affects receiving nutrition and healing
if(istype(loc,/turf)) //else, there's considered to be no light if(istype(loc,/turf)) //else, there's considered to be no light
light_amount = min(10,loc:sd_lumcount) - 5 //hardcapped so it's not abused by having a ton of flashlights var/turf/currentTurf = get_turf(src)
light_amount = min(10,max(currentTurf.ul_GetRed(), currentTurf.ul_GetGreen(), currentTurf.ul_GetBlue())) - 5 //hardcapped so it's not abused by having a ton of flashlights
if(nutrition < 500) //so they can't store nutrition to survive without light forever if(nutrition < 500) //so they can't store nutrition to survive without light forever
nutrition += light_amount nutrition += light_amount
if(light_amount > 0) //if there's enough light, heal if(light_amount > 0) //if there's enough light, heal

View File

@@ -673,9 +673,7 @@
return health return health
/mob/proc/UpdateLuminosity() /mob/proc/UpdateLuminosity()
if(total_luminosity == last_luminosity) return 0//nothing to do here ul_SetLuminosity(LuminosityRed, LuminosityGreen, LuminosityBlue)//Current hardcode max at 7, should likely be a const somewhere else
last_luminosity = total_luminosity
sd_SetLuminosity(min(total_luminosity,7))//Current hardcode max at 7, should likely be a const somewhere else
return 1 return 1
/mob/MouseDrop(mob/M as mob) /mob/MouseDrop(mob/M as mob)

View File

@@ -55,8 +55,8 @@
var/obj/screen/gun/run/gun_run_icon = null var/obj/screen/gun/run/gun_run_icon = null
var/obj/screen/gun/mode/gun_setting_icon = null var/obj/screen/gun/mode/gun_setting_icon = null
var/total_luminosity = 0 //This controls luminosity for mobs, when you pick up lights and such this is edited. If you want the mob to use lights it must update its lum in its life proc or such. Note clamp this value around 7 or such to prevent massive light lag. // var/total_luminosity = 0 //This controls luminosity for mobs, when you pick up lights and such this is edited. If you want the mob to use lights it must update its lum in its life proc or such. Note clamp this value around 7 or such to prevent massive light lag.
var/last_luminosity = 0 // var/last_luminosity = 0
/*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob. /*A bunch of this stuff really needs to go under their own defines instead of being globally attached to mob.
A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such. A variable should only be globally attached to turfs/objects/whatever, when it is in fact needed as such.

View File

@@ -104,7 +104,7 @@
emote_hear = list("barks", "woofs", "yaps","pants") emote_hear = list("barks", "woofs", "yaps","pants")
emote_see = list("shakes its head", "shivers") emote_see = list("shakes its head", "shivers")
desc = "It's a corgi." desc = "It's a corgi."
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
inventory_head.loc = src.loc inventory_head.loc = src.loc
inventory_head = null inventory_head = null
else else
@@ -239,7 +239,7 @@
name = "Rudolph the Red-Nosed Corgi" name = "Rudolph the Red-Nosed Corgi"
emote_hear = list("barks christmas songs", "yaps") emote_hear = list("barks christmas songs", "yaps")
desc = "He has a very shiny nose." desc = "He has a very shiny nose."
src.sd_SetLuminosity(6) src.ul_SetLuminosity(6)
if(/obj/item/clothing/head/cargosoft) if(/obj/item/clothing/head/cargosoft)
name = "Corgi Tech [real_name]" name = "Corgi Tech [real_name]"
speak = list("Needs a stamp!", "Request DENIED!", "Fill these out in triplicate!") speak = list("Needs a stamp!", "Request DENIED!", "Fill these out in triplicate!")

View File

@@ -123,7 +123,7 @@
var/oldlum = luminosity var/oldlum = luminosity
//luminosity = on * brightness //luminosity = on * brightness
sd_SetLuminosity(on * brightness) // *DAL* ul_SetLuminosity(on * brightness, on * brightness, ( fitting == "tube" ? on * brightness : 0 ) ) // *DAL*
// if the state changed, inc the switching counter // if the state changed, inc the switching counter
if(oldlum != luminosity) if(oldlum != luminosity)
@@ -137,7 +137,7 @@
status = LIGHT_BURNED status = LIGHT_BURNED
icon_state = "[base_state]-burned" icon_state = "[base_state]-burned"
on = 0 on = 0
sd_SetLuminosity(0) ul_SetLuminosity(0)
active_power_usage = (luminosity * 20) active_power_usage = (luminosity * 20)
if(on != on_gs) if(on != on_gs)
on_gs = on on_gs = on

View File

@@ -1,23 +1,23 @@
/* Overview of sd_DynamicAreaLighting as modified for SS13 /* Overview of sd_DynamicAreaLighting as modified for SS13
* *
* *
* Use sd_SetLuminosity(value) to change the luminosity of an atom * Use ul_SetLuminosity(value) to change the luminosity of an atom
* rather than setting the luminosity var directly. * rather than setting the luminosity var directly.
* Avoid having luminous objects at compile-time since this can mess up * Avoid having luminous objects at compile-time since this can mess up
* the lighting system during map load. Instead use sd_SetLuminosity() in * the lighting system during map load. Instead use ul_SetLuminosity() in
* the atom's New() proc after a small spawn delay. * the atom's New() proc after a small spawn delay.
* *
* Use sd_SetOpacity(value) to change the opacity of an atom (e.g. doors) * Use ul_SetOpacity(value) to change the opacity of an atom (e.g. doors)
* rather than setting the opacity var directly. This ensures that lighting * rather than setting the opacity var directly. This ensures that lighting
* will be blocked/unblocked as necessary. * will be blocked/unblocked as necessary.
* *
* If creating a new opaque atom (e.g. a wall) at runtime, create the atom, * If creating a new opaque atom (e.g. a wall) at runtime, create the atom,
* set its opacity var to zero, then perform sd_SetOpacity(1) * set its opacity var to zero, then perform ul_SetOpacity(1)
* e.g.: * e.g.:
* *
* var/obj/block/B = new(loc) * var/obj/block/B = new(loc)
* B.opacity = 0 * B.opacity = 0
* B.sd_SetOpacity(1) * B.ul_SetOpacity(1)
* *
* *
* The library creates multiple instances of each /area to split a mapped area * The library creates multiple instances of each /area to split a mapped area
@@ -52,13 +52,13 @@ Using sd_DynamicAreaLighting
1) Luminosity changes at run time. 1) Luminosity changes at run time.
If your program makes changes in luminosity while it is If your program makes changes in luminosity while it is
running, you need to use sd_SetLuminosity(new_luminosity) running, you need to use ul_SetLuminosity(new_luminosity)
so the library can remove the effect of the old luminosity so the library can remove the effect of the old luminosity
and apply the new effect. and apply the new effect.
2) Opacity changes at run time. 2) Opacity changes at run time.
As with luminosity changes, you need to use As with luminosity changes, you need to use
sd_SetOpacity(new_opacity) if your program changes the opacity ul_SetOpacity(new_opacity) if your program changes the opacity
of atoms at runtime. of atoms at runtime.
3) New atoms that change the opacity of a location. 3) New atoms that change the opacity of a location.
@@ -67,17 +67,17 @@ Using sd_DynamicAreaLighting
sd_StripLocalLum() to strip the luminosity effect of sd_StripLocalLum() to strip the luminosity effect of
anything shining on that space, create the new atom, then anything shining on that space, create the new atom, then
use sd_ApplyLocalLum() to reapply the luminosity effect. use sd_ApplyLocalLum() to reapply the luminosity effect.
Examine the sd_SetOpacity() proc for an example of the Examine the ul_SetOpacity() proc for an example of the
procedure. procedure.
All areas will automatically use the sd_DynamicAreaLighting All areas will automatically use the sd_DynamicAreaLighting
library when it is included in your project. You may disable library when it is included in your project. You may disable
lighting effect in an area by specifically setting the area's lighting effect in an area by specifically setting the area's
sd_lighting var to 0. For example: ul_Lighting var to 0. For example:
area/always_lit area/always_lit
luminosity = 1 luminosity = 1
sd_lighting = 0 ul_Lighting = 0
This library chops areas into 5 separate areas of differing This library chops areas into 5 separate areas of differing
light effect, so you may want to modify area Enter(), Exit(), light effect, so you may want to modify area Enter(), Exit(),
@@ -253,17 +253,17 @@ All atoms have the following procs:
IMPORTANT! Each sd_StripLocalLum() call should have a matching IMPORTANT! Each sd_StripLocalLum() call should have a matching
sd_ApplyLocalLum() to restore the local effect. sd_ApplyLocalLum() to restore the local effect.
sd_SetLuminosity(new_luminosity as num) ul_SetLuminosity(new_luminosity as num)
Sets the atom's luminosity, making adjustments to the Sets the atom's luminosity, making adjustments to the
sd_lumcount of local turfs. sd_lumcount of local turfs.
sd_SetOpacity(new_opacity as num) ul_SetOpacity(new_opacity as num)
Sets the atom's opacity, making adjustments to the Sets the atom's opacity, making adjustments to the
sd_lumcount of local turfs. sd_lumcount of local turfs.
Areas have one additional proc and 4 variables: Areas have one additional proc and 4 variables:
var var
sd_lighting ul_Lighting
Turn this flag off to prevent sd_DynamicAreaLighting Turn this flag off to prevent sd_DynamicAreaLighting
from effecting this area. from effecting this area.
DEFAULT VALUE: 1 (allow dynamic lighting) DEFAULT VALUE: 1 (allow dynamic lighting)
@@ -304,7 +304,7 @@ Turfs have these additional procs and vars:
Places the turf in the appropriate sd_dark area, Places the turf in the appropriate sd_dark area,
depending on its brightness (sd_lumcount). depending on its brightness (sd_lumcount).
sd_LumReset() ul_Recalculate()
Resets a turf's lumcount by stripping local luminosity, Resets a turf's lumcount by stripping local luminosity,
zeroing the lumcount, then reapplying local luminosity. zeroing the lumcount, then reapplying local luminosity.
@@ -436,7 +436,7 @@ atom
return affected return affected
sd_SetLuminosity(new_luminosity as num) ul_SetLuminosity(new_luminosity as num)
/* This proc should be called everytime you want to change the /* This proc should be called everytime you want to change the
luminosity of an atom instead of setting it directly. luminosity of an atom instead of setting it directly.
@@ -448,7 +448,7 @@ atom
sd_ApplyLum() sd_ApplyLum()
sd_SetOpacity(new_opacity as num) ul_SetOpacity(new_opacity as num)
/* if(opacity != new_opacity) /* if(opacity != new_opacity)
var/list/affected = sd_StripLocalLum() var/list/affected = sd_StripLocalLum()
opacity = new_opacity opacity = new_opacity
@@ -567,7 +567,7 @@ turf
sd_lumcount = 0 // the brightness of the turf sd_lumcount = 0 // the brightness of the turf
proc proc
sd_LumReset() ul_Recalculate()
/* Clear local lum, reset this turf's sd_lumcount, and /* Clear local lum, reset this turf's sd_lumcount, and
re-apply local lum*/ re-apply local lum*/
var/list/affected = sd_StripLocalLum() var/list/affected = sd_StripLocalLum()
@@ -580,7 +580,7 @@ turf
sd_LumUpdate() sd_LumUpdate()
set background = 1 set background = 1
var/area/Loc = loc var/area/Loc = loc
if(!istype(Loc) || !Loc.sd_lighting) return if(!istype(Loc) || !Loc.ul_Lighting) return
// change the turf's area depending on its brightness // change the turf's area depending on its brightness
// restrict light to valid levels // restrict light to valid levels
@@ -685,7 +685,7 @@ area
var var
/* Turn this flag off to prevent sd_DynamicAreaLighting from affecting /* Turn this flag off to prevent sd_DynamicAreaLighting from affecting
this area */ this area */
sd_lighting = 1 ul_Lighting = 1
/* This var determines if an area is outside (affected by sunlight) or /* This var determines if an area is outside (affected by sunlight) or
not. */ not. */
@@ -718,7 +718,7 @@ area
..() ..()
if(!tag) tag = "[type]" if(!tag) tag = "[type]"
spawn(1) // wait a tick spawn(1) // wait a tick
if(sd_lighting) if(ul_Lighting)
// see if this area was created by the library // see if this area was created by the library
if(!findtext(tag, "sd_L")) if(!findtext(tag, "sd_L"))
/* show the dark overlay so areas outside of luminous regions /* show the dark overlay so areas outside of luminous regions
@@ -731,7 +731,7 @@ area
if(!tag) tag = "[type]" if(!tag) tag = "[type]"
spawn(1) // wait a tick spawn(1) // wait a tick
if(sd_lighting) if(ul_Lighting)
// see if this area was created by the library // see if this area was created by the library
if(!sd_created) if(!sd_created)
/* show the dark overlay so areas outside of luminous regions /* show the dark overlay so areas outside of luminous regions

View File

@@ -14,7 +14,7 @@
New() New()
spawn(1) spawn(1)
src.sd_SetLuminosity(5) src.ul_SetLuminosity(5)
Del() Del()

View File

@@ -3,7 +3,7 @@
/area/shipbuilder /area/shipbuilder
requires_power = 0 requires_power = 0
luminosity = 1 luminosity = 1
sd_lighting = 0 ul_Lighting = 0
/area/shipbuilder/station /area/shipbuilder/station
name = "shipbuilder station" name = "shipbuilder station"

View File

@@ -60,13 +60,13 @@
/obj/item/device/pda2/pickup(mob/user) /obj/item/device/pda2/pickup(mob/user)
if (src.fon) if (src.fon)
src.sd_SetLuminosity(0) src.ul_SetLuminosity(0)
user.sd_SetLuminosity(user.luminosity + src.f_lum) user.ul_SetLuminosity(user.luminosity + src.f_lum)
/obj/item/device/pda2/dropped(mob/user) /obj/item/device/pda2/dropped(mob/user)
if (src.fon) if (src.fon)
user.sd_SetLuminosity(user.luminosity - src.f_lum) user.ul_SetLuminosity(user.luminosity - src.f_lum)
src.sd_SetLuminosity(src.f_lum) src.ul_SetLuminosity(src.f_lum)
/obj/item/device/pda2/New() /obj/item/device/pda2/New()
..() ..()
@@ -240,11 +240,11 @@
if (ismob(src.loc)) if (ismob(src.loc))
if (src.fon) if (src.fon)
src.loc.sd_SetLuminosity(src.loc.luminosity + src.f_lum) src.loc.ul_SetLuminosity(src.loc.luminosity + src.f_lum)
else else
src.loc.sd_SetLuminosity(src.loc.luminosity - src.f_lum) src.loc.ul_SetLuminosity(src.loc.luminosity - src.f_lum)
else else
src.sd_SetLuminosity(src.fon * src.f_lum) src.ul_SetLuminosity(src.fon * src.f_lum)
src.updateSelfDialog() src.updateSelfDialog()