From 05954c7fb99845e95dcf0abcc7e1ab5fc1a8a343 Mon Sep 17 00:00:00 2001 From: Neerti Date: Sun, 18 Sep 2016 23:31:09 -0400 Subject: [PATCH] Shotgun Reloading Tweak Adds ability to hit a shotgun or similar weapon with a container containing ammo, to load said ammo into the shotgun one at a time automatically, instead of having to play inventory tetris, as requested by some people. --- code/modules/projectiles/guns/projectile.dm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/code/modules/projectiles/guns/projectile.dm b/code/modules/projectiles/guns/projectile.dm index d1fc9ee4a80..93904387cd1 100644 --- a/code/modules/projectiles/guns/projectile.dm +++ b/code/modules/projectiles/guns/projectile.dm @@ -141,6 +141,24 @@ user.visible_message("[user] inserts \a [C] into [src].", "You insert \a [C] into [src].") playsound(src.loc, 'sound/weapons/empty.ogg', 50, 1) + else if(istype(A, /obj/item/weapon/storage)) + var/obj/item/weapon/storage/storage = A + if(!(load_method & SINGLE_CASING)) + return //incompatible + + user << "You start loading \the [src]." + sleep(1 SECOND) + for(var/obj/item/ammo_casing/ammo in storage.contents) + if(caliber != ammo.caliber) + continue + + load_ammo(ammo, user) + + if(loaded.len >= max_shells) + user << "[src] is full." + break + sleep(1 SECOND) + update_icon() //attempts to unload src. If allow_dump is set to 0, the speedloader unloading method will be disabled