mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Do not copy-paste code.
Do not copy-paste code.
This commit is contained in:
@@ -619,3 +619,61 @@ proc/is_blind(A)
|
||||
// Returns true if the mob has a client which has been active in the last given X minutes.
|
||||
/mob/proc/is_client_active(var/active = 1)
|
||||
return client && client.inactivity < active MINUTES
|
||||
|
||||
#define SAFE_PERP -50
|
||||
/mob/living/proc/assess_perp(var/auth_weapons, var/check_records, var/check_arrest)
|
||||
if(stat == DEAD)
|
||||
return SAFE_PERP
|
||||
|
||||
return 0
|
||||
|
||||
/mob/living/carbon/human/assess_perp(var/obj/access_obj, var/auth_weapons, var/check_records, var/check_arrest)
|
||||
var/threatcount = ..()
|
||||
if(. == SAFE_PERP)
|
||||
return SAFE_PERP
|
||||
|
||||
//Agent cards lower threatlevel.
|
||||
var/obj/item/weapon/card/id/id = GetIdCard(src)
|
||||
if(id && istype(id, /obj/item/weapon/card/id/syndicate))
|
||||
threatcount -= 2
|
||||
// A proper CentCom id is hard currency.
|
||||
else if(id && istype(id, /obj/item/weapon/card/id/centcom))
|
||||
return SAFE_PERP
|
||||
|
||||
if(auth_weapons && !access_obj.allowed(src))
|
||||
if(istype(l_hand, /obj/item/weapon/gun) || istype(l_hand, /obj/item/weapon/melee))
|
||||
threatcount += 4
|
||||
|
||||
if(istype(r_hand, /obj/item/weapon/gun) || istype(r_hand, /obj/item/weapon/melee))
|
||||
threatcount += 4
|
||||
|
||||
if(istype(belt, /obj/item/weapon/gun) || istype(belt, /obj/item/weapon/melee))
|
||||
threatcount += 2
|
||||
|
||||
if(species.name != "Human")
|
||||
threatcount += 2
|
||||
|
||||
if(check_records || check_arrest)
|
||||
var/perpname = name
|
||||
if(id)
|
||||
perpname = id.registered_name
|
||||
|
||||
var/datum/data/record/R = find_security_record("name", perpname)
|
||||
if(check_records && !R)
|
||||
threatcount += 4
|
||||
|
||||
if(check_arrest && R && (R.fields["criminal"] == "*Arrest*"))
|
||||
threatcount += 4
|
||||
|
||||
return threatcount
|
||||
|
||||
/mob/living/simple_animal/hostile/assess_perp(var/obj/access_obj, var/auth_weapons, var/check_records, var/check_arrest)
|
||||
var/threatcount = ..()
|
||||
if(. == SAFE_PERP)
|
||||
return SAFE_PERP
|
||||
|
||||
if(!istype(src, /mob/living/simple_animal/hostile/retaliate/goat))
|
||||
threatcount += 4
|
||||
return threatcount
|
||||
|
||||
#undef SAFE_PERP
|
||||
|
||||
Reference in New Issue
Block a user