Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

re:magazines #2867

Merged
merged 5 commits into from
Apr 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions code/modules/projectiles/boxes_magazines/_box_magazine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@

/obj/item/ammo_box/Initialize()
. = ..()
if(!base_icon_state)
base_icon_state = icon_state
if (!bullet_cost)
for (var/material in custom_materials)
var/material_amount = custom_materials[material]
Expand Down Expand Up @@ -150,9 +152,9 @@
var/shells_left = LAZYLEN(stored_ammo)
switch(multiple_sprites)
if(AMMO_BOX_PER_BULLET)
icon_state = "[initial(icon_state)]-[shells_left]"
icon_state = "[base_icon_state]-[shells_left]"
if(AMMO_BOX_FULL_EMPTY)
icon_state = "[initial(icon_state)]-[shells_left ? "[max_ammo]" : "0"]"
icon_state = "[base_icon_state]-[shells_left ? "1" : "0"]"
return ..()

/// Updates the amount of material in this ammo box according to how many bullets are left in it.
Expand Down
15 changes: 10 additions & 5 deletions code/modules/projectiles/boxes_magazines/ammo_boxes.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
/obj/item/ammo_box/a357
name = "speed loader (.357)"
desc = "A 7-round speed loader for quickly reloading .357 revolvers. These rounds do good damage with average performance against armor."
icon_state = "357"
icon_state = "speedloader_357-7"
base_icon_state = "speedloader_357"
ammo_type = /obj/item/ammo_casing/a357
caliber = ".357"
max_ammo = 7
Expand Down Expand Up @@ -56,7 +57,8 @@
/obj/item/ammo_box/c38
name = "speed loader (.38 special)"
desc = "A 6-round speed loader for quickly reloading .38 special revolvers. These rounds do okay damage, but struggle against armor."
icon_state = "38"
icon_state = "speedloader_38-6"
base_icon_state = "speedloader_38"
ammo_type = /obj/item/ammo_casing/c38
caliber = ".38"
max_ammo = 6
Expand Down Expand Up @@ -111,7 +113,8 @@
/obj/item/ammo_box/vickland_a308
name = "stripper clip (.308)"
desc = "A 5-round stripper clip for the Vickland Battle Rifle. The Vickland itself has a 10 round capacity, so keep in mind two of these are needed to fully reload it. These rounds do good damage with significant armor penetration."
icon_state = "308"
icon_state = "stripper_308-5"
base_icon_state = "stripper_308"
ammo_type = /obj/item/ammo_casing/a308
max_ammo = 5
multiple_sprites = AMMO_BOX_PER_BULLET
Expand Down Expand Up @@ -149,7 +152,8 @@
/obj/item/ammo_box/amagpellet_claris
name = "\improper Claris speed loader (ferromagnetic pellet)"
desc = "A 22-round speed loader for quickly reloading the Claris rifle. Ferromagnetic pellets do okay damage with significant armor penetration."
icon_state = "claris-sl"
icon_state = "claris-sl-1"
base_icon_state = "claris-sl"
ammo_type = /obj/item/ammo_casing/caseless/gauss
max_ammo = 22
multiple_sprites = AMMO_BOX_FULL_EMPTY
Expand Down Expand Up @@ -388,7 +392,8 @@
/obj/item/ammo_box/c45_speedloader
name = "speed loader (.45)"
desc = "Designed to quickly reload revolvers."
icon_state = "38"
icon_state = "speedloader_38-6"
base_icon_state = "speedloader_38"
ammo_type = /obj/item/ammo_casing/c45
caliber = ".45"
max_ammo = 6
Expand Down
61 changes: 41 additions & 20 deletions code/modules/projectiles/boxes_magazines/external/pistol.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/obj/item/ammo_box/magazine/m10mm
name = "pistol magazine (10mm)"
desc = "An 8-round single-stack magazine for the stechkin pistol. These rounds do moderate damage, but struggle against armor."
icon_state = "9x19p"
icon_state = "stechkin_mag-1"
base_icon_state = "stechkin_mag"
ammo_type = /obj/item/ammo_casing/c10mm
caliber = "10mm"
max_ammo = 8
Expand All @@ -10,32 +11,28 @@
/obj/item/ammo_box/magazine/m10mm/inc
name = "pistol magazine (10mm incendiary)"
desc = "An 8-round single-stack magazine for the stechkin pistol. These incendiary rounds deal mediocre damage, but leave flaming trails which set targets ablaze."
icon_state = "9x19pI"
ammo_type = /obj/item/ammo_casing/c10mm/inc

