diff --git a/baystation12.dme b/baystation12.dme index f12daf760b..1f8ba207fd 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -1076,7 +1076,6 @@ #include "code\modules\power\lighting.dm" #include "code\modules\power\port_gen.dm" #include "code\modules\power\power.dm" -#include "code\modules\power\sd_DynamicAreaLighting.dm" #include "code\modules\power\smes.dm" #include "code\modules\power\solar.dm" #include "code\modules\power\switch.dm" @@ -1204,6 +1203,7 @@ #include "code\WorkInProgress\SkyMarshal\coatrack.dm" #include "code\WorkInProgress\SkyMarshal\portalathe.dm" #include "code\WorkInProgress\SkyMarshal\traitoritems.dm" +#include "code\WorkInProgress\SkyMarshal\Ultralight.dm" #include "code\WorkInProgress\SkyMarshal\wardrobes.dm" #include "code\WorkInProgress\Tastyfish\Eliza.dm" #include "code\WorkInProgress\Tastyfish\Eliza_Data.dm" diff --git a/code/FEA/FEA_fire.dm b/code/FEA/FEA_fire.dm index c37e51ac2c..db653b820b 100644 --- a/code/FEA/FEA_fire.dm +++ b/code/FEA/FEA_fire.dm @@ -156,13 +156,13 @@ obj New() ..() dir = pick(cardinal) - sd_SetLuminosity(3) + ul_SetLuminosity(3) Del() if (istype(loc, /turf/simulated)) var/turf/simulated/T = loc loc:active_hotspot = null - src.sd_SetLuminosity(0) + src.ul_SetLuminosity(0) diff --git a/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm b/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm index ebbf265ca3..ca0693a2cc 100644 --- a/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm +++ b/code/WorkInProgress/Cael_Aislinn/Supermatter/SuperMatter.dm @@ -30,7 +30,7 @@ New() ..() spawn(1) - sd_SetLuminosity(4) + ul_SetLuminosity(4,6,0) bullet_act(var/obj/item/projectile/Proj) if(Proj.flag != "bullet") diff --git a/code/unused/Ultralight.dm b/code/WorkInProgress/SkyMarshal/Ultralight.dm similarity index 93% rename from code/unused/Ultralight.dm rename to code/WorkInProgress/SkyMarshal/Ultralight.dm index 9b9189c957..1e3a0aebed 100644 --- a/code/unused/Ultralight.dm +++ b/code/WorkInProgress/SkyMarshal/Ultralight.dm @@ -1,340 +1,349 @@ -//UltraLight system, by Sukasa - -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_LightingResolution = 1 - ul_Steps = 7 - ul_FalloffStyle = UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular. - ul_TopLuminosity = 0 - ul_Layer = 10 - ul_SuppressLightLevelChanges = 0 - - list/ul_FastRoot = list(0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, - 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) - - -proc/ul_Clamp(var/Value) - return min(max(Value, 0), ul_Steps) - -atom - var - LuminosityRed = 0 - LuminosityGreen = 0 - LuminosityBlue = 0 - - ul_Extinguished = UL_I_ONZERO - -atom/proc/ul_SetLuminosity(var/Red, var/Green = Red, var/Blue = Red) - - if(LuminosityRed == Red && LuminosityGreen == Green && LuminosityBlue == Blue) - return //No point doing all that work if it won't have any effect anyways... - - if (ul_Extinguished == UL_I_EXTINGUISHED) - LuminosityRed = Red - LuminosityGreen = Green - LuminosityBlue = Blue - - return - - if (ul_IsLuminous()) - ul_Extinguish() - - LuminosityRed = Red - LuminosityGreen = Green - LuminosityBlue = Blue - - ul_Extinguished = UL_I_ONZERO - - if (ul_IsLuminous()) - ul_Illuminate() - - return - -atom/proc/ul_Illuminate() - if (ul_Extinguished == UL_I_LIT) - return - - ul_Extinguished = UL_I_LIT - - ul_UpdateTopLuminosity() - luminosity = ul_Luminosity() - - for(var/turf/Affected in view(ul_Luminosity(), src)) - var/Falloff = src.ul_FalloffAmount(Affected) - - var/DeltaRed = LuminosityRed - Falloff - var/DeltaGreen = LuminosityGreen - Falloff - var/DeltaBlue = LuminosityBlue - Falloff - - if(ul_IsLuminous(DeltaRed, DeltaGreen, DeltaBlue)) - - Affected.LightLevelRed += max(DeltaRed, 0) - Affected.LightLevelGreen += max(DeltaGreen, 0) - Affected.LightLevelBlue += max(DeltaBlue, 0) - - Affected.MaxRed += LuminosityRed - Affected.MaxGreen += LuminosityGreen - Affected.MaxBlue += LuminosityBlue - - Affected.ul_UpdateLight() - - if (ul_SuppressLightLevelChanges == 0) - Affected.ul_LightLevelChanged() - - for(var/atom/AffectedAtom in Affected) - AffectedAtom.ul_LightLevelChanged() - return - -atom/proc/ul_Extinguish() - - if (ul_Extinguished != UL_I_LIT) - return - - ul_Extinguished = UL_I_EXTINGUISHED - - for(var/turf/Affected in view(ul_Luminosity(), src)) - - var/Falloff = ul_FalloffAmount(Affected) - - var/DeltaRed = LuminosityRed - Falloff - var/DeltaGreen = LuminosityGreen - Falloff - var/DeltaBlue = LuminosityBlue - Falloff - - if(ul_IsLuminous(DeltaRed, DeltaGreen, DeltaBlue)) - - Affected.LightLevelRed -= max(DeltaRed, 0) - Affected.LightLevelGreen -= max(DeltaGreen, 0) - Affected.LightLevelBlue -= max(DeltaBlue, 0) - - Affected.MaxRed -= LuminosityRed - Affected.MaxGreen -= LuminosityGreen - Affected.MaxBlue -= LuminosityBlue - - Affected.ul_UpdateLight() - - if (ul_SuppressLightLevelChanges == 0) - Affected.ul_LightLevelChanged() - - for(var/atom/AffectedAtom in Affected) - AffectedAtom.ul_LightLevelChanged() - - luminosity = 0 - - return - - -/* - Calculates the correct lighting falloff value (used to calculate what brightness to set the turf to) to use, - when called on a luminous atom and passed an atom in the turf to be lit. - - Supports multiple configurations, BS12 uses the circular falloff setting. This setting uses an array lookup - to avoid the cost of the square root function. -*/ -atom/proc/ul_FalloffAmount(var/atom/ref) - if (ul_FalloffStyle == UL_I_FALLOFF_ROUND) - var/x = (ref.x - src.x) - var/y = (ref.y - src.y) - if ((x*x + y*y) > ul_FastRoot.len) - for(var/i = ul_FastRoot.len, i <= x*x+y*y, i++) - ul_FastRoot += round(sqrt(x*x+y*y)) - return round(ul_LightingResolution * ul_FastRoot[x*x + y*y + 1], 1) - - else if (ul_FalloffStyle == UL_I_FALLOFF_SQUARE) - return get_dist(src, ref) - - return 0 - -atom/proc/ul_SetOpacity(var/NewOpacity) - if(opacity != NewOpacity) - - var/list/Blanked = ul_BlankLocal() - var/atom/T = src - while(T && !isturf(T)) - T = T.loc - - opacity = NewOpacity - - if(T) - T:LightLevelRed = 0 - T:LightLevelGreen = 0 - T:LightLevelBlue = 0 - - ul_UnblankLocal(Blanked) - - return - -atom/proc/ul_UnblankLocal(var/list/ReApply = view(ul_TopLuminosity, src)) - for(var/atom/Light in ReApply) - if(Light.ul_IsLuminous()) - Light.ul_Illuminate() - - return - -atom/proc/ul_BlankLocal() - var/list/Blanked = list( ) - var/TurfAdjust = isturf(src) ? 1 : 0 - - for(var/atom/Affected in view(ul_TopLuminosity, src)) - if(Affected.ul_IsLuminous() && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= Affected.luminosity + TurfAdjust)) - Affected.ul_Extinguish() - Blanked += Affected - - return Blanked - -atom/proc/ul_UpdateTopLuminosity() - if (ul_TopLuminosity < LuminosityRed) - ul_TopLuminosity = LuminosityRed - - if (ul_TopLuminosity < LuminosityGreen) - ul_TopLuminosity = LuminosityGreen - - if (ul_TopLuminosity < LuminosityBlue) - ul_TopLuminosity = LuminosityBlue - - return - -atom/proc/ul_Luminosity() - return max(LuminosityRed, LuminosityGreen, LuminosityBlue) - -atom/proc/ul_IsLuminous(var/Red = LuminosityRed, var/Green = LuminosityGreen, var/Blue = LuminosityBlue) - return (Red > 0 || Green > 0 || Blue > 0) - -atom/proc/ul_LightLevelChanged() - //Designed for client projects to use. Called on items when the turf they are in has its light level changed - return - -atom/proc/New() - ..() - if(ul_IsLuminous()) - spawn(1) - ul_Illuminate() - return - -atom/proc/Del() - if(ul_IsLuminous()) - ul_Extinguish() - - ..() - - return - -// formerly atom/proc/movable/Move(), this now overwrites other shit causing random inexplicable problems. -// need to find a way to plug it in to the root without overriding, might just do the snowflake treatment -/*atom/proc/Move() - ul_Extinguish() - ..() - ul_Illuminate() - return*/ - -turf - var - LightLevelRed = 0 - LightLevelGreen = 0 - LightLevelBlue = 0 - - list/MaxRed = list( ) - list/MaxGreen = list( ) - list/MaxBlue = list( ) - - - -turf/proc/ul_GetRed() - return ul_Clamp(min(LightLevelRed, max(MaxRed))) -turf/proc/ul_GetGreen() - return ul_Clamp(min(LightLevelGreen, max(MaxGreen))) -turf/proc/ul_GetBlue() - return ul_Clamp(min(LightLevelBlue, max(MaxBlue))) - -turf/proc/ul_UpdateLight() - - var/area/CurrentArea = loc - - if(!isarea(CurrentArea) || !CurrentArea.ul_Lighting) - return - - var/LightingTag = copytext(CurrentArea.tag, 1, findtext(CurrentArea.tag, ":UL")) + ":UL[ul_GetRed()]_[ul_GetGreen()]_[ul_GetBlue()]" - - if(CurrentArea.tag != LightingTag) - var/area/NewArea = locate(LightingTag) - - if(!NewArea) - NewArea = new CurrentArea.type() - NewArea.tag = LightingTag - - for(var/V in CurrentArea.vars - "contents") - if(issaved(CurrentArea.vars[V])) - NewArea.vars[V] = CurrentArea.vars[V] - - NewArea.tag = LightingTag - - NewArea.ul_Light(ul_GetRed(), ul_GetGreen(), ul_GetBlue()) - - - NewArea.contents += src - - return - -turf/proc/ul_Recalculate() - - ul_SuppressLightLevelChanges++ - - var/list/Lights = ul_BlankLocal() - - LightLevelRed = 0 - LightLevelGreen = 0 - LightLevelBlue = 0 - - ul_UnblankLocal(Lights) - - ul_SuppressLightLevelChanges-- - - return - -area - var - ul_Overlay = null - ul_Lighting = 1 - - LightLevelRed = 0 - LightLevelGreen = 0 - LightLevelBlue = 0 - - -area/proc/ul_Light(var/Red = LightLevelRed, var/Green = LightLevelGreen, var/Blue = LightLevelBlue) - - if(!src || !src.ul_Lighting) - return - - overlays -= ul_Overlay - - LightLevelRed = Red - LightLevelGreen = Green - LightLevelBlue = Blue - - luminosity = ul_IsLuminous(LightLevelRed, LightLevelGreen, LightLevelBlue) - - ul_Overlay = image('ULIcons.dmi', , num2text(LightLevelRed) + "-" + num2text(LightLevelGreen) + "-" + num2text(LightLevelBlue), ul_Layer) - - overlays += ul_Overlay - - return - -area/proc/ul_Prep() - - if(!tag) - tag = "[type]" - if(ul_Lighting) - if(!findtext(tag,":UL")) - ul_Light() - //world.log << tag - +//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 + ul_LightingEnabled = 1 + ul_LightingResolution = 1 + ul_Steps = 7 + ul_FalloffStyle = UL_I_FALLOFF_ROUND // Sets the lighting falloff to be either squared or circular. + ul_TopLuminosity = 0 + ul_Layer = 10 + ul_SuppressLightLevelChanges = 0 + + list/ul_FastRoot = list(0, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, + 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) + +var/list/light_to_instantiate = list() +var/UL_setup = 0 + +proc/setup_UL() + UL_setup = 1 + world << "\red Setting up UltraLight..." + for(var/atom/A in light_to_instantiate) + if(A.ul_IsLuminous()) + A.ul_Illuminate() + +proc/ul_Clamp(var/Value) + return min(max(Value, 0), ul_Steps) + +atom + var + LuminosityRed = 0 + LuminosityGreen = 0 + LuminosityBlue = 0 + + ul_Extinguished = UL_I_ONZERO + +atom/proc/ul_SetLuminosity(var/Red, var/Green = Red, var/Blue = Red) + + if(LuminosityRed == Red && LuminosityGreen == Green && LuminosityBlue == Blue) + return //No point doing all that work if it won't have any effect anyways... + + if (ul_Extinguished == UL_I_EXTINGUISHED) + LuminosityRed = Red + LuminosityGreen = Green + LuminosityBlue = Blue + + return + + if (ul_IsLuminous()) + ul_Extinguish() + + LuminosityRed = Red + LuminosityGreen = Green + LuminosityBlue = Blue + + ul_Extinguished = UL_I_ONZERO + + if (ul_IsLuminous()) + ul_Illuminate() + + return + +atom/proc/ul_Illuminate() + if (ul_Extinguished == UL_I_LIT) + return + + ul_Extinguished = UL_I_LIT + + ul_UpdateTopLuminosity() + luminosity = ul_Luminosity() + + for(var/turf/Affected in view(ul_Luminosity(), src)) + var/Falloff = src.ul_FalloffAmount(Affected) + + var/DeltaRed = LuminosityRed - Falloff + var/DeltaGreen = LuminosityGreen - Falloff + var/DeltaBlue = LuminosityBlue - Falloff + + if(ul_IsLuminous(DeltaRed, DeltaGreen, DeltaBlue)) + + Affected.LightLevelRed += max(DeltaRed, 0) + Affected.LightLevelGreen += max(DeltaGreen, 0) + Affected.LightLevelBlue += max(DeltaBlue, 0) + + Affected.MaxRed += LuminosityRed + Affected.MaxGreen += LuminosityGreen + Affected.MaxBlue += LuminosityBlue + + Affected.ul_UpdateLight() + + if (ul_SuppressLightLevelChanges == 0) + Affected.ul_LightLevelChanged() + + for(var/atom/AffectedAtom in Affected) + AffectedAtom.ul_LightLevelChanged() + return + +atom/proc/ul_Extinguish() + + if (ul_Extinguished != UL_I_LIT) + return + + ul_Extinguished = UL_I_EXTINGUISHED + + for(var/turf/Affected in view(ul_Luminosity(), src)) + + var/Falloff = ul_FalloffAmount(Affected) + + var/DeltaRed = LuminosityRed - Falloff + var/DeltaGreen = LuminosityGreen - Falloff + var/DeltaBlue = LuminosityBlue - Falloff + + if(ul_IsLuminous(DeltaRed, DeltaGreen, DeltaBlue)) + + Affected.LightLevelRed -= max(DeltaRed, 0) + Affected.LightLevelGreen -= max(DeltaGreen, 0) + Affected.LightLevelBlue -= max(DeltaBlue, 0) + + Affected.MaxRed -= LuminosityRed + Affected.MaxGreen -= LuminosityGreen + Affected.MaxBlue -= LuminosityBlue + + Affected.ul_UpdateLight() + + if (ul_SuppressLightLevelChanges == 0) + Affected.ul_LightLevelChanged() + + for(var/atom/AffectedAtom in Affected) + AffectedAtom.ul_LightLevelChanged() + + luminosity = 0 + + return + + +/* + Calculates the correct lighting falloff value (used to calculate what brightness to set the turf to) to use, + when called on a luminous atom and passed an atom in the turf to be lit. + + Supports multiple configurations, BS12 uses the circular falloff setting. This setting uses an array lookup + to avoid the cost of the square root function. +*/ +atom/proc/ul_FalloffAmount(var/atom/ref) + if (ul_FalloffStyle == UL_I_FALLOFF_ROUND) + var/x = (ref.x - src.x) + var/y = (ref.y - src.y) + if ((x*x + y*y) > ul_FastRoot.len) + for(var/i = ul_FastRoot.len, i <= x*x+y*y, i++) + ul_FastRoot += round(sqrt(x*x+y*y)) + return round(ul_LightingResolution * ul_FastRoot[x*x + y*y + 1], 1) + + else if (ul_FalloffStyle == UL_I_FALLOFF_SQUARE) + return get_dist(src, ref) + + return 0 + +atom/proc/ul_SetOpacity(var/NewOpacity) + if(opacity != NewOpacity) + + var/list/Blanked = ul_BlankLocal() + var/atom/T = src + while(T && !isturf(T)) + T = T.loc + + opacity = NewOpacity + + if(T) + T:LightLevelRed = 0 + T:LightLevelGreen = 0 + T:LightLevelBlue = 0 + + ul_UnblankLocal(Blanked) + + return + +atom/proc/ul_UnblankLocal(var/list/ReApply = view(ul_TopLuminosity, src)) + for(var/atom/Light in ReApply) + if(Light.ul_IsLuminous()) + Light.ul_Illuminate() + + return + +atom/proc/ul_BlankLocal() + var/list/Blanked = list( ) + var/TurfAdjust = isturf(src) ? 1 : 0 + + for(var/atom/Affected in view(ul_TopLuminosity, src)) + if(Affected.ul_IsLuminous() && Affected.ul_Extinguished == UL_I_LIT && (ul_FalloffAmount(Affected) <= Affected.luminosity + TurfAdjust)) + Affected.ul_Extinguish() + Blanked += Affected + + return Blanked + +atom/proc/ul_UpdateTopLuminosity() + if (ul_TopLuminosity < LuminosityRed) + ul_TopLuminosity = LuminosityRed + + if (ul_TopLuminosity < LuminosityGreen) + ul_TopLuminosity = LuminosityGreen + + if (ul_TopLuminosity < LuminosityBlue) + ul_TopLuminosity = LuminosityBlue + + return + +atom/proc/ul_Luminosity() + return max(LuminosityRed, LuminosityGreen, LuminosityBlue) + +atom/proc/ul_IsLuminous(var/Red = LuminosityRed, var/Green = LuminosityGreen, var/Blue = LuminosityBlue) + return (Red > 0 || Green > 0 || Blue > 0) + +atom/proc/ul_LightLevelChanged() + //Designed for client projects to use. Called on items when the turf they are in has its light level changed + return + +atom/New() + ..() + if(UL_setup) + if(ul_IsLuminous()) + ul_Illuminate() + else + light_to_instantiate |= src + +atom/Del() + if(ul_IsLuminous()) + ul_Extinguish() + + ..() + + return + +// formerly atom/proc/movable/Move(), this now overwrites other shit causing random inexplicable problems. +// need to find a way to plug it in to the root without overriding, might just do the snowflake treatment +/*atom/proc/Move() + ul_Extinguish() + ..() + ul_Illuminate() + return*/ + +turf + var + LightLevelRed = 0 + LightLevelGreen = 0 + LightLevelBlue = 0 + + list/MaxRed = list( ) + list/MaxGreen = list( ) + list/MaxBlue = list( ) + + + +turf/proc/ul_GetRed() + return ul_Clamp(min(LightLevelRed, max(MaxRed))) +turf/proc/ul_GetGreen() + return ul_Clamp(min(LightLevelGreen, max(MaxGreen))) +turf/proc/ul_GetBlue() + return ul_Clamp(min(LightLevelBlue, max(MaxBlue))) + +turf/proc/ul_UpdateLight() + + var/area/CurrentArea = loc + + if(!isarea(CurrentArea) || !CurrentArea.ul_Lighting) + return + + var/LightingTag = copytext(CurrentArea.tag, 1, findtext(CurrentArea.tag, ":UL")) + ":UL[ul_GetRed()]_[ul_GetGreen()]_[ul_GetBlue()]" + + if(CurrentArea.tag != LightingTag) + var/area/NewArea = locate(LightingTag) + + if(!NewArea) + NewArea = new CurrentArea.type() + NewArea.tag = LightingTag + + for(var/V in CurrentArea.vars - "contents") + if(issaved(CurrentArea.vars[V])) + NewArea.vars[V] = CurrentArea.vars[V] + + NewArea.tag = LightingTag + + NewArea.ul_Light(ul_GetRed(), ul_GetGreen(), ul_GetBlue()) + + + NewArea.contents += src + + return + +turf/proc/ul_Recalculate() + + ul_SuppressLightLevelChanges++ + + var/list/Lights = ul_BlankLocal() + + LightLevelRed = 0 + LightLevelGreen = 0 + LightLevelBlue = 0 + + ul_UnblankLocal(Lights) + + ul_SuppressLightLevelChanges-- + + return + +area + var + ul_Overlay = null + ul_Lighting = 1 + + LightLevelRed = 0 + LightLevelGreen = 0 + LightLevelBlue = 0 + + +area/proc/ul_Light(var/Red = LightLevelRed, var/Green = LightLevelGreen, var/Blue = LightLevelBlue) + + if(!src || !src.ul_Lighting) + return + + overlays -= ul_Overlay + + LightLevelRed = Red + LightLevelGreen = Green + LightLevelBlue = Blue + + luminosity = ul_IsLuminous(LightLevelRed, LightLevelGreen, LightLevelBlue) + + ul_Overlay = image('ULIcons.dmi', , num2text(LightLevelRed) + "-" + num2text(LightLevelGreen) + "-" + num2text(LightLevelBlue), ul_Layer) + + overlays += ul_Overlay + + return + +area/proc/ul_Prep() + + if(!tag) + tag = "[type]" + if(ul_Lighting) + if(!findtext(tag,":UL")) + ul_Light() + //world.log << tag + return \ No newline at end of file diff --git a/code/ZAS/Fire.dm b/code/ZAS/Fire.dm index 2042564ee1..be430d58e2 100644 --- a/code/ZAS/Fire.dm +++ b/code/ZAS/Fire.dm @@ -157,14 +157,14 @@ obj New(newLoc,fl) ..() dir = pick(cardinal) - sd_SetLuminosity(3) + ul_SetLuminosity(3) firelevel = fl for(var/mob/living/carbon/human/M in loc) M.FireBurn(min(max(0.1,firelevel / 20),10)) //Burn the humans! Del() if (istype(loc, /turf/simulated)) - src.sd_SetLuminosity(0) + ul_SetLuminosity(0) 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 ) //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) diff --git a/code/ZAS/Processing.dm b/code/ZAS/Processing.dm index 2d001fb97b..b5ebc7a9d8 100644 --- a/code/ZAS/Processing.dm +++ b/code/ZAS/Processing.dm @@ -95,7 +95,7 @@ zone/proc/process() AirflowSpace(src) ShareSpace(air,total_space*(zone_share_percent/100)) - if(!(last_update%20)) //every 20 processes. +/* if(!(last_update%20)) //every 20 processes. if(connections) connections.Remove(null) if(!connections.len) @@ -103,7 +103,7 @@ zone/proc/process() if(connected_zones) connected_zones.Remove(null) if(!connected_zones.len) - del connected_zones + del connected_zones*/ //React the air here. //air.react(null,0) diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index 8b93f01736..e4aa79dbb0 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -124,7 +124,7 @@ playSpecials(destturf,effectout,soundout) // Re-Apply lum - teleatom.sd_SetLuminosity(prevlum) + teleatom.ul_SetLuminosity(prevlum) destarea.Entered(teleatom) diff --git a/code/defines/area/Space Station 13 areas.dm b/code/defines/area/Space Station 13 areas.dm index 592198d5d2..03517f2807 100755 --- a/code/defines/area/Space Station 13 areas.dm +++ b/code/defines/area/Space Station 13 areas.dm @@ -126,10 +126,8 @@ proc/process_ghost_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 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 - luminosity = 1 - sd_lighting = 0 /area/shuttle/arrival name = "\improper Arrival Shuttle" @@ -233,15 +231,11 @@ proc/process_ghost_teleport_locs() icon_state = "shuttle" name = "\improper Alien Shuttle Base" requires_power = 1 - luminosity = 0 - sd_lighting = 1 /area/shuttle/alien/mine icon_state = "shuttle" name = "\improper Alien Shuttle Mine" requires_power = 1 - luminosity = 0 - sd_lighting = 1 /area/shuttle/prison/ name = "\improper Prison Shuttle" @@ -313,7 +307,7 @@ proc/process_ghost_teleport_locs() icon_state = "start" requires_power = 0 luminosity = 1 - sd_lighting = 0 + ul_Lighting = 0 has_gravity = 1 // === end remove @@ -808,8 +802,6 @@ proc/process_ghost_teleport_locs() /area/holodeck name = "\improper Holodeck" icon_state = "Holodeck" - luminosity = 1 - sd_lighting = 0 /area/holodeck/alphadeck name = "\improper Holodeck Alpha" @@ -966,8 +958,6 @@ proc/process_ghost_teleport_locs() /area/solar requires_power = 0 - luminosity = 1 - sd_lighting = 0 auxport name = "\improper Port Auxiliary Solar Array" @@ -1483,26 +1473,18 @@ proc/process_ghost_teleport_locs() /area/turret_protected/AIsatextFP name = "\improper AI Sat Ext" icon_state = "storage" - luminosity = 1 - sd_lighting = 0 /area/turret_protected/AIsatextFS name = "\improper AI Sat Ext" icon_state = "storage" - luminosity = 1 - sd_lighting = 0 /area/turret_protected/AIsatextAS name = "\improper AI Sat Ext" icon_state = "storage" - luminosity = 1 - sd_lighting = 0 /area/turret_protected/AIsatextAP name = "\improper AI Sat Ext" icon_state = "storage" - luminosity = 1 - sd_lighting = 0 /area/turret_protected/NewAIMain name = "\improper AI Main New" @@ -1580,7 +1562,7 @@ proc/process_ghost_teleport_locs() /area/turret_protected/AssistantRoom name = "\improper Assistant Room" icon_state = "storage" - sd_lighting = 0 + ul_Lighting = 0 ///////////////////////////////////////////////////////////////////// /* @@ -1653,7 +1635,7 @@ var/list/the_station_areas = list ( name = "Keelin's private beach" icon_state = "null" luminosity = 1 - sd_lighting = 0 + ul_Lighting = 0 requires_power = 0 var/sound/mysound = null diff --git a/code/defines/obj/door.dm b/code/defines/obj/door.dm index 92196e75f6..e4e01d8c66 100644 --- a/code/defines/obj/door.dm +++ b/code/defines/obj/door.dm @@ -52,8 +52,8 @@ f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,EAST)) f1.density = density f2.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) Del() del f1 @@ -71,8 +71,8 @@ f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,NORTH)) f1.density = density f2.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) Del() del f1 @@ -96,10 +96,10 @@ f2.density = density f3.density = density f4.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) - f4.sd_SetOpacity(opacity) - f3.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) + f4.ul_SetOpacity(opacity) + f3.ul_SetOpacity(opacity) Del() del f1 @@ -125,10 +125,10 @@ f2.density = density f3.density = density f4.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) - f4.sd_SetOpacity(opacity) - f3.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) + f4.ul_SetOpacity(opacity) + f3.ul_SetOpacity(opacity) Del() del f1 diff --git a/code/defines/obj/hydro.dm b/code/defines/obj/hydro.dm index 82d54ac17e..efb3da713d 100644 --- a/code/defines/obj/hydro.dm +++ b/code/defines/obj/hydro.dm @@ -1149,16 +1149,16 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/glowberries/Del() 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) - src.sd_SetLuminosity(0) - user.total_luminosity += potency/5 + src.ul_SetLuminosity(0) + 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) - user.total_luminosity -= potency/5 - src.sd_SetLuminosity(potency/5) + user.ul_SetLuminosity(user.LuminosityRed - potency/5, user.LuminosityGreen - potency/5, user.LuminosityBlue - potency/5) + src.ul_SetLuminosity(potency/5) /obj/item/weapon/reagent_containers/food/snacks/grown/cocoapod seed = "/obj/item/seeds/cocoapodseed" @@ -1621,7 +1621,7 @@ if(istype(src.loc,/mob)) pickup(src.loc) else - src.sd_SetLuminosity(potency/10) + src.ul_SetLuminosity(potency/10) lifespan = 120 //ten times that is the delay endurance = 30 maturation = 15 @@ -1646,16 +1646,16 @@ /obj/item/weapon/reagent_containers/food/snacks/grown/mushroom/glowshroom/Del() 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) - src.sd_SetLuminosity(0) - user.total_luminosity += potency/10 + ul_SetLuminosity(0) + 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) - user.total_luminosity -= potency/10 - src.sd_SetLuminosity(potency/10) + user.ul_SetLuminosity(user.LuminosityRed - potency/10, user.LuminosityGreen - potency/10, user.LuminosityBlue - potency/10) + ul_SetLuminosity(potency/10) // ********************** // Other harvested materials from plants (that are not food) diff --git a/code/defines/procs/helpers.dm b/code/defines/procs/helpers.dm index 8bfb13504d..2ef0a60f83 100644 --- a/code/defines/procs/helpers.dm +++ b/code/defines/procs/helpers.dm @@ -1515,9 +1515,9 @@ proc/listclearnulls(list/list) var/area/AR = X.loc - if(AR.sd_lighting) + if(AR.ul_Lighting) X.opacity = !X.opacity - X.sd_SetOpacity(!X.opacity) + X.ul_SetOpacity(!X.opacity) toupdate += X @@ -1526,9 +1526,9 @@ proc/listclearnulls(list/list) var/area/AR2 = ttl.loc - if(AR2.sd_lighting) + if(AR2.ul_Lighting) ttl.opacity = !ttl.opacity - ttl.sd_SetOpacity(!ttl.opacity) + ttl.ul_SetOpacity(!ttl.opacity) fromupdate += ttl @@ -1687,9 +1687,9 @@ proc/DuplicateObject(obj/original, var/perfectcopy = 0 , var/sameloc = 0) var/area/AR = X.loc - if(AR.sd_lighting) + if(AR.ul_Lighting) X.opacity = !X.opacity - X.sd_SetOpacity(!X.opacity) + X.ul_SetOpacity(!X.opacity) toupdate += X diff --git a/code/defines/turf.dm b/code/defines/turf.dm index 3d9befcfba..84ee94551e 100644 --- a/code/defines/turf.dm +++ b/code/defines/turf.dm @@ -45,6 +45,8 @@ thermal_conductivity = OPEN_HEAT_TRANSFER_COEFFICIENT heat_capacity = 700000 + LightLevelBlue = 5 + transit var/pushdirection // push things that get caught in the transit tile this direction @@ -311,7 +313,7 @@ New() ..() - sd_SetLuminosity(3) + ul_SetLuminosity(3) /turf/simulated/wall/mineral/gold walltype = "gold" diff --git a/code/game/area/areas.dm b/code/game/area/areas.dm index 629e420d52..03330d9fbd 100644 --- a/code/game/area/areas.dm +++ b/code/game/area/areas.dm @@ -14,9 +14,9 @@ uid = ++global_uid spawn(1) //world.log << "New: [src] [tag]" - var/sd_created = findtext(tag,"sd_L") - sd_New(sd_created) - if(sd_created) + var/ul_created = findtext(tag,":UL") + ul_Prep() + if(ul_created) related += src return related = list(src) @@ -27,7 +27,7 @@ if(name == "Space") // override defaults for space requires_power = 1 always_unpowered = 1 - sd_SetLuminosity(1) + ul_SetLuminosity(1) power_light = 0 power_equip = 0 power_environ = 0 @@ -38,11 +38,11 @@ power_equip = 0//rastaf0 power_environ = 0//rastaf0 luminosity = 1 - sd_lighting = 0 // *DAL* + ul_Lighting = 0 // *DAL* else luminosity = 0 area_lights_luminosity = rand(6,9) - //sd_SetLuminosity(0) // *DAL* + //ul_SetLuminosity(0) // *DAL* diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 420d36e917..50d14572e7 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -477,7 +477,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. update_icon() if (!istype(src, /obj/machinery/door/airlock/glass)) - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) src.operating = 0 return 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() if (!istype(src, /obj/machinery/door/airlock/glass)) - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) src.operating = 0 return @@ -513,7 +513,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }. update_icon() if ((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass))) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) src.operating = 0 else 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() if ((src.visible) && (!istype(src, /obj/machinery/door/airlock/glass))) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) src.operating = 0 else diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 50fdb03b0c..840cec57ee 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -249,12 +249,12 @@ if(!src.operating) //in case of emag src.operating = 1 animate("opening") - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) sleep(10) src.layer = 2.7 src.density = 0 update_icon() - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) update_nearby_tiles() if(operating == 1) //emag again @@ -332,7 +332,7 @@ update_icon() if(src.visible && (!src.glass)) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) if(operating == 1) operating = 0 update_nearby_tiles() diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index dfdfe818d6..f1d78e40b4 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -22,7 +22,7 @@ src.icon_state = "pdoor0" sleep(15) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) src.operating = 0 return return @@ -38,7 +38,7 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) update_nearby_tiles() if(operating == 1) //emag again @@ -56,7 +56,7 @@ src.icon_state = "pdoor1" src.density = 1 if (src.visible) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -74,12 +74,12 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) f1.density = 0 - f1.sd_SetOpacity(0) + f1.ul_SetOpacity(0) f2.density = 0 - f2.sd_SetOpacity(0) + f2.ul_SetOpacity(0) update_nearby_tiles() @@ -99,12 +99,12 @@ src.density = 1 f1.density = 1 - f1.sd_SetOpacity(1) + f1.ul_SetOpacity(1) f2.density = 1 - f2.sd_SetOpacity(1) + f2.ul_SetOpacity(1) if (src.visible) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -122,16 +122,16 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) f1.density = 0 - f1.sd_SetOpacity(0) + f1.ul_SetOpacity(0) f2.density = 0 - f2.sd_SetOpacity(0) + f2.ul_SetOpacity(0) f3.density = 0 - f3.sd_SetOpacity(0) + f3.ul_SetOpacity(0) f4.density = 0 - f4.sd_SetOpacity(0) + f4.ul_SetOpacity(0) update_nearby_tiles() @@ -151,16 +151,16 @@ src.density = 1 f1.density = 1 - f1.sd_SetOpacity(1) + f1.ul_SetOpacity(1) f2.density = 1 - f2.sd_SetOpacity(1) + f2.ul_SetOpacity(1) f3.density = 1 - f3.sd_SetOpacity(1) + f3.ul_SetOpacity(1) f4.density = 1 - f4.sd_SetOpacity(1) + f4.ul_SetOpacity(1) if (src.visible) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -178,12 +178,12 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) f1.density = 0 - f1.sd_SetOpacity(0) + f1.ul_SetOpacity(0) f2.density = 0 - f2.sd_SetOpacity(0) + f2.ul_SetOpacity(0) update_nearby_tiles() @@ -203,12 +203,12 @@ src.density = 1 f1.density = 1 - f1.sd_SetOpacity(1) + f1.ul_SetOpacity(1) f2.density = 1 - f2.sd_SetOpacity(1) + f2.ul_SetOpacity(1) if (src.visible) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -226,16 +226,16 @@ src.icon_state = "pdoor0" sleep(10) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) f1.density = 0 - f1.sd_SetOpacity(0) + f1.ul_SetOpacity(0) f2.density = 0 - f2.sd_SetOpacity(0) + f2.ul_SetOpacity(0) f3.density = 0 - f3.sd_SetOpacity(0) + f3.ul_SetOpacity(0) f4.density = 0 - f4.sd_SetOpacity(0) + f4.ul_SetOpacity(0) update_nearby_tiles() @@ -255,16 +255,16 @@ src.density = 1 f1.density = 1 - f1.sd_SetOpacity(1) + f1.ul_SetOpacity(1) f2.density = 1 - f2.sd_SetOpacity(1) + f2.ul_SetOpacity(1) f3.density = 1 - f3.sd_SetOpacity(1) + f3.ul_SetOpacity(1) f4.density = 1 - f4.sd_SetOpacity(1) + f4.ul_SetOpacity(1) if (src.visible) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) update_nearby_tiles() sleep(10) @@ -285,8 +285,8 @@ f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,EAST)) f1.density = density f2.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) Del() del f1 @@ -304,8 +304,8 @@ f2 = new/obj/machinery/door/poddoor/filler_object (get_step(src,NORTH)) f1.density = density f2.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) Del() del f1 @@ -329,10 +329,10 @@ f2.density = density f3.density = density f4.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) - f4.sd_SetOpacity(opacity) - f3.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) + f4.ul_SetOpacity(opacity) + f3.ul_SetOpacity(opacity) Del() del f1 @@ -358,10 +358,10 @@ f2.density = density f3.density = density f4.density = density - f1.sd_SetOpacity(opacity) - f2.sd_SetOpacity(opacity) - f4.sd_SetOpacity(opacity) - f3.sd_SetOpacity(opacity) + f1.ul_SetOpacity(opacity) + f2.ul_SetOpacity(opacity) + f4.ul_SetOpacity(opacity) + f3.ul_SetOpacity(opacity) Del() del f1 diff --git a/code/game/machinery/doors/shutters.dm b/code/game/machinery/doors/shutters.dm index 8e1b9a8cae..386eac23c2 100644 --- a/code/game/machinery/doors/shutters.dm +++ b/code/game/machinery/doors/shutters.dm @@ -18,7 +18,7 @@ src.icon_state = "shutter0" sleep(15) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) src.operating = 0 return return @@ -34,7 +34,7 @@ src.icon_state = "shutter0" sleep(10) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) update_nearby_tiles() if(operating == 1) //emag again @@ -52,7 +52,7 @@ src.icon_state = "shutter1" src.density = 1 if (src.visible) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) update_nearby_tiles() sleep(10) diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index dfa6f2ccb0..d885ecb77a 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -94,7 +94,7 @@ sleep(10) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) update_nearby_tiles() if(operating == 1) //emag again @@ -111,7 +111,7 @@ src.density = 1 if (src.visible) - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) update_nearby_tiles() sleep(10) diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm index 2b87f3211c..86fd9a7cf9 100644 --- a/code/game/machinery/flasher.dm +++ b/code/game/machinery/flasher.dm @@ -24,17 +24,17 @@ /obj/machinery/flasher/New() sleep(4) - src.sd_SetLuminosity(2) + src.ul_SetLuminosity(2) /obj/machinery/flasher/power_change() if ( powered() ) stat &= ~NOPOWER icon_state = "[base_state]1" - src.sd_SetLuminosity(2) + src.ul_SetLuminosity(2) else stat |= ~NOPOWER icon_state = "[base_state]1-p" - src.sd_SetLuminosity(0) + src.ul_SetLuminosity(0) //Don't want to render prison breaks impossible /obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm index 08e13e535c..992c79e680 100644 --- a/code/game/machinery/floodlight.dm +++ b/code/game/machinery/floodlight.dm @@ -16,17 +16,17 @@ if (!on) if (luminosity) updateicon() - sd_SetLuminosity(0) + ul_SetLuminosity(0) return if(!luminosity && cell && cell.charge > 0) - sd_SetLuminosity(10) + ul_SetLuminosity(10) updateicon() if(!cell && luminosity) on = 0 updateicon() - sd_SetLuminosity(0) + ul_SetLuminosity(0) return cell.charge -= use @@ -34,7 +34,7 @@ if(cell.charge <= 0 && luminosity) on = 0 updateicon() - sd_SetLuminosity(0) + ul_SetLuminosity(0) return /obj/machinery/floodlight/attack_hand(mob/user as mob) diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm index c9a9faa92e..2f85c5db95 100644 --- a/code/game/machinery/hologram.dm +++ b/code/game/machinery/hologram.dm @@ -72,20 +72,20 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/ hologram.icon = A.holo_icon 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.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.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" master = A//AI is the master. use_power = 2//Active power usage. return 1 /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. 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" use_power = 1//Passive power usage. return 1 diff --git a/code/game/machinery/hydroponics.dm b/code/game/machinery/hydroponics.dm index d665d3a473..534c501d1b 100644 --- a/code/game/machinery/hydroponics.dm +++ b/code/game/machinery/hydroponics.dm @@ -179,12 +179,12 @@ obj/machinery/hydroponics/proc/updateicon() if(myseed) 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 - sd_SetLuminosity(myseed.potency/10) + ul_SetLuminosity(myseed.potency/10) else if(luminosity) - sd_SetLuminosity(0) + ul_SetLuminosity(0) return @@ -1014,10 +1014,10 @@ obj/machinery/hydroponics/attackby(var/obj/item/O as obj, var/mob/user as mob) if(myseed) if(luminosity && !istype(myseed,/obj/item/seeds/glowshroom)) - sd_SetLuminosity(0) + ul_SetLuminosity(0) else if(!luminosity && istype(myseed,/obj/item/seeds/glowshroom)) - sd_SetLuminosity(myseed.potency/10) + ul_SetLuminosity(myseed.potency/10) else if(luminosity) - sd_SetLuminosity(0) + ul_SetLuminosity(0) return \ No newline at end of file diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm index 015a35bc4b..35f94eff58 100755 --- a/code/game/machinery/igniter.dm +++ b/code/game/machinery/igniter.dm @@ -53,11 +53,11 @@ if ( powered() && disable == 0 ) stat &= ~NOPOWER icon_state = "[base_state]" - src.sd_SetLuminosity(2) + src.ul_SetLuminosity(2) else stat |= ~NOPOWER 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) if(istype(W, /obj/item/device/detective_scanner)) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index 9b98922870..d334b02f9f 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -427,7 +427,7 @@ if(A && B) needs_power = 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. if(istype(M,/mob/living/carbon)) diff --git a/code/game/master_controller.dm b/code/game/master_controller.dm index f77e9f4a77..76882780fe 100644 --- a/code/game/master_controller.dm +++ b/code/game/master_controller.dm @@ -55,12 +55,12 @@ datum/controller/game_controller // Now that the game is world is fully initialized, pause server until a user connects. world.sleep_offline = 1 - setup_objects() - setupgenetics() setupdooralarms() + setup_objects() + // for(var/i = 0, i < max_secret_rooms, i++) // make_mining_asteroid_secret() // 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) emclosetcount-- + setup_UL() + world << "\red \b Initializations complete." diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index f2ac1f2526..d1c9c000be 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -942,9 +942,9 @@ return lights = !lights if(lights) - src.sd_SetLuminosity(src.luminosity + src.lights_power) + src.ul_SetLuminosity(src.luminosity + src.lights_power) else - src.sd_SetLuminosity(src.luminosity - src.lights_power) + src.ul_SetLuminosity(src.luminosity - src.lights_power) src.log_message("Toggled lights.") return diff --git a/code/game/objects/alien/weeds.dm b/code/game/objects/alien/weeds.dm index 3c07c2fd73..4ae4b2f118 100644 --- a/code/game/objects/alien/weeds.dm +++ b/code/game/objects/alien/weeds.dm @@ -13,7 +13,7 @@ /obj/effect/alien/weeds/node/New() ..() - sd_SetLuminosity(NODERANGE) + ul_SetLuminosity(NODERANGE) return /obj/effect/alien/weeds/proc/Life() diff --git a/code/game/objects/blood.dm b/code/game/objects/blood.dm index 3581860518..389802bd9a 100644 --- a/code/game/objects/blood.dm +++ b/code/game/objects/blood.dm @@ -63,7 +63,7 @@ New() ..() - sd_SetLuminosity(1) + ul_SetLuminosity(1) spawn(1200) // 2 minutes del(src) \ No newline at end of file diff --git a/code/game/objects/devices/PDA/PDA.dm b/code/game/objects/devices/PDA/PDA.dm index 9e2ec3aac7..83658eb318 100755 --- a/code/game/objects/devices/PDA/PDA.dm +++ b/code/game/objects/devices/PDA/PDA.dm @@ -173,13 +173,13 @@ */ /obj/item/device/pda/pickup(mob/user) if (fon) - sd_SetLuminosity(0) - user.total_luminosity += f_lum + ul_SetLuminosity(0) + 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) if (fon) - user.total_luminosity -= f_lum - sd_SetLuminosity(f_lum) + user.ul_SetLuminosity(user.LuminosityRed - (f_lum - 1), user.LuminosityGreen - (f_lum - 1), user.LuminosityBlue - (f_lum + 1)) + ul_SetLuminosity(f_lum - 1, f_lum - 1, f_lum + 1) /obj/item/device/pda/New() ..() @@ -468,11 +468,11 @@ fon = (!fon) if (src in U.contents) 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 - U.total_luminosity -= f_lum + U.ul_SetLuminosity(U.LuminosityRed - (f_lum - 1), U.LuminosityGreen - (f_lum - 1), U.LuminosityBlue - (f_lum + 1)) else - sd_SetLuminosity(fon * f_lum) + ul_SetLuminosity(fon * f_lum) if("Medical Scan") if(scanmode == 1) scanmode = 0 @@ -939,7 +939,7 @@ if (src in M.contents) if(fon) 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) T.hotspot_expose(700,125) diff --git a/code/game/objects/devices/flashlight.dm b/code/game/objects/devices/flashlight.dm index 62b9c9506e..503e624bfe 100644 --- a/code/game/objects/devices/flashlight.dm +++ b/code/game/objects/devices/flashlight.dm @@ -17,30 +17,30 @@ ..() if (on) icon_state = icon_on - src.sd_SetLuminosity(brightness_on) + src.ul_SetLuminosity(brightness_on, brightness_on, 0) else icon_state = icon_off - src.sd_SetLuminosity(0) + src.ul_SetLuminosity(0) /obj/item/device/flashlight/proc/update_brightness(var/mob/user = null) if (on) icon_state = icon_on 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)) - src.sd_SetLuminosity(brightness_on) + src.ul_SetLuminosity(brightness_on, brightness_on, 0) else icon_state = icon_off 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)) - src.sd_SetLuminosity(0) + src.ul_SetLuminosity(0) /obj/item/device/flashlight/attack_self(mob/user) - if(!isturf(user.loc)) - user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. - return +// if(!isturf(user.loc)) +// user << "You cannot turn the light on while in this [user.loc]" //To prevent some lighting anomalities. +// return on = !on update_brightness(user) return @@ -82,14 +82,14 @@ /obj/item/device/flashlight/pickup(mob/user) if(on) - user.total_luminosity += brightness_on - src.sd_SetLuminosity(0) + user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + brightness_on, user.LuminosityBlue) + src.ul_SetLuminosity(0) /obj/item/device/flashlight/dropped(mob/user) if(on) - user.total_luminosity -= brightness_on - src.sd_SetLuminosity(brightness_on) + user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - brightness_on, user.LuminosityBlue) + src.ul_SetLuminosity(brightness_on) /obj/item/device/flashlight/pen @@ -148,21 +148,19 @@ item_state = "hardhat[on]_[color]" if(on) - user.total_luminosity += brightness_on + user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) 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) if(on) - user.total_luminosity += brightness_on - user.UpdateLuminosity() - src.sd_SetLuminosity(0) + user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) + ul_SetLuminosity(0) /obj/item/clothing/head/helmet/hardhat/dropped(mob/user) if(on) - user.total_luminosity -= brightness_on - user.UpdateLuminosity() - src.sd_SetLuminosity(brightness_on) + user.ul_SetLuminosity(user.LuminosityRed - brightness_on, user.LuminosityGreen - (brightness_on - 1), user.LuminosityBlue) + ul_SetLuminosity(brightness_on, brightness_on - 1, 0) //RIG helmet light /obj/item/clothing/head/helmet/space/rig/attack_self(mob/user) @@ -174,21 +172,19 @@ item_state = "rig[on]-[color]" if(on) - user.total_luminosity += brightness_on + user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) 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) if(on) - user.total_luminosity += brightness_on - user.UpdateLuminosity() - src.sd_SetLuminosity(0) + user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) + ul_SetLuminosity(0) /obj/item/clothing/head/helmet/space/rig/dropped(mob/user) if(on) - user.total_luminosity -= brightness_on - user.UpdateLuminosity() - src.sd_SetLuminosity(brightness_on) + user.ul_SetLuminosity(user.LuminosityRed + brightness_on, user.LuminosityGreen + (brightness_on - 1), user.LuminosityBlue) + ul_SetLuminosity(brightness_on, brightness_on-1, 0) // the desk lamps are a bit special /obj/item/device/flashlight/lamp diff --git a/code/game/objects/devices/powersink.dm b/code/game/objects/devices/powersink.dm index 4edc453e01..ea45398d5c 100644 --- a/code/game/objects/devices/powersink.dm +++ b/code/game/objects/devices/powersink.dm @@ -50,7 +50,7 @@ for(var/mob/M in viewers(user)) if(M == user) continue M << "[user] detaches the power sink from the cable." - sd_SetLuminosity(0) + ul_SetLuminosity(0) icon_state = "powersink0" return @@ -85,7 +85,7 @@ if(M == user) continue M << "[user] deactivates the power sink!" mode = 1 - sd_SetLuminosity(0) + ul_SetLuminosity(0) icon_state = "powersink0" processing_objects.Remove(src) @@ -94,7 +94,7 @@ var/datum/powernet/PN = attached.get_powernet() if(PN) if(!luminosity) - sd_SetLuminosity(12) + ul_SetLuminosity(12) // found a powernet, so drain up to max power from it diff --git a/code/game/objects/effect_system.dm b/code/game/objects/effect_system.dm index 3e80c869db..74b382e894 100644 --- a/code/game/objects/effect_system.dm +++ b/code/game/objects/effect_system.dm @@ -975,10 +975,10 @@ steam.start() -- spawns the effect ..() update_nearby_tiles(1) spawn(1) - sd_NewOpacity(1) + ul_SetOpacity(1) Del() - sd_NewOpacity(0) + ul_SetOpacity(0) density = 0 update_nearby_tiles(1) ..() diff --git a/code/game/objects/glowshroom.dm b/code/game/objects/glowshroom.dm index 6ae84e2761..6a3f3410ee 100644 --- a/code/game/objects/glowshroom.dm +++ b/code/game/objects/glowshroom.dm @@ -41,7 +41,7 @@ icon_state = "glowshroomf" 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) if(src) Spread() diff --git a/code/game/objects/items/candle.dm b/code/game/objects/items/candle.dm index 3e103f23ab..e54c7fbb77 100644 --- a/code/game/objects/items/candle.dm +++ b/code/game/objects/items/candle.dm @@ -51,7 +51,7 @@ //src.damtype = "fire" for(var/mob/O in viewers(usr, null)) O.show_message(flavor_text, 1) - sd_SetLuminosity(CANDLE_LUM) + ul_SetLuminosity(CANDLE_LUM, CANDLE_LUM -2, 0) processing_objects.Add(src) @@ -74,20 +74,19 @@ if(lit) lit = 0 update_icon() - sd_SetLuminosity(0) - user.total_luminosity -= CANDLE_LUM + ul_SetLuminosity(0) + user.ul_SetLuminosity(user.LuminosityRed - CANDLE_LUM, user.LuminosityGreen - (CANDLE_LUM - 2), user.LuminosityBlue) pickup(mob/user) if(lit) - src.sd_SetLuminosity(0) - user.total_luminosity += CANDLE_LUM - + ul_SetLuminosity(0) + user.ul_SetLuminosity(user.LuminosityRed + CANDLE_LUM, user.LuminosityGreen + (CANDLE_LUM - 2), user.LuminosityBlue) dropped(mob/user) if(lit) - user.total_luminosity -= CANDLE_LUM - src.sd_SetLuminosity(CANDLE_LUM) + user.ul_SetLuminosity(user.LuminosityRed - CANDLE_LUM, user.LuminosityGreen - (CANDLE_LUM - 2), user.LuminosityBlue) + src.ul_SetLuminosity(CANDLE_LUM, CANDLE_LUM, 0) diff --git a/code/game/objects/items/weapons/cigs_lighters.dm b/code/game/objects/items/weapons/cigs_lighters.dm index 77628fab40..fe19691854 100644 --- a/code/game/objects/items/weapons/cigs_lighters.dm +++ b/code/game/objects/items/weapons/cigs_lighters.dm @@ -441,7 +441,7 @@ ZIPPO 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) - user.total_luminosity += 2 + user.ul_SetLuminosity(user.LuminosityRed + 2, user.LuminosityGreen + 1, user.LuminosityBlue) processing_objects.Add(src) else src.lit = 0 @@ -454,7 +454,7 @@ ZIPPO for(var/mob/O in viewers(user, null)) 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) else return ..() @@ -483,13 +483,13 @@ ZIPPO pickup(mob/user) if(lit) - src.sd_SetLuminosity(0) - user.total_luminosity += 2 + ul_SetLuminosity(0) + user.ul_SetLuminosity(user.LuminosityRed + 2, user.LuminosityGreen + 1, user.LuminosityBlue) return dropped(mob/user) if(lit) - user.total_luminosity -= 2 - src.sd_SetLuminosity(2) + user.ul_SetLuminosity(user.LuminosityRed - 2, user.LuminosityGreen - 1, user.LuminosityBlue) + ul_SetLuminosity(2) return diff --git a/code/game/objects/items/weapons/papers_bins.dm b/code/game/objects/items/weapons/papers_bins.dm index c3b8a87196..4860885543 100644 --- a/code/game/objects/items/weapons/papers_bins.dm +++ b/code/game/objects/items/weapons/papers_bins.dm @@ -37,9 +37,9 @@ NOTEBOOK M << "\red \the [src] burns up." if(istype(src.loc,/mob)) var/mob/M = src.loc - M.total_luminosity -= 8 + M.ul_SetLuminosity(M.LuminosityRed - 8, M.LuminosityGreen - 6, M.LuminosityBlue) else - src.sd_SetLuminosity(0) + ul_SetLuminosity(0) processing_objects.Remove(src) del(src) @@ -53,13 +53,13 @@ NOTEBOOK /obj/item/weapon/paper/pickup(mob/user) if(burning) - src.sd_SetLuminosity(0) - user.total_luminosity += 8 + src.ul_SetLuminosity(0) + user.ul_SetLuminosity(user.LuminosityRed + 8, user.LuminosityGreen + 6, user.LuminosityBlue) /obj/item/weapon/paper/dropped(mob/user) if(burning) - user.total_luminosity -= 8 - src.sd_SetLuminosity(8) + user.ul_SetLuminosity(user.LuminosityRed - 8, user.LuminosityGreen - 6, user.LuminosityBlue) + src.ul_SetLuminosity(8,6,0) /obj/item/weapon/paper/examine() set src in view() @@ -163,7 +163,7 @@ NOTEBOOK if(is_burn(P)) for(var/mob/M in viewers(5, get_turf(src))) 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 processing_objects.Add(src) update_icon() diff --git a/code/game/objects/mineral_doors.dm b/code/game/objects/mineral_doors.dm index 9e7fcb5fb2..43e2a64041 100644 --- a/code/game/objects/mineral_doors.dm +++ b/code/game/objects/mineral_doors.dm @@ -170,7 +170,7 @@ New() ..() - sd_SetLuminosity(3) + ul_SetLuminosity(3) /obj/structure/mineral_door/sandstone mineralType = "sandstone" diff --git a/code/game/objects/transfer_valve.dm b/code/game/objects/transfer_valve.dm index 3404d4b649..e92b1ff8d8 100644 --- a/code/game/objects/transfer_valve.dm +++ b/code/game/objects/transfer_valve.dm @@ -191,20 +191,20 @@ flick("fwall_opening", src) sleep(15) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) var/turf/T = src.loc - T.sd_LumReset() + T.ul_Recalculate() else icon_state = "wall" flick("fwall_closing", src) sleep(15) src.density = 1 - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) var/turf/T = src.loc //T.sd_LumUpdate() src.relativewall() - T.sd_LumReset() + T.ul_Recalculate() attackby(obj/item/weapon/W as obj, mob/user as mob) @@ -235,20 +235,20 @@ flick("frwall_opening", src) sleep(15) src.density = 0 - src.sd_SetOpacity(0) + src.ul_SetOpacity(0) var/turf/T = src.loc - T.sd_LumReset() + T.ul_Recalculate() else icon_state = "r_wall" flick("frwall_closing", src) sleep(15) src.density = 1 - src.sd_SetOpacity(1) + src.ul_SetOpacity(1) var/turf/T = src.loc //T.sd_LumUpdate() src.relativewall() - T.sd_LumReset() + T.ul_Recalculate() attackby(obj/item/weapon/W as obj, mob/user as mob) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index 8e17391389..ce3a54e921 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -20,18 +20,18 @@ var/supply_shuttle_points = 50 var/ordernum=0 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" icon_state = "shuttle3" luminosity = 1 - sd_lighting = 0 + ul_Lighting = 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" icon_state = "shuttle3" luminosity = 1 - sd_lighting = 0 + ul_Lighting = 0 requires_power = 0 //SUPPLY PACKS MOVED TO /code/defines/obj/supplypacks.dm diff --git a/code/game/turf.dm b/code/game/turf.dm index d530fc406a..31bf5a1f9b 100644 --- a/code/game/turf.dm +++ b/code/game/turf.dm @@ -162,7 +162,7 @@ if (!explode) 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 W.levelupdate() air_master.tiles_to_update |= W @@ -191,7 +191,7 @@ if(prior_icon) W.icon_state = prior_icon else W.icon_state = "plating" W.opacity = 1 - W.sd_SetOpacity(0) + W.ul_SetOpacity(0) W.levelupdate() 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) ) S.icon_old = old_icon S.opacity = 0 - S.sd_NewOpacity(1) + S.ul_SetOpacity(1) levelupdate() 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) ) S.icon_old = old_icon S.opacity = 0 - S.sd_NewOpacity(1) + S.ul_SetOpacity(1) levelupdate() air_master.tiles_to_update |= S @@ -851,7 +851,7 @@ spawn(100) if(O) del(O) - F.sd_LumReset() + F.ul_Recalculate() return /turf/simulated/wall/meteorhit(obj/M as obj) @@ -1055,19 +1055,19 @@ turf/simulated/floor/proc/update_icon() switch(T.state) if(0) icon_state = "light_on" - sd_SetLuminosity(5) + ul_SetLuminosity(5) if(1) var/num = pick("1","2","3","4") icon_state = "light_on_flicker[num]" - sd_SetLuminosity(5) + ul_SetLuminosity(5) if(2) icon_state = "light_on_broken" - sd_SetLuminosity(5) + ul_SetLuminosity(5) if(3) icon_state = "light_off" - sd_SetLuminosity(0) + ul_SetLuminosity(0) else - sd_SetLuminosity(0) + ul_SetLuminosity(0) icon_state = "light_off" if(is_grass_floor()) if(!broken && !burnt) @@ -1215,7 +1215,7 @@ turf/simulated/floor/return_siding_icon_state() if(!floor_tile) return del(floor_tile) icon_plating = "plating" - sd_SetLuminosity(0) + ul_SetLuminosity(0) floor_tile = null intact = 0 broken = 0 @@ -1231,7 +1231,7 @@ turf/simulated/floor/return_siding_icon_state() broken = 0 burnt = 0 intact = 1 - sd_SetLuminosity(0) + ul_SetLuminosity(0) if(T) if(istype(T,/obj/item/stack/tile/plasteel)) floor_tile = T diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm index 80f76fe964..21a64028bd 100644 --- a/code/modules/admin/verbs/massmodvar.dm +++ b/code/modules/admin/verbs/massmodvar.dm @@ -213,7 +213,7 @@ if(new_value == null) return if(variable=="luminosity") - O.sd_SetLuminosity(new_value) + O.ul_SetLuminosity(new_value) else O.vars[variable] = new_value @@ -222,7 +222,7 @@ for(var/mob/M in world) if ( istype(M , O.type) ) if(variable=="luminosity") - M.sd_SetLuminosity(new_value) + M.ul_SetLuminosity(new_value) else M.vars[variable] = O.vars[variable] @@ -230,7 +230,7 @@ for(var/obj/A in world) if ( istype(A , O.type) ) if(variable=="luminosity") - A.sd_SetLuminosity(new_value) + A.ul_SetLuminosity(new_value) else A.vars[variable] = O.vars[variable] @@ -238,7 +238,7 @@ for(var/turf/A in world) if ( istype(A , O.type) ) if(variable=="luminosity") - A.sd_SetLuminosity(new_value) + A.ul_SetLuminosity(new_value) else A.vars[variable] = O.vars[variable] @@ -247,7 +247,7 @@ for(var/mob/M in world) if (M.type == O.type) if(variable=="luminosity") - M.sd_SetLuminosity(new_value) + M.ul_SetLuminosity(new_value) else M.vars[variable] = O.vars[variable] @@ -255,7 +255,7 @@ for(var/obj/A in world) if (A.type == O.type) if(variable=="luminosity") - A.sd_SetLuminosity(new_value) + A.ul_SetLuminosity(new_value) else A.vars[variable] = O.vars[variable] @@ -263,7 +263,7 @@ for(var/turf/A in world) if (A.type == O.type) if(variable=="luminosity") - A.sd_SetLuminosity(new_value) + A.ul_SetLuminosity(new_value) else A.vars[variable] = O.vars[variable] diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm index 8e30ca8b46..ca79df1737 100644 --- a/code/modules/admin/verbs/modifyvariables.dm +++ b/code/modules/admin/verbs/modifyvariables.dm @@ -531,7 +531,7 @@ var/list/forbidden_varedit_object_types = list( if(variable=="luminosity") var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num if(var_new == null) return - O.sd_SetLuminosity(var_new) + O.ul_SetLuminosity(var_new) else var/var_new = input("Enter new number:","Num",O.vars[variable]) as null|num if(var_new==null) return diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm index 29f1ac90dd..817dbe2be0 100644 --- a/code/modules/mining/mine_turfs.dm +++ b/code/modules/mining/mine_turfs.dm @@ -199,8 +199,8 @@ if(old_icon) W.icon_state = old_icon */ W.opacity = 1 - W.sd_SetOpacity(0) - W.sd_LumReset() + W.ul_SetOpacity(0) + W.ul_Recalculate() W.levelupdate() return W diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 3868321973..c477007eb2 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -125,8 +125,8 @@ G.process() 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 - if(!currentTurf.sd_lumcount) + var/turf/currentTurf = get_turf(src) + if(!max(currentTurf.ul_GetRed(), currentTurf.ul_GetGreen(), currentTurf.ul_GetBlue())) playsound_local(src,pick(scarySounds),50, 1, -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 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 - 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 nutrition += light_amount if(light_amount > 0) //if there's enough light, heal diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index b8e66cf0e3..8eea820f73 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -673,9 +673,7 @@ return health /mob/proc/UpdateLuminosity() - if(total_luminosity == last_luminosity) return 0//nothing to do here - last_luminosity = total_luminosity - sd_SetLuminosity(min(total_luminosity,7))//Current hardcode max at 7, should likely be a const somewhere else + ul_SetLuminosity(LuminosityRed, LuminosityGreen, LuminosityBlue)//Current hardcode max at 7, should likely be a const somewhere else return 1 /mob/MouseDrop(mob/M as mob) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 3d54b956cb..4417cdb911 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -55,8 +55,8 @@ var/obj/screen/gun/run/gun_run_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/last_luminosity = 0 +// 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 /*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. diff --git a/code/modules/mob/simple_animal/corgi.dm b/code/modules/mob/simple_animal/corgi.dm index 09eb81ce2f..15a0f1f3df 100644 --- a/code/modules/mob/simple_animal/corgi.dm +++ b/code/modules/mob/simple_animal/corgi.dm @@ -104,7 +104,7 @@ emote_hear = list("barks", "woofs", "yaps","pants") emote_see = list("shakes its head", "shivers") desc = "It's a corgi." - src.sd_SetLuminosity(0) + src.ul_SetLuminosity(0) inventory_head.loc = src.loc inventory_head = null else @@ -239,7 +239,7 @@ name = "Rudolph the Red-Nosed Corgi" emote_hear = list("barks christmas songs", "yaps") desc = "He has a very shiny nose." - src.sd_SetLuminosity(6) + src.ul_SetLuminosity(6) if(/obj/item/clothing/head/cargosoft) name = "Corgi Tech [real_name]" speak = list("Needs a stamp!", "Request DENIED!", "Fill these out in triplicate!") diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index b845d9f0eb..6975e37730 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -123,7 +123,7 @@ var/oldlum = luminosity //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(oldlum != luminosity) @@ -137,7 +137,7 @@ status = LIGHT_BURNED icon_state = "[base_state]-burned" on = 0 - sd_SetLuminosity(0) + ul_SetLuminosity(0) active_power_usage = (luminosity * 20) if(on != on_gs) on_gs = on diff --git a/code/modules/power/sd_DynamicAreaLighting.dm b/code/modules/power/sd_DynamicAreaLighting.dm index 7388288af2..062e67d986 100644 --- a/code/modules/power/sd_DynamicAreaLighting.dm +++ b/code/modules/power/sd_DynamicAreaLighting.dm @@ -1,23 +1,23 @@ /* 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. * 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. * - * 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 * will be blocked/unblocked as necessary. * * 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.: * * var/obj/block/B = new(loc) * B.opacity = 0 - * B.sd_SetOpacity(1) + * B.ul_SetOpacity(1) * * * 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. 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 and apply the new effect. 2) Opacity changes at run time. 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. 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 anything shining on that space, create the new atom, then 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. All areas will automatically use the sd_DynamicAreaLighting library when it is included in your project. You may disable 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 luminosity = 1 - sd_lighting = 0 + ul_Lighting = 0 This library chops areas into 5 separate areas of differing 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 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 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 sd_lumcount of local turfs. Areas have one additional proc and 4 variables: var - sd_lighting + ul_Lighting Turn this flag off to prevent sd_DynamicAreaLighting from effecting this area. 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, depending on its brightness (sd_lumcount). - sd_LumReset() + ul_Recalculate() Resets a turf's lumcount by stripping local luminosity, zeroing the lumcount, then reapplying local luminosity. @@ -436,7 +436,7 @@ atom 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 luminosity of an atom instead of setting it directly. @@ -448,7 +448,7 @@ atom sd_ApplyLum() - sd_SetOpacity(new_opacity as num) + ul_SetOpacity(new_opacity as num) /* if(opacity != new_opacity) var/list/affected = sd_StripLocalLum() opacity = new_opacity @@ -567,7 +567,7 @@ turf sd_lumcount = 0 // the brightness of the turf proc - sd_LumReset() + ul_Recalculate() /* Clear local lum, reset this turf's sd_lumcount, and re-apply local lum*/ var/list/affected = sd_StripLocalLum() @@ -580,7 +580,7 @@ turf sd_LumUpdate() set background = 1 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 // restrict light to valid levels @@ -685,7 +685,7 @@ area var /* Turn this flag off to prevent sd_DynamicAreaLighting from affecting this area */ - sd_lighting = 1 + ul_Lighting = 1 /* This var determines if an area is outside (affected by sunlight) or not. */ @@ -718,7 +718,7 @@ area ..() if(!tag) tag = "[type]" spawn(1) // wait a tick - if(sd_lighting) + if(ul_Lighting) // see if this area was created by the library if(!findtext(tag, "sd_L")) /* show the dark overlay so areas outside of luminous regions @@ -731,7 +731,7 @@ area if(!tag) tag = "[type]" spawn(1) // wait a tick - if(sd_lighting) + if(ul_Lighting) // see if this area was created by the library if(!sd_created) /* show the dark overlay so areas outside of luminous regions diff --git a/code/modules/power/singularity/containment_field.dm b/code/modules/power/singularity/containment_field.dm index 4cfcd3bbaa..d763828e83 100644 --- a/code/modules/power/singularity/containment_field.dm +++ b/code/modules/power/singularity/containment_field.dm @@ -14,7 +14,7 @@ New() spawn(1) - src.sd_SetLuminosity(5) + src.ul_SetLuminosity(5) Del() diff --git a/code/unused/mining/spaceship_builder_unused.dm b/code/unused/mining/spaceship_builder_unused.dm index 0613ca3b9c..235f5b6659 100644 --- a/code/unused/mining/spaceship_builder_unused.dm +++ b/code/unused/mining/spaceship_builder_unused.dm @@ -3,7 +3,7 @@ /area/shipbuilder requires_power = 0 luminosity = 1 - sd_lighting = 0 + ul_Lighting = 0 /area/shipbuilder/station name = "shipbuilder station" diff --git a/code/unused/pda2/pda2.dm b/code/unused/pda2/pda2.dm index 7aa1f538f5..f915ddf5f9 100644 --- a/code/unused/pda2/pda2.dm +++ b/code/unused/pda2/pda2.dm @@ -60,13 +60,13 @@ /obj/item/device/pda2/pickup(mob/user) if (src.fon) - src.sd_SetLuminosity(0) - user.sd_SetLuminosity(user.luminosity + src.f_lum) + src.ul_SetLuminosity(0) + user.ul_SetLuminosity(user.luminosity + src.f_lum) /obj/item/device/pda2/dropped(mob/user) if (src.fon) - user.sd_SetLuminosity(user.luminosity - src.f_lum) - src.sd_SetLuminosity(src.f_lum) + user.ul_SetLuminosity(user.luminosity - src.f_lum) + src.ul_SetLuminosity(src.f_lum) /obj/item/device/pda2/New() ..() @@ -240,11 +240,11 @@ if (ismob(src.loc)) if (src.fon) - src.loc.sd_SetLuminosity(src.loc.luminosity + src.f_lum) + src.loc.ul_SetLuminosity(src.loc.luminosity + src.f_lum) else - src.loc.sd_SetLuminosity(src.loc.luminosity - src.f_lum) + src.loc.ul_SetLuminosity(src.loc.luminosity - src.f_lum) else - src.sd_SetLuminosity(src.fon * src.f_lum) + src.ul_SetLuminosity(src.fon * src.f_lum) src.updateSelfDialog()