From af5276467b58e744e63093ef7eef144da4dee76e Mon Sep 17 00:00:00 2001 From: c0 Date: Tue, 1 Mar 2016 23:52:58 +0300 Subject: [PATCH 1/2] Allows aliens/monkeys to use magic and arm-mounted guns --- code/modules/mob/living/carbon/human/human_helpers.dm | 4 ++-- code/modules/mob/living/living.dm | 2 +- code/modules/projectiles/guns/magic.dm | 2 +- code/modules/projectiles/guns/mounted.dm | 2 ++ 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 989ed1bf936..274306cfedb 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -153,7 +153,7 @@ /mob/living/carbon/human/can_use_guns(var/obj/item/weapon/gun/G) . = ..() - if(G.trigger_guard) + if(G.trigger_guard == 1) if(src.dna.check_mutation(HULK)) src << "Your meaty finger is much too large for the trigger guard!" return 0 @@ -165,4 +165,4 @@ src << "Use of ranged weaponry would bring dishonor to the clan." return 0 - return . + return . diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 7d78d0a2e66..8e563ccd3ce 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -968,7 +968,7 @@ Sorry Giacom. Please don't be mad :( src << "You don't have the dexterity to do this!" return /mob/living/proc/can_use_guns(var/obj/item/weapon/gun/G) - if (!IsAdvancedToolUser()) + if (G.trigger_guard != -1 && !IsAdvancedToolUser()) src << "You don't have the dexterity to do this!" return 0 return 1 diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm index 685483285a3..bcf1f5c2194 100644 --- a/code/modules/projectiles/guns/magic.dm +++ b/code/modules/projectiles/guns/magic.dm @@ -16,7 +16,7 @@ var/no_den_usage origin_tech = null clumsy_check = 0 - trigger_guard = 0 + trigger_guard = -1 // Has no trigger at all, uses magic instead pin = /obj/item/device/firing_pin/magic lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' //not really a gun and some toys use these inhands diff --git a/code/modules/projectiles/guns/mounted.dm b/code/modules/projectiles/guns/mounted.dm index 177445f3b43..7fffde0c1e0 100644 --- a/code/modules/projectiles/guns/mounted.dm +++ b/code/modules/projectiles/guns/mounted.dm @@ -7,6 +7,7 @@ force = 5 selfcharge = 1 can_flashlight = 0 + trigger_guard = -1 // Has no trigger at all, uses neural signals instead /obj/item/weapon/gun/energy/gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow... ..() @@ -20,6 +21,7 @@ item_state = "armcannonlase" force = 5 selfcharge = 1 + trigger_guard = -1 /obj/item/weapon/gun/energy/laser/mounted/dropped() ..() From 1dea7ac78bdd8e517725c519bb9e52139f5df9fa Mon Sep 17 00:00:00 2001 From: c0 Date: Wed, 2 Mar 2016 00:23:50 +0300 Subject: [PATCH 2/2] Defines --- code/__DEFINES/misc.dm | 7 ++++++- code/modules/mob/living/carbon/human/human_helpers.dm | 2 +- code/modules/mob/living/living.dm | 2 +- code/modules/projectiles/gun.dm | 2 +- code/modules/projectiles/guns/energy/nuclear.dm | 2 +- code/modules/projectiles/guns/magic.dm | 2 +- code/modules/projectiles/guns/mounted.dm | 4 ++-- 7 files changed, 13 insertions(+), 8 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 9e94460dcbd..7ffcfa0e7ce 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -360,4 +360,9 @@ var/list/bloody_footprints_cache = list() #define EARLY_LAUNCHED 2 //Just space -#define SPACE_ICON_STATE "[((x + y) ^ ~(x * y) + z) % 25]" \ No newline at end of file +#define SPACE_ICON_STATE "[((x + y) ^ ~(x * y) + z) % 25]" + +//Gun trigger guards +#define TRIGGER_GUARD_ALLOW_ALL -1 +#define TRIGGER_GUARD_NONE 0 +#define TRIGGER_GUARD_NORMAL 1 \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/human_helpers.dm b/code/modules/mob/living/carbon/human/human_helpers.dm index 274306cfedb..ce5ba1cba23 100644 --- a/code/modules/mob/living/carbon/human/human_helpers.dm +++ b/code/modules/mob/living/carbon/human/human_helpers.dm @@ -153,7 +153,7 @@ /mob/living/carbon/human/can_use_guns(var/obj/item/weapon/gun/G) . = ..() - if(G.trigger_guard == 1) + if(G.trigger_guard == TRIGGER_GUARD_NORMAL) if(src.dna.check_mutation(HULK)) src << "Your meaty finger is much too large for the trigger guard!" return 0 diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 8e563ccd3ce..679927978c3 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -968,7 +968,7 @@ Sorry Giacom. Please don't be mad :( src << "You don't have the dexterity to do this!" return /mob/living/proc/can_use_guns(var/obj/item/weapon/gun/G) - if (G.trigger_guard != -1 && !IsAdvancedToolUser()) + if (G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser()) src << "You don't have the dexterity to do this!" return 0 return 1 diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 60e546f65b4..0070be79669 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -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 = 1 //trigger guard on the weapon, hulks can't fire them with their big meaty fingers + var/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 diff --git a/code/modules/projectiles/guns/energy/nuclear.dm b/code/modules/projectiles/guns/energy/nuclear.dm index d49f0bf093b..e1eae1a20f8 100644 --- a/code/modules/projectiles/guns/energy/nuclear.dm +++ b/code/modules/projectiles/guns/energy/nuclear.dm @@ -38,7 +38,7 @@ ammo_type = list(/obj/item/ammo_casing/energy/electrode, /obj/item/ammo_casing/energy/laser) heavy_weapon = 1 can_flashlight = 0 - trigger_guard = 0 + trigger_guard = TRIGGER_GUARD_NONE ammo_x_offset = 2 /obj/item/weapon/gun/energy/gun/nuclear diff --git a/code/modules/projectiles/guns/magic.dm b/code/modules/projectiles/guns/magic.dm index bcf1f5c2194..1600fc21096 100644 --- a/code/modules/projectiles/guns/magic.dm +++ b/code/modules/projectiles/guns/magic.dm @@ -16,7 +16,7 @@ var/no_den_usage origin_tech = null clumsy_check = 0 - trigger_guard = -1 // Has no trigger at all, uses magic instead + trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses magic instead pin = /obj/item/device/firing_pin/magic lefthand_file = 'icons/mob/inhands/items_lefthand.dmi' //not really a gun and some toys use these inhands diff --git a/code/modules/projectiles/guns/mounted.dm b/code/modules/projectiles/guns/mounted.dm index 7fffde0c1e0..c5b050ff94e 100644 --- a/code/modules/projectiles/guns/mounted.dm +++ b/code/modules/projectiles/guns/mounted.dm @@ -7,7 +7,7 @@ force = 5 selfcharge = 1 can_flashlight = 0 - trigger_guard = -1 // Has no trigger at all, uses neural signals instead + trigger_guard = TRIGGER_GUARD_ALLOW_ALL // Has no trigger at all, uses neural signals instead /obj/item/weapon/gun/energy/gun/advtaser/mounted/dropped()//if somebody manages to drop this somehow... ..() @@ -21,7 +21,7 @@ item_state = "armcannonlase" force = 5 selfcharge = 1 - trigger_guard = -1 + trigger_guard = TRIGGER_GUARD_ALLOW_ALL /obj/item/weapon/gun/energy/laser/mounted/dropped() ..()