hasSiliconAccessInArea vars change

This commit is contained in:
Seris02
2020-01-21 11:44:49 +08:00
parent c2bcbe868e
commit 74be93a8cc
60 changed files with 129 additions and 127 deletions
+1 -1
View File
@@ -52,7 +52,7 @@
/datum/wires/airlock/interactable(mob/user)
var/obj/machinery/door/airlock/A = holder
if(!hasSiliconAccessInArea(user,get_area(src)) && A.isElectrified() && A.shock(user, 100))
if(!hasSiliconAccessInArea(user) && A.isElectrified() && A.shock(user, 100))
return FALSE
if(A.panel_open)
return TRUE
+1 -1
View File
@@ -12,7 +12,7 @@
/datum/wires/vending/interactable(mob/user)
var/obj/machinery/vending/V = holder
if(!hasSiliconAccessInArea(user,get_area(src)) && V.seconds_electrified && V.shock(user, 100))
if(!hasSiliconAccessInArea(user) && V.seconds_electrified && V.shock(user, 100))
return FALSE
if(V.panel_open)
return TRUE
+1 -1
View File
@@ -182,7 +182,7 @@
/obj/machinery/sleeper/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
if(state_open)
close_machine()
+1 -1
View File
@@ -224,7 +224,7 @@ Class Procs:
return !(stat & (NOPOWER|BROKEN|MAINT))
/obj/machinery/can_interact(mob/user)
var/silicon = hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user)
var/silicon = hasSiliconAccessInArea(user) || IsAdminGhost(user)
if((stat & (NOPOWER|BROKEN)) && !(interaction_flags_machine & INTERACT_MACHINE_OFFLINE))
return FALSE
if(panel_open && !(interaction_flags_machine & INTERACT_MACHINE_OPEN))
+5 -5
View File
@@ -105,7 +105,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
/obj/machinery/announcement_system/ui_interact(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
if(stat & BROKEN)
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='italics'>You hear a faint buzz.</span>")
@@ -123,7 +123,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
/obj/machinery/announcement_system/Topic(href, href_list)
if(..())
return
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
if(stat & BROKEN)
visible_message("<span class='warning'>[src] buzzes.</span>", "<span class='italics'>You hear a faint buzz.</span>")
@@ -132,13 +132,13 @@ GLOBAL_LIST_EMPTY(announcement_systems)
if(href_list["ArrivalTopic"])
var/NewMessage = stripped_input(usr, "Enter in the arrivals announcement configuration.", "Arrivals Announcement Config", arrival)
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
if(NewMessage)
arrival = NewMessage
else if(href_list["NewheadTopic"])
var/NewMessage = stripped_input(usr, "Enter in the departmental head announcement configuration.", "Head Departmental Announcement Config", newhead)
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
if(NewMessage)
newhead = NewMessage
@@ -157,7 +157,7 @@ GLOBAL_LIST_EMPTY(announcement_systems)
. = attack_ai(user)
/obj/machinery/announcement_system/attack_ai(mob/user)
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
if(stat & BROKEN)
to_chat(user, "<span class='warning'>[src]'s firmware appears to be malfunctioning!</span>")
@@ -304,12 +304,12 @@
/obj/machinery/computer/arcade/minesweeper/proc/custom_generation(mob/user)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10) //Entered into the menu so ping sound
var/new_rows = input(user, "How many rows do you want? (Minimum: 4, Maximum: 30)", "Minesweeper Rows") as null|num
if(!new_rows || !user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!new_rows || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
new_rows = CLAMP(new_rows + 1, 4, 30)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
var/new_columns = input(user, "How many columns do you want? (Minimum: 4, Maximum: 50)", "Minesweeper Squares") as null|num
if(!new_columns || !user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!new_columns || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
new_columns = CLAMP(new_columns + 1, 4, 50)
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
@@ -317,7 +317,7 @@
var/lower_limit = round(grid_area*0.156)
var/upper_limit = round(grid_area*0.85)
var/new_mine_limit = input(user, "How many mines do you want? (Minimum: [lower_limit], Maximum: [upper_limit])", "Minesweeper Mines") as null|num
if(!new_mine_limit || !user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!new_mine_limit || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return FALSE
playsound(loc, 'sound/arcade/minesweeper_menuselect.ogg', 50, 0, extrarange = -3, falloff = 10)
rows = new_rows
+1 -1
View File
@@ -36,7 +36,7 @@
return ..()
/obj/machinery/computer/security/can_interact(mob/user)
if((!hasSiliconAccessInArea(user,get_area(src)) && !Adjacent(user)) || is_blind(user) || !in_view_range(user, src))
if((!hasSiliconAccessInArea(user) && !Adjacent(user)) || is_blind(user) || !in_view_range(user, src))
return FALSE
return ..()
+5 -5
View File
@@ -171,7 +171,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
/obj/machinery/computer/card/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))) || !is_operational())
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)) || !is_operational())
return
if(inserted_modify_id)
if(id_eject(user, inserted_modify_id))
@@ -360,7 +360,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
if(..())
return
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))) || !is_operational())
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr)) || !is_operational())
usr.unset_machine()
usr << browse(null, "window=id_com")
return
@@ -392,7 +392,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
inserted_scan_id = id_to_insert
updateUsrDialog()
if ("auth")
if ((!( authenticated ) && (inserted_scan_id || hasSiliconAccessInArea(usr,get_area(src))) || mode))
if ((!( authenticated ) && (inserted_scan_id || hasSiliconAccessInArea(usr)) || mode))
if (check_access(inserted_scan_id))
region_access = list()
head_subordinates = list()
@@ -426,7 +426,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
get_subordinates("Quartermaster")
if(region_access)
authenticated = 1
else if ((!( authenticated ) && hasSiliconAccessInArea(usr,get_area(src))) && (!inserted_modify_id))
else if ((!( authenticated ) && hasSiliconAccessInArea(usr)) && (!inserted_modify_id))
to_chat(usr, "<span class='warning'>You can't modify an ID without an ID inserted to modify! Once one is in the modify slot on the computer, you can log in.</span>")
if ("logout")
region_access = null
@@ -481,7 +481,7 @@ GLOBAL_VAR_INIT(time_last_changed_position, 0)
if ("reg")
if (authenticated)
var/t2 = inserted_modify_id
if ((authenticated && inserted_modify_id == t2 && (in_range(src, usr) || hasSiliconAccessInArea(usr,get_area(src))) && isturf(loc)))
if ((authenticated && inserted_modify_id == t2 && (in_range(src, usr) || hasSiliconAccessInArea(usr)) && isturf(loc)))
var/newName = reject_bad_name(href_list["reg"])
if(newName)
inserted_modify_id.registered_name = newName
@@ -449,7 +449,7 @@
var/datum/browser/popup = new(user, "communications", "Communications Console", 400, 500)
popup.set_title_image(user.browse_rsc_icon(icon, icon_state))
if(issilicon(user) || (hasSiliconAccessInArea(user,get_area(src)) && !in_range(user,src)))
if(issilicon(user) || (hasSiliconAccessInArea(user) && !in_range(user,src)))
var/dat2 = interact_ai(user) // give the AI a different interact proc to limit its access
if(dat2)
dat += dat2
+2 -2
View File
@@ -64,7 +64,7 @@
if(!user)
return
var/datum/browser/popup = new(user, "scannernew", "DNA Modifier Console", 800, 630) // Set up the popup browser window
if(!(in_range(src, user) || hasSiliconAccessInArea(user,get_area(src))))
if(!(in_range(src, user) || hasSiliconAccessInArea(user)))
popup.close()
return
popup.add_stylesheet("scannernew", 'html/browser/scannernew.css')
@@ -308,7 +308,7 @@
return
if(!isturf(usr.loc))
return
if(!((isturf(loc) && in_range(src, usr)) || hasSiliconAccessInArea(usr,get_area(src))))
if(!((isturf(loc) && in_range(src, usr)) || hasSiliconAccessInArea(usr)))
return
if(current_screen == "working")
return
+3 -3
View File
@@ -190,7 +190,7 @@
if(!(active2 in GLOB.data_core.medical))
active2 = null
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr,get_area(src)) || IsAdminGhost(usr))
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr) || IsAdminGhost(usr))
usr.set_machine(src)
if(href_list["temp"])
temp = null
@@ -216,7 +216,7 @@
else if(href_list["login"])
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
if(hasSiliconAccessInArea(M,get_area(src)))
if(hasSiliconAccessInArea(M))
active1 = null
active2 = null
authenticated = 1
@@ -569,7 +569,7 @@
if(user)
if(message)
if(authenticated)
if(user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(user.canUseTopic(src, !hasSiliconAccessInArea(user)))
if(!record1 || record1 == active1)
if(!record2 || record2 == active2)
return 1
+1 -1
View File
@@ -86,7 +86,7 @@
/obj/machinery/computer/pod/Topic(href, href_list)
if(..())
return
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr,get_area(src)))
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr))
usr.set_machine(src)
if(href_list["power"])
var/t = text2num(href_list["power"])
@@ -87,7 +87,7 @@
/obj/machinery/computer/prisoner/management/Topic(href, href_list)
if(..())
return
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr,get_area(src)))
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr))
usr.set_machine(src)
if(href_list["id"])
+3 -3
View File
@@ -265,7 +265,7 @@ What a mess.*/
active1 = null
if(!( GLOB.data_core.security.Find(active2) ))
active2 = null
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr,get_area(src)) || IsAdminGhost(usr))
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr) || IsAdminGhost(usr))
usr.set_machine(src)
switch(href_list["choice"])
// SORTING!
@@ -299,7 +299,7 @@ What a mess.*/
if("Log In")
var/mob/M = usr
var/obj/item/card/id/I = M.get_idcard(TRUE)
if(hasSiliconAccessInArea(M,get_area(src)))
if(hasSiliconAccessInArea(M))
var/mob/living/silicon/borg = M
active1 = null
active2 = null
@@ -802,7 +802,7 @@ What a mess.*/
/obj/machinery/computer/secure_data/proc/canUseSecurityRecordsConsole(mob/user, message1 = 0, record1, record2)
if(user)
if(authenticated)
if(user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(user.canUseTopic(src, !hasSiliconAccessInArea(user)))
if(!trim(message1))
return 0
if(!record1 || record1 == active1)
+2 -2
View File
@@ -141,7 +141,7 @@
L[avoid_assoc_duplicate_keys(M.real_name, areaindex)] = M
var/desc = input("Please select a location to lock in.", "Locking Computer") as null|anything in L
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src)), NO_DEXTERY)) //check if we are still around
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user), NO_DEXTERY)) //check if we are still around
return
target = L[desc]
if(imp_t)
@@ -169,7 +169,7 @@
to_chat(user, "<span class='alert'>No active connected stations located.</span>")
return
var/desc = input("Please select a station to lock in.", "Locking Computer") as null|anything in L
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src)), NO_DEXTERY)) //again, check if we are still around
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user), NO_DEXTERY)) //again, check if we are still around
return
var/obj/machinery/teleport/station/target_station = L[desc]
if(!target_station || !target_station.teleporter_hub)
+1 -1
View File
@@ -53,7 +53,7 @@
/obj/machinery/jukebox/ui_interact(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
if (!anchored)
to_chat(user,"<span class='warning'>This device must be anchored by a wrench!</span>")
+1 -1
View File
@@ -98,7 +98,7 @@
/obj/machinery/dish_drive/AltClick(mob/living/user)
. = ..()
if(user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(user.canUseTopic(src, !hasSiliconAccessInArea(user)))
do_the_dishes(TRUE)
return TRUE
+1 -1
View File
@@ -172,7 +172,7 @@
/obj/machinery/dna_scannernew/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
interact(user)
return TRUE
+2 -2
View File
@@ -676,7 +676,7 @@
else
. += "It looks very robust."
if(hasSiliconAccessInArea(user,get_area(src)) && (!stat & BROKEN))
if(hasSiliconAccessInArea(user) && (!stat & BROKEN))
. += "<span class='notice'>Shift-click [src] to [ density ? "open" : "close"] it.</span>"
. += "<span class='notice'>Ctrl-click [src] to [ locked ? "raise" : "drop"] its bolts.</span>"
. += "<span class='notice'>Alt-click [src] to [ secondsElectrified ? "un-electrify" : "permanently electrify"] it.</span>"
@@ -1587,7 +1587,7 @@
. = TRUE
/obj/machinery/door/airlock/proc/user_allowed(mob/user)
return (hasSiliconAccessInArea(user,get_area(src)) && canAIControl(user)) || IsAdminGhost(user)
return (hasSiliconAccessInArea(user) && canAIControl(user)) || IsAdminGhost(user)
/obj/machinery/door/airlock/proc/shock_restore(mob/user)
if(!user_allowed(user))
+1 -1
View File
@@ -509,7 +509,7 @@ GLOBAL_LIST_EMPTY(allCasters)
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
return
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || hasSiliconAccessInArea(usr,get_area(src)))
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && isturf(loc))) || hasSiliconAccessInArea(usr))
usr.set_machine(src)
scan_user(usr)
if(href_list["set_channel_name"])
@@ -839,7 +839,7 @@
/obj/machinery/turretid/examine(mob/user)
. = ..()
if(hasSiliconAccessInArea(user,get_area(src)) && (!stat & BROKEN))
if(hasSiliconAccessInArea(user) && (!stat & BROKEN))
. += "<span class='notice'>Ctrl-click [src] to [ enabled ? "disable" : "enable"] turrets.</span>"
. += "<span class='notice'>Alt-click [src] to set turrets to [ lethal ? "stun" : "kill"].</span>"
@@ -854,7 +854,7 @@
to_chat(user, "You link \the [M.buffer] with \the [src]")
return
if (hasSiliconAccessInArea(user,get_area(src)))
if (hasSiliconAccessInArea(user))
return attack_hand(user)
if ( get_dist(src, user) == 0 ) // trying to unlock the interface
@@ -895,7 +895,7 @@
/obj/machinery/turretid/ui_interact(mob/user)
. = ..()
if ( get_dist(src, user) > 0 )
if ( !(hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user)) )
if ( !(hasSiliconAccessInArea(user) || IsAdminGhost(user)) )
to_chat(user, "<span class='notice'>You are too far away.</span>")
user.unset_machine()
user << browse(null, "window=turretid")
@@ -903,10 +903,10 @@
var/t = ""
if(locked && !(hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user)))
if(locked && !(hasSiliconAccessInArea(user) || IsAdminGhost(user)))
t += "<div class='notice icon'>Swipe ID card to unlock interface</div>"
else
if(!hasSiliconAccessInArea(user,get_area(src)) && !IsAdminGhost(user))
if(!hasSiliconAccessInArea(user) && !IsAdminGhost(user))
t += "<div class='notice icon'>Swipe ID card to lock interface</div>"
t += "Turrets [enabled?"activated":"deactivated"] - <A href='?src=[REF(src)];toggleOn=1'>[enabled?"Disable":"Enable"]?</a><br>"
t += "Currently set for [lethal?"lethal":"stun repeatedly"] - <A href='?src=[REF(src)];toggleLethal=1'>Change to [lethal?"Stun repeatedly":"Lethal"]?</a><br>"
@@ -920,7 +920,7 @@
if(..())
return
if (locked)
if(!(hasSiliconAccessInArea(usr,get_area(src)) || IsAdminGhost(usr)))
if(!(hasSiliconAccessInArea(usr) || IsAdminGhost(usr)))
to_chat(usr, "Control panel is locked!")
return
if (href_list["toggleOn"])
+2 -2
View File
@@ -124,7 +124,7 @@
. = ..()
if(.)
return
if(locked && !hasSiliconAccessInArea(user,get_area(src)))
if(locked && !hasSiliconAccessInArea(user))
to_chat(user, "<span class='warning'>The machine is locked, you are unable to use it!</span>")
return
if(panel_open)
@@ -370,7 +370,7 @@
if(!anchored)
to_chat(user, "<span class='warning'>\The [src] needs to be firmly secured to the floor first!</span>")
return
if(locked && !hasSiliconAccessInArea(user,get_area(src)))
if(locked && !hasSiliconAccessInArea(user))
to_chat(user, "<span class='warning'>The controls are locked!</span>")
return
if(!power)
@@ -196,7 +196,7 @@
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && ((usr in range(1, src)) || hasSiliconAccessInArea(usr,get_area(src))))
if(newnet && ((usr in range(1, src)) || hasSiliconAccessInArea(usr)))
if(length(newnet) > 15)
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
@@ -260,7 +260,7 @@
if(..())
return
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr,get_area(src)))
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr))
//Authenticate
if (href_list["auth"])
if(LINKED_SERVER_NONRESPONSIVE)
@@ -108,7 +108,7 @@
if(href_list["network"])
var/newnet = stripped_input(usr, "Which network do you want to view?", "Comm Monitor", network)
if(newnet && ((usr in range(1, src)) || hasSiliconAccessInArea(usr,get_area(src))))
if(newnet && ((usr in range(1, src)) || hasSiliconAccessInArea(usr)))
if(length(newnet) > 15)
temp = "<font color = #D70B00>- FAILED: NETWORK TAG STRING TOO LENGHTLY -</font color>"
@@ -30,7 +30,7 @@
/obj/machinery/telecomms/ui_interact(mob/user)
. = ..()
// You need a multitool to use this, or be silicon
if(!hasSiliconAccessInArea(user,get_area(src)))
if(!hasSiliconAccessInArea(user))
// istype returns false if the value is null
if(!istype(user.get_active_held_item(), /obj/item/multitool))
return
@@ -97,7 +97,7 @@
var/obj/item/multitool/P = null
// Let's double check
if(!hasSiliconAccessInArea(user,get_area(src)) && istype(user.get_active_held_item(), /obj/item/multitool))
if(!hasSiliconAccessInArea(user) && istype(user.get_active_held_item(), /obj/item/multitool))
P = user.get_active_held_item()
else if(isAI(user))
var/mob/living/silicon/ai/U = user
@@ -162,7 +162,7 @@
if(..())
return
if(!hasSiliconAccessInArea(usr,get_area(src)))
if(!hasSiliconAccessInArea(usr))
if(!istype(usr.get_active_held_item(), /obj/item/multitool))
return
@@ -270,6 +270,6 @@
updateUsrDialog()
/obj/machinery/telecomms/proc/canAccess(mob/user)
if(hasSiliconAccessInArea(user,get_area(src)) || in_range(user, src))
if(hasSiliconAccessInArea(user) || in_range(user, src))
return TRUE
return FALSE
+1 -1
View File
@@ -27,7 +27,7 @@
/obj/machinery/transformer/examine(mob/user)
. = ..()
if(cooldown && (hasSiliconAccessInArea(user,get_area(src)) || isobserver(user)))
if(cooldown && (hasSiliconAccessInArea(user) || isobserver(user)))
. += "It will be ready in [DisplayTimeText(cooldown_timer - world.time)]."
/obj/machinery/transformer/Destroy()
+3 -3
View File
@@ -715,7 +715,7 @@ GLOBAL_LIST_EMPTY(PDAs)
return
/obj/item/pda/proc/remove_id(mob/user)
if(hasSiliconAccessInArea(user,get_area(src)) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
if(hasSiliconAccessInArea(user) || !user.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
do_remove_id(user)
@@ -904,7 +904,7 @@ GLOBAL_LIST_EMPTY(PDAs)
remove_pen()
/obj/item/pda/proc/toggle_light()
if(hasSiliconAccessInArea(usr,get_area(src)) || !usr.canUseTopic(src, BE_CLOSE))
if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE))
return
if(fon)
fon = FALSE
@@ -916,7 +916,7 @@ GLOBAL_LIST_EMPTY(PDAs)
/obj/item/pda/proc/remove_pen()
if(hasSiliconAccessInArea(usr,get_area(src)) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
if(hasSiliconAccessInArea(usr) || !usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK))
return
if(inserted_item)
+1 -1
View File
@@ -587,7 +587,7 @@ Code:
/obj/item/cartridge/Topic(href, href_list)
..()
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
usr.unset_machine()
usr << browse(null, "window=pda")
return
@@ -56,8 +56,7 @@
/obj/item/implant/hijack/proc/InterceptClickOn(mob/living/user,params,atom/object)
if (user.get_active_held_item() || isitem(object) || !toggled || user.incapacitated())
return
var/area/a = get_area(object)
if (!hasSiliconAccessInArea(imp_in,a))
if (!object.hasSiliconAccessInArea(imp_in))
return
var/list/modifiers = params2list(params)
imp_in.face_atom(object)
+1 -1
View File
@@ -125,7 +125,7 @@
if ((M.client && M.machine == src))
is_in_use = TRUE
ui_interact(M)
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr) || hasSiliconAccessInArea(usr,get_area(src)))
if(isAI(usr) || iscyborg(usr) || IsAdminGhost(usr) || hasSiliconAccessInArea(usr))
if (!(usr in nearby))
if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
is_in_use = TRUE
+1 -1
View File
@@ -168,7 +168,7 @@ GLOBAL_LIST_EMPTY(bodycontainers) //Let them act as spawnpoints for revenants an
/obj/structure/bodycontainer/morgue/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
beeper = !beeper
to_chat(user, "<span class='notice'>You turn the speaker function [beeper ? "on" : "off"].</span>")
@@ -245,7 +245,7 @@
/obj/machinery/airalarm/ui_data(mob/user)
var/data = list(
"locked" = locked,
"siliconUser" = user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user,get_area(src)),
"siliconUser" = user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user),
"emagged" = (obj_flags & EMAGGED ? 1 : 0),
"danger_level" = danger_level,
)
@@ -288,7 +288,7 @@
"danger_level" = cur_tlv.get_danger_level(environment.gases[gas_id] * partial_pressure)
))
if(!locked || user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user,get_area(src)))
if(!locked || user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user))
data["vents"] = list()
for(var/id_tag in A.air_vent_names)
var/long_name = A.air_vent_names[id_tag]
@@ -368,7 +368,7 @@
/obj/machinery/airalarm/ui_act(action, params)
if(..() || buildstage != 2)
return
if((locked && !usr.has_unlimited_silicon_privilege && !hasSiliconAccessInArea(usr,get_area(src))) || (usr.has_unlimited_silicon_privilege && aidisabled))
if((locked && !usr.has_unlimited_silicon_privilege && !hasSiliconAccessInArea(usr)) || (usr.has_unlimited_silicon_privilege && aidisabled))
return
var/device_id = params["id_tag"]
switch(action)
@@ -839,7 +839,7 @@
/obj/machinery/airalarm/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))) || !isturf(loc))
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user)) || !isturf(loc))
return
togglelock(user)
return TRUE
@@ -44,7 +44,7 @@
return
if(reload < reload_cooldown)
return
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr,get_area(src)))
if(usr.contents.Find(src) || (in_range(src, usr) && isturf(loc)) || hasSiliconAccessInArea(usr))
priority_announce("Bluespace artillery fire detected. Brace for impact.")
message_admins("[ADMIN_LOOKUPFLW(usr)] has launched an artillery strike.")
var/list/L = list()
+1 -1
View File
@@ -77,7 +77,7 @@
/obj/item/supplypod_beacon/AltClick(mob/user)
. = ..()
if (!user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if (!user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
if (express_console)
unlink_console()
+1 -1
View File
@@ -140,7 +140,7 @@
/obj/item/valentine/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
if( !(ishuman(user) || isobserver(user) || hasSiliconAccessInArea(user,get_area(src))) )
if( !(ishuman(user) || isobserver(user) || hasSiliconAccessInArea(user)) )
user << browse("<HTML><HEAD><TITLE>[name]</TITLE></HEAD><BODY>[stars(message)]</BODY></HTML>", "window=[name]")
onclose(user, "[name]")
else
@@ -55,7 +55,7 @@
if(!operating)
. += "<span class='notice'>Alt-click [src] to turn it on.</span>"
if(!in_range(user, src) && !hasSiliconAccessInArea(user,get_area(src)) && !isobserver(user))
if(!in_range(user, src) && !hasSiliconAccessInArea(user) && !isobserver(user))
. += "<span class='warning'>You're too far away to examine [src]'s contents and display!</span>"
return
if(operating)
@@ -63,7 +63,7 @@
return
if(length(ingredients))
if(hasSiliconAccessInArea(user,get_area(src)))
if(hasSiliconAccessInArea(user))
. += "<span class='notice'>\The [src] camera shows:</span>"
else
. += "<span class='notice'>\The [src] contains:</span>"
@@ -187,14 +187,14 @@
/obj/machinery/microwave/AltClick(mob/user)
. = ..()
if(user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(user.canUseTopic(src, !hasSiliconAccessInArea(user)))
cook()
return TRUE
/obj/machinery/microwave/ui_interact(mob/user)
. = ..()
if(operating || panel_open || !anchored || !user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(operating || panel_open || !anchored || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
if(isAI(user) && (stat & NOPOWER))
return
@@ -206,10 +206,10 @@
to_chat(user, "<span class='warning'>\The [src] is empty.</span>")
return
var/choice = show_radial_menu(user, src, isAI(user) ? ai_radial_options : radial_options, require_near = !hasSiliconAccessInArea(user,get_area(src)))
var/choice = show_radial_menu(user, src, isAI(user) ? ai_radial_options : radial_options, require_near = !hasSiliconAccessInArea(user))
// post choice verification
if(operating || panel_open || !anchored || !user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(operating || panel_open || !anchored || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
if(isAI(user) && (stat & NOPOWER))
return
+2 -2
View File
@@ -92,7 +92,7 @@
data["emagged"] = TRUE
data["emag_programs"] = emag_programs
data["program"] = program
data["can_toggle_safety"] = hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user)
data["can_toggle_safety"] = hasSiliconAccessInArea(user) || IsAdminGhost(user)
return data
@@ -109,7 +109,7 @@
if(A)
load_program(A)
if("safety")
if(!hasSiliconAccessInArea(usr,get_area(src)) && !IsAdminGhost(usr))
if(!hasSiliconAccessInArea(usr) && !IsAdminGhost(usr))
var/msg = "[key_name(usr)] attempted to emag the holodeck using a href they shouldn't have!"
message_admins(msg)
log_admin(msg)
+1 -1
View File
@@ -105,7 +105,7 @@
return
var/datum/browser/popup = new(user, "plantdna", "Plant DNA Manipulator", 450, 600)
if(!(in_range(src, user) || hasSiliconAccessInArea(user,get_area(src))))
if(!(in_range(src, user) || hasSiliconAccessInArea(user)))
popup.close()
return
@@ -107,7 +107,7 @@
interact(user)
/obj/item/integrated_circuit_printer/interact(mob/user)
if(!(in_range(src, user) || hasSiliconAccessInArea(user,get_area(src))))
if(!(in_range(src, user) || hasSiliconAccessInArea(user)))
return
if(isnull(current_category))
+1 -1
View File
@@ -4,7 +4,7 @@
//check if it doesn't require any access at all
if(src.check_access(null))
return TRUE
if(hasSiliconAccessInArea(M,get_area(src)))
if(hasSiliconAccessInArea(M))
if(ispAI(M))
return FALSE
return TRUE //AI can do whatever it wants
@@ -809,14 +809,14 @@ Pass a positive integer as an argument to override a bot's default speed.
switch(href_list["operation"])
if("patrol")
if(!hasSiliconAccessInArea(usr,get_area(src)) && !IsAdminGhost(usr) && !(bot_core.allowed(usr) || !locked))
if(!hasSiliconAccessInArea(usr) && !IsAdminGhost(usr) && !(bot_core.allowed(usr) || !locked))
return TRUE
auto_patrol = !auto_patrol
bot_reset()
if("remote")
remote_disabled = !remote_disabled
if("hack")
if(!hasSiliconAccessInArea(usr,get_area(src)) && !IsAdminGhost(usr))
if(!hasSiliconAccessInArea(usr) && !IsAdminGhost(usr))
var/msg = "[key_name(usr)] attempted to hack a bot with a href that shouldn't be available!"
message_admins(msg)
log_admin(msg)
@@ -835,7 +835,7 @@ Pass a positive integer as an argument to override a bot's default speed.
to_chat(usr, "<span class='notice'>[text_dehack]</span>")
bot_reset()
if("ejectpai")
if(paicard && (!locked || hasSiliconAccessInArea(usr,get_area(src)) || IsAdminGhost(usr)))
if(paicard && (!locked || hasSiliconAccessInArea(usr) || IsAdminGhost(usr)))
to_chat(usr, "<span class='notice'>You eject [paicard] from [bot_name]</span>")
ejectpai(usr)
update_controls()
@@ -862,13 +862,13 @@ Pass a positive integer as an argument to override a bot's default speed.
if(emagged == 2) //An emagged bot cannot be controlled by humans, silicons can if one hacked it.
if(!hacked) //Manually emagged by a human - access denied to all.
return TRUE
else if(!hasSiliconAccessInArea(user,get_area(src)) && !IsAdminGhost(user)) //Bot is hacked, so only silicons and admins are allowed access.
else if(!hasSiliconAccessInArea(user) && !IsAdminGhost(user)) //Bot is hacked, so only silicons and admins are allowed access.
return TRUE
return FALSE
/mob/living/simple_animal/bot/proc/hack(mob/user)
var/hack
if(hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user)) //Allows silicons or admins to toggle the emag status of a bot.
if(hasSiliconAccessInArea(user) || IsAdminGhost(user)) //Allows silicons or admins to toggle the emag status of a bot.
hack += "[emagged == 2 ? "Software compromised! Unit may exhibit dangerous or erratic behavior." : "Unit operating normally. Release safety lock?"]<BR>"
hack += "Harm Prevention Safety System: <A href='?src=[REF(src)];operation=hack'>[emagged ? "<span class='bad'>DANGER</span>" : "Engaged"]</A><BR>"
else if(!locked) //Humans with access can use this option to hide a bot from the AI's remote control panel and PDA control.
@@ -877,7 +877,7 @@ Pass a positive integer as an argument to override a bot's default speed.
/mob/living/simple_animal/bot/proc/showpai(mob/user)
var/eject = ""
if((!locked || hasSiliconAccessInArea(usr,get_area(src)) || IsAdminGhost(usr)))
if((!locked || hasSiliconAccessInArea(usr) || IsAdminGhost(usr)))
if(paicard || allow_pai)
eject += "Personality card status: "
if(paicard)
@@ -296,7 +296,7 @@
Status: <A href='?src=[REF(src)];power=1'>[on ? "On" : "Off"]</A><BR>
Behaviour controls are [locked ? "locked" : "unlocked"]<BR>
Maintenance panel panel is [open ? "opened" : "closed"]"})
if(!locked || hasSiliconAccessInArea(user,get_area(src))|| IsAdminGhost(user))
if(!locked || hasSiliconAccessInArea(user)|| IsAdminGhost(user))
dat += "<BR>Clean Blood: <A href='?src=[REF(src)];operation=blood'>[blood ? "Yes" : "No"]</A>"
dat += "<BR>Clean Trash: <A href='?src=[REF(src)];operation=trash'>[trash ? "Yes" : "No"]</A>"
dat += "<BR>Exterminate Pests: <A href='?src=[REF(src)];operation=pests'>[pests ? "Yes" : "No"]</A>"
@@ -110,7 +110,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]<BR>"},
"<A href='?src=[REF(src)];power=1'>[on ? "On" : "Off"]</A>" )
if(!locked || hasSiliconAccessInArea(user,get_area(src))|| IsAdminGhost(user))
if(!locked || hasSiliconAccessInArea(user)|| IsAdminGhost(user))
if(!lasercolor)
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>
@@ -111,7 +111,7 @@
dat += "Maintenance panel panel is [open ? "opened" : "closed"]<BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
if(!locked || hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user))
if(!locked || hasSiliconAccessInArea(user) || IsAdminGhost(user))
dat += "Extinguish Fires: <A href='?src=[REF(src)];operation=extinguish_fires'>[extinguish_fires ? "Yes" : "No"]</A><BR>"
dat += "Extinguish People: <A href='?src=[REF(src)];operation=extinguish_people'>[extinguish_people ? "Yes" : "No"]</A><BR>"
dat += "Patrol Station: <A href='?src=[REF(src)];operation=patrol'>[auto_patrol ? "Yes" : "No"]</A><BR>"
@@ -83,7 +83,7 @@
dat += "None Loaded<BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
if(!locked || hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user))
if(!locked || hasSiliconAccessInArea(user) || IsAdminGhost(user))
dat += "Add tiles to new hull plating: <A href='?src=[REF(src)];operation=autotile'>[autotile ? "Yes" : "No"]</A><BR>"
dat += "Place floor tiles: <A href='?src=[REF(src)];operation=place'>[placetiles ? "Yes" : "No"]</A><BR>"
dat += "Replace existing floor tiles with custom tiles: <A href='?src=[REF(src)];operation=replace'>[replacetiles ? "Yes" : "No"]</A><BR>"
@@ -90,7 +90,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"<A href='?src=[REF(src)];power=[TRUE]'>[on ? "On" : "Off"]</A>" )
if(!locked || hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user))
if(!locked || hasSiliconAccessInArea(user) || IsAdminGhost(user))
dat += text({"<BR> Auto Patrol: []"},
"<A href='?src=[REF(src)];operation=patrol'>[auto_patrol ? "On" : "Off"]</A>" )
@@ -148,7 +148,7 @@
else
dat += "None Loaded"
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
if(!locked || hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user))
if(!locked || hasSiliconAccessInArea(user) || IsAdminGhost(user))
dat += "<TT>Healing Threshold: "
dat += "<a href='?src=[REF(src)];adj_threshold=-10'>--</a> "
dat += "<a href='?src=[REF(src)];adj_threshold=-5'>-</a> "
@@ -262,7 +262,7 @@
// TODO: remove this; PDAs currently depend on it
/mob/living/simple_animal/bot/mulebot/get_controls(mob/user)
var/ai = hasSiliconAccessInArea(user,get_area(src))
var/ai = hasSiliconAccessInArea(user)
var/dat
dat += "<h3>Multiple Utility Load Effector Mk. V</h3>"
dat += "<b>ID:</b> [id]<BR>"
@@ -110,7 +110,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"<A href='?src=[REF(src)];power=1'>[on ? "On" : "Off"]</A>" )
if(!locked || hasSiliconAccessInArea(user,get_area(src)) || IsAdminGhost(user))
if(!locked || hasSiliconAccessInArea(user) || IsAdminGhost(user))
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>
Arrest for Unauthorized Weapons: []<BR>
@@ -131,7 +131,7 @@ Auto Patrol: []"},
/mob/living/simple_animal/bot/secbot/Topic(href, href_list)
if(..())
return 1
if(!hasSiliconAccessInArea(usr,get_area(src)) && !IsAdminGhost(usr) && !(bot_core.allowed(usr) || !locked))
if(!hasSiliconAccessInArea(usr) && !IsAdminGhost(usr) && !(bot_core.allowed(usr) || !locked))
return TRUE
switch(href_list["operation"])
if("idcheck")
+2 -2
View File
@@ -511,7 +511,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
if(href_list["flavor2_more"])
usr << browse(text("<HTML><HEAD><TITLE>[]</TITLE></HEAD><BODY><TT>[]</TT></BODY></HTML>", name, replacetext(flavor_text_2, "\n", "<BR>")), text("window=[];size=500x200", name))
onclose(usr, "[name]")
if(href_list["flavor_change"])
update_flavor_text()
@@ -816,7 +816,7 @@ GLOBAL_VAR_INIT(exploit_warn_spam_prevention, 0)
//Can the mob interact() with an atom?
/mob/proc/can_interact_with(atom/A)
return IsAdminGhost(src) || Adjacent(A) || hasSiliconAccessInArea(src,get_area(A))
return IsAdminGhost(src) || Adjacent(A) || A.hasSiliconAccessInArea(src)
//Can the mob use Topic to interact with machines
/mob/proc/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
+5 -2
View File
@@ -409,8 +409,11 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
return
return TRUE
/proc/hasSiliconAccessInArea(mob/user,area/area)
return user && (issilicon(user) || (user.siliconaccesstoggle && area && (area in user.siliconaccessareas)))
/atom/proc/hasSiliconAccessInArea(mob/user)
return user && (issilicon(user) || (user.siliconaccesstoggle && (get_area(src) in user.siliconaccessareas)))
/area/proc/hasSiliconAccessInArea(mob/user)
return user && (issilicon(user) || (user.siliconaccesstoggle && (src in user.siliconaccessareas)))
/mob/proc/toggleSiliconAccessArea(area/area)
if (area in siliconaccessareas)
@@ -14,7 +14,7 @@
return 0
// Robots don't really need to see the screen, their wireless connection works as long as computer is on.
if(!screen_on && !hasSiliconAccessInArea(user,get_area(src)))
if(!screen_on && !hasSiliconAccessInArea(user))
if(ui)
ui.close()
return 0
@@ -87,7 +87,7 @@
if(IsAdminGhost(user))
return 1
if(hasSiliconAccessInArea(user,get_area(computer)))
if(computer.hasSiliconAccessInArea(user))
return 1
if(ishuman(user))
+1 -1
View File
@@ -35,7 +35,7 @@
return ..()
/obj/machinery/oui_canview(mob/user)
if(user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user,get_area(src)))
if(user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user))
return TRUE
if(!can_interact(user))
return FALSE
+13 -13
View File
@@ -272,7 +272,7 @@
. += "<span class='notice'>Alt-Click the APC to [ locked ? "unlock" : "lock"] the interface.</span>"
if(hasSiliconAccessInArea(user,area))
if(area.hasSiliconAccessInArea(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
@@ -549,7 +549,7 @@
/obj/machinery/power/apc/attackby(obj/item/W, mob/living/user, params)
if(hasSiliconAccessInArea(user,area) && get_dist(src,user)>1)
if(area.hasSiliconAccessInArea(user) && get_dist(src,user)>1)
return attack_hand(user)
if (istype(W, /obj/item/stock_parts/cell) && opened)
@@ -756,7 +756,7 @@
/obj/machinery/power/apc/AltClick(mob/user)
. = ..()
if(!user.canUseTopic(src, !hasSiliconAccessInArea(user,area)) || !isturf(loc))
if(!user.canUseTopic(src, !area.hasSiliconAccessInArea(user)) || !isturf(loc))
return
togglelock(user)
return TRUE
@@ -771,7 +771,7 @@
else if(stat & (BROKEN|MAINT))
to_chat(user, "<span class='warning'>Nothing happens!</span>")
else
if((allowed(usr) || hasSiliconAccessInArea(usr,area)) && !wires.is_cut(WIRE_IDSCAN) && !malfhack)
if((allowed(usr) || area.hasSiliconAccessInArea(usr)) && !wires.is_cut(WIRE_IDSCAN) && !malfhack)
locked = !locked
to_chat(user, "<span class='notice'>You [ locked ? "lock" : "unlock"] the APC interface.</span>")
update_icon()
@@ -849,7 +849,7 @@
return
/obj/machinery/power/apc/oui_canview(mob/user)
if(user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user,area))
if(user.has_unlimited_silicon_privilege || area.hasSiliconAccessInArea(user))
return TRUE
return ..()
@@ -863,7 +863,7 @@
/obj/machinery/power/apc/ui_data(mob/user)
var/list/data = list(
"locked" = locked && !(integration_cog && is_servant_of_ratvar(user)) && !hasSiliconAccessInArea(user,area),
"locked" = locked && !(integration_cog && is_servant_of_ratvar(user)) && !area.hasSiliconAccessInArea(user),
"lock_nightshift" = nightshift_requires_auth,
"failTime" = failure_timer,
"isOperating" = operating,
@@ -873,7 +873,7 @@
"chargingStatus" = charging,
"totalLoad" = DisplayPower(lastused_total),
"coverLocked" = coverlocked,
"siliconUser" = user.has_unlimited_silicon_privilege || user.using_power_flow_console() || hasSiliconAccessInArea(user,area),
"siliconUser" = user.has_unlimited_silicon_privilege || user.using_power_flow_console() || area.hasSiliconAccessInArea(user),
"malfStatus" = get_malf_status(user),
"emergencyLights" = !emergency_lights,
"nightshiftLights" = nightshift_lights,
@@ -948,7 +948,7 @@
/obj/machinery/power/apc/proc/can_use(mob/user, loud = 0) //used by attack_hand() and Topic()
if(IsAdminGhost(user))
return TRUE
if (user == hijacker || (hasSiliconAccessInArea(user,area) && !aidisabled))
if (user == hijacker || (area.hasSiliconAccessInArea(user) && !aidisabled))
return TRUE
if(user.has_unlimited_silicon_privilege)
var/mob/living/silicon/ai/AI = user
@@ -963,14 +963,14 @@
. = ..()
if (!. && !QDELETED(remote_control))
. = remote_control.can_interact(user)
if (hasSiliconAccessInArea(user,area))
if (area.hasSiliconAccessInArea(user))
return TRUE
/obj/machinery/power/apc/ui_status(mob/user)
. = ..()
if (!QDELETED(remote_control) && user == remote_control.operator)
. = UI_INTERACTIVE
if (user == hijacker && hasSiliconAccessInArea(user,area))
if (user == hijacker && area.hasSiliconAccessInArea(user))
. = UI_INTERACTIVE
/obj/machinery/power/apc/ui_act(action, params)
@@ -984,7 +984,7 @@
if (action == "hijack" && can_use(usr, 1)) //don't need auth for hijack button
hijack(usr)
return
var/authorized = (!locked || usr.has_unlimited_silicon_privilege || hasSiliconAccessInArea(usr,area) || (integration_cog && (is_servant_of_ratvar(usr))))
var/authorized = (!locked || usr.has_unlimited_silicon_privilege || area.hasSiliconAccessInArea(usr) || (integration_cog && (is_servant_of_ratvar(usr))))
if((action == "toggle_nightshift") && (!nightshift_requires_auth || authorized))
toggle_nightshift_lights()
return TRUE
@@ -992,7 +992,7 @@
return
switch(action)
if("lock")
if(usr.has_unlimited_silicon_privilege || hasSiliconAccessInArea(usr,area))
if(usr.has_unlimited_silicon_privilege || area.hasSiliconAccessInArea(usr))
if((obj_flags & EMAGGED) || (stat & (BROKEN|MAINT)))
to_chat(usr, "The APC does not respond to the command.")
else
@@ -1026,7 +1026,7 @@
update()
return TRUE
if("overload")
if(usr.has_unlimited_silicon_privilege || hasSiliconAccessInArea(usr,area))
if(usr.has_unlimited_silicon_privilege || area.hasSiliconAccessInArea(usr))
overload_lighting()
return TRUE
if("hack")
@@ -312,7 +312,7 @@
return
var/name = stripped_input(usr,"Name","What do you want to name this recipe?", "Recipe", MAX_NAME_LEN)
var/recipe = stripped_input(usr,"Recipe","Insert recipe with chem IDs")
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
if(name && recipe)
var/list/first_process = splittext(recipe, ";")
@@ -261,7 +261,7 @@
return
vol_each = min(reagents.total_volume / amount, 50)
var/name = html_decode(stripped_input(usr,"Name:","Name your pill!", "[reagents.get_master_reagent_name()] ([vol_each]u)", MAX_NAME_LEN))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
var/obj/item/reagent_containers/pill/P
var/target_loc = drop_location()
@@ -288,7 +288,7 @@
reagents.trans_to(P,vol_each)
else
var/name = html_decode(stripped_input(usr, "Name:", "Name your pack!", reagents.get_master_reagent_name(), MAX_NAME_LEN))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
var/obj/item/reagent_containers/food/condiment/pack/P = new/obj/item/reagent_containers/food/condiment/pack(drop_location())
@@ -314,7 +314,7 @@
return
vol_each = min(reagents.total_volume / amount, 40)
var/name = html_decode(stripped_input(usr,"Name:","Name your patch!", "[reagents.get_master_reagent_name()] ([vol_each]u)", MAX_NAME_LEN))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
var/obj/item/reagent_containers/pill/P
@@ -332,7 +332,7 @@
if(condi)
var/name = html_decode(stripped_input(usr, "Name:","Name your bottle!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
var/obj/item/reagent_containers/food/condiment/P = new(drop_location())
P.originalname = name
@@ -345,7 +345,7 @@
amount_full = round(reagents.total_volume / 30)
vol_part = ((reagents.total_volume*1000) % 30000) / 1000 //% operator doesn't support decimals.
var/name = html_decode(stripped_input(usr, "Name:","Name your bottle!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
var/obj/item/reagent_containers/glass/bottle/P
@@ -373,7 +373,7 @@
amount_full = round(reagents.total_volume / 60)
vol_part = reagents.total_volume % 60
var/name = html_decode(stripped_input(usr, "Name:","Name your hypovial!", (reagents.total_volume ? reagents.get_master_reagent_name() : " "), MAX_NAME_LEN))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
var/obj/item/reagent_containers/glass/bottle/vial/small/P
@@ -408,7 +408,7 @@
vol_each = min(reagents.total_volume / amount, 20)
var/name = html_decode(stripped_input(usr,"Name:","Name your SmartDart!", "[reagents.get_master_reagent_name()] ([vol_each]u)", MAX_NAME_LEN))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr,get_area(src))))
if(!name || !reagents.total_volume || !src || QDELETED(src) || !usr.canUseTopic(src, !hasSiliconAccessInArea(usr)))
return
var/obj/item/reagent_containers/syringe/dart/D
@@ -142,7 +142,7 @@
/obj/machinery/reagentgrinder/ui_interact(mob/user) // The microwave Menu //I am reasonably certain that this is not a microwave
. = ..()
if(operating || !user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(operating || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
var/list/options = list()
@@ -170,10 +170,10 @@
for(var/key in options)
choice = key
else
choice = show_radial_menu(user, src, options, require_near = !hasSiliconAccessInArea(user,get_area(src)))
choice = show_radial_menu(user, src, options, require_near = !hasSiliconAccessInArea(user))
// post choice verification
if(operating || (isAI(user) && stat & NOPOWER) || !user.canUseTopic(src, !hasSiliconAccessInArea(user,get_area(src))))
if(operating || (isAI(user) && stat & NOPOWER) || !user.canUseTopic(src, !hasSiliconAccessInArea(user)))
return
switch(choice)
@@ -190,7 +190,7 @@
/obj/machinery/reagentgrinder/examine(mob/user)
. = ..()
if(!in_range(user, src) && !hasSiliconAccessInArea(user,get_area(src)) && !isobserver(user))
if(!in_range(user, src) && !hasSiliconAccessInArea(user) && !isobserver(user))
. += "<span class='warning'>You're too far away to examine [src]'s contents and display!</span>"
return
+1 -1
View File
@@ -103,7 +103,7 @@
return UI_CLOSE
var/dist = get_dist(src_object, src)
if(dist <= 1 || hasSiliconAccessInArea(src,get_area(src_object))) // Open and interact if 1-0 tiles away.
if(dist <= 1 || src_object.hasSiliconAccessInArea(src)) // Open and interact if 1-0 tiles away.
return UI_INTERACTIVE
else if(dist <= 2) // View only if 2-3 tiles away.
return UI_UPDATE