Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
thgvr committed Oct 8, 2024
1 parent 2add6f7 commit d5d3b3d
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 89 deletions.
2 changes: 0 additions & 2 deletions code/modules/projectiles/ammunition/_ammo_casing.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,6 @@
///If true, overrides the bouncing sfx from the turf to this one
var/list/bounce_sfx_override

var/bullet_per_box

///What this casing can be stacked into.
var/obj/item/ammo_box/magazine/stack_type = /obj/item/ammo_box/magazine/ammo_stack
///Maximum stack size of ammunition
Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/ammunition/ballistic/lmg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
icon_state = "rifle-steel"
caliber = "7.12x82mm"
projectile_type = /obj/projectile/bullet/mm712x82
bullet_per_box = 100

/obj/item/ammo_casing/mm712x82/ap
name = "7.12x82mm armor-piercing bullet casing"
Expand Down
6 changes: 0 additions & 6 deletions code/modules/projectiles/ammunition/ballistic/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
icon_state = "pistol-steel"
caliber = "10mm"
projectile_type = /obj/projectile/bullet/c10mm
bullet_per_box = 50

/obj/item/ammo_casing/c10mm/surplus
name = "10mm surplus bullet casing"
Expand Down Expand Up @@ -46,7 +45,6 @@
icon_state = "pistol-brass"
caliber = "9mm"
projectile_type = /obj/projectile/bullet/c9mm
bullet_per_box = 50

/obj/item/ammo_casing/c9mm/surplus
name = "9mm surplus bullet casing"
Expand Down Expand Up @@ -86,7 +84,6 @@
icon_state = "pistol-steel"
caliber = ".45"
projectile_type = /obj/projectile/bullet/c45
bullet_per_box = 50
stack_size = 12

/obj/item/ammo_casing/c45/surplus
Expand Down Expand Up @@ -126,7 +123,6 @@
desc = "A .50 AE bullet casing."
caliber = ".50 AE"
projectile_type = /obj/projectile/bullet/a50AE
bullet_per_box = 20

/obj/item/ammo_casing/a50AE/hp
name = ".50 AE hollow point bullet casing"
Expand All @@ -139,5 +135,3 @@
desc = "A .22 LR bullet casing."
projectile_type = /obj/projectile/bullet/c22lr
caliber = "22lr"
bullet_per_box = 75

3 changes: 0 additions & 3 deletions code/modules/projectiles/ammunition/ballistic/revolver.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
caliber = ".357"
icon_state = "magnum-brass"
projectile_type = /obj/projectile/bullet/a357
bullet_per_box = 50

/obj/item/ammo_casing/a357/match
name = ".357 match bullet casing"
Expand All @@ -29,7 +28,6 @@
caliber = ".45-70"
icon_state = "magnum-brass"
projectile_type = /obj/projectile/bullet/a4570
bullet_per_box = 12

/obj/item/ammo_casing/a4570/match
name = ".45-70 match bullet casing"
Expand All @@ -55,7 +53,6 @@
desc = "A .38 Special bullet casing."
caliber = ".38"
projectile_type = /obj/projectile/bullet/c38
bullet_per_box = 50

/obj/item/ammo_casing/c38/surplus
name = ".38 surplus bullet casing"
Expand Down
9 changes: 0 additions & 9 deletions code/modules/projectiles/ammunition/ballistic/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
icon_state = "rifle-brass"
caliber = "8x50mmR"
projectile_type = /obj/projectile/bullet/a8_50r
bullet_per_box = 20

/obj/item/ammo_casing/a8_50rhp
name = "8x50mmR hollow point bullet casing"
Expand All @@ -23,7 +22,6 @@
icon_state = "caseless"
caliber = "a858"
projectile_type = /obj/projectile/bullet/a858
bullet_per_box = 20

// .300 Magnum (Smile Rifle)

Expand All @@ -33,7 +31,6 @@
icon_state = "rifle-steel"
caliber = "a300"
projectile_type = /obj/projectile/bullet/a300
bullet_per_box = 20

// 5.56x42mm CLIP (CM82, Hydra variants)

Expand All @@ -43,8 +40,6 @@
icon_state = "rifle-brass"
caliber = "5.56x42mm"
projectile_type = /obj/projectile/bullet/a556_42
bullet_per_box = 80

// 5.45x39mm (SKM-24v)

/obj/item/ammo_casing/a545_39
Expand All @@ -54,7 +49,6 @@
caliber = "5.45x39mm"
randomspread = TRUE
projectile_type = /obj/projectile/bullet/a545_39
bullet_per_box = 80

/obj/item/ammo_casing/a545_39/recycled
name = "recycled 5.45x39mm bullet casing"
Expand All @@ -71,7 +65,6 @@
icon_state = "rifle-brass"
caliber = "7.62x40mm"
projectile_type = /obj/projectile/bullet/a762_40
bullet_per_box = 80

