diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 531c6082b0..19fdfd2b7e 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -37,6 +37,7 @@ var/burst_spread = 0 //Spread induced by the gun itself during burst fire per iteration. Only checked if spread is 0. var/randomspread = 1 //Set to 0 for shotguns. This is used for weapons that don't fire all their bullets at once. var/inaccuracy_modifier = 1 + var/pb_knockback = 0 lefthand_file = 'icons/mob/inhands/weapons/guns_lefthand.dmi' righthand_file = 'icons/mob/inhands/weapons/guns_righthand.dmi' @@ -125,6 +126,10 @@ if(message) if(pointblank) user.visible_message("[user] fires [src] point blank at [pbtarget]!", null, null, COMBAT_MESSAGE_RANGE) + if(pb_knockback > 0) + var/atom/throw_target = get_edge_target_turf(pbtarget, user.dir) + pbtarget.throw_at(throw_target, pb_knockback, 2) + else user.visible_message("[user] fires [src]!", null, null, COMBAT_MESSAGE_RANGE) diff --git a/code/modules/projectiles/guns/ballistic/automatic.dm b/code/modules/projectiles/guns/ballistic/automatic.dm index bcb212a031..7fb4a8232e 100644 --- a/code/modules/projectiles/guns/ballistic/automatic.dm +++ b/code/modules/projectiles/guns/ballistic/automatic.dm @@ -267,6 +267,7 @@ fire_delay = 0 pin = /obj/item/firing_pin/implant/pindicate actions_types = list() + pb_knockback = 2 /obj/item/gun/ballistic/automatic/shotgun/bulldog/unrestricted pin = /obj/item/firing_pin diff --git a/code/modules/projectiles/guns/ballistic/revolver.dm b/code/modules/projectiles/guns/ballistic/revolver.dm index c2206fcea8..31a5131804 100644 --- a/code/modules/projectiles/guns/ballistic/revolver.dm +++ b/code/modules/projectiles/guns/ballistic/revolver.dm @@ -273,6 +273,7 @@ "Maple" = "dshotgun-l", "Rosewood" = "dshotgun-p" ) + pb_knockback = 3 // it's a super shotgun! /obj/item/gun/ballistic/revolver/doublebarrel/attackby(obj/item/A, mob/user, params) ..() diff --git a/code/modules/projectiles/guns/ballistic/shotgun.dm b/code/modules/projectiles/guns/ballistic/shotgun.dm index 571525d8f0..deec187f88 100644 --- a/code/modules/projectiles/guns/ballistic/shotgun.dm +++ b/code/modules/projectiles/guns/ballistic/shotgun.dm @@ -12,6 +12,8 @@ var/recentpump = 0 // to prevent spammage weapon_weight = WEAPON_MEDIUM + pb_knockback = 2 + /obj/item/gun/ballistic/shotgun/attackby(obj/item/A, mob/user, params) . = ..() if(.) diff --git a/code/modules/projectiles/guns/ballistic/toy.dm b/code/modules/projectiles/guns/ballistic/toy.dm index 8b358832b0..8f9bc13583 100644 --- a/code/modules/projectiles/guns/ballistic/toy.dm +++ b/code/modules/projectiles/guns/ballistic/toy.dm @@ -56,6 +56,7 @@ item_flags = NONE casing_ejector = FALSE can_suppress = FALSE + pb_knockback = 0 /obj/item/gun/ballistic/shotgun/toy/process_chamber(empty_chamber = 0) ..()