/obj/item/ammo_box/magazine/m10mm/hp
name = "pistol magazine (10mm HP)"
desc = "An 8-round single-stack magazine for the stechkin pistol. These hollow point rounds do incredible damage against soft targets, but are nearly ineffective against armored ones."
icon_state = "9x19pH"
ammo_type = /obj/item/ammo_casing/c10mm/hp

/obj/item/ammo_box/magazine/m10mm/ap
name = "pistol magazine (10mm AP)"
desc = "An 8-round single-stack magazine for the stechkin pistol. These armor-piercing rounds are okay at piercing protective equipment, but lose some stopping power."
icon_state = "9x19pA"
ammo_type = /obj/item/ammo_casing/c10mm/ap

/obj/item/ammo_box/magazine/m10mm/rubber
name = "pistol magazine (10mm rubber)"
desc = "An 8-round handgun magazine for the stechkin pistol. These rubber rounds trade lethality for a heavy impact which can incapacitate targets. Performs even worse against armor."
icon_state = "9x19p"
ammo_type = /obj/item/ammo_casing/c10mm/rubber

/obj/item/ammo_box/magazine/m45
name = "pistol magazine (.45)"
desc = "An 8-round single-stack magazine for the Candor pistol. These rounds do moderate damage, but struggle against armor."
icon_state = "45-8"
base_icon_state = "45"
icon_state = "candor_mag-8"
base_icon_state = "candor_mag"
ammo_type = /obj/item/ammo_casing/c45
caliber = ".45"
max_ammo = 8
Expand Down Expand Up @@ -65,13 +62,36 @@
icon_state = "[base_icon_state]-[min(ammo_count(), 8)]"

/obj/item/ammo_box/magazine/co9mm
name = "pistol magazine (9mm)"
desc = "A 10-round double-stack magazine for standard-issue 9mm pistols. These rounds do okay damage, but struggle against armor."
icon_state = "co9mm-8"
base_icon_state = "co9mm"
name = "commander pistol magazine (9mm)"
desc = "A 10-round double-stack magazine for Commander pistols. These rounds do okay damage, but struggle against armor."
icon_state = "commander_mag-10"
base_icon_state = "commander_mag"
ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm"
max_ammo = 10
multiple_sprites = AMMO_BOX_PER_BULLET

/obj/item/ammo_box/magazine/pistol556mm
name = "Pistole C magazine (5.56mm HITP caseless)"
desc = "A 12-round, double-stack magazine for the Pistole C pistol. These rounds do okay damage with average performance against armor."
icon_state = "pistolec_mag-12" //ok i did it
base_icon_state = "pistolec_mag"
ammo_type = /obj/item/ammo_casing/caseless/c556mm
caliber = "5.56mm caseless"
max_ammo = 12

/obj/item/ammo_box/magazine/pistol556mm/update_icon_state()
. = ..()
if(ammo_count() == 12)
icon_state = "[base_icon_state]-12"
else if(ammo_count() >= 10)
icon_state = "[base_icon_state]-10"
else if(ammo_count() >= 5)
icon_state = "[base_icon_state]-5"
else if(ammo_count() >= 1)
icon_state = "[base_icon_state]-1"
else
icon_state = "[base_icon_state]-0"

/obj/item/ammo_box/magazine/co9mm/inc
name = "pistol magazine (9mm incendiary)"
Expand Down Expand Up @@ -100,20 +120,18 @@
/obj/item/ammo_box/magazine/pistolm9mm
name = "large pistol magazine (9mm)"
desc = "A long, 15-round double-stack magazine designed for the stechkin APS pistol. These rounds do okay damage, but struggle against armor."
icon_state = "9x19p-8"
base_icon_state = "9x19p"
icon_state = "stechkin_mag-1"
base_icon_state = "stechkin_mag"
ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm"
max_ammo = 15

/obj/item/ammo_box/magazine/pistolm9mm/update_icon_state()
. = ..()
icon_state = "[base_icon_state]-[ammo_count() ? "8" : "0"]"
multiple_sprites = AMMO_BOX_FULL_EMPTY

