Merge pull request #2373 from Citadel-Station-13/upstream-merge-29854

[MIRROR] Moved can_trigger_gun to item/weapon parent
This commit is contained in:
LetterJay
2017-08-14 18:53:38 -05:00
committed by GitHub
8 changed files with 19 additions and 22 deletions

View File

@@ -143,7 +143,7 @@
var/protection = (prot["head"] + prot["arms"] + prot["feet"] + prot["legs"] + prot["groin"] + prot["chest"] + prot["hands"])/7
return protection
/mob/living/carbon/human/can_use_guns(var/obj/item/weapon/gun/G)
/mob/living/carbon/human/can_use_guns(var/obj/item/weapon/G)
. = ..()
if(G.trigger_guard == TRIGGER_GUARD_NORMAL)

View File

@@ -140,7 +140,7 @@
return 0
return 1
/mob/living/carbon/monkey/can_use_guns(var/obj/item/weapon/gun/G)
/mob/living/carbon/monkey/can_use_guns(var/obj/item/weapon/G)
return 1
/mob/living/carbon/monkey/angry

View File

@@ -795,7 +795,7 @@
else
to_chat(src, "<span class='warning'>You don't have the dexterity to do this!</span>")
return
/mob/living/proc/can_use_guns(var/obj/item/weapon/gun/G)
/mob/living/proc/can_use_guns(var/obj/item/weapon/G)
if (G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
to_chat(src, "<span class='warning'>You don't have the dexterity to do this!</span>")
return 0

View File

@@ -176,7 +176,7 @@
else
..()
/mob/living/simple_animal/drone/cogscarab/can_use_guns(obj/item/weapon/gun/G)
/mob/living/simple_animal/drone/cogscarab/can_use_guns(obj/item/weapon/G)
return GLOB.ratvar_awakens
/mob/living/simple_animal/drone/cogscarab/get_armor_effectiveness()

View File

@@ -27,7 +27,7 @@
var/recoil = 0 //boom boom shake the room
var/clumsy_check = 1
var/obj/item/ammo_casing/chambered = null
var/trigger_guard = TRIGGER_GUARD_NORMAL //trigger guard on the weapon, hulks can't fire them with their big meaty fingers
trigger_guard = TRIGGER_GUARD_NORMAL //trigger guard on the weapon, hulks can't fire them with their big meaty fingers
var/sawn_desc = null //description change if weapon is sawn-off
var/sawn_state = SAWN_INTACT
var/burst_size = 1 //how large a burst is
@@ -188,12 +188,10 @@
/obj/item/weapon/gun/proc/can_trigger_gun(var/mob/living/user)
if(!handle_pins(user) || !user.can_use_guns(src))
return 0
return 1
/obj/item/weapon/gun/can_trigger_gun(mob/living/user)
. = ..()
if(!handle_pins(user))
return FALSE
/obj/item/weapon/gun/proc/handle_pins(mob/living/user)
if(pin)