Renames IsAGhost to IsAdminGhost.

Reworks checks to not need stat to be 0
Fixes the majority of the Nanoui bugs.
This commit is contained in:
Shadowlight213
2015-12-06 20:21:43 -08:00
parent 828f880432
commit 74c27189b9
24 changed files with 45 additions and 45 deletions

View File

@@ -94,7 +94,7 @@
if(istype(M, /mob/living/silicon))
//AI can do whatever he wants
return 1
if(IsAGhost(M))
if(IsAdminGhost(M))
//Access can't stop the abuse
return 1
else if(istype(M, /mob/living/carbon/human))

View File

@@ -55,7 +55,7 @@
if(stat & (NOPOWER|BROKEN))
return
if ( (get_dist(src, user) > 1 ))
if (!istype(user, /mob/living/silicon))
if (!(istype(user, /mob/living/silicon) || IsAdminGhost(user)))
user << text("Too far away.")
user.unset_machine()
user << browse(null, "window=ai_slipper")
@@ -71,7 +71,7 @@
var/area/area = loc
var/t = "<TT><B>AI Liquid Dispenser</B> ([format_text(area.name)])<HR>"
if(src.locked && (!istype(user, /mob/living/silicon)))
if(src.locked && (!(istype(user, /mob/living/silicon) || IsAdminGhost(user))))
t += "<I>(Swipe ID card to unlock control panel.)</I><BR>"
else
t += text("Dispenser [] - <A href='?src=\ref[];toggleOn=1'>[]?</a><br>\n", src.disabled?"deactivated":"activated", src, src.disabled?"Enable":"Disable")
@@ -85,7 +85,7 @@
if(..())
return
if (src.locked)
if (!istype(usr, /mob/living/silicon))
if (!(istype(usr, /mob/living/silicon)|| IsAdminGhost(usr)))
usr << "Control panel is locked!"
return
if (href_list["toggleOn"])

View File

@@ -994,7 +994,7 @@ FIRE ALARM
update_icon()
/obj/machinery/firealarm/attack_hand(mob/user)
if(user.stat || stat & (NOPOWER|BROKEN))
if((user.stat && !IsAdminGhost(user)) || stat & (NOPOWER|BROKEN))
return
if (buildstage != 2)
@@ -1134,7 +1134,7 @@ Handheld fire alarm frame, for placing on walls
desc = "Cuban Pete is in the house!"
/obj/machinery/firealarm/partyalarm/attack_hand(mob/user)
if(user.stat || stat & (NOPOWER|BROKEN))
if((user.stat && !IsAdminGhost(user)) || stat & (NOPOWER|BROKEN))
return
if (buildstage != 2)

View File

@@ -205,7 +205,7 @@
if(!(active2 in data_core.medical))
src.active2 = null
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)) || IsAGhost(usr))
if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)) || IsAdminGhost(usr))
usr.set_machine(src)
if(href_list["temp"])
src.temp = null
@@ -248,7 +248,7 @@
src.authenticated = 1
src.rank = "AI"
src.screen = 1
else if(IsAGhost(usr))
else if(IsAdminGhost(usr))
src.active1 = null
src.active2 = null
src.authenticated = 1

View File

@@ -39,7 +39,7 @@
/obj/machinery/computer/monitor/interact(mob/user)
if ( (get_dist(src, user) > 1 ) || (stat & (BROKEN|NOPOWER)) )
if (!istype(user, /mob/living/silicon))
if (!(istype(user, /mob/living/silicon) || IsAdminGhost(user)))
user.unset_machine()
user << browse(null, "window=powcomp")
return

View File

@@ -117,9 +117,9 @@
usr << "<span class='danger'>Access Denied.</span>"
else if (href_list["magbot"])
if(issilicon(usr) && is_special_character(usr))
if((issilicon(usr) && is_special_character(usr)) || IsAdminGhost(usr))
var/mob/living/silicon/robot/R = locate(href_list["magbot"])
if(istype(R) && !R.emagged && R.connected_ai == usr && !R.scrambledcodes && can_control(usr, R))
if(istype(R) && !R.emagged && (R.connected_ai == usr || IsAdminGhost(usr)) && !R.scrambledcodes && can_control(usr, R))
log_game("[key_name(usr)] emagged [R.name] using robotic console!")
R.SetEmagged(1)
if(R.mind.special_role)

