diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 0cc8eded06..a056cbc0f9 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -504,42 +504,12 @@ /obj/machinery/porta_turret/proc/assess_perp(var/mob/living/carbon/human/H) if(!H || !istype(H)) - return + return 0 if(emagged) return 10 - var/threatcount = 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(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 + return H.assess_perp(src, check_weapons, check_records, check_arrest) /obj/machinery/porta_turret/proc/tryToShootAt(var/list/mob/living/targets) if(targets.len && last_target && (last_target in targets) && target(last_target)) @@ -587,17 +557,6 @@ invisibility = INVISIBILITY_LEVEL_TWO 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) if(disabled) return @@ -613,7 +572,7 @@ /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! - 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 return last_fired = 1 diff --git a/code/game/objects/items/weapons/storage/misc.dm b/code/game/objects/items/weapons/storage/misc.dm index ada630e953..65e1bfea37 100644 --- a/code/game/objects/items/weapons/storage/misc.dm +++ b/code/game/objects/items/weapons/storage/misc.dm @@ -36,10 +36,5 @@ overlays += img i++ -<<<<<<< HEAD /obj/item/weapon/storage/box/donut/empty - icon_state = "donutbox0" -======= -/obj/item/weapon/storage/donut_box/empty ->>>>>>> upstream/master startswith = 0 diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index 9698021cbb..eba380340f 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -334,53 +334,13 @@ path = list() /mob/living/bot/secbot/proc/check_threat(var/mob/living/M) - if(M.stat == DEAD) + if(!M || !istype(M) || M.stat) return 0 + if(emagged) return 10 - var/threatcount = 0 - - 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 + return M.assess_perp(access_scanner, idcheck, check_records, check_arrest) /mob/living/bot/secbot/proc/patrol_step() if(loc == patrol_target) diff --git a/code/modules/mob/mob_helpers.dm b/code/modules/mob/mob_helpers.dm index 4138c1454b..9275c4f339 100644 --- a/code/modules/mob/mob_helpers.dm +++ b/code/modules/mob/mob_helpers.dm @@ -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