Fixes dual wielding bypassing wizard checks (#72431)

Fixes #72428

🆑 ShizCalev
fix: Non-magic inclined mobs will no longer fire staffs while duel
wielding.
/🆑
This commit is contained in:
ShizCalev
2023-01-06 17:52:40 -08:00
committed by GitHub
parent 5abbd019b1
commit 69337dffba
7 changed files with 28 additions and 10 deletions
+1 -1
View File
@@ -903,7 +903,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
var/mob/living/living_target = target
living_target.adjustBruteLoss(extra_strength_damage)
/obj/item/proc/can_trigger_gun(mob/living/user)
/obj/item/proc/can_trigger_gun(mob/living/user, akimbo_usage)
if(!user.can_use_guns(src))
return FALSE
return TRUE
+3 -1
View File
@@ -780,7 +780,9 @@ Striking a noncultist, however, will tear their flesh."}
mag_type = /obj/item/ammo_box/magazine/internal/blood
fire_sound = 'sound/magic/wand_teleport.ogg'
/obj/item/gun/ballistic/rifle/enchanted/arcane_barrage/blood/can_trigger_gun(mob/living/user)
/obj/item/gun/ballistic/rifle/enchanted/arcane_barrage/blood/can_trigger_gun(mob/living/user, akimbo_usage)
if(akimbo_usage)
return FALSE //no akimbo wielding magic lol.
. = ..()
if(!IS_CULTIST(user))
to_chat(user, span_cultlarge("\"Did you truly think that you could channel MY blood without my approval? Amusing, but futile.\""))
+5 -5
View File
@@ -260,13 +260,13 @@
var/loop_counter = 0
if(ishuman(user) && user.combat_mode)
var/mob/living/carbon/human/H = user
for(var/obj/item/gun/G in H.held_items)
if(G == src || G.weapon_weight >= WEAPON_MEDIUM)
for(var/obj/item/gun/gun in H.held_items)
if(gun == src || gun.weapon_weight >= WEAPON_MEDIUM)
continue
else if(G.can_trigger_gun(user))
else if(gun.can_trigger_gun(user, akimbo_usage = TRUE))
bonus_spread += dual_wield_spread
loop_counter++
addtimer(CALLBACK(G, TYPE_PROC_REF(/obj/item/gun, process_fire), target, user, TRUE, params, null, bonus_spread), loop_counter)
addtimer(CALLBACK(gun, TYPE_PROC_REF(/obj/item/gun, process_fire), target, user, TRUE, params, null, bonus_spread), loop_counter)
return process_fire(target, user, TRUE, params, null, bonus_spread)
@@ -284,7 +284,7 @@
user.dropItemToGround(src, TRUE)
return TRUE
/obj/item/gun/can_trigger_gun(mob/living/user)
/obj/item/gun/can_trigger_gun(mob/living/user, akimbo_usage)
. = ..()
if(!handle_pins(user))
return FALSE
@@ -182,6 +182,11 @@
A.update_appearance()
return
/obj/item/gun/ballistic/revolver/russian/can_trigger_gun(mob/living/user, akimbo_usage)
if(akimbo_usage)
return FALSE
return ..()
/obj/item/gun/ballistic/revolver/russian/attack_self(mob/user)
if(!spun)
spin()
@@ -268,7 +273,9 @@
/obj/item/gun/ballistic/revolver/reverse //Fires directly at its user... unless the user is a clown, of course.
clumsy_check = FALSE
/obj/item/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user)
/obj/item/gun/ballistic/revolver/reverse/can_trigger_gun(mob/living/user, akimbo_usage)
if(akimbo_usage)
return FALSE
if(HAS_TRAIT(user, TRAIT_CLUMSY) || is_clown_job(user.mind?.assigned_role))
return ..()
if(process_fire(user, user, FALSE, null, BODY_ZONE_HEAD))
@@ -223,7 +223,9 @@
. = ..()
duel?.clear_duel()
/obj/item/gun/energy/dueling/can_trigger_gun(mob/living/user)
/obj/item/gun/energy/dueling/can_trigger_gun(mob/living/user, akimbo_usage)
if(akimbo_usage)
return FALSE //not honorable.
. = ..()
if(!check_valid_duel(user, TRUE))
return FALSE
@@ -18,6 +18,11 @@
return FALSE
return TRUE
/obj/item/gun/magic/staff/can_trigger_gun(mob/living/user, akimbo_usage)
if(akimbo_usage && !is_wizard_or_friend(user))
return FALSE
return ..()
/obj/item/gun/magic/staff/check_botched(mob/living/user, atom/target)
if(!is_wizard_or_friend(user))
return !on_intruder_use(user, target)
@@ -19,7 +19,9 @@
/obj/item/gun/magic/hook/shoot_with_empty_chamber(mob/living/user)
balloon_alert(user, "not ready yet!")
/obj/item/gun/magic/hook/can_trigger_gun(mob/living/user) // This isn't really a gun, so it shouldn't be checking for TRAIT_NOGUNS, a firing pin (pinless), or a trigger guard (guardless)
/obj/item/gun/magic/hook/can_trigger_gun(mob/living/user, akimbo_usage) // This isn't really a gun, so it shouldn't be checking for TRAIT_NOGUNS, a firing pin (pinless), or a trigger guard (guardless)
if(akimbo_usage)
return FALSE //this would be kinda weird while shooting someone down.
return TRUE
/obj/item/ammo_casing/magic/hook