View File

@@ -266,7 +266,7 @@ What a mess.*/
active1 = null
if(!( data_core.security.Find(active2) ))
active2 = null
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)) || IsAGhost(usr))
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)) || IsAdminGhost(usr))
usr.set_machine(src)
switch(href_list["choice"])
// SORTING!
@@ -319,7 +319,7 @@ What a mess.*/
authenticated = borg.name
rank = "AI"
screen = 1
else if(IsAGhost(usr))
else if(IsAdminGhost(usr))
active1 = null
active2 = null
authenticated = usr.client.holder.admin_signature

View File

@@ -546,7 +546,7 @@ About the new airlock wires panel:
return src.attack_hand(user)
/obj/machinery/door/airlock/attack_hand(mob/user)
if(!istype(user, /mob/living/silicon))
if(!(istype(user, /mob/living/silicon) || IsAdminGhost(user)))
if(src.isElectrified())
if(src.shock(user, 100))
return
@@ -579,7 +579,7 @@ About the new airlock wires panel:
// Otherwise it will runtime with this kind of error: null.Topic()
if(!nowindow)
..()
if(usr.stat || usr.restrained())
if((usr.stat || usr.restrained()) && !IsAdminGhost(usr))
return
add_fingerprint(usr)
if(href_list["close"])
@@ -593,7 +593,7 @@ About the new airlock wires panel:
if((istype(usr, /mob/living/silicon) && src.canAIControl()) || IsAGhost(usr))
if((istype(usr, /mob/living/silicon) && src.canAIControl()) || IsAdminGhost(usr))
//AI
//aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 door safties, 9 door speed, 11 emergency access
//aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door, 8 door safties, 9 door speed, 11 emergency access
@@ -798,7 +798,7 @@ About the new airlock wires panel:
return
/obj/machinery/door/airlock/attackby(obj/item/C, mob/user, params)
if(!istype(usr, /mob/living/silicon))
if(!(istype(usr, /mob/living/silicon) || IsAdminGhost(user)))
if(src.isElectrified())
if(src.shock(user, 75))
return

View File

@@ -239,9 +239,9 @@ Class Procs:
/obj/machinery/attack_hand(mob/user, check_power = 1, set_machine = 1)
if(..())// unbuckling etc
return 1
if(user.lying || user.stat)
if((user.lying || user.stat) && !IsAdminGhost(user))
return 1
if(!user.IsAdvancedToolUser())
if(!user.IsAdvancedToolUser() && !IsAdminGhost(user))
usr << "<span class='warning'>You don't have the dexterity to do this!</span>"
return 1
if (ishuman(user))
@@ -390,8 +390,8 @@ Class Procs:
// Hook for html_interface module to prevent updates to clients who don't have this as their active machine.
/obj/machinery/proc/hiIsValidClient(datum/html_interface_client/hclient, datum/html_interface/hi)
if (hclient.client.mob && hclient.client.mob.stat == 0)
if (isAI(hclient.client.mob)) return TRUE
if (hclient.client.mob && (hclient.client.mob.stat == 0 || IsAdminGhost(hclient.client.mob)))
if (isAI(hclient.client.mob) || IsAdminGhost(hclient.client.mob)) return TRUE
else return hclient.client.mob.machine == src && src.Adjacent(hclient.client.mob)
else
return FALSE

View File

