Merge pull request #3552 from Citadel-Station-13/upstream-merge-31355
[MIRROR] Code Consistency: luminosity --> light_range
This commit is contained in:
@@ -1,72 +1,71 @@
|
||||
// the light switch
|
||||
// can have multiple per area
|
||||
// can also operate on non-loc area through "otherarea" var
|
||||
/obj/machinery/light_switch
|
||||
name = "light switch"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "light1"
|
||||
// the light switch
|
||||
// can have multiple per area
|
||||
// can also operate on non-loc area through "otherarea" var
|
||||
/obj/machinery/light_switch
|
||||
name = "light switch"
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "light1"
|
||||
anchored = TRUE
|
||||
desc = "Make dark."
|
||||
var/on = TRUE
|
||||
var/area/area = null
|
||||
var/otherarea = null
|
||||
// luminosity = 1
|
||||
|
||||
/obj/machinery/light_switch/Initialize()
|
||||
var/area/area = null
|
||||
var/otherarea = null
|
||||
|
||||
/obj/machinery/light_switch/Initialize()
|
||||
. = ..()
|
||||
area = get_area(src)
|
||||
|
||||
if(otherarea)
|
||||
area = locate(text2path("/area/[otherarea]"))
|
||||
|
||||
if(!name)
|
||||
name = "light switch ([area.name])"
|
||||
|
||||
on = area.lightswitch
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/light_switch/proc/updateicon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "light-p"
|
||||
else
|
||||
if(on)
|
||||
icon_state = "light1"
|
||||
else
|
||||
icon_state = "light0"
|
||||
|
||||
/obj/machinery/light_switch/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "It is [on? "on" : "off"].")
|
||||
|
||||
|
||||
/obj/machinery/light_switch/attack_paw(mob/user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/light_switch/attack_hand(mob/user)
|
||||
|
||||
on = !on
|
||||
|
||||
for(var/area/A in area.related)
|
||||
A.lightswitch = on
|
||||
A.updateicon()
|
||||
|
||||
for(var/obj/machinery/light_switch/L in A)
|
||||
L.on = on
|
||||
L.updateicon()
|
||||
|
||||
area.power_change()
|
||||
|
||||
/obj/machinery/light_switch/power_change()
|
||||
|
||||
if(!otherarea)
|
||||
if(powered(LIGHT))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/light_switch/emp_act(severity)
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
power_change()
|
||||
..()
|
||||
area = get_area(src)
|
||||
|
||||
if(otherarea)
|
||||
area = locate(text2path("/area/[otherarea]"))
|
||||
|
||||
if(!name)
|
||||
name = "light switch ([area.name])"
|
||||
|
||||
on = area.lightswitch
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/light_switch/proc/updateicon()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "light-p"
|
||||
else
|
||||
if(on)
|
||||
icon_state = "light1"
|
||||
else
|
||||
icon_state = "light0"
|
||||
|
||||
/obj/machinery/light_switch/examine(mob/user)
|
||||
..()
|
||||
to_chat(user, "It is [on? "on" : "off"].")
|
||||
|
||||
|
||||
/obj/machinery/light_switch/attack_paw(mob/user)
|
||||
src.attack_hand(user)
|
||||
|
||||
/obj/machinery/light_switch/attack_hand(mob/user)
|
||||
|
||||
on = !on
|
||||
|
||||
for(var/area/A in area.related)
|
||||
A.lightswitch = on
|
||||
A.updateicon()
|
||||
|
||||
for(var/obj/machinery/light_switch/L in A)
|
||||
L.on = on
|
||||
L.updateicon()
|
||||
|
||||
area.power_change()
|
||||
|
||||
/obj/machinery/light_switch/power_change()
|
||||
|
||||
if(!otherarea)
|
||||
if(powered(LIGHT))
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
stat |= NOPOWER
|
||||
|
||||
updateicon()
|
||||
|
||||
/obj/machinery/light_switch/emp_act(severity)
|
||||
if(!(stat & (BROKEN|NOPOWER)))
|
||||
power_change()
|
||||
..()
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
flags_1 = CONDUCT_1 | NODROP_1 | DROPDEL_1
|
||||
slot_flags = null
|
||||
block_chance = 0 //RNG WON'T HELP YOU NOW, PANSY
|
||||
luminosity = 3
|
||||
light_range = 3
|
||||
attack_verb = list("brutalized", "eviscerated", "disemboweled", "hacked", "carved", "cleaved") //ONLY THE MOST VISCERAL ATTACK VERBS
|
||||
var/notches = 0 //HOW MANY PEOPLE HAVE BEEN SLAIN WITH THIS BLADE
|
||||
var/obj/item/disk/nuclear/nuke_disk //OUR STORED NUKE DISK
|
||||
|
||||
Reference in New Issue
Block a user