Merge pull request #998 from tigercat2000/LightShit

Baystation12's Lighting Overhaul
This commit is contained in:
ZomgPonies
2015-05-11 17:06:30 -04:00
151 changed files with 1447 additions and 1590 deletions
+11 -17
View File
@@ -103,7 +103,6 @@
/obj/item/areaeditor/proc/get_area()
var/turf/T = get_turf(usr)
var/area/A = T.loc
A = A.master
return A
@@ -150,7 +149,6 @@
return
var/area/A = new
A.name = str
A.tagbase="[A.type]_[md5(str)]" // without this dynamic light system ruin everithing
//var/ma
//ma = A.master ? "[A.master]" : "(null)"
//world << "DEBUG: create_area: <br>A.name=[A.name]<br>A.tag=[A.tag]<br>A.master=[ma]"
@@ -159,7 +157,6 @@
A.power_environ = 0
A.always_unpowered = 0
move_turfs_to_area(turfs, A)
A.SetDynamicLighting()
interact()
return
@@ -179,8 +176,7 @@
usr << "<span class='warning'>The given name is too long. The area's name is unchanged.</span>"
return
set_area_machinery_title(A,str,prevname)
for(var/area/RA in A.related)
RA.name = str
A.name = str
usr << "<span class='notice'>You rename the '[prevname]' to '[str]'.</span>"
interact()
return
@@ -189,20 +185,18 @@
/obj/item/areaeditor/proc/set_area_machinery_title(var/area/A,var/title,var/oldtitle)
if (!oldtitle) // or replacetext goes to infinite loop
return
for(var/area/RA in A.related)
for(var/obj/machinery/alarm/M in RA)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/power/apc/M in RA)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in RA)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_pump/M in RA)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/door/M in RA)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/alarm/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/power/apc/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_scrubber/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/atmospherics/unary/vent_pump/M in A)
M.name = replacetext(M.name,oldtitle,title)
for(var/obj/machinery/door/M in A)
M.name = replacetext(M.name,oldtitle,title)
//TODO: much much more. Unnamed airlocks, cameras, etc.
/obj/item/areaeditor/proc/check_tile_is_border(var/turf/T2,var/dir)
if (istype(T2, /turf/space))
return BORDER_SPACE //omg hull breach we all going to die here
+2 -15
View File
@@ -48,7 +48,7 @@
//src.damtype = "fire"
for(var/mob/O in viewers(usr, null))
O.show_message(flavor_text, 1)
SetLuminosity(CANDLE_LUM)
set_light(CANDLE_LUM)
processing_objects.Add(src)
@@ -72,17 +72,4 @@
if(lit)
lit = 0
update_icon()
SetLuminosity(0)
user.SetLuminosity(user.luminosity - CANDLE_LUM)
pickup(mob/user)
if(lit)
SetLuminosity(0)
user.SetLuminosity(user.luminosity + CANDLE_LUM)
dropped(mob/user)
if(lit)
user.SetLuminosity(user.luminosity - CANDLE_LUM)
SetLuminosity(CANDLE_LUM)
set_light(0)
+2 -14
View File
@@ -327,16 +327,6 @@ var/global/list/obj/item/device/pda/PDAs = list()
/*
* The Actual PDA
*/
/obj/item/device/pda/pickup(mob/user)
if(fon)
SetLuminosity(0)
user.SetLuminosity(user.luminosity + f_lum)
/obj/item/device/pda/dropped(mob/user)
if(fon)
user.SetLuminosity(user.luminosity - f_lum)
SetLuminosity(f_lum)
/obj/item/device/pda/New()
..()
PDAs += src
@@ -623,12 +613,10 @@ var/global/list/obj/item/device/pda/PDAs = list()
if("Light")
if(fon)
fon = 0
if(src in U.contents) U.SetLuminosity(U.luminosity - f_lum)
else SetLuminosity(0)
set_light(0)
else
fon = 1
if(src in U.contents) U.SetLuminosity(U.luminosity + f_lum)
else SetLuminosity(f_lum)
set_light(f_lum)
if("Medical Scan")
if(scanmode == 1)
scanmode = 0
+5 -24
View File
@@ -17,24 +17,18 @@
..()
if(on)
icon_state = "[initial(icon_state)]-on"
SetLuminosity(brightness_on)
set_light(brightness_on)
else
icon_state = initial(icon_state)
SetLuminosity(0)
set_light(0)
/obj/item/device/flashlight/proc/update_brightness(var/mob/user = null)
if(on)
icon_state = "[initial(icon_state)]-on"
if(loc == user)
user.SetLuminosity(user.luminosity + brightness_on)
else if(isturf(loc))
SetLuminosity(brightness_on)
set_light(brightness_on)
else
icon_state = initial(icon_state)
if(loc == user)
user.SetLuminosity(user.luminosity - brightness_on)
else if(isturf(loc))
SetLuminosity(0)
set_light(0)
/obj/item/device/flashlight/attack_self(mob/user)
if(!isturf(user.loc))
@@ -87,19 +81,6 @@
else
return ..()
/obj/item/device/flashlight/pickup(mob/user)
if(on)
user.SetLuminosity(user.luminosity + brightness_on)
SetLuminosity(0)
/obj/item/device/flashlight/dropped(mob/user)
if(on)
user.SetLuminosity(user.luminosity - brightness_on)
SetLuminosity(brightness_on)
/obj/item/device/flashlight/pen
name = "penlight"
desc = "A pen-sized light, used by medical staff."
@@ -197,7 +178,7 @@
on = 1 //Bio-luminesence has one setting, on.
/obj/item/device/flashlight/slime/New()
SetLuminosity(brightness_on)
set_light(brightness_on)
spawn(1) //Might be sloppy, but seems to be necessary to prevent further runtimes and make these work as intended... don't judge me!
update_brightness()
icon_state = initial(icon_state)
@@ -103,7 +103,7 @@
/obj/item/device/lightreplacer/emag_act(user as mob)
if(!emagged)
Emag()
/obj/item/device/lightreplacer/attack_self(mob/user)
/* // This would probably be a bit OP. If you want it though, uncomment the code.
if(isrobot(user))
@@ -147,7 +147,9 @@
var/obj/item/weapon/light/L1 = new target.light_type(target.loc)
L1.status = target.status
L1.rigged = target.rigged
L1.brightness = target.brightness
L1.brightness_range = target.brightness_range
L1.brightness_power = target.brightness_power
L1.brightness_color = target.brightness_color
L1.switchcount = target.switchcount
target.switchcount = 0
L1.update()
@@ -160,7 +162,9 @@
target.status = L2.status
target.switchcount = L2.switchcount
target.rigged = emagged
target.brightness = L2.brightness
target.brightness_range = L2.brightness_range
target.brightness_power = L2.brightness_power
target.brightness_color = L2.brightness_color
target.on = target.has_power()
target.update()
del(L2)
+4 -4
View File
@@ -53,7 +53,7 @@
for(var/mob/M in viewers(user))
if(M == user) continue
M << "[user] detaches the power sink from the cable."
SetLuminosity(0)
set_light(0)
icon_state = "powersink0"
return
@@ -61,7 +61,7 @@
..()
Destroy()
SetLuminosity(0)
set_light(0)
processing_objects.Remove(src)
// attached.attached = null
attached = null
@@ -93,7 +93,7 @@
if(M == user) continue
M << "[user] deactivates the power sink!"
mode = 1
SetLuminosity(0)
set_light(0)
icon_state = "powersink0"
processing_objects.Remove(src)
@@ -101,7 +101,7 @@
if(attached)
var/datum/powernet/PN = attached.get_powernet()
if(PN)
SetLuminosity(12)
set_light(12)
// found a powernet, so drain up to max power from it
@@ -442,7 +442,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
user.adjustFireLoss(5)
user.visible_message("<span class='notice'>After a few attempts, [user] manages to light the [src], they however burn their finger in the process.</span>")
user.SetLuminosity(user.luminosity + 2)
set_light(2)
processing_objects.Add(src)
else
lit = 0
@@ -455,7 +455,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
else
user.visible_message("<span class='notice'>[user] quietly shuts off the [src].")
user.SetLuminosity(user.luminosity - 2)
set_light(0)
processing_objects.Remove(src)
else
return ..()
@@ -488,19 +488,6 @@ CIGARETTE PACKETS ARE IN FANCY.DM
return
/obj/item/weapon/lighter/pickup(mob/user)
if(lit)
SetLuminosity(0)
user.SetLuminosity(user.luminosity+2)
return
/obj/item/weapon/lighter/dropped(mob/user)
if(lit)
user.SetLuminosity(user.luminosity-2)
SetLuminosity(2)
return
///////////
//ROLLING//
///////////