@@ -1070,14 +1070,14 @@
src.attack_hand(user)
/obj/machinery/turretid/attack_ai(mob/user)
if(!ailock || IsAGhost(user))
if(!ailock || IsAdminGhost(user))
return attack_hand(user)
else
user << "<span class='notice'>There seems to be a firewall preventing you from accessing this device.</span>"
/obj/machinery/turretid/attack_hand(mob/user as mob)
if ( get_dist(src, user) > 0 )
if ( !(issilicon(user) || IsAGhost(user)) )
if ( !(issilicon(user) || IsAdminGhost(user)) )
user << "<span class='notice'>You are too far away.</span>"
user.unset_machine()
user << browse(null, "window=turretid")
@@ -1093,10 +1093,10 @@
var/area/area = loc
var/t = ""
if(src.locked && (!(istype(user, /mob/living/silicon) || IsAGhost(user))))
if(src.locked && (!(istype(user, /mob/living/silicon) || IsAdminGhost(user))))
t += "<div class='notice icon'>Swipe ID card to unlock interface</div>"
else
if (!istype(user, /mob/living/silicon) && !IsAGhost(user))
if (!istype(user, /mob/living/silicon) && !IsAdminGhost(user))
t += "<div class='notice icon'>Swipe ID card to lock interface</div>"
t += text("Turrets [] - <A href='?src=\ref[];toggleOn=1'>[]?</a><br>\n", src.enabled?"activated":"deactivated", src, src.enabled?"Disable":"Enable")
t += text("Currently set for [] - <A href='?src=\ref[];toggleLethal=1'>Change to []?</a><br>\n", src.lethal?"lethal":"stun repeatedly", src, src.lethal?"Stun repeatedly":"Lethal")
@@ -1112,7 +1112,7 @@
if(..())
return
if (src.locked)
if (!(istype(usr, /mob/living/silicon) || IsAGhost(usr)))
if (!(istype(usr, /mob/living/silicon) || IsAdminGhost(usr)))
usr << "Control panel is locked!"
return
if (href_list["toggleOn"])

View File

@@ -211,7 +211,7 @@ var/list/obj/machinery/requests_console/allConsoles = list()
dat += "<div class='notice'>Swipe your card to authenticate yourself</div><BR>"
dat += "<b>Message: </b>[message ? message : "<i>No Message</i>"]<BR>"
dat += "<A href='?src=\ref[src];writeAnnouncement=1'>[message ? "Edit" : "Write"] Message</A><BR><BR>"
if (announceAuth && message)
if ((announceAuth || IsAdminGhost(user)) && message)
dat += "<A href='?src=\ref[src];sendAnnouncement=1'>Announce Message</A><BR>"
else
dat += "<span class='linkOff'>Announce Message</span><BR>"

View File

@@ -176,10 +176,10 @@
/obj/item/device/radio/Topic(href, href_list)
//..()
if (usr.stat || !on)
if ((usr.stat && !IsAdminGhost(usr)) || !on)
return
if (!(issilicon(usr) || (usr.contents.Find(src) || ( in_range(src, usr) && istype(loc, /turf) ))))
if (!(issilicon(usr) || IsAdminGhost(usr) || (usr.contents.Find(src) || ( in_range(src, usr) && istype(loc, /turf) ))))
usr << browse(null, "window=radio")
return
usr.set_machine(src)

View File

@@ -60,7 +60,7 @@
if ((M.client && M.machine == src))
is_in_use = 1
src.attack_hand(M)
if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot) || IsAdminGhost(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 = 1
@@ -94,6 +94,7 @@
/obj/attack_ghost(mob/user)
..()
if(!IsAdminGhost(user))
ui_interact(user)
/obj/proc/interact(mob/user)

View File

@@ -2,7 +2,6 @@
..()
if(check_rights(R_ADMIN, 0))
stat = 0
has_unlimited_silicon_privilege = 1

View File

@@ -763,14 +763,14 @@ 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 1
else if(!issilicon(user) || IsAGhost(user)) //Bot is hacked, so only silicons and admins are allowed access.
else if(!issilicon(user) || IsAdminGhost(user)) //Bot is hacked, so only silicons and admins are allowed access.
return 1
else
return 0
/mob/living/simple_animal/bot/proc/hack(mob/user)
var/hack
if(issilicon(user) || IsAGhost(user)) //Allows silicons or admins to toggle the emag status of a bot.
if(issilicon(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.

View File

@@ -225,7 +225,7 @@ Status: []<BR>
Behaviour controls are [locked ? "locked" : "unlocked"]<BR>
Maintenance panel panel is [open ? "opened" : "closed"]"},
text("<A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A>"))
if(!locked || issilicon(user)|| IsAGhost(user))
if(!locked || issilicon(user)|| IsAdminGhost(user))
dat += text({"<BR>Cleans Blood: []<BR>"}, text("<A href='?src=\ref[src];operation=blood'>[blood ? "Yes" : "No"]</A>"))
dat += text({"<BR>Patrol station: []<BR>"}, text("<A href='?src=\ref[src];operation=patrol'>[auto_patrol ? "Yes" : "No"]</A>"))
return dat

View File

@@ -103,7 +103,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]<BR>"},
"<A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A>" )
if(!locked || issilicon(user)|| IsAGhost(user))
if(!locked || issilicon(user)|| IsAdminGhost(user))
if(!lasercolor)
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>

