diff --git a/code/modules/projectiles/ammunition/magazines.dm b/code/modules/projectiles/ammunition/magazines.dm index 6ad60248a28..5944ec52b01 100644 --- a/code/modules/projectiles/ammunition/magazines.dm +++ b/code/modules/projectiles/ammunition/magazines.dm @@ -119,6 +119,9 @@ ammo_type = /obj/item/ammo_casing/shotgun/rubbershot max_ammo = 6 +/obj/item/ammo_box/magazine/internal/shot/riot/short + max_ammo = 3 + /obj/item/ammo_box/magazine/internal/grenadelauncher name = "grenade launcher internal magazine" ammo_type = /obj/item/ammo_casing/a40mm diff --git a/code/modules/projectiles/guns/projectile/shotgun.dm b/code/modules/projectiles/guns/projectile/shotgun.dm index c0678323409..997fecbda33 100644 --- a/code/modules/projectiles/guns/projectile/shotgun.dm +++ b/code/modules/projectiles/guns/projectile/shotgun.dm @@ -80,16 +80,85 @@ desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control." icon_state = "riotshotgun" mag_type = /obj/item/ammo_box/magazine/internal/shot/riot - sawn_desc = "Come with me if you want to live." + var/style = 1 /obj/item/gun/projectile/shotgun/riot/attackby(obj/item/A, mob/user, params) ..() if(istype(A, /obj/item/circular_saw) || istype(A, /obj/item/gun/energy/plasmacutter)) - sawoff(user) + sawoff(A, user, 0) if(istype(A, /obj/item/melee/energy)) var/obj/item/melee/energy/W = A if(W.active) - sawoff(user) + sawoff(A, user, 0) + if(istype(A, /obj/item/pipe)) + sawoff(A, user, 1) + +/obj/item/gun/projectile/shotgun/riot/sawoff(obj/item/A, mob/user, style = 0) + //Check to see if they match + if(sawn_state == SAWN_OFF & style == 0) + to_chat(user, "\The [src] is already shortened!") + return + if(sawn_state != SAWN_OFF & style == 1) + to_chat(user, "[src] already has a full barrel and magazine!") + return + //Make sure it isn't in a bag + if(istype(loc, /obj/item/storage)) + to_chat(user, "How do you plan to modify [src] while it's in a bag.") + return + //if there's any live ammo inside the gun, makes it go off + if(chambered) + afterattack(user, user) + user.visible_message("\The [src] goes off!", "\The [src] goes off in your face!") + return + //Spill the mag onto the floor + if(magazine.ammo_count()) + user.visible_message("[user.name] opens [src] up and the shells go goes flying around!", "You open [src] up and the shells go goes flying everywhere!!") + while(get_ammo() > 0) + var/obj/item/ammo_casing/CB + CB = magazine.get_round(0) + if(CB) + CB.loc = get_turf(loc) + CB.update_icon() + if(style == 0) + if(do_after(user, 10, target = src)) + to_chat(user, "You saw the barrel and magazine of the [src].") + w_class = WEIGHT_CLASS_NORMAL + slot_flags = null + magazine.max_ammo = 3 + name = "assault shotgun" + current_skin = "riotshotgun-short" + desc = "A shortened riot shotgun that has been shortened enough to fit inside a bag." + sawn_state = SAWN_OFF + update_icon() + else + if(do_after(user, 10, target = src)) + to_chat(user, "You install the longer barrel and magazine onto [src].") + w_class = WEIGHT_CLASS_BULKY + slot_flags = SLOT_BACK + magazine.max_ammo = 6 + name = "riot shotgun" + current_skin = "riotshotgun" + desc = "A sturdy shotgun with a longer magazine and a fixed tactical stock designed for non-lethal riot control." + sawn_state = null + update_icon() + qdel(A) + return + +/obj/item/gun/projectile/shotgun/riot/update_icon() //Can't use the old proc as it makes it go to riotshotgun-short_sawn + ..() + if(current_skin) + icon_state = "[current_skin]" + else + icon_state = "[initial(icon_state)]" + +/obj/item/gun/projectile/shotgun/riot/short + name = "assault shotgun" + desc = "A shortened riot shotgun that has been shortened enough to fit inside a bag." + icon_state = "riotshotgun-short" + mag_type = /obj/item/ammo_box/magazine/internal/shot/riot/short + w_class = WEIGHT_CLASS_NORMAL + slot_flags = null + sawn_state = SAWN_OFF /////////////////////// // BOLT ACTION RIFLE // diff --git a/icons/obj/guns/projectile.dmi b/icons/obj/guns/projectile.dmi index 288785052cd..906ffaac4cb 100644 Binary files a/icons/obj/guns/projectile.dmi and b/icons/obj/guns/projectile.dmi differ