mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
Merge pull request #6369 from Markolie/admin_interact
Admin interaction update
This commit is contained in:
@@ -76,7 +76,8 @@ var/list/admin_verbs_admin = list(
|
||||
/client/proc/debug_variables,
|
||||
/client/proc/show_snpc_verbs,
|
||||
/client/proc/reset_all_tcs, /*resets all telecomms scripts*/
|
||||
/client/proc/toggle_mentor_chat
|
||||
/client/proc/toggle_mentor_chat,
|
||||
/client/proc/toggle_advanced_interaction, /*toggle admin ability to interact with not only machines, but also atoms such as buttons and doors*/
|
||||
)
|
||||
var/list/admin_verbs_ban = list(
|
||||
/client/proc/unban_panel,
|
||||
@@ -970,20 +971,33 @@ var/list/admin_verbs_snpc = list(
|
||||
set name = "Show SNPC Verbs"
|
||||
set category = "Admin"
|
||||
|
||||
if(!holder)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
verbs += admin_verbs_snpc
|
||||
verbs -= /client/proc/show_snpc_verbs
|
||||
to_chat(src, "<span class='interface'>SNPC verbs on.</span>")
|
||||
to_chat(src, "<span class='interface'>SNPC verbs have been toggled on.</span>")
|
||||
|
||||
/client/proc/hide_snpc_verbs()
|
||||
set name = "Hide SNPC Verbs"
|
||||
set category = "Admin"
|
||||
|
||||
if(!holder)
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
verbs -= admin_verbs_snpc
|
||||
verbs += /client/proc/show_snpc_verbs
|
||||
to_chat(src, "<span class='interface'>SNPC verbs off.</span>")
|
||||
to_chat(src, "<span class='interface'>SNPC verbs have been toggled off.</span>")
|
||||
|
||||
/client/proc/toggle_advanced_interaction()
|
||||
set name = "Toggle Advanced Admin Interaction"
|
||||
set category = "Admin"
|
||||
set desc = "Allows you to interact with atoms such as buttons and doors, on top of regular machinery interaction."
|
||||
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
advanced_admin_interaction = !advanced_admin_interaction
|
||||
|
||||
log_admin("[key_name(usr)] has [advanced_admin_interaction ? "activated" : "deactivated"] their advanced admin interaction.")
|
||||
message_admins("[key_name_admin(usr)] has [advanced_admin_interaction ? "activated" : "deactivated"] their advanced admin interaction.")
|
||||
|
||||
@@ -10,11 +10,11 @@
|
||||
var/input = input(usr, "Enter the description of the custom event. Be descriptive. To cancel the event, make this blank or hit cancel.", "Custom Event", custom_event_msg) as message|null
|
||||
if(!input || input == "")
|
||||
custom_event_msg = null
|
||||
log_admin("[usr.key] has cleared the custom event text.")
|
||||
log_admin("[key_name(usr)] has cleared the custom event text.")
|
||||
message_admins("[key_name_admin(usr)] has cleared the custom event text.")
|
||||
return
|
||||
|
||||
log_admin("[usr.key] has changed the custom event text.")
|
||||
log_admin("[key_name(usr)] has changed the custom event text.")
|
||||
message_admins("[key_name_admin(usr)] has changed the custom event text.")
|
||||
|
||||
custom_event_msg = input
|
||||
|
||||
@@ -93,5 +93,9 @@
|
||||
|
||||
// Donator stuff.
|
||||
var/donator_level = DONATOR_LEVEL_NONE
|
||||
|
||||
// If set to true, this client can interact with atoms such as buttons and doors on top of regular machinery interaction
|
||||
var/advanced_admin_interaction = FALSE
|
||||
|
||||
// Has the client been varedited by an admin?
|
||||
var/var_edited = FALSE
|
||||
|
||||
@@ -156,6 +156,7 @@
|
||||
if(stat & BROKEN || panel_open)
|
||||
return
|
||||
user.set_machine(src)
|
||||
add_fingerprint(user)
|
||||
var/dat
|
||||
if(processing)
|
||||
dat += "<div class='statusDisplay'>Biogenerator is processing! Please wait...</div><BR>"
|
||||
@@ -207,6 +208,9 @@
|
||||
|
||||
/obj/machinery/biogenerator/attack_hand(mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/biogenerator/attack_ghost(mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/biogenerator/proc/activate()
|
||||
if(usr.stat != 0)
|
||||
@@ -302,7 +306,7 @@
|
||||
|
||||
/obj/machinery/biogenerator/Topic(href, href_list)
|
||||
if(..() || panel_open)
|
||||
return
|
||||
return 1
|
||||
|
||||
usr.set_machine(src)
|
||||
|
||||
|
||||
@@ -90,16 +90,17 @@
|
||||
if(..())
|
||||
return
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/plantgenes/attack_ghost(mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/plantgenes/interact(mob/user)
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
if(!user)
|
||||
return
|
||||
|
||||
var/datum/browser/popup = new(user, "plantdna", "Plant DNA Manipulator", 450, 600)
|
||||
if(!(in_range(src, user) || issilicon(user)))
|
||||
popup.close()
|
||||
return
|
||||
|
||||
var/dat = ""
|
||||
|
||||
@@ -216,7 +217,7 @@
|
||||
|
||||
/obj/machinery/plantgenes/Topic(var/href, var/list/href_list)
|
||||
if(..())
|
||||
return
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
|
||||
if(href_list["eject_seed"] && !operation)
|
||||
|
||||
@@ -124,12 +124,17 @@
|
||||
src.amount = am
|
||||
|
||||
/obj/machinery/seed_extractor/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/seed_extractor/attack_ghost(mob/user)
|
||||
interact(user)
|
||||
|
||||
/obj/machinery/seed_extractor/interact(mob/user)
|
||||
if (stat)
|
||||
if(stat)
|
||||
return 0
|
||||
|
||||
add_fingerprint(user)
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "<b>Stored seeds:</b><br>"
|
||||
|
||||
@@ -149,7 +154,7 @@
|
||||
|
||||
/obj/machinery/seed_extractor/Topic(var/href, var/list/href_list)
|
||||
if(..())
|
||||
return
|
||||
return 1
|
||||
usr.set_machine(src)
|
||||
|
||||
href_list["li"] = text2num(href_list["li"])
|
||||
|
||||
@@ -641,10 +641,22 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
|
||||
client.images -= ghostimage //remove ourself
|
||||
|
||||
/mob/proc/can_admin_interact()
|
||||
return 0
|
||||
return FALSE
|
||||
|
||||
/mob/proc/can_advanced_admin_interact()
|
||||
return FALSE
|
||||
|
||||
/mob/dead/observer/can_admin_interact()
|
||||
return check_rights(R_ADMIN, 0, src)
|
||||
|
||||
/mob/dead/observer/can_advanced_admin_interact()
|
||||
if(!can_admin_interact())
|
||||
return FALSE
|
||||
|
||||
if(client && client.advanced_admin_interaction)
|
||||
return TRUE
|
||||
|
||||
return FALSE
|
||||
|
||||
//this is a mob verb instead of atom for performance reasons
|
||||
//see /mob/verb/examinate() in mob.dm for more info
|
||||
|
||||
@@ -263,6 +263,9 @@
|
||||
interact(H)
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_animal/bot/attack_ghost(mob/M)
|
||||
interact(M)
|
||||
|
||||
/mob/living/simple_animal/bot/attack_ai(mob/user)
|
||||
if(!topic_denied(user))
|
||||
@@ -818,7 +821,7 @@ Pass a positive integer as an argument to override a bot's default speed.
|
||||
return 1
|
||||
add_fingerprint(usr)
|
||||
|
||||
if((href_list["power"]) && (bot_core.allowed(usr) || !locked))
|
||||
if((href_list["power"]) && (bot_core.allowed(usr) || !locked || usr.can_admin_interact()))
|
||||
if(on)
|
||||
turn_off()
|
||||
else
|
||||
@@ -838,6 +841,7 @@ Pass a positive integer as an argument to override a bot's default speed.
|
||||
to_chat(usr, "<span class='warning'>[text_hack]</span>")
|
||||
show_laws()
|
||||
bot_reset()
|
||||
add_logs(usr, src, "hacked")
|
||||
else if(!hacked)
|
||||
to_chat(usr, "<span class='userdanger'>[text_dehack_fail]</span>")
|
||||
else
|
||||
@@ -846,8 +850,9 @@ Pass a positive integer as an argument to override a bot's default speed.
|
||||
to_chat(usr, "<span class='notice'>[text_dehack]</span>")
|
||||
show_laws()
|
||||
bot_reset()
|
||||
add_logs(usr, src, "dehacked")
|
||||
if("ejectpai")
|
||||
if(paicard && (!locked || issilicon(usr) || check_rights(R_ADMIN, 0, usr)))
|
||||
if(paicard && (!locked || issilicon(usr) || usr.can_admin_interact()))
|
||||
to_chat(usr, "<span class='notice'>You eject [paicard] from [bot_name]</span>")
|
||||
ejectpai(usr)
|
||||
update_controls()
|
||||
@@ -867,19 +872,21 @@ Pass a positive integer as an argument to override a bot's default speed.
|
||||
qdel(src)
|
||||
|
||||
/mob/living/simple_animal/bot/proc/topic_denied(mob/user) //Access check proc for bot topics! Remember to place in a bot's individual Topic if desired.
|
||||
if(user.can_admin_interact())
|
||||
return 0
|
||||
if(user.incapacitated() || !(issilicon(user) || in_range(src, user)))
|
||||
return 1
|
||||
// 0 for access, 1 for denied.
|
||||
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 1
|
||||
else if(!issilicon(user) && !check_rights(R_ADMIN, 0, user)) //Bot is hacked, so only silicons and admins are allowed access.
|
||||
else if(!issilicon(user)) //Bot is hacked, so only silicons are allowed access.
|
||||
return 1
|
||||
return 0
|
||||
|
||||
/mob/living/simple_animal/bot/proc/hack(mob/user)
|
||||
var/hack
|
||||
if(issilicon(user) || check_rights(R_ADMIN, 0, user)) //Allows silicons or admins to toggle the emag status of a bot.
|
||||
if(issilicon(user) || user.can_admin_interact()) //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=[UID()];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.
|
||||
@@ -888,7 +895,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 || issilicon(usr) || check_rights(R_ADMIN, 0, user))
|
||||
if(!locked || issilicon(usr) || user.can_admin_interact())
|
||||
if(paicard || allow_pai)
|
||||
eject += "Personality card status: "
|
||||
if(paicard)
|
||||
|
||||
@@ -204,7 +204,7 @@ Status: []<BR>
|
||||
Behaviour controls are [locked ? "locked" : "unlocked"]<BR>
|
||||
Maintenance panel panel is [open ? "opened" : "closed"]"},
|
||||
text("<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>"))
|
||||
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
|
||||
if(!locked || issilicon(user) || user.can_admin_interact())
|
||||
dat += text({"<BR>Cleans Blood: []<BR>"}, text("<A href='?src=[UID()];operation=blood'>[blood ? "Yes" : "No"]</A>"))
|
||||
dat += text({"<BR>Patrol station: []<BR>"}, text("<A href='?src=[UID()];operation=patrol'>[auto_patrol ? "Yes" : "No"]</A>"))
|
||||
return dat
|
||||
|
||||
@@ -106,7 +106,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]<BR>"},
|
||||
|
||||
"<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>" )
|
||||
|
||||
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
|
||||
if(!locked || issilicon(user) || user.can_admin_interact())
|
||||
if(!lasercolor)
|
||||
dat += text({"<BR>
|
||||
Arrest Unidentifiable Persons: []<BR>
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
dat += "Maintenance panel panel is [open ? "opened" : "closed"]<BR>"
|
||||
dat += "Tiles left: [amount]<BR>"
|
||||
dat += "Behvaiour controls are [locked ? "locked" : "unlocked"]<BR>"
|
||||
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
|
||||
if(!locked || issilicon(user) || user.can_admin_interact())
|
||||
dat += "Add tiles to new hull plating: <A href='?src=[UID()];operation=autotile'>[autotile ? "Yes" : "No"]</A><BR>"
|
||||
dat += "Replace floor tiles: <A href='?src=[UID()];operation=replace'>[replacetiles ? "Yes" : "No"]</A><BR>"
|
||||
dat += "Finds tiles: <A href='?src=[UID()];operation=tiles'>[eattiles ? "Yes" : "No"]</A><BR>"
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
else
|
||||
dat += "None Loaded"
|
||||
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
|
||||
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
|
||||
if(!locked || issilicon(user) || user.can_admin_interact())
|
||||
dat += "<TT>Healing Threshold: "
|
||||
dat += "<a href='?src=[UID()];adj_threshold=-10'>--</a> "
|
||||
dat += "<a href='?src=[UID()];adj_threshold=-5'>-</a> "
|
||||
|
||||
@@ -284,7 +284,7 @@
|
||||
dat += "<b>Destination:</b> [!destination ? "<i>none</i>" : destination]<BR>"
|
||||
dat += "<b>Power level:</b> [cell ? cell.percent() : 0]%"
|
||||
|
||||
if(locked && !ai && !check_rights(R_ADMIN, 0, user))
|
||||
if(locked && !ai && !user.can_admin_interact())
|
||||
dat += " <br /><div class='notice'>Controls are locked</div><A href='?src=[UID()];op=unlock'>Unlock Controls</A>"
|
||||
else
|
||||
dat += " <br /><div class='notice'>Controls are unlocked</div><A href='?src=[UID()];op=lock'>Lock Controls</A><BR><BR>"
|
||||
|
||||
@@ -119,7 +119,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
|
||||
|
||||
"<A href='?src=[UID()];power=1'>[on ? "On" : "Off"]</A>" )
|
||||
|
||||
if(!locked || issilicon(user) || check_rights(R_ADMIN, 0, user))
|
||||
if(!locked || issilicon(user) || user.can_admin_interact())
|
||||
dat += text({"<BR>
|
||||
Arrest Unidentifiable Persons: []<BR>
|
||||
Arrest for Unauthorized Weapons: []<BR>
|
||||
|
||||
@@ -37,9 +37,12 @@ var/list/alldepartments = list()
|
||||
fax_network = "Central Command Quantum Entanglement Network"
|
||||
long_range_enabled = 1
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/attack_hand(mob/user as mob)
|
||||
/obj/machinery/photocopier/faxmachine/attack_hand(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/attack_ghost(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/attackby(obj/item/weapon/item, mob/user, params)
|
||||
if(istype(item,/obj/item/weapon/card/id) && !scan)
|
||||
scan(item)
|
||||
@@ -64,13 +67,14 @@ var/list/alldepartments = list()
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/ui_data(mob/user, ui_key = "main", datum/topic_state/state = default_state)
|
||||
var/data[0]
|
||||
var/is_authenticated = is_authenticated(user)
|
||||
|
||||
if(scan)
|
||||
data["scan_name"] = scan.name
|
||||
else
|
||||
data["scan_name"] = "-----"
|
||||
data["authenticated"] = authenticated
|
||||
if(!authenticated)
|
||||
data["authenticated"] = is_authenticated
|
||||
if(!is_authenticated)
|
||||
data["network"] = "Disconnected"
|
||||
else if(!emagged)
|
||||
data["network"] = fax_network
|
||||
@@ -91,12 +95,20 @@ var/list/alldepartments = list()
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/proc/is_authenticated(mob/user)
|
||||
if(authenticated)
|
||||
return TRUE
|
||||
else if(user.can_admin_interact())
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/obj/machinery/photocopier/faxmachine/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
|
||||
var/is_authenticated = is_authenticated(usr)
|
||||
if(href_list["send"])
|
||||
if(copyitem && authenticated)
|
||||
if(copyitem && is_authenticated)
|
||||
if((destination in admin_departments) || (destination in hidden_admin_departments))
|
||||
send_admin_fax(usr, destination)
|
||||
else
|
||||
@@ -128,7 +140,7 @@ var/list/alldepartments = list()
|
||||
scan()
|
||||
|
||||
if(href_list["dept"])
|
||||
if(authenticated)
|
||||
if(is_authenticated)
|
||||
var/lastdestination = destination
|
||||
var/list/combineddepartments = alldepartments.Copy()
|
||||
if(long_range_enabled)
|
||||
@@ -145,7 +157,7 @@ var/list/alldepartments = list()
|
||||
if((!authenticated) && scan)
|
||||
if(check_access(scan))
|
||||
authenticated = 1
|
||||
else if(authenticated)
|
||||
else if(!authenticated)
|
||||
authenticated = 0
|
||||
|
||||
if(href_list["rename"])
|
||||
|
||||
@@ -19,10 +19,13 @@
|
||||
var/maxcopies = 10 //how many copies can be copied at once- idea shamelessly stolen from bs12's copier!
|
||||
var/mob/living/ass = null
|
||||
|
||||
/obj/machinery/photocopier/attack_ai(mob/user as mob)
|
||||
/obj/machinery/photocopier/attack_ai(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/photocopier/attack_ghost(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/photocopier/attack_hand(mob/user as mob)
|
||||
/obj/machinery/photocopier/attack_hand(mob/user)
|
||||
user.set_machine(src)
|
||||
|
||||
var/dat = "Photocopier<BR><BR>"
|
||||
@@ -47,6 +50,9 @@
|
||||
return
|
||||
|
||||
/obj/machinery/photocopier/Topic(href, href_list)
|
||||
if(..())
|
||||
return 1
|
||||
|
||||
if(href_list["copy"])
|
||||
if(stat & (BROKEN|NOPOWER))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user