/obj/item/ammo_box/magazine/m50
name = "handgun magazine (.50 AE)"
desc = "An oversized, 7-round handgun magazine for the Desert Eagle handgun. These rounds do significant damage with average performance against armor."
icon_state = "50ae"
icon_state = "deagle_mag-7"
base_icon_state = "deagle_mag"
ammo_type = /obj/item/ammo_casing/a50AE
caliber = ".50 AE"
max_ammo = 7
Expand All @@ -122,7 +140,8 @@
/obj/item/ammo_box/magazine/disposable
name = "part of a disposable gun"
desc = "You ripped out part of the gun, somehow, rendering it unusuable. I hope you're happy."
icon_state = "45-8"
icon_state = "himehabu_mag-10"
base_icon_state = "himehabu_mag"
ammo_type = /obj/item/ammo_casing/c22lr
caliber = ".22lr"
max_ammo = 10
Expand All @@ -140,8 +159,10 @@
/obj/item/ammo_box/magazine/m22lr
name = "pistol magazine (.22 LR)"
desc = "A single-stack handgun magazine designed to chamber .22 LR. It's rather tiny, all things considered."
icon_state = "pistol_22lr"
icon_state = "himehabu_mag-10"
base_icon_state = "himehabu_mag"
ammo_type = /obj/item/ammo_casing/c22lr
caliber = "22lr"
max_ammo = 10
w_class = WEIGHT_CLASS_TINY
multiple_sprites = AMMO_BOX_PER_BULLET
54 changes: 21 additions & 33 deletions code/modules/projectiles/boxes_magazines/external/rifle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
/obj/item/ammo_box/magazine/m556
name = "toploader magazine (5.56x45mm)"
desc = "An advanced, 30-round toploading magazine for the M-90gl Carbine. These rounds do moderate damage with good armor penetration."
icon_state = "5.56m"
icon_state = "5.56m-1"
base_icon_state = "5.56m"
ammo_type = /obj/item/ammo_casing/a556_39
caliber = "5.56x45mm"
max_ammo = 30
Expand All @@ -40,38 +41,32 @@
ammo_type = /obj/item/ammo_casing/c46x30mm
caliber = "4.6x30mm"
max_ammo = 30
base_icon_state = "skm_mag"
icon_state = "skm_mag"

/obj/item/ammo_box/magazine/skm_545_39/update_icon_state()
. = ..()
icon_state = "[base_icon_state]-[!!ammo_count()]"
base_icon_state = "skmcarbine_mag"
icon_state = "skmcarbine_mag-1"
multiple_sprites = AMMO_BOX_FULL_EMPTY

/obj/item/ammo_box/magazine/skm_762_40
name = "assault rifle magazine (7.62x40mm CLIP)"
desc = "A slightly curved, 20-round magazine for the 7.62x40mm CLIP variants of the SKM assault rifle family. These rounds do good damage with good armor penetration."
base_icon_state = "skm_mag"
icon_state = "skm_mag"
icon_state = "skm_mag-1"
ammo_type = /obj/item/ammo_casing/a762_40
caliber = "7.62x40mm"
max_ammo = 20

/obj/item/ammo_box/magazine/skm_762_40/update_icon_state()
. = ..()
icon_state = "[base_icon_state]-[!!ammo_count()]"
multiple_sprites = AMMO_BOX_FULL_EMPTY

/obj/item/ammo_box/magazine/skm_762_40/extended
name = "extended assault rifle magazine (7.62x40mm CLIP)"
desc = "A very curved, 40-round magazine for the 7.62x40mm CLIP variants of the SKM assault rifle family. These rounds do good damage with good armor penetration."
base_icon_state = "skm_extended_mag"
icon_state = "skm_extended_mag"
icon_state = "skm_extended_mag-1"
max_ammo = 40

/obj/item/ammo_box/magazine/skm_762_40/drum
name = "assault rifle drum (7.62x40mm CLIP)"
desc = "A 75-round drum for the 7.62x40mm CLIP variants of the SKM assault rifle family. These rounds do good damage with good armor penetration."
base_icon_state = "skm_drum"
icon_state = "skm_drum"
icon_state = "skm_drum-1"
max_ammo = 75
w_class = WEIGHT_CLASS_NORMAL

Expand All @@ -90,49 +85,42 @@
/obj/item/ammo_box/magazine/gal
name = "\improper GAL Magazine (.308)"
desc = "A standard 10-round magazine for GAL platform DMRs. These rounds do good damage with significant armor penetration."
icon_state = "ebr_mag"
icon_state = "gal_mag-1"
base_icon_state = "gal_mag"
ammo_type = /obj/item/ammo_casing/a308
caliber = ".308"
max_ammo = 10

/obj/item/ammo_box/magazine/gal/update_icon_state()
. = ..()
icon_state = "galmag-[!!ammo_count()]"
multiple_sprites = AMMO_BOX_FULL_EMPTY

