From 698f0b8177c7c17019b8b25582f2a6499b5fd898 Mon Sep 17 00:00:00 2001 From: Ghommie <42542238+Ghommie@users.noreply.github.com> Date: Tue, 18 Feb 2020 16:20:44 +0100 Subject: [PATCH] Something about pAIs and silicon access priviledges. --- code/__DEFINES/robots.dm | 8 +++++++- code/game/machinery/bloodbankgen.dm | 16 ++++++++-------- code/game/machinery/computer/camera_advanced.dm | 2 +- code/game/machinery/cryopod.dm | 2 +- code/game/machinery/iv_drip.dm | 2 +- code/game/objects/items/RCD.dm | 2 +- code/modules/admin/admin_verbs.dm | 2 +- .../antagonists/bloodsucker/powers/bs_feed.dm | 2 +- .../antagonists/bloodsucker/powers/bs_gohome.dm | 16 ++++++++-------- code/modules/atmospherics/machinery/airalarm.dm | 12 +++++++----- code/modules/cargo/expressconsole.dm | 2 +- .../kitchen_machinery/icecream_vat.dm | 2 +- code/modules/mob/dead/observer/login.dm | 2 +- code/modules/mob/living/carbon/carbon.dm | 3 +++ code/modules/mob/living/carbon/human/human.dm | 3 --- code/modules/mob/living/silicon/pai/pai.dm | 1 + code/modules/mob/living/silicon/silicon.dm | 2 +- code/modules/mob/living/simple_animal/bot/bot.dm | 2 +- .../mob/living/simple_animal/bot/mulebot.dm | 8 ++++---- .../simple_animal/friendly/drone/_drone.dm | 2 +- .../mob/living/simple_animal/hostile/statue.dm | 2 +- code/modules/mob/mob_defines.dm | 2 +- code/modules/mob/mob_helpers.dm | 6 +++--- code/modules/oracle_ui/hookup_procs.dm | 4 ++-- code/modules/power/apc.dm | 14 +++++++------- .../chemistry/machinery/chem_dispenser.dm | 2 +- .../reagents/chemistry/machinery/chem_heater.dm | 2 +- .../reagents/chemistry/machinery/chem_master.dm | 4 ++-- .../reagents/chemistry/machinery/pandemic.dm | 8 ++++---- .../chemistry/machinery/reagentgrinder.dm | 2 +- 30 files changed, 73 insertions(+), 64 deletions(-) diff --git a/code/__DEFINES/robots.dm b/code/__DEFINES/robots.dm index a05e6f6160..affa23d30a 100644 --- a/code/__DEFINES/robots.dm +++ b/code/__DEFINES/robots.dm @@ -53,4 +53,10 @@ //Checks to determine borg availability depending on the server's config. These are defines in the interest of reducing copypasta -#define BORG_SEC_AVAILABLE (!CONFIG_GET(flag/disable_secborg) && GLOB.security_level >= CONFIG_GET(number/minimum_secborg_alert)) \ No newline at end of file +#define BORG_SEC_AVAILABLE (!CONFIG_GET(flag/disable_secborg) && GLOB.security_level >= CONFIG_GET(number/minimum_secborg_alert)) + +//silicon_priviledges flags +#define PRIVILEDGES_SILICON (1<<0) +#define PRIVILEDGES_PAI (1<<1) +#define PRIVILEDGES_BOT (1<<2) +#define PRIVILEDGES_DRONE (1<<3) diff --git a/code/game/machinery/bloodbankgen.dm b/code/game/machinery/bloodbankgen.dm index cb25adc126..19632711fc 100644 --- a/code/game/machinery/bloodbankgen.dm +++ b/code/game/machinery/bloodbankgen.dm @@ -274,20 +274,20 @@ return TRUE -/obj/machinery/bloodbankgen/proc/detachinput() +/obj/machinery/bloodbankgen/proc/detachinput(mob/user) if(bag) bag.forceMove(drop_location()) - if(usr && Adjacent(usr) && !issiliconoradminghost(usr)) - usr.put_in_hands(bag) + if(user && Adjacent(usr) && user.can_hold_items()) + user.put_in_hands(bag) bag = null draining = null update_icon() -/obj/machinery/bloodbankgen/proc/detachoutput() +/obj/machinery/bloodbankgen/proc/detachoutput(mob/user) if(outbag) outbag.forceMove(drop_location()) - if(usr && Adjacent(usr) && !issiliconoradminghost(usr)) - usr.put_in_hands(outbag) + if(user && Adjacent(user) && user.can_hold_items()) + user.put_in_hands(outbag) outbag = null filling = null update_icon() @@ -325,12 +325,12 @@ activateinput() else if(href_list["detachinput"]) - detachinput() + detachinput(usr) else if(href_list["activateoutput"]) activateoutput() else if(href_list["detachoutput"]) - detachoutput() + detachoutput(usr) updateUsrDialog() diff --git a/code/game/machinery/computer/camera_advanced.dm b/code/game/machinery/computer/camera_advanced.dm index e5ac9a0f78..5fe62ebb76 100644 --- a/code/game/machinery/computer/camera_advanced.dm +++ b/code/game/machinery/computer/camera_advanced.dm @@ -72,7 +72,7 @@ playsound(src, 'sound/machines/terminal_off.ogg', 25, 0) /obj/machinery/computer/camera_advanced/check_eye(mob/user) - if( (stat & (NOPOWER|BROKEN)) || (!Adjacent(user) && !user.has_unlimited_silicon_privilege) || user.eye_blind || user.incapacitated() ) + if( (stat & (NOPOWER|BROKEN)) || (!Adjacent(user) && hasSiliconAccessInArea(user)) || user.eye_blind || user.incapacitated() ) user.unset_machine() /obj/machinery/computer/camera_advanced/Destroy() diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index b33b87f8b1..92927d047d 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -116,7 +116,7 @@ playsound(src, 'sound/machines/terminal_prompt_confirm.ogg', 50, 0) I.forceMove(drop_location()) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) user.put_in_hands(I) frozen_items -= I updateUsrDialog() diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm index 6d19776d86..b3f0ce9693 100644 --- a/code/game/machinery/iv_drip.dm +++ b/code/game/machinery/iv_drip.dm @@ -184,7 +184,7 @@ if(usr.incapacitated()) return if(beaker) - if(usr && Adjacent(usr) && !issiliconoradminghost(usr)) + if(usr && Adjacent(usr) && usr.can_hold_items()) if(!usr.put_in_hands(beaker)) beaker.forceMove(drop_location()) beaker = null diff --git a/code/game/objects/items/RCD.dm b/code/game/objects/items/RCD.dm index 3f57fa7cdf..3fad8cc53d 100644 --- a/code/game/objects/items/RCD.dm +++ b/code/game/objects/items/RCD.dm @@ -196,7 +196,7 @@ RLD /obj/item/construction/rcd/verb/change_airlock_access(mob/user) - if (!ishuman(user) && !user.has_unlimited_silicon_privilege) + if (!ishuman(user) && !user.silicon_privileges) return var/t1 = "" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index f23fc5c070..3ccd113864 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -714,7 +714,7 @@ GLOBAL_PROTECT(admin_verbs_hideable) AI_Interact = !AI_Interact if(mob && IsAdminGhost(mob)) - mob.has_unlimited_silicon_privilege = AI_Interact + mob.silicon_privileges = AI_Interact ? ALL : NONE log_admin("[key_name(usr)] has [AI_Interact ? "activated" : "deactivated"] Admin AI Interact") message_admins("[key_name_admin(usr)] has [AI_Interact ? "activated" : "deactivated"] their AI interaction") diff --git a/code/modules/antagonists/bloodsucker/powers/bs_feed.dm b/code/modules/antagonists/bloodsucker/powers/bs_feed.dm index 2da84b6075..f9ff31d94a 100644 --- a/code/modules/antagonists/bloodsucker/powers/bs_feed.dm +++ b/code/modules/antagonists/bloodsucker/powers/bs_feed.dm @@ -170,7 +170,7 @@ // Warn Feeder about Witnesses... var/was_unnoticed = TRUE for(var/mob/living/M in viewers(notice_range, owner)) - if(M != owner && M != target && iscarbon(M) && M.mind && !M.has_unlimited_silicon_privilege && !M.eye_blind && !M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) + if(M != owner && M != target && iscarbon(M) && M.mind && !M.silicon_privileges && !M.eye_blind && !M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) was_unnoticed = FALSE break if(was_unnoticed) diff --git a/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm b/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm index 476f8ae012..3fa8a07299 100644 --- a/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm +++ b/code/modules/antagonists/bloodsucker/powers/bs_gohome.dm @@ -28,9 +28,9 @@ to_chat(owner, "Your coffin has been destroyed!") return FALSE return TRUE - + /datum/action/bloodsucker/gohome/proc/flicker_lights(var/flicker_range, var/beat_volume) - for(var/obj/machinery/light/L in view(flicker_range, get_turf(owner))) + for(var/obj/machinery/light/L in view(flicker_range, get_turf(owner))) playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', beat_volume, 1) @@ -45,7 +45,7 @@ flicker_lights(4, 40) sleep(50) flicker_lights(4, 60) - for(var/obj/machinery/light/L in view(6, get_turf(owner))) + for(var/obj/machinery/light/L in view(6, get_turf(owner))) L.flicker(5) playsound(get_turf(owner), 'sound/effects/singlebeat.ogg', 60, 1) // ( STEP TWO: Lights OFF? ) @@ -56,7 +56,7 @@ if(!owner) return // SEEN?: (effects ONLY if there are witnesses! Otherwise you just POOF) - + var/am_seen = FALSE // Do Effects (seen by anyone) var/drop_item = FALSE // Drop Stuff (seen by non-vamp) if(isturf(owner.loc)) // Only check if I'm not in a Locker or something. @@ -65,7 +65,7 @@ if(T && T.lighting_object && T.get_lumcount()>= 0.1) // B) Check for Viewers for(var/mob/living/M in viewers(get_turf(owner))) - if(M != owner && isliving(M) && M.mind && !M.has_unlimited_silicon_privilege && !M.eye_blind) // M.client <--- add this in after testing! + if(M != owner && isliving(M) && M.mind && !M.silicon_privileges && !M.eye_blind) // M.client <--- add this in after testing! am_seen = TRUE if (!M.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER)) drop_item = TRUE @@ -95,12 +95,12 @@ puff.effect_type = /obj/effect/particle_effect/smoke/vampsmoke puff.set_up(3, 0, get_turf(owner)) puff.start() - + //STEP FIVE: Create animal at prev location var/mob/living/simple_animal/SA = pick(/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse, /mob/living/simple_animal/hostile/retaliate/bat) //prob(300) /mob/living/simple_animal/mouse, new SA (owner.loc) // TELEPORT: Move to Coffin & Close it! - do_teleport(owner, bloodsuckerdatum.coffin, no_effects = TRUE, forced = TRUE, channel = TELEPORT_CHANNEL_QUANTUM) + do_teleport(owner, bloodsuckerdatum.coffin, no_effects = TRUE, forced = TRUE, channel = TELEPORT_CHANNEL_QUANTUM) user.resting = TRUE user.Stun(30,1) // CLOSE LID: If fail, force me in. @@ -112,4 +112,4 @@ bloodsuckerdatum.coffin.update_icon() // Lock Coffin bloodsuckerdatum.coffin.LockMe(owner) - + diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index e85cf1efa6..36a128f2eb 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -229,7 +229,7 @@ . += "Alt-click to [locked ? "unlock" : "lock"] the interface." /obj/machinery/airalarm/ui_status(mob/user) - if(user.has_unlimited_silicon_privilege && aidisabled) + if(hasSiliconAccessInArea(user) && aidisabled) to_chat(user, "AI control has been disabled.") else if(!shorted) return ..() @@ -245,7 +245,7 @@ /obj/machinery/airalarm/ui_data(mob/user) var/data = list( "locked" = locked, - "siliconUser" = user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user), + "siliconUser" = 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)) + if(!locked || hasSiliconAccessInArea(user, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE)) data["vents"] = list() for(var/id_tag in A.air_vent_names) var/long_name = A.air_vent_names[id_tag] @@ -368,12 +368,14 @@ /obj/machinery/airalarm/ui_act(action, params) if(..() || buildstage != 2) return - if((locked && !usr.has_unlimited_silicon_privilege && !hasSiliconAccessInArea(usr)) || (usr.has_unlimited_silicon_privilege && aidisabled)) + var/silicon_access = hasSiliconAccessInArea(usr) + var/bot_priviledges = silicon_access || (usr.silicon_privileges & PRIVILEDGES_DRONE) + if((locked && !bot_priviledges) || (silicon_access && aidisabled)) return var/device_id = params["id_tag"] switch(action) if("lock") - if(usr.has_unlimited_silicon_privilege && !wires.is_cut(WIRE_IDSCAN)) + if(bot_priviledges && !wires.is_cut(WIRE_IDSCAN)) locked = !locked . = TRUE if("power", "toggle_filter", "widenet", "scrubbing") diff --git a/code/modules/cargo/expressconsole.dm b/code/modules/cargo/expressconsole.dm index 20dc724707..dbf10e837f 100644 --- a/code/modules/cargo/expressconsole.dm +++ b/code/modules/cargo/expressconsole.dm @@ -97,7 +97,7 @@ var/canBeacon = beacon && (isturf(beacon.loc) || ismob(beacon.loc))//is the beacon in a valid location? var/list/data = list() data["locked"] = locked//swipe an ID to unlock - data["siliconUser"] = user.has_unlimited_silicon_privilege + data["siliconUser"] = hasSiliconAccessInArea(user) data["beaconzone"] = beacon ? get_area(beacon) : ""//where is the beacon located? outputs in the tgui data["usingBeacon"] = usingBeacon //is the mode set to deliver to the beacon or the cargobay? data["canBeacon"] = !usingBeacon || canBeacon //is the mode set to beacon delivery, and is the beacon in a valid location? diff --git a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm index 71becf0542..4fc55ba4c3 100644 --- a/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm +++ b/code/modules/food_and_drinks/kitchen_machinery/icecream_vat.dm @@ -319,7 +319,7 @@ /obj/machinery/icecream_vat/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker) if(beaker) beaker.forceMove(drop_location()) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) user.put_in_hands(beaker) if(new_beaker) beaker = new_beaker diff --git a/code/modules/mob/dead/observer/login.dm b/code/modules/mob/dead/observer/login.dm index 1b328dbc69..8daf8ec052 100644 --- a/code/modules/mob/dead/observer/login.dm +++ b/code/modules/mob/dead/observer/login.dm @@ -6,7 +6,7 @@ var/preferred_form = null if(IsAdminGhost(src)) - has_unlimited_silicon_privilege = 1 + silicon_privileges = ALL if(client.prefs.unlock_content) preferred_form = client.prefs.ghost_form diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index 6460d8331d..b5e9e4f1d7 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -987,3 +987,6 @@ return TRUE if(isclothing(wear_mask) && (wear_mask.clothing_flags & SCAN_REAGENTS)) return TRUE + +/mob/living/carbon/can_hold_items() + return TRUE diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index ef3d4cbb98..f41b19aa83 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -823,9 +823,6 @@ . += dna.species.check_weakness(weapon, attacker) /mob/living/carbon/human/is_literate() - return 1 - -/mob/living/carbon/human/can_hold_items() return TRUE /mob/living/carbon/human/update_gravity(has_gravity,override = 0) diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm index 409665f792..ee78a8a5d6 100644 --- a/code/modules/mob/living/silicon/pai/pai.dm +++ b/code/modules/mob/living/silicon/pai/pai.dm @@ -11,6 +11,7 @@ health = 500 maxHealth = 500 layer = BELOW_MOB_LAYER + silicon_privileges = PRIVILEDGES_PAI var/datum/element/mob_holder/current_mob_holder //because only a few of their chassis can be actually held. var/network = "ss13" diff --git a/code/modules/mob/living/silicon/silicon.dm b/code/modules/mob/living/silicon/silicon.dm index 72e98e348c..531faff056 100644 --- a/code/modules/mob/living/silicon/silicon.dm +++ b/code/modules/mob/living/silicon/silicon.dm @@ -1,6 +1,6 @@ /mob/living/silicon gender = NEUTER - has_unlimited_silicon_privilege = 1 + silicon_privileges = PRIVILEDGES_SILICON verb_say = "states" verb_ask = "queries" verb_exclaim = "declares" diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm index 7da0ad13da..3a28a32f9c 100644 --- a/code/modules/mob/living/simple_animal/bot/bot.dm +++ b/code/modules/mob/living/simple_animal/bot/bot.dm @@ -15,7 +15,7 @@ maxbodytemp = INFINITY minbodytemp = 0 blood_volume = 0 - has_unlimited_silicon_privilege = 1 + silicon_privileges = PRIVILEDGES_BOT sentience_type = SENTIENCE_ARTIFICIAL status_flags = NONE //no default canpush verb_say = "states" diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm index b23f3f2baa..be9ffb7479 100644 --- a/code/modules/mob/living/simple_animal/bot/mulebot.dm +++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm @@ -180,7 +180,7 @@ var/list/data = list() data["on"] = on data["locked"] = locked - data["siliconUser"] = user.has_unlimited_silicon_privilege + data["siliconUser"] = hasSiliconAccessInArea(usr) data["mode"] = mode ? mode_name[mode] : "Ready" data["modeStatus"] = "" switch(mode) @@ -205,11 +205,12 @@ return data /mob/living/simple_animal/bot/mulebot/ui_act(action, params) - if(..() || (locked && !usr.has_unlimited_silicon_privilege)) + var/silicon_access = hasSiliconAccessInArea(usr) + if(..() || (locked && silicon_access)) return switch(action) if("lock") - if(usr.has_unlimited_silicon_privilege) + if(silicon_access) locked = !locked . = TRUE if("power") @@ -766,4 +767,3 @@ /obj/machinery/bot_core/mulebot req_access = list(ACCESS_CARGO) - \ No newline at end of file diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm index 7dd373b49f..43149e6ba7 100644 --- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm +++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm @@ -41,7 +41,7 @@ bubble_icon = "machine" initial_language_holder = /datum/language_holder/drone mob_size = MOB_SIZE_SMALL - has_unlimited_silicon_privilege = 1 + silicon_privileges = PRIVILEDGES_DRONE damage_coeff = list(BRUTE = 1, BURN = 1, TOX = 0, CLONE = 0, STAMINA = 0, OXY = 0) hud_possible = list(DIAG_STAT_HUD, DIAG_HUD, ANTAG_HUD) unique_name = TRUE diff --git a/code/modules/mob/living/simple_animal/hostile/statue.dm b/code/modules/mob/living/simple_animal/hostile/statue.dm index 5ad787b143..2bab332cd0 100644 --- a/code/modules/mob/living/simple_animal/hostile/statue.dm +++ b/code/modules/mob/living/simple_animal/hostile/statue.dm @@ -126,7 +126,7 @@ // This loop will, at most, loop twice. for(var/atom/check in check_list) for(var/mob/living/M in viewers(world.view + 1, check) - src) - if(M.client && CanAttack(M) && !M.has_unlimited_silicon_privilege) + if(M.client && CanAttack(M) && !M.silicon_privileges) if(!M.eye_blind) return M for(var/obj/mecha/M in view(world.view + 1, check)) //assuming if you can see them they can see you diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 6d5ae72e77..c45f6eec13 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -95,7 +95,7 @@ var/digitalinvis = 0 //Are they ivisible to the AI? var/image/digitaldisguise = null //what does the AI see instead of them? - var/has_unlimited_silicon_privilege = 0 // Can they interact with station electronics + var/silicon_privileges = NONE // Can they interact with station electronics var/obj/control_object //Used by admins to possess objects. All mobs should have this var var/atom/movable/remote_control //Calls relaymove() to whatever it is diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index b25531f0e0..12d74d2f8f 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -406,8 +406,8 @@ It's fairly easy to fix if dealing with single letters but not so much with comp return return TRUE -/atom/proc/hasSiliconAccessInArea(mob/user) - return user && (issilicon(user) || (user.siliconaccesstoggle && (get_area(src) in user.siliconaccessareas))) +/atom/proc/hasSiliconAccessInArea(mob/user, flags = PRIVILEDGES_SILICON) + return user.silicon_privileges & (flags) || (user.siliconaccesstoggle && (get_area(src) in user.siliconaccessareas)) /mob/proc/toggleSiliconAccessArea(area/area) if (area in siliconaccessareas) @@ -555,4 +555,4 @@ It's fairly easy to fix if dealing with single letters but not so much with comp //Can the mob see reagents inside of containers? /mob/proc/can_see_reagents() - return stat == DEAD || has_unlimited_silicon_privilege //Dead guys and silicons can always see reagents + return stat == DEAD || silicon_privileges //Dead guys and silicons can always see reagents diff --git a/code/modules/oracle_ui/hookup_procs.dm b/code/modules/oracle_ui/hookup_procs.dm index 18d7bbfd8c..30db9d92b9 100644 --- a/code/modules/oracle_ui/hookup_procs.dm +++ b/code/modules/oracle_ui/hookup_procs.dm @@ -5,7 +5,7 @@ return "Default Implementation" /datum/proc/oui_canuse(mob/user) - if(isobserver(user) && !user.has_unlimited_silicon_privilege) + if(isobserver(user) && !user.silicon_privileges) return FALSE return oui_canview(user) @@ -35,7 +35,7 @@ return ..() /obj/machinery/oui_canview(mob/user) - if(user.has_unlimited_silicon_privilege || hasSiliconAccessInArea(user)) + if(hasSiliconAccessInArea(user, ALL)) return TRUE if(!can_interact(user)) return FALSE diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 982afa49c8..db3e3c83c6 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -846,7 +846,7 @@ return /obj/machinery/power/apc/oui_canview(mob/user) - if(user.has_unlimited_silicon_privilege || area.hasSiliconAccessInArea(user)) + if(area.hasSiliconAccessInArea(user)) //some APCs are mapped outside their assigned area, so this is required. return TRUE return ..() @@ -864,7 +864,7 @@ if (H && !H.stealthmode && H.toggled) abilitiesavail = TRUE var/list/data = list( - "locked" = locked && !(integration_cog && is_servant_of_ratvar(user)) && !area.hasSiliconAccessInArea(user), + "locked" = locked && !(integration_cog && is_servant_of_ratvar(user)) && !area.hasSiliconAccessInArea(user, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE), "lock_nightshift" = nightshift_requires_auth, "failTime" = failure_timer, "isOperating" = operating, @@ -874,7 +874,7 @@ "chargingStatus" = charging, "totalLoad" = DisplayPower(lastused_total), "coverLocked" = coverlocked, - "siliconUser" = user.has_unlimited_silicon_privilege || user.using_power_flow_console() || area.hasSiliconAccessInArea(user), + "siliconUser" = user.using_power_flow_console() || area.hasSiliconAccessInArea(user), "malfStatus" = get_malf_status(user), "emergencyLights" = !emergency_lights, "nightshiftLights" = nightshift_lights, @@ -951,7 +951,7 @@ return TRUE if (user == hijacker || (area.hasSiliconAccessInArea(user) && !aidisabled)) return TRUE - if(user.has_unlimited_silicon_privilege) + if(user.silicon_privileges & PRIVILEDGES_SILICON) var/mob/living/silicon/ai/AI = user var/mob/living/silicon/robot/robot = user if (src.aidisabled || malfhack && istype(malfai) && ((istype(AI) && (malfai!=AI && malfai != AI.parent)) || (istype(robot) && (robot in malfai.connected_robots)))) @@ -985,7 +985,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 || area.hasSiliconAccessInArea(usr) || (integration_cog && (is_servant_of_ratvar(usr)))) + var/authorized = (!locked || area.hasSiliconAccessInArea(usr, PRIVILEDGES_SILICON|PRIVILEDGES_DRONE) || (integration_cog && (is_servant_of_ratvar(usr)))) if((action == "toggle_nightshift") && (!nightshift_requires_auth || authorized)) toggle_nightshift_lights() return TRUE @@ -993,7 +993,7 @@ return switch(action) if("lock") - if(usr.has_unlimited_silicon_privilege || area.hasSiliconAccessInArea(usr)) + if(area.hasSiliconAccessInArea(usr)) if((obj_flags & EMAGGED) || (stat & (BROKEN|MAINT))) to_chat(usr, "The APC does not respond to the command.") else @@ -1027,7 +1027,7 @@ update() return TRUE if("overload") - if(usr.has_unlimited_silicon_privilege || area.hasSiliconAccessInArea(usr)) + if(area.hasSiliconAccessInArea(usr)) overload_lighting() return TRUE if("hack") diff --git a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm index ed68c25cb6..be15bb70cf 100644 --- a/code/modules/reagents/chemistry/machinery/chem_dispenser.dm +++ b/code/modules/reagents/chemistry/machinery/chem_dispenser.dm @@ -408,7 +408,7 @@ if(beaker) var/obj/item/reagent_containers/B = beaker B.forceMove(drop_location()) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) user.put_in_hands(B) if(new_beaker) beaker = new_beaker diff --git a/code/modules/reagents/chemistry/machinery/chem_heater.dm b/code/modules/reagents/chemistry/machinery/chem_heater.dm index 189d09b06f..4c4d0fdb6e 100644 --- a/code/modules/reagents/chemistry/machinery/chem_heater.dm +++ b/code/modules/reagents/chemistry/machinery/chem_heater.dm @@ -38,7 +38,7 @@ /obj/machinery/chem_heater/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker) if(beaker) beaker.forceMove(drop_location()) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) user.put_in_hands(beaker) if(new_beaker) beaker = new_beaker diff --git a/code/modules/reagents/chemistry/machinery/chem_master.dm b/code/modules/reagents/chemistry/machinery/chem_master.dm index 66c663e2e4..abfd00ed90 100644 --- a/code/modules/reagents/chemistry/machinery/chem_master.dm +++ b/code/modules/reagents/chemistry/machinery/chem_master.dm @@ -129,7 +129,7 @@ if(beaker) var/obj/item/reagent_containers/B = beaker B.forceMove(drop_location()) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) user.put_in_hands(B) if(new_beaker) beaker = new_beaker @@ -139,7 +139,7 @@ if(bottle) var/obj/item/storage/pill_bottle/B = bottle B.forceMove(drop_location()) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) user.put_in_hands(B) else adjust_item_drop_location(B) diff --git a/code/modules/reagents/chemistry/machinery/pandemic.dm b/code/modules/reagents/chemistry/machinery/pandemic.dm index 3dea44cf40..7b25aa769d 100644 --- a/code/modules/reagents/chemistry/machinery/pandemic.dm +++ b/code/modules/reagents/chemistry/machinery/pandemic.dm @@ -192,7 +192,7 @@ update_icon() var/turf/source_turf = get_turf(src) log_virus("A culture bottle was printed for the virus [A.admin_details()] at [loc_name(source_turf)] by [key_name(usr)]") - + . = TRUE if("create_vaccine_bottle") wait = TRUE @@ -202,9 +202,9 @@ var/obj/item/reagent_containers/glass/bottle/B = new(drop_location()) B.name = "[D.name] vaccine bottle" B.reagents.add_reagent(/datum/reagent/vaccine, 15, list(id)) - + update_icon() - + . = TRUE /obj/machinery/computer/pandemic/attackby(obj/item/I, mob/user, params) @@ -229,7 +229,7 @@ /obj/machinery/computer/pandemic/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker) if(beaker) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) if(!user.put_in_hands(beaker)) beaker.forceMove(drop_location()) if(new_beaker) diff --git a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm index b17c2dfb37..85cdc33e72 100644 --- a/code/modules/reagents/chemistry/machinery/reagentgrinder.dm +++ b/code/modules/reagents/chemistry/machinery/reagentgrinder.dm @@ -75,7 +75,7 @@ /obj/machinery/reagentgrinder/proc/replace_beaker(mob/living/user, obj/item/reagent_containers/new_beaker) if(beaker) beaker.forceMove(drop_location()) - if(user && Adjacent(user) && !issiliconoradminghost(user)) + if(user && Adjacent(user) && user.can_hold_items()) user.put_in_hands(beaker) if(new_beaker) beaker = new_beaker