- Desk lamps are now just fancy flashlights. Which means you can pick them up. They have w_class set to 4 and don't have the onbelt flag, meaning you can't put them in any container and you can't put them in a pocket. Click on them to pick them up, use the toggle-light verb to turn them on or off. They are no longer affected by light switches (desk lights generally aren't anyway)

- Updated lamp type path on both uterus and 2.0.8

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@3115 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
baloh.matevz
2012-02-12 19:28:44 +00:00
parent a5fea19b5d
commit e5d2b7ac7b
5 changed files with 72 additions and 70 deletions
+57 -8
View File
@@ -13,18 +13,36 @@
icon_on = "flight1"
icon_off = "flight0"
/obj/item/device/flashlight/initialize()
..()
if (on)
icon_state = icon_on
src.sd_SetLuminosity(brightness_on)
else
icon_state = icon_off
src.sd_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
else if (isturf(src.loc))
src.sd_SetLuminosity(brightness_on)
else
icon_state = icon_off
if(src.loc == user)
user.total_luminosity -= brightness_on
else if (isturf(src.loc))
src.sd_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
on = !on
if (on)
icon_state = icon_on
user.total_luminosity += brightness_on
else
icon_state = icon_off
user.total_luminosity -= brightness_on
update_brightness(user)
return
@@ -64,8 +82,8 @@
/obj/item/device/flashlight/pickup(mob/user)
if(on)
src.sd_SetLuminosity(0)
user.total_luminosity += brightness_on
src.sd_SetLuminosity(0)
/obj/item/device/flashlight/dropped(mob/user)
@@ -133,10 +151,41 @@
/obj/item/clothing/head/helmet/hardhat/pickup(mob/user)
if(on)
src.sd_SetLuminosity(0)
user.total_luminosity += brightness_on
user.UpdateLuminosity()
src.sd_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)
// the desk lamps are a bit special
/obj/item/device/flashlight/lamp
name = "desk lamp"
desc = "A desk lamp"
icon = 'lighting.dmi'
icon_state = "lamp0"
brightness_on = 5
icon_on = "lamp1"
icon_off = "lamp0"
w_class = 4
flags = FPRINT | TABLEPASS | CONDUCT
m_amt = 0
g_amt = 0
on = 1
// green-shaded desk lamp
/obj/item/device/flashlight/lamp/green
icon_state = "green0"
icon_on = "green1"
icon_off = "green0"
desc = "A green-shaded desk lamp"
/obj/item/device/flashlight/lamp/verb/toggle_light(mob/user)
set name = "Toggle light"
set category = "Object"
set src in oview(1)
attack_self(user)