/obj/item/ammo_box/magazine/p16
name = "assault rifle magazine (5.56x45mm)"
desc = "A simple, 30-round magazine for 5.56x45mm assault rifles. These rounds do moderate damage with good armor penetration."
icon_state = "p16_mag"
icon_state = "p16_mag-1"
base_icon_state = "p16_mag"
ammo_type = /obj/item/ammo_casing/a556_39
caliber = "5.56x45mm"
max_ammo = 30
multiple_sprites = AMMO_BOX_FULL_EMPTY

/obj/item/ammo_box/magazine/p16/update_icon_state()
. = ..()
icon_state = "p16_mag-[!!ammo_count()]"

/obj/item/ammo_box/magazine/swiss
name = "\improper Swiss Cheese Magazine (5.56x45mm)"
desc = "A deft, 30-round magazine for the Swiss Cheese assault rifle. These rounds do moderate damage with good armor penetration."
icon_state = "swissmag"
icon_state = "swissmag-1"
base_icon_state = "swissmag"
ammo_type = /obj/item/ammo_casing/a556_39
caliber = "5.56x45mm"
max_ammo = 30

/obj/item/ammo_box/magazine/swiss/update_icon_state()
. = ..()
icon_state = "swissmag-[!!ammo_count()]"
multiple_sprites = AMMO_BOX_FULL_EMPTY

/obj/item/ammo_box/magazine/e40
name = "E-40 magazine (.229 Eoehoma caseless)"
icon_state = "e40_mag"
icon_state = "e40_mag-1"
base_icon_state = "e40_mag"
ammo_type = /obj/item/ammo_casing/caseless/c299
caliber = ".299 caseless"
max_ammo = 30

/obj/item/ammo_box/magazine/e40/update_icon_state()
. = ..()
icon_state = "e40_mag-[!!ammo_count()]"
multiple_sprites = AMMO_BOX_FULL_EMPTY

// 8x50mmR En Bloc Clip (Illestren Hunting Rifle)

Expand Down
31 changes: 12 additions & 19 deletions code/modules/projectiles/boxes_magazines/external/shotgun.dm
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
/obj/item/ammo_box/magazine/m12g
name = "shotgun drum magazine (12g buckshot)"
desc = "A bulky 8-round drum designed for Scarborough family shotguns."
icon_state = "m12gb"
desc = "A bulky 8-round drum designed for the Bulldog shotgun and it's derivatives."
icon_state = "bulldog_drum-1"
base_icon_state = "bulldog_drum"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
caliber = "12ga"
max_ammo = 8
w_class = WEIGHT_CLASS_NORMAL

/obj/item/ammo_box/magazine/m12g/update_icon_state()
. = ..()
icon_state = "m12gb-[!!ammo_count()]"
multiple_sprites = AMMO_BOX_FULL_EMPTY

/obj/item/ammo_box/magazine/m12g/stun
name = "shotgun drum magazine (12g taser slugs)"
Expand All @@ -31,25 +29,20 @@
name = "shotgun drum magazine (12g meteor slugs)"
ammo_type = /obj/item/ammo_casing/shotgun/meteorslug

/obj/item/ammo_box/magazine/m12g/small
/obj/item/ammo_box/magazine/m12g/small //shouldnt this be the parrent intsead of the drum
name = "shotgun box magazine (12g buckshot)"
desc = "A single-stack, 6-round box magazine for Scarborough family shotguns."
icon_state = "m12gsmall"
desc = "A single-stack, 6-round box magazine for the Bulldog shotgun and it's derivatives."
icon_state = "bulldog_mag-1"
base_icon_state = "bulldog_mag"
max_ammo = 6
w_class = WEIGHT_CLASS_SMALL //Smaller, holds less

/obj/item/ammo_box/magazine/m12g/small/update_icon_state()
. = ..()
icon_state = "m12gsmall-[!!ammo_count()]"

/obj/item/ammo_box/magazine/cm15_mag
name = "CM-15 magazine (12g buckshot)"
desc = "A curved, 8-round magazine designed for Minutemen shotguns."
icon_state = "cm15_mag"
desc = "An almost straight, 8-round magazine designed for the CM-15 shotgun."
icon_state = "cm15_mag-1"
base_icon_state = "cm15_mag"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot
caliber = "12ga"
max_ammo = 8

/obj/item/ammo_box/magazine/cm15_mag/update_icon_state()
. = ..()
icon_state = "cm15_mag-[!!ammo_count()]"
multiple_sprites = AMMO_BOX_FULL_EMPTY
Loading
Loading