From a0787fef057e9411c95763cfc91d822d2e774d20 Mon Sep 17 00:00:00 2001 From: Rob Bailey Date: Sun, 24 Feb 2019 12:30:12 -0800 Subject: [PATCH] Fixes the Russian Revolver dual wield exploit (#42887) Fixes #42880 Also theoretically patches out any future bypassing behavior by overriding the function that makes guns actually able to shoot since the russian revolver is all special functionality. Also corrects some odd behavior with the russian revolver. ## Why It's Good For The Game I don't think a free 357 is a good idea ## Changelog cl fix: The anti-combat mechanism in the Russian Revolver has been revised to prevent usage while dual wielding. /cl --- .../modules/projectiles/guns/ballistic/revolver.dm | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index 19f78f70948..223102fe392 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -160,17 +160,20 @@ mag_type = /obj/item/ammo_box/magazine/internal/cylinder/rus357 var/spun = FALSE +/obj/item/gun/ballistic/revolver/russian/do_spin() + ..() + spun = TRUE + /obj/item/gun/ballistic/revolver/russian/attackby(obj/item/A, mob/user, params) ..() if(get_ammo() > 0) spin() - spun = TRUE update_icon() A.update_icon() return /obj/item/gun/ballistic/revolver/russian/attack_self(mob/user) - if(!spun && can_shoot()) + if(!spun) spin() spun = TRUE return @@ -195,7 +198,7 @@ if(ishuman(user)) var/mob/living/carbon/human/H = user if(!spun) - to_chat(user, "You need to spin the revolver's chamber first!") + to_chat(user, "You need to spin \the [src]'s chamber first!") return spun = FALSE @@ -216,6 +219,11 @@ user.visible_message("*click*") playsound(src, dry_fire_sound, 30, TRUE) +/obj/item/gun/ballistic/revolver/russian/process_fire(atom/target, mob/living/user, message = TRUE, params = null, zone_override = "", bonus_spread = 0) + add_fingerprint(user) + playsound(src, dry_fire_sound, 30, TRUE) + user.visible_message("[user.name] tries to fire \the [src] at the same time, but only succeeds at looking like an idiot.", "\The [src]'s anti-combat mechanism prevents you from firing it at the same time!") + /obj/item/gun/ballistic/revolver/russian/proc/shoot_self(mob/living/carbon/human/user, affecting = BODY_ZONE_HEAD) user.apply_damage(300, BRUTE, affecting) user.visible_message("[user.name] fires [src] at [user.p_their()] head!", "You fire [src] at your head!", "You hear a gunshot!")