module things, jfc
This commit is contained in:
+53
-15
@@ -101,10 +101,11 @@
|
||||
var/update_state = -1
|
||||
var/update_overlay = -1
|
||||
var/icon_update_needed = FALSE
|
||||
var/obj/machinery/computer/apc_control/remote_control = null
|
||||
|
||||
/obj/machinery/power/apc/unlocked
|
||||
locked = FALSE
|
||||
|
||||
|
||||
/obj/machinery/power/apc/syndicate //general syndicate access
|
||||
req_access = list(ACCESS_SYNDICATE)
|
||||
|
||||
@@ -117,6 +118,25 @@
|
||||
/obj/machinery/power/apc/highcap/fifteen_k
|
||||
cell_type = /obj/item/stock_parts/cell/high/plus
|
||||
|
||||
/obj/machinery/power/apc/auto_name
|
||||
auto_name = TRUE
|
||||
|
||||
/obj/machinery/power/apc/auto_name/north //Pixel offsets get overwritten on New()
|
||||
dir = NORTH
|
||||
pixel_y = 23
|
||||
|
||||
/obj/machinery/power/apc/auto_name/south
|
||||
dir = SOUTH
|
||||
pixel_y = -23
|
||||
|
||||
/obj/machinery/power/apc/auto_name/east
|
||||
dir = EAST
|
||||
pixel_x = 24
|
||||
|
||||
/obj/machinery/power/apc/auto_name/west
|
||||
dir = WEST
|
||||
pixel_x = -25
|
||||
|
||||
/obj/machinery/power/apc/get_cell()
|
||||
return cell
|
||||
|
||||
@@ -245,6 +265,11 @@
|
||||
if(integration_cog && is_servant_of_ratvar(user))
|
||||
to_chat(user, "<span class='brass'>There is an integration cog installed!</span>")
|
||||
|
||||
to_chat(user, "<span class='notice'>Alt-Click the APC to [ locked ? "unlock" : "lock"] the interface.</span>")
|
||||
|
||||
if(issilicon(user))
|
||||
to_chat(user, "<span class='notice'>Ctrl-Click the APC to switch the breaker [ operating ? "off" : "on"].</span>")
|
||||
|
||||
// update the APC icon to show the three base states
|
||||
// also add overlays for indicator lights
|
||||
/obj/machinery/power/apc/update_icon()
|
||||
@@ -280,19 +305,17 @@
|
||||
icon_state = "apc0"
|
||||
|
||||
if(!(update_state & UPSTATE_ALLGOOD))
|
||||
cut_overlays()
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
|
||||
if(update & 2)
|
||||
cut_overlays()
|
||||
SSvis_overlays.remove_vis_overlay(src, managed_vis_overlays)
|
||||
if(!(stat & (BROKEN|MAINT)) && update_state & UPSTATE_ALLGOOD)
|
||||
var/list/O = list(
|
||||
"apcox-[locked]",
|
||||
"apco3-[charging]")
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apcox-[locked]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco3-[charging]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
|
||||
if(operating)
|
||||
O += "apco0-[equipment]"
|
||||
O += "apco1-[lighting]"
|
||||
O += "apco2-[environ]"
|
||||
add_overlay(O)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco0-[equipment]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco1-[lighting]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
|
||||
SSvis_overlays.add_vis_overlay(src, icon, "apco2-[environ]", ABOVE_LIGHTING_LAYER, ABOVE_LIGHTING_PLANE, dir)
|
||||
|
||||
// And now, separately for cleanness, the lighting changing
|
||||
if(update_state & UPSTATE_ALLGOOD)
|
||||
@@ -452,6 +475,8 @@
|
||||
return
|
||||
|
||||
/obj/machinery/power/apc/screwdriver_act(mob/living/user, obj/item/W)
|
||||
if(..())
|
||||
return TRUE
|
||||
. = TRUE
|
||||
if(opened)
|
||||
if(cell)
|
||||
@@ -699,6 +724,13 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Access denied.</span>")
|
||||
|
||||
/obj/machinery/power/apc/proc/toggle_nightshift_lights(mob/living/user)
|
||||
if(last_nightshift_switch > world.time - 100) //~10 seconds between each toggle to prevent spamming
|
||||
to_chat(usr, "<span class='warning'>[src]'s night lighting circuit breaker is still cycling!</span>")
|
||||
return
|
||||
last_nightshift_switch = world.time
|
||||
set_nightshift(!nightshift_lights)
|
||||
|
||||
/obj/machinery/power/apc/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
|
||||
if(damage_flag == "melee" && damage_amount < 10 && (!(stat & BROKEN) || malfai))
|
||||
return 0
|
||||
@@ -863,6 +895,16 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/apc/can_interact(mob/user)
|
||||
. = ..()
|
||||
if (!. && !QDELETED(remote_control))
|
||||
. = remote_control.can_interact(user)
|
||||
|
||||
/obj/machinery/power/apc/ui_status(mob/user)
|
||||
. = ..()
|
||||
if (!QDELETED(remote_control) && user == remote_control.operator)
|
||||
. = UI_INTERACTIVE
|
||||
|
||||
/obj/machinery/power/apc/ui_act(action, params)
|
||||
if(..() || !can_use(usr, 1) || (locked && !usr.has_unlimited_silicon_privilege && !failure_timer && !(integration_cog && (is_servant_of_ratvar(usr)))))
|
||||
return
|
||||
@@ -882,11 +924,7 @@
|
||||
toggle_breaker()
|
||||
. = TRUE
|
||||
if("toggle_nightshift")
|
||||
if(last_nightshift_switch > world.time + 100) //don't spam..
|
||||
to_chat(usr, "<span class='warning'>[src]'s night lighting circuit breaker is still cycling!</span>")
|
||||
return
|
||||
last_nightshift_switch = world.time
|
||||
set_nightshift(!nightshift_lights)
|
||||
toggle_nightshift_lights()
|
||||
. = TRUE
|
||||
if("charge")
|
||||
chargemode = !chargemode
|
||||
|
||||
Reference in New Issue
Block a user