//.308 (M514 EBR & CM-GAL-S)

Expand All @@ -81,15 +74,13 @@
icon_state = "rifle-brass"
caliber = ".308"
projectile_type = /obj/projectile/bullet/a308
bullet_per_box = 20

/obj/item/ammo_casing/caseless/c299
name = ".299 Eoehoma caseless bullet casing"
desc = "A .299 Eoehoma caseless bullet casing."
icon_state = "caseless"
caliber = ".299 caseless"
projectile_type = /obj/projectile/bullet/c299
bullet_per_box = 100

/obj/item/ammo_casing/a65clip
name = "6.5x57mm CLIP bullet casing"
Expand Down
3 changes: 1 addition & 2 deletions code/modules/projectiles/ammunition/ballistic/shotgun.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
caliber = "12ga"
custom_materials = list(/datum/material/iron=4000)
projectile_type = /obj/projectile/bullet/slug
stack_size = 8 //Not too big of a handful, not too small
bullet_per_box = 25
stack_size = 8 //Make sure this matches max_ammo variable on prefilled stacks (magazine/ammo_stack/prefilled)

bounce_sfx_override = 'sound/weapons/gun/general/bulletcasing_shotgun_bounce.ogg'

Expand Down
4 changes: 0 additions & 4 deletions code/modules/projectiles/ammunition/ballistic/smg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
icon_state = "rifle-steel"
caliber = "5.7x39mm"
projectile_type = /obj/projectile/bullet/c57x39mm
bullet_per_box = 50

// 4.6x30mm (WT-550 Automatic Rifle & SKM-24v)

Expand All @@ -16,7 +15,6 @@
icon_state = "rifle-brass"
caliber = "4.6x30mm"
projectile_type = /obj/projectile/bullet/c46x30mm
bullet_per_box = 50

/obj/item/ammo_casing/c46x30mm/ap
name = "4.6x30mm armor-piercing bullet casing"
Expand All @@ -29,7 +27,6 @@
desc = "A 4.6x30mm incendiary bullet casing."
bullet_skin = "incen"
projectile_type = /obj/projectile/bullet/incendiary/c46x30mm
bullet_per_box = 50

// 4.73x33mm caseless (Solar)

Expand All @@ -39,7 +36,6 @@
icon_state = "caseless"
caliber = "4.73x33mm caseless"
projectile_type = /obj/projectile/bullet/c47x33mm
bullet_per_box = 50

// 5.56mm HITP caseless (Pistole C)

Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/ammunition/ballistic/sniper.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
icon_state = "big-steel"
caliber = ".50 BMG"
projectile_type = /obj/projectile/bullet/p50
bullet_per_box = 20

/obj/item/ammo_casing/p50/soporific
name = ".50 BMG soporific bullet casing"
Expand Down
1 change: 0 additions & 1 deletion code/modules/projectiles/ammunition/caseless/foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
custom_materials = list(/datum/material/iron = 11.25)
harmful = FALSE
var/modified = FALSE
bullet_per_box = 40

/obj/item/ammo_casing/caseless/foam_dart/update_icon_state()
. = ..()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Shotshells
/obj/item/ammo_box/magazine/ammo_stack/prefilled/shotgun
max_ammo = 8 //make sure these values are consistent across the board with stack_size variable.
max_ammo = 8 //make sure these values are consistent across the board with stack_size variable on respective ammo_casing

/obj/item/ammo_box/magazine/ammo_stack/prefilled/shotgun/buckshot
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// 4.6x30mm (WT-550 Automatic Rifle & SKM-24v)
/obj/item/ammo_box/magazine/ammo_stack/prefilled/c46x30mm
ammo_type = /obj/item/ammo_casing/c46x30mm
max_ammo = 15

/obj/item/storage/box/ammo/c46x30mm
name = "box of 4.6x30mm ammo"
Expand Down
104 changes: 52 additions & 52 deletions code/modules/projectiles/boxes_magazines/generic_ammo_box.dm
Original file line number Diff line number Diff line change
@@ -1,53 +1,53 @@
/obj/item/ammo_box/generic
name = "generic ammo box"
desc = "A generic, unbranded box of ammo. It doesn't have great capacity, but it can hold a variety of different calibers."
max_ammo = 20
start_empty = TRUE
icon_state = "generic-ammo"
/// Does the box currently have an ammo type set?
var/ammo_set = FALSE
/// Name of the currently set ammo type
var/ammo_name

/obj/item/ammo_box/generic/update_ammo_count()
. = ..()
if(LAZYLEN(stored_ammo) == 0)
ammo_set = FALSE
ammo_type = /obj/item/ammo_casing

