Adds a preference to have an intent check for guns (#3653)

what title says
This commit is contained in:
chaoko99
2017-12-17 01:37:16 -08:00
committed by Erki
parent 81e8d371de
commit c0ee47579d
11 changed files with 99 additions and 30 deletions

View File

@@ -148,9 +148,14 @@
return ..() //Pistolwhippin'
/obj/item/weapon/gun/proc/Fire(atom/target, mob/living/user, clickparams, pointblank=0, reflex=0)
if(!user || !target) return
add_fingerprint(user)
if(user.client && (user.client.prefs.toggles_secondary & SAFETY_CHECK) && user.a_intent != I_HURT) //Check this first to save time.
user << "You refrain from firing, as you aren't on harm intent."
return
if(!special_check(user))
return

View File

@@ -9,6 +9,10 @@
AO.update_aiming_deferred()
/obj/aiming_overlay/proc/trigger(var/perm)
if((user.client.prefs.toggles_secondary & SAFETY_CHECK) && user.a_intent != I_HURT) //Check this first to save time.
user << "You refrain from firing, as you aren't on harm intent."
return
if(!owner || !aiming_with || !aiming_at || !locked)
return
if(perm && (target_permissions & perm))
@@ -25,7 +29,7 @@
toggle_active()
if (owner.client)
owner.client.remove_gun_icons()
/mob/living/ClickOn(var/atom/A, var/params)
. = ..()
trigger_aiming(TARGET_CAN_CLICK)