Skip to content

Commit

Permalink
wow it just works!!
Browse files Browse the repository at this point in the history
  • Loading branch information
FalloutFalcon committed Jan 25, 2024
1 parent 8cc5bfe commit 5304d07
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
17 changes: 9 additions & 8 deletions code/modules/guncrafting/frame.dm
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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
Expand All @@ -176,4 +172,9 @@
. += "<span class='notice'>\the [src] does not have a barrel installed.</span>"

/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)
11 changes: 10 additions & 1 deletion code/modules/guncrafting/part.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 3 additions & 1 deletion code/modules/projectiles/gun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5304d07

Please sign in to comment.