/obj/item/ammo_box/generic/proc/update_max_ammo(obj/item/ammo_casing/ammo)
if(ammo.bullet_per_box)
max_ammo = round(ammo.bullet_per_box)
else
max_ammo = 10

return

/obj/item/ammo_box/generic/attackby(obj/item/attacking_obj, mob/user, params, silent, replace_spent)
. = ..()

if(!ammo_set && istype(attacking_obj, /obj/item/ammo_casing))
var/obj/item/ammo_casing/ammo_load = attacking_obj.type
ammo_type = ammo_load
ammo_set = TRUE
ammo_name = attacking_obj.name
update_max_ammo(attacking_obj)
to_chat(user, span_notice("You set the box to hold [attacking_obj]!"))

if(istype(attacking_obj, /obj/item/pen))
if(!user.is_literate())
to_chat(user, span_notice("You scribble illegibly on the cover of [src]!"))
return
var/inputvalue = stripped_input(user, "What would you like to label the box?", "Box Labelling", "", MAX_NAME_LEN)

if(!inputvalue)
return

if(user.canUseTopic(src, BE_CLOSE))
name = "[initial(src.name)][(inputvalue ? " - '[inputvalue]'" : null)]"

/obj/item/ammo_box/generic/examine(mob/user)
. = ..()
. += span_notice("[ammo_set ? "It's set to hold [ammo_name]\s. The box can hold up to [max_ammo] rounds." : "It doesn't have an ammo type set. Use a bullet on the box to set it."]")
. += span_notice("You can use a pen on it to rename the box.")
// /obj/item/ammo_box/generic
// name = "generic ammo box"
// desc = "A generic, unbranded box of ammo. It doesn't have great capacity, but it can hold a variety of different calibers."
// max_ammo = 20
// start_empty = TRUE
// icon_state = "generic-ammo"
// /// Does the box currently have an ammo type set?
// var/ammo_set = FALSE
// /// Name of the currently set ammo type
// var/ammo_name

// /obj/item/ammo_box/generic/update_ammo_count()
// . = ..()
// if(LAZYLEN(stored_ammo) == 0)
// ammo_set = FALSE
// ammo_type = /obj/item/ammo_casing

// /obj/item/ammo_box/generic/proc/update_max_ammo(obj/item/ammo_casing/ammo)
// if(ammo.bullet_per_box)
// max_ammo = round(ammo.bullet_per_box)
// else
// max_ammo = 10

// return

// /obj/item/ammo_box/generic/attackby(obj/item/attacking_obj, mob/user, params, silent, replace_spent)
// . = ..()

// if(!ammo_set && istype(attacking_obj, /obj/item/ammo_casing))
// var/obj/item/ammo_casing/ammo_load = attacking_obj.type
// ammo_type = ammo_load
// ammo_set = TRUE
// ammo_name = attacking_obj.name
// update_max_ammo(attacking_obj)
// to_chat(user, span_notice("You set the box to hold [attacking_obj]!"))

// if(istype(attacking_obj, /obj/item/pen))
// if(!user.is_literate())
// to_chat(user, span_notice("You scribble illegibly on the cover of [src]!"))
// return
// var/inputvalue = stripped_input(user, "What would you like to label the box?", "Box Labelling", "", MAX_NAME_LEN)

// if(!inputvalue)
// return

// if(user.canUseTopic(src, BE_CLOSE))
// name = "[initial(src.name)][(inputvalue ? " - '[inputvalue]'" : null)]"

// /obj/item/ammo_box/generic/examine(mob/user)
// . = ..()
// . += span_notice("[ammo_set ? "It's set to hold [ammo_name]\s. The box can hold up to [max_ammo] rounds." : "It doesn't have an ammo type set. Use a bullet on the box to set it."]")
// . += span_notice("You can use a pen on it to rename the box.")

14 changes: 7 additions & 7 deletions code/modules/research/designs/autolathe_designs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -852,13 +852,13 @@
build_path = /obj/item/storage/box/ammo/c556mm_surplus
category = list("initial", "Security", "Ammo")

/datum/design/generic_ammo_box
name = "Generic Ammo Box"
id = "ammo-generic"
build_type = AUTOLATHE | PROTOLATHE
materials = list(/datum/material/iron = 1500)
build_path = /obj/item/ammo_box/generic
category = list("initial", "Security", "Ammo")
// /datum/design/generic_ammo_box
// name = "Generic Ammo Box"
// id = "ammo-generic"
// build_type = AUTOLATHE | PROTOLATHE
// materials = list(/datum/material/iron = 1500)
// build_path = /obj/item/ammo_box/generic
// category = list("initial", "Security", "Ammo")

/datum/design/ammo_can
name = "Ammo Can"
Expand Down

0 comments on commit d5d3b3d

Please sign in to comment.