View File

@@ -75,7 +75,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) || IsAGhost(user))
if(!locked || issilicon(user) || IsAdminGhost(user))
dat += "Add tiles to new hull plating: <A href='?src=\ref[src];operation=autotile'>[autotile ? "Yes" : "No"]</A><BR>"
dat += "Replace floor tiles: <A href='?src=\ref[src];operation=replace'>[replacetiles ? "Yes" : "No"]</A><BR>"
dat += "Finds tiles: <A href='?src=\ref[src];operation=tiles'>[eattiles ? "Yes" : "No"]</A><BR>"

View File

@@ -130,7 +130,7 @@
else
dat += "None Loaded"
dat += "<br>Behaviour controls are [locked ? "locked" : "unlocked"]<hr>"
if(!locked || issilicon(user) || IsAGhost(user))
if(!locked || issilicon(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> "

View File

@@ -199,7 +199,7 @@ mob/living/simple_animal/bot/mulebot/bot_reset()
dat += "<b>Destination:</b> [!destination ? "<i>none</i>" : destination]<BR>"
dat += "<b>Power level:</b> [cell ? cell.percent() : 0]%"
if(locked && !ai && !IsAGhost(user))
if(locked && !ai && !IsAdminGhost(user))
dat += "&nbsp;<br /><div class='notice'>Controls are locked</div><A href='byond://?src=\ref[src];op=unlock'>Unlock Controls</A>"
else
dat += "&nbsp;<br /><div class='notice'>Controls are unlocked</div><A href='byond://?src=\ref[src];op=lock'>Lock Controls</A><BR><BR>"
@@ -245,7 +245,7 @@ mob/living/simple_animal/bot/mulebot/bot_reset()
return
if (usr.stat)
return
if ((in_range(src, usr) && istype(loc, /turf)) || (istype(usr, /mob/living/silicon)) || IsAGhost(usr))
if ((in_range(src, usr) && istype(loc, /turf)) || (istype(usr, /mob/living/silicon)) || IsAdminGhost(usr))
switch(href_list["op"])
if("lock", "unlock")

View File

@@ -87,7 +87,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"<A href='?src=\ref[src];power=1'>[on ? "On" : "Off"]</A>" )
if(!locked || issilicon(user) || IsAGhost(user))
if(!locked || issilicon(user) || IsAdminGhost(user))
dat += text({"<BR>
Arrest Unidentifiable Persons: []<BR>
Arrest for Unauthorized Weapons: []<BR>

View File

@@ -370,7 +370,7 @@ It's fairly easy to fix if dealing with single letters but not so much with comp
else
return
/proc/IsAGhost(var/mob/user)
/proc/IsAdminGhost(var/mob/user)
if(check_rights(R_ADMIN, 0) && istype(user, /mob/dead/observer))
return 1
else

View File

@@ -721,7 +721,7 @@
/obj/machinery/power/apc/proc/can_use(mob/user, loud = 0) //used by attack_hand() and Topic()
if (IsAGhost(user))
if (IsAdminGhost(user))
return 1
if (user.stat)
user << "<span class='warning'>You must be conscious to use [src]!</span>"

View File

@@ -21,8 +21,8 @@
power_channel = ENVIRON
/obj/machinery/keycard_auth/attack_ai(mob/user)
if(IsAGhost(user))
user << "Just use your Set Security Level verb!"
if(IsAdminGhost(user))
return
user << "The station AI is not to interact with these devices."
return