mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 18:32:03 +00:00
Working UL
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
//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
|
||||
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
|
||||
@@ -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,
|
||||
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)
|
||||
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
|
||||
return
|
||||
|
||||
atom/proc/New()
|
||||
atom/New()
|
||||
..()
|
||||
if(UL_setup)
|
||||
if(ul_IsLuminous())
|
||||
spawn(1)
|
||||
ul_Illuminate()
|
||||
return
|
||||
else
|
||||
light_to_instantiate |= src
|
||||
|
||||
atom/proc/Del()
|
||||
atom/Del()
|
||||
if(ul_IsLuminous())
|
||||
ul_Extinguish()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -124,7 +124,7 @@
|
||||
playSpecials(destturf,effectout,soundout)
|
||||
|
||||
// Re-Apply lum
|
||||
teleatom.sd_SetLuminosity(prevlum)
|
||||
teleatom.ul_SetLuminosity(prevlum)
|
||||
|
||||
destarea.Entered(teleatom)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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*
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
@@ -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))
|
||||
|
||||
@@ -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))
|
||||
|
||||
@@ -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."
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
/obj/effect/alien/weeds/node/New()
|
||||
..()
|
||||
sd_SetLuminosity(NODERANGE)
|
||||
ul_SetLuminosity(NODERANGE)
|
||||
return
|
||||
|
||||
/obj/effect/alien/weeds/proc/Life()
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
sd_SetLuminosity(1)
|
||||
ul_SetLuminosity(1)
|
||||
|
||||
spawn(1200) // 2 minutes
|
||||
del(src)
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
..()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -170,7 +170,7 @@
|
||||
|
||||
New()
|
||||
..()
|
||||
sd_SetLuminosity(3)
|
||||
ul_SetLuminosity(3)
|
||||
|
||||
/obj/structure/mineral_door/sandstone
|
||||
mineralType = "sandstone"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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]
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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!")
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
|
||||
New()
|
||||
spawn(1)
|
||||
src.sd_SetLuminosity(5)
|
||||
src.ul_SetLuminosity(5)
|
||||
|
||||
|
||||
Del()
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
/area/shipbuilder
|
||||
requires_power = 0
|
||||
luminosity = 1
|
||||
sd_lighting = 0
|
||||
ul_Lighting = 0
|
||||
|
||||
/area/shipbuilder/station
|
||||
name = "shipbuilder station"
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user