From 5304d07e5e8e2f40b1f3844b654604ccfa386df3 Mon Sep 17 00:00:00 2001 From: FalloutFalcon Date: Wed, 24 Jan 2024 19:21:56 -0600 Subject: [PATCH] wow it just works!! --- code/modules/guncrafting/frame.dm | 17 +++++++++-------- code/modules/guncrafting/part.dm | 11 ++++++++++- code/modules/projectiles/gun.dm | 4 +++- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/code/modules/guncrafting/frame.dm b/code/modules/guncrafting/frame.dm index e48d011cef19..6989e364cc4e 100644 --- a/code/modules/guncrafting/frame.dm +++ b/code/modules/guncrafting/frame.dm @@ -1,9 +1,9 @@ /obj/item/part/gun/frame name = "gun frame" - desc = "a generic gun frame. consider debug" + desc = "a generic gun frame." icon_state = "frame_olivaw" generic = FALSE - var/result = /obj/item/gun + var/obj/item/gun/result = /obj/item/gun // Currently installed grip var/obj/item/part/gun/modular/grip/InstalledGrip @@ -20,9 +20,7 @@ // Which barrels does the frame accept? var/list/validBarrels = list(/obj/item/part/gun/modular/barrel) - var/quality = 4 - -/obj/item/part/gun/frame/New(loc) +/obj/item/part/gun/frame/Initialize(mapload) ..() var/spawn_with_preinstalled_parts = TRUE @@ -152,9 +150,7 @@ to_chat(user, span_warning("\the [src] does not have a barrel!")) return var/turf/T = get_turf(src) - var/obj/item/gun/newGun = result - newGun.quality = 0 - new newGun(T) + var/obj/item/gun/newGun = new result(T, 0) newGun.frame = src src.forceMove(newGun) return @@ -176,4 +172,9 @@ . += "\the [src] does not have a barrel installed." /obj/item/part/gun/frame/mk1 + name = "wellmade gun frame" + icon_state = "frame_shotgun" result = /obj/item/gun/ballistic/shotgun/winchester/mk1 + validGrips = list(/obj/item/part/gun/modular/grip/wood) + validMechanisms = list(/obj/item/part/gun/modular/mechanism/shotgun) + validBarrels = list(/obj/item/part/gun/modular/barrel/shotgun) diff --git a/code/modules/guncrafting/part.dm b/code/modules/guncrafting/part.dm index 17a03247668b..785a749c3469 100644 --- a/code/modules/guncrafting/part.dm +++ b/code/modules/guncrafting/part.dm @@ -34,8 +34,17 @@ desc = "All the bits that makes the bullet go bang." icon_state = "mechanism_pistol" +/obj/item/part/gun/modular/mechanism/shotgun + name = "generic shotgun mechanism" + desc = "All the bits that makes the bullet go bang." + icon_state = "mechanism_shotgun" + /obj/item/part/gun/modular/barrel name = "generic barrel" desc = "A gun barrel, which keeps the bullet going in the right direction." icon_state = "barrel_35" - var/caliber = 357 + +/obj/item/part/gun/modular/barrel/shotgun + name = "generic shotgun barrel" + desc = "A gun barrel, which keeps the bullet going in the right direction." + icon_state = "barrel_30" diff --git a/code/modules/projectiles/gun.dm b/code/modules/projectiles/gun.dm index 25e26933a5b0..56af3894f2f6 100644 --- a/code/modules/projectiles/gun.dm +++ b/code/modules/projectiles/gun.dm @@ -139,8 +139,10 @@ var/quality = 3 -/obj/item/gun/Initialize() +/obj/item/gun/Initialize(mapload, proviedQuality) . = ..() + if(proviedQuality) + quality = proviedQuality if(quality != 0) if(!frame) frame = new(src)