Refactored, simplified access system a bit. Tested, for once.

* Mobs provide GetAccess() and hasFullAccess()
 * Human GetAccess() provides the "best" accesses available combined from all conventional sources.\
 * Silicons have hasFullAccess()
 * AdminGhosts also provide full access.

Conflicts:
	code/game/jobs/access.dm
	code/modules/mob/dead/observer/observer.dm
	code/modules/mob/living/carbon/human/human.dm
	code/modules/mob/living/silicon/silicon.dm
	code/modules/mob/mob.dm
	html/changelog.html
This commit is contained in:
Rob Nelson
2014-05-20 12:30:01 -07:00
committed by Regen
parent b740176097
commit a5e65d9b2b
6 changed files with 71 additions and 55 deletions
@@ -24,6 +24,7 @@
var/atom/movable/following = null
var/medHUD = 0
/mob/dead/observer/New(var/mob/body=null, var/flags=1)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
see_invisible = SEE_INVISIBLE_OBSERVER
@@ -1531,3 +1531,14 @@
M.apply_damage(50,BRUTE)
if(M.stat == 2)
M.gib()
// Get ALL accesses available.
/mob/living/carbon/human/GetAccess()
var/list/ACL=list()
var/obj/item/I = get_active_hand()
if(istype(I))
ACL |= I.GetAccess()
if(wear_id)
ACL |= wear_id.GetAccess()
return ACL
@@ -497,3 +497,10 @@
if(!ticker.mode.name == "monkey") return 0
return 1
// Get ALL accesses available.
/mob/living/carbon/monkey/GetAccess()
var/list/ACL=list()
var/obj/item/I = get_active_hand()
if(istype(I))
ACL |= I.GetAccess()
return ACL
+6 -1
View File
@@ -11,6 +11,12 @@
var/list/alarm_types_show = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
var/list/alarm_types_clear = list("Motion" = 0, "Fire" = 0, "Atmosphere" = 0, "Power" = 0, "Camera" = 0)
/mob/living/silicon/hasFullAccess()
return 1
/mob/living/silicon/GetAccess()
return get_all_accesses()
/mob/living/silicon/proc/cancelAlarm()
return
@@ -182,7 +188,6 @@
stat(null, "ETA-[(timeleft / 60) % 60]:[add_zero(num2text(timeleft % 60), 2)]")
// This adds the basic clock, shuttle recall timer, and malf_ai info to all silicon lifeforms
/mob/living/silicon/Stat()
..()
+9 -1
View File
@@ -1204,4 +1204,12 @@ mob/proc/yank_out_object()
if(host)
host.ckey = src.ckey
host << "<span class='info'>You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.</span>"
host << "<span class='info'>You are now a mouse. Try to avoid interaction with players, and do not give hints away that you are more than a simple rodent.</span>"
// Mobs tell access what access levels it has.
/mob/proc/GetAccess()
return list()
// Skip over all the complex list checks.
/mob/proc/hasFullAccess()
return 0