mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Do not copy-paste code.
Do not copy-paste code.
This commit is contained in:
@@ -504,42 +504,12 @@
|
|||||||
|
|
||||||
/obj/machinery/porta_turret/proc/assess_perp(var/mob/living/carbon/human/H)
|
/obj/machinery/porta_turret/proc/assess_perp(var/mob/living/carbon/human/H)
|
||||||
if(!H || !istype(H))
|
if(!H || !istype(H))
|
||||||
return
|
return 0
|
||||||
|
|
||||||
if(emagged)
|
if(emagged)
|
||||||
return 10
|
return 10
|
||||||
|
|
||||||
var/threatcount = 0
|
return H.assess_perp(src, check_weapons, check_records, check_arrest)
|
||||||
var/obj/item/weapon/card/id/id = GetIdCard(H) //Agent cards lower threatlevel.
|
|
||||||
if(id && istype(id, /obj/item/weapon/card/id/syndicate))
|
|
||||||
threatcount -= 2
|
|
||||||
|
|
||||||
if(check_weapons && !allowed(H))
|
|
||||||
if(istype(H.l_hand, /obj/item/weapon/gun) || istype(H.l_hand, /obj/item/weapon/melee))
|
|
||||||
threatcount += 4
|
|
||||||
|
|
||||||
if(istype(H.r_hand, /obj/item/weapon/gun) || istype(H.r_hand, /obj/item/weapon/melee))
|
|
||||||
threatcount += 4
|
|
||||||
|
|
||||||
if(istype(H.belt, /obj/item/weapon/gun) || istype(H.belt, /obj/item/weapon/melee))
|
|
||||||
threatcount += 2
|
|
||||||
|
|
||||||
if(H.species.name != "Human")
|
|
||||||
threatcount += 2
|
|
||||||
|
|
||||||
if(check_records || check_arrest)
|
|
||||||
var/perpname = H.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
|
|
||||||
|
|
||||||
/obj/machinery/porta_turret/proc/tryToShootAt(var/list/mob/living/targets)
|
/obj/machinery/porta_turret/proc/tryToShootAt(var/list/mob/living/targets)
|
||||||
if(targets.len && last_target && (last_target in targets) && target(last_target))
|
if(targets.len && last_target && (last_target in targets) && target(last_target))
|
||||||
@@ -587,17 +557,6 @@
|
|||||||
invisibility = INVISIBILITY_LEVEL_TWO
|
invisibility = INVISIBILITY_LEVEL_TWO
|
||||||
update_icon()
|
update_icon()
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
/obj/machinery/porta_turret/on_assess_perp(mob/living/carbon/human/perp)
|
|
||||||
if((check_access || attacked) && !allowed(perp))
|
|
||||||
//if the turret has been attacked or is angry, target all non-authorized personnel, see req_access
|
|
||||||
return 10
|
|
||||||
|
|
||||||
return ..()
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/obj/machinery/porta_turret/proc/target(var/mob/living/target)
|
/obj/machinery/porta_turret/proc/target(var/mob/living/target)
|
||||||
if(disabled)
|
if(disabled)
|
||||||
return
|
return
|
||||||
@@ -613,7 +572,7 @@
|
|||||||
|
|
||||||
/obj/machinery/porta_turret/proc/shootAt(var/mob/living/target)
|
/obj/machinery/porta_turret/proc/shootAt(var/mob/living/target)
|
||||||
//any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power!
|
//any emagged turrets will shoot extremely fast! This not only is deadly, but drains a lot power!
|
||||||
if(!emagged) //if it hasn't been emagged, it has to obey a cooldown rate
|
if(!(emagged || attacked)) //if it hasn't been emagged or attacked, it has to obey a cooldown rate
|
||||||
if(last_fired || !raised) //prevents rapid-fire shooting, unless it's been emagged
|
if(last_fired || !raised) //prevents rapid-fire shooting, unless it's been emagged
|
||||||
return
|
return
|
||||||
last_fired = 1
|
last_fired = 1
|
||||||
|
|||||||
@@ -36,10 +36,5 @@
|
|||||||
overlays += img
|
overlays += img
|
||||||
i++
|
i++
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
/obj/item/weapon/storage/box/donut/empty
|
/obj/item/weapon/storage/box/donut/empty
|
||||||
icon_state = "donutbox0"
|
|
||||||
=======
|
|
||||||
/obj/item/weapon/storage/donut_box/empty
|
|
||||||
>>>>>>> upstream/master
|
|
||||||
startswith = 0
|
startswith = 0
|
||||||
|
|||||||
@@ -334,53 +334,13 @@
|
|||||||
path = list()
|
path = list()
|
||||||
|
|
||||||
/mob/living/bot/secbot/proc/check_threat(var/mob/living/M)
|
/mob/living/bot/secbot/proc/check_threat(var/mob/living/M)
|
||||||
if(M.stat == DEAD)
|
if(!M || !istype(M) || M.stat)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
if(emagged)
|
if(emagged)
|
||||||
return 10
|
return 10
|
||||||
|
|
||||||
var/threatcount = 0
|
return M.assess_perp(access_scanner, idcheck, check_records, check_arrest)
|
||||||
|
|
||||||
if(ishuman(M))
|
|
||||||
var/mob/living/carbon/human/H = M
|
|
||||||
|
|
||||||
if(H.handcuffed)
|
|
||||||
return 0
|
|
||||||
|
|
||||||
var/obj/item/weapon/card/id/id = GetIdCard(H) //Agent cards lower threatlevel.
|
|
||||||
if(id && istype(id, /obj/item/weapon/card/id/syndicate))
|
|
||||||
threatcount -= 2
|
|
||||||
|
|
||||||
if(idcheck && !access_scanner.allowed(H))
|
|
||||||
if(istype(H.l_hand, /obj/item/weapon/gun) || istype(H.l_hand, /obj/item/weapon/melee))
|
|
||||||
threatcount += 4
|
|
||||||
|
|
||||||
if(istype(H.r_hand, /obj/item/weapon/gun) || istype(H.r_hand, /obj/item/weapon/melee))
|
|
||||||
threatcount += 4
|
|
||||||
|
|
||||||
if(istype(H.belt, /obj/item/weapon/gun) || istype(H.belt, /obj/item/weapon/melee))
|
|
||||||
threatcount += 2
|
|
||||||
|
|
||||||
if(H.species.name != "Human") //beepsky so racist.
|
|
||||||
threatcount += 2
|
|
||||||
|
|
||||||
if(check_records || check_arrest)
|
|
||||||
var/perpname = H.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
|
|
||||||
|
|
||||||
else if(isanimal(M))
|
|
||||||
if(istype(M, /mob/living/simple_animal/hostile) && !istype(M, /mob/living/simple_animal/hostile/retaliate/goat))
|
|
||||||
threatcount += 4
|
|
||||||
|
|
||||||
return threatcount
|
|
||||||
|
|
||||||
/mob/living/bot/secbot/proc/patrol_step()
|
/mob/living/bot/secbot/proc/patrol_step()
|
||||||
if(loc == patrol_target)
|
if(loc == patrol_target)
|
||||||
|
|||||||
@@ -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.
|
// 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)
|
/mob/proc/is_client_active(var/active = 1)
|
||||||
return client && client.inactivity < active MINUTES
|
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