From 1b2695fde6a215c756be8c17df21b77685b27d88 Mon Sep 17 00:00:00 2001 From: Razgriz Date: Thu, 7 May 2020 02:10:04 -0700 Subject: [PATCH 1/3] Recoil knockdown code for micros From old chomp: https://github.com/CHOMPstation/CHOMPstation/pull/619 Code to make anyone under 50% take recoil damage (5 brute - your size * 2; so at 50% thats 5-1) Also makes tinies fall down from firing guns. First step in giving being a micro combat downsides for being so hard to hit. --- code/modules/projectiles/gun.dm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 561ebeb641..c3c58ed239 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -434,6 +434,15 @@ else set_light(0) //VOREStation Edit End + + //YAWNEDIT: Recoil knockdown for micros, ported from CHOMPStation + if(iscarbon(user)) + var/mob/living/carbon/nerd = user + var/mysize = nerd.size_multiplier + if(mysize <= 0.5) + nerd.Weaken(1) + nerd.adjustBruteLoss(5-mysize*4) + //YAWNEDIT: Knockdown code end // Similar to the above proc, but does not require a user, which is ideal for things like turrets. /obj/item/weapon/gun/proc/Fire_userless(atom/target) From 9a493e4cebe834c67e604a46cdcf8b8dcd1ae7a2 Mon Sep 17 00:00:00 2001 From: Razgriz Date: Fri, 8 May 2020 21:33:10 -0700 Subject: [PATCH 2/3] Recoil knockdown for micros --- code/modules/projectiles/gun.dm | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index c3c58ed239..66876d615d 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -51,6 +51,7 @@ zoomdevicename = "scope" drop_sound = 'sound/items/drop/gun.ogg' + var/recoil_mode = 1 //0 = no micro recoil, 1 = regular, anything higher than 1 is a multiplier //YAWN Addition, ported from CHOMP var/automatic = 0 var/burst = 1 var/fire_delay = 6 //delay after shooting before the gun can be used again @@ -436,12 +437,17 @@ //VOREStation Edit End //YAWNEDIT: Recoil knockdown for micros, ported from CHOMPStation - if(iscarbon(user)) + if(recoil_mode && iscarbon(user) && !istype(src,/obj/item/weapon/gun/energy)) var/mob/living/carbon/nerd = user var/mysize = nerd.size_multiplier if(mysize <= 0.5) - nerd.Weaken(1) - nerd.adjustBruteLoss(5-mysize*4) + nerd.Weaken(1*recoil_mode) + if(!istype(src,/obj/item/weapon/gun/energy)) + nerd.adjustBruteLoss((5-mysize*4)*recoil_mode) + to_chat(nerd, <"span class='danger'> You're so tiny that you drop the gun and hurt yourself from the recoil!") + else + to_chat(nerd, <"span class='danger'> You're so tiny that the pull of the trigger causes you to drop the gun!") + //YAWNEDIT: Knockdown code end // Similar to the above proc, but does not require a user, which is ideal for things like turrets. From 95439574aed15fb74de3b63abe70900e72b42b52 Mon Sep 17 00:00:00 2001 From: Razgriz Date: Fri, 8 May 2020 21:36:21 -0700 Subject: [PATCH 3/3] Recoil knockdown for micros --- code/modules/projectiles/gun.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 66876d615d..c2ffca978d 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -444,9 +444,9 @@ nerd.Weaken(1*recoil_mode) if(!istype(src,/obj/item/weapon/gun/energy)) nerd.adjustBruteLoss((5-mysize*4)*recoil_mode) - to_chat(nerd, <"span class='danger'> You're so tiny that you drop the gun and hurt yourself from the recoil!") + to_chat(nerd, "You're so tiny that you drop the gun and hurt yourself from the recoil!") else - to_chat(nerd, <"span class='danger'> You're so tiny that the pull of the trigger causes you to drop the gun!") + to_chat(nerd, "You're so tiny that the pull of the trigger causes you to drop the gun!") //YAWNEDIT: Knockdown code end