goddamn stupid runtimes
This commit is contained in:
@@ -394,8 +394,11 @@ Class Procs:
|
||||
M.icon_state = "box_1"
|
||||
|
||||
/obj/machinery/obj_break(damage_flag)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
. = ..()
|
||||
if(!(stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))
|
||||
stat |= BROKEN
|
||||
SEND_SIGNAL(src, COMSIG_MACHINERY_BROKEN, damage_flag)
|
||||
update_appearance()
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/contents_explosion(severity, target)
|
||||
|
||||
@@ -1,29 +1,47 @@
|
||||
// the light switch
|
||||
// can have multiple per area
|
||||
// can also operate on non-loc area through "otherarea" var
|
||||
/// The light switch. Can have multiple per area.
|
||||
/obj/machinery/light_switch
|
||||
name = "light switch"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "light1"
|
||||
base_icon_state = "light"
|
||||
plane = ABOVE_WALL_PLANE
|
||||
desc = "Make dark."
|
||||
var/on = TRUE
|
||||
var/area/area = null
|
||||
var/otherarea = null
|
||||
|
||||
/obj/machinery/light_switch/directional/north
|
||||
dir = SOUTH
|
||||
pixel_y = 26
|
||||
|
||||
/obj/machinery/light_switch/directional/south
|
||||
dir = NORTH
|
||||
pixel_y = -26
|
||||
|
||||
/obj/machinery/light_switch/directional/east
|
||||
dir = WEST
|
||||
pixel_x = 26
|
||||
|
||||
/obj/machinery/light_switch/directional/west
|
||||
dir = EAST
|
||||
pixel_x = -26
|
||||
|
||||
/obj/machinery/light_switch/Initialize()
|
||||
. = ..()
|
||||
area = get_area(src)
|
||||
|
||||
if(istext(area))
|
||||
area = text2path(area)
|
||||
if(ispath(area))
|
||||
area = GLOB.areas_by_type[area]
|
||||
if(otherarea)
|
||||
area = locate(text2path("/area/[otherarea]"))
|
||||
if(!area)
|
||||
area = get_area(src)
|
||||
|
||||
if(!name)
|
||||
name = "light switch ([area.name])"
|
||||
update_appearance()
|
||||
|
||||
on = area.lightswitch
|
||||
update_icon()
|
||||
/obj/machinery/light_switch/update_appearance(updates=ALL)
|
||||
. = ..()
|
||||
luminosity = (stat & NOPOWER) ? 0 : 1
|
||||
|
||||
/obj/machinery/light_switch/update_icon_state()
|
||||
if(stat & NOPOWER)
|
||||
@@ -39,18 +57,15 @@
|
||||
|
||||
/obj/machinery/light_switch/examine(mob/user)
|
||||
. = ..()
|
||||
. += "It is [on? "on" : "off"]."
|
||||
|
||||
. += "It is [area.lightswitch ? "on" : "off"]."
|
||||
/obj/machinery/light_switch/interact(mob/user)
|
||||
. = ..()
|
||||
on = !on
|
||||
|
||||
area.lightswitch = on
|
||||
area.update_icon()
|
||||
area.lightswitch = !area.lightswitch
|
||||
area.update_appearance()
|
||||
|
||||
for(var/obj/machinery/light_switch/L in area)
|
||||
L.on = on
|
||||
L.update_icon()
|
||||
L.update_appearance()
|
||||
|
||||
area.power_change()
|
||||
|
||||
@@ -62,7 +77,7 @@
|
||||
else
|
||||
stat |= NOPOWER
|
||||
|
||||
update_icon()
|
||||
update_appearance()
|
||||
|
||||
/obj/machinery/light_switch/emp_act(severity)
|
||||
. = ..()
|
||||
|
||||
Reference in New Issue
Block a user