diff --git a/code/game/objects/items/weapons/pneumaticCannon.dm b/code/game/objects/items/weapons/pneumaticCannon.dm
index eb7652cb0a0..cde8d46f6d4 100644
--- a/code/game/objects/items/weapons/pneumaticCannon.dm
+++ b/code/game/objects/items/weapons/pneumaticCannon.dm
@@ -37,6 +37,9 @@
return
updateTank(W, 0, user)
return
+ if(W.type == type)
+ user << "You're fairly certain that putting a pneumatic cannon inside another pneumatic cannon would cause a spacetime disruption."
+ return
if(istype(W, /obj/item/weapon/wrench))
switch(pressureSetting)
if(1)
@@ -70,9 +73,22 @@
return
-/obj/item/weapon/pneumatic_cannon/afterattack(atom/target as mob|obj|turf, mob/living/carbon/human/user as mob|obj, flag, params)
- if(user.a_intent == "harm" || !ishuman(user))
+/obj/item/weapon/pneumatic_cannon/afterattack(atom/target, mob/living/carbon/human/user, flag, params)
+ if(istype(target, /obj/item/weapon/storage)) //So you can store it in backpacks
return ..()
+ if(istype(target, /obj/structure/closet)) //So you can store it in closets
+ return ..()
+ if(istype(target, /obj/structure/rack)) //So you can store it on racks
+ return ..()
+ if(!istype(user))
+ return ..()
+ Fire(user, target)
+
+
+/obj/item/weapon/pneumatic_cannon/proc/Fire(var/mob/living/carbon/human/user, var/atom/target)
+ if(!istype(user) && !target)
+ return
+ var/discharge = 0
if(is_in_gang(user, "Sleeping Carp"))
user << "Use of ranged weaponry would bring dishonor to the clan."
return
@@ -85,10 +101,20 @@
if(tank && !tank.air_contents.remove(gasPerThrow * pressureSetting))
user << "\The [src] lets out a weak hiss and doesn't react!"
return
- user.visible_message("[user] fires \the [src]!", \
- "You fire \the [src]!")
+ if(user.disabilities & CLUMSY && prob(75))
+ user.visible_message("[user] loses their grip on [src], causing it to go off!", "[src] slips out of your hands and goes off!")
+ user.drop_item()
+ if(prob(10))
+ target = get_turf(user)
+ else
+ var/list/possible_targets = range(3,src)
+ target = pick(possible_targets)
+ discharge = 1
+ if(!discharge)
+ user.visible_message("[user] fires \the [src]!", \
+ "You fire \the [src]!")
add_logs(user, target, "fired at", src)
- playsound(src.loc, 'sound/weapons/sonic_jackhammer.ogg', (50 * pressureSetting), 1)
+ playsound(src.loc, 'sound/weapons/sonic_jackhammer.ogg', 50, 1)
for(var/obj/item/ITD in loadedItems) //Item To Discharge
spawn(0)
loadedItems.Remove(ITD)
@@ -96,9 +122,9 @@
ITD.throw_speed = pressureSetting * 2
ITD.loc = get_turf(src)
ITD.throw_at(target, pressureSetting * 5, pressureSetting * 2,user)
- if(pressureSetting >= 3)
- user << "\The [src]'s recoil knocks you down!"
- user.Weaken(2)
+ if(pressureSetting >= 3 && user)
+ user.visible_message("[user] is thrown down by the force of the cannon!", "[src] slams into your shoulder, knocking you down!")
+ user.Weaken(3)
/obj/item/weapon/pneumatic_cannon/ghetto //Obtainable by improvised methods; more gas per use, less capacity, but smaller