Defines calibers (#56476)

Adds defines for all of the ammo calibers
Replaces all current magic strings with defines
Docs what guns use what calibers
Corrects the name of the incendiary .45 ammo casing to indicate that it fires incendiary rounds rather than armor piercing rounds
This commit is contained in:
TemporalOroboros
2021-01-30 17:16:30 -08:00
committed by GitHub
parent 8ddb583d1b
commit 0782e92d1d
33 changed files with 126 additions and 82 deletions

View File

@@ -7,3 +7,53 @@
#define PROJECTILE_PIERCE_PHASE 2 #define PROJECTILE_PIERCE_PHASE 2
// Delete self without hitting // Delete self without hitting
#define PROJECTILE_DELETE_WITHOUT_HITTING 3 #define PROJECTILE_DELETE_WITHOUT_HITTING 3
// Caliber defines: (current count stands at 24)
/// The caliber used by the [L6 SAW][/obj/item/gun/ballistic/automatic/l6_saw].
#define CALIBER_712X82MM "mm71282"
/// The caliber used by the [security auto-rifle][/obj/item/gun/ballistic/automatic/wt550].
#define CALIBER_46X30MM "4.6x30mm"
/// The caliber used by the [plastikov SMG][/obj/item/gun/ballistic/automatic/plastikov].
#define CALIBER_9X19MM "9x19mm"
/// The caliber used by the Nanotrasen Saber SMG, and Type U3 Uzi. Also used as the default caliber for pistols but only the stechkin APS machine pistol doesn't override it.
#define CALIBER_9MM "9mm"
/// The caliber used as the default for ballistic guns. Only not overridden for the [surplus rifle][/obj/item/gun/ballistic/automatic/surplus].
#define CALIBER_10MM "10mm"
/// The caliber used by most revolver variants.
#define CALIBER_357 ".357"
/// The caliber used by the detective's revolver.
#define CALIBER_38 ".38"
/// The caliber used by the C-20r SMG, the tommygun, and the M1911 pistol.
#define CALIBER_45 ".45"
/// The caliber used by sniper rifles and the desert eagle.
#define CALIBER_50 ".50"
/// The caliber used by the gyrojet pistol.
#define CALIBER_75 ".75"
/// The caliber used by [one revolver variant][/obj/item/gun/ballistic/revolver/nagant].
#define CALIBER_N762 "n762"
/// The caliber used by the the M-90gl Carbine, and NT-ARG 'Boarder'.
#define CALIBER_A556 "a556"
/// The caliber used by bolt action rifles.
#define CALIBER_A762 "a762"
/// The caliber used by shotguns.
#define CALIBER_SHOTGUN "shotgun"
/// The caliber used by grenade launchers.
#define CALIBER_40MM "40mm"
/// The caliber used by rocket launchers.
#define CALIBER_84MM "84mm"
/// The caliber used by laser guns.
#define CALIBER_LASER "laser"
/// The caliber used by most energy guns.
#define CALIBER_ENERGY "energy"
/// The caliber used by the laser minigun.
#define CALIBER_GATLING "gatling"
/// The acliber used by foam force and donksoft toy guns.
#define CALIBER_FOAM "foam_force"
/// The caliber used by the bow and arrow.
#define CALIBER_ARROW "arrow"
/// The caliber used by the harpoon gun.
#define CALIBER_HARPOON "harpoon"
/// The caliber used by the meat hook.
#define CALIBER_HOOK "hook"
/// The caliber used by the changeling tentacle mutation.
#define CALIBER_TENTACLE "tentacle"

View File

@@ -280,7 +280,7 @@
name = "tentacle" name = "tentacle"
desc = "A tentacle." desc = "A tentacle."
projectile_type = /obj/projectile/tentacle projectile_type = /obj/projectile/tentacle
caliber = "tentacle" caliber = CALIBER_TENTACLE
icon_state = "tentacle_end" icon_state = "tentacle_end"
firing_effect_type = null firing_effect_type = null
var/obj/item/gun/magic/tentacle/gun //the item that shot it var/obj/item/gun/magic/tentacle/gun //the item that shot it

View File

@@ -416,7 +416,7 @@
name = "hook" name = "hook"
desc = "A hook." desc = "A hook."
projectile_type = /obj/projectile/hook projectile_type = /obj/projectile/hook
caliber = "hook" caliber = CALIBER_HOOK
icon_state = "hook" icon_state = "hook"
/obj/projectile/hook /obj/projectile/hook

View File

@@ -4,7 +4,7 @@
name = "7.12x82mm bullet casing" name = "7.12x82mm bullet casing"
desc = "A 7.12x82mm bullet casing." desc = "A 7.12x82mm bullet casing."
icon_state = "762-casing" icon_state = "762-casing"
caliber = "mm71282" caliber = CALIBER_712X82MM
projectile_type = /obj/projectile/bullet/mm712x82 projectile_type = /obj/projectile/bullet/mm712x82
/obj/item/ammo_casing/mm712x82/ap /obj/item/ammo_casing/mm712x82/ap

View File

@@ -3,7 +3,7 @@
/obj/item/ammo_casing/c10mm /obj/item/ammo_casing/c10mm
name = "10mm bullet casing" name = "10mm bullet casing"
desc = "A 10mm bullet casing." desc = "A 10mm bullet casing."
caliber = "10mm" caliber = CALIBER_10MM
projectile_type = /obj/projectile/bullet/c10mm projectile_type = /obj/projectile/bullet/c10mm
/obj/item/ammo_casing/c10mm/ap /obj/item/ammo_casing/c10mm/ap
@@ -26,7 +26,7 @@
/obj/item/ammo_casing/c9mm /obj/item/ammo_casing/c9mm
name = "9mm bullet casing" name = "9mm bullet casing"
desc = "A 9mm bullet casing." desc = "A 9mm bullet casing."
caliber = "9mm" caliber = CALIBER_9MM
projectile_type = /obj/projectile/bullet/c9mm projectile_type = /obj/projectile/bullet/c9mm
/obj/item/ammo_casing/c9mm/ap /obj/item/ammo_casing/c9mm/ap
@@ -50,5 +50,5 @@
/obj/item/ammo_casing/a50ae /obj/item/ammo_casing/a50ae
name = ".50AE bullet casing" name = ".50AE bullet casing"
desc = "A .50AE bullet casing." desc = "A .50AE bullet casing."
caliber = ".50" caliber = CALIBER_50
projectile_type = /obj/projectile/bullet/a50ae projectile_type = /obj/projectile/bullet/a50ae

View File

@@ -3,13 +3,12 @@
/obj/item/ammo_casing/a357 /obj/item/ammo_casing/a357
name = ".357 bullet casing" name = ".357 bullet casing"
desc = "A .357 bullet casing." desc = "A .357 bullet casing."
caliber = "357" caliber = CALIBER_357
projectile_type = /obj/projectile/bullet/a357 projectile_type = /obj/projectile/bullet/a357
/obj/item/ammo_casing/a357/match /obj/item/ammo_casing/a357/match
name = ".357 match bullet casing" name = ".357 match bullet casing"
desc = "A .357 bullet casing, manufactured to exceedingly high standards." desc = "A .357 bullet casing, manufactured to exceedingly high standards."
caliber = "357"
projectile_type = /obj/projectile/bullet/a357/match projectile_type = /obj/projectile/bullet/a357/match
// 7.62x38mmR (Nagant Revolver) // 7.62x38mmR (Nagant Revolver)
@@ -17,7 +16,7 @@
/obj/item/ammo_casing/n762 /obj/item/ammo_casing/n762
name = "7.62x38mmR bullet casing" name = "7.62x38mmR bullet casing"
desc = "A 7.62x38mmR bullet casing." desc = "A 7.62x38mmR bullet casing."
caliber = "n762" caliber = CALIBER_N762
projectile_type = /obj/projectile/bullet/n762 projectile_type = /obj/projectile/bullet/n762
// .38 (Detective's Gun) // .38 (Detective's Gun)
@@ -25,7 +24,7 @@
/obj/item/ammo_casing/c38 /obj/item/ammo_casing/c38
name = ".38 bullet casing" name = ".38 bullet casing"
desc = "A .38 bullet casing." desc = "A .38 bullet casing."
caliber = "38" caliber = CALIBER_38
projectile_type = /obj/projectile/bullet/c38 projectile_type = /obj/projectile/bullet/c38
/obj/item/ammo_casing/c38/trac /obj/item/ammo_casing/c38/trac
@@ -51,11 +50,9 @@
/obj/item/ammo_casing/c38/hotshot /obj/item/ammo_casing/c38/hotshot
name = ".38 Hot Shot bullet casing" name = ".38 Hot Shot bullet casing"
desc = "A .38 Hot Shot bullet casing." desc = "A .38 Hot Shot bullet casing."
caliber = "38"
projectile_type = /obj/projectile/bullet/c38/hotshot projectile_type = /obj/projectile/bullet/c38/hotshot
/obj/item/ammo_casing/c38/iceblox /obj/item/ammo_casing/c38/iceblox
name = ".38 Iceblox bullet casing" name = ".38 Iceblox bullet casing"
desc = "A .38 Iceblox bullet casing." desc = "A .38 Iceblox bullet casing."
caliber = "38"
projectile_type = /obj/projectile/bullet/c38/iceblox projectile_type = /obj/projectile/bullet/c38/iceblox

View File

@@ -4,7 +4,7 @@
name = "7.62 bullet casing" name = "7.62 bullet casing"
desc = "A 7.62 bullet casing." desc = "A 7.62 bullet casing."
icon_state = "762-casing" icon_state = "762-casing"
caliber = "a762" caliber = CALIBER_A762
projectile_type = /obj/projectile/bullet/a762 projectile_type = /obj/projectile/bullet/a762
/obj/item/ammo_casing/a762/enchanted /obj/item/ammo_casing/a762/enchanted
@@ -15,7 +15,7 @@
/obj/item/ammo_casing/a556 /obj/item/ammo_casing/a556
name = "5.56mm bullet casing" name = "5.56mm bullet casing"
desc = "A 5.56mm bullet casing." desc = "A 5.56mm bullet casing."
caliber = "a556" caliber = CALIBER_A556
projectile_type = /obj/projectile/bullet/a556 projectile_type = /obj/projectile/bullet/a556
/obj/item/ammo_casing/a556/phasic /obj/item/ammo_casing/a556/phasic
@@ -28,6 +28,6 @@
/obj/item/ammo_casing/a40mm /obj/item/ammo_casing/a40mm
name = "40mm HE shell" name = "40mm HE shell"
desc = "A cased high explosive grenade that can only be activated once fired out of a grenade launcher." desc = "A cased high explosive grenade that can only be activated once fired out of a grenade launcher."
caliber = "40mm" caliber = CALIBER_40MM
icon_state = "40mmHE" icon_state = "40mmHE"
projectile_type = /obj/projectile/bullet/a40mm projectile_type = /obj/projectile/bullet/a40mm

View File

@@ -5,7 +5,7 @@
desc = "A 12 gauge lead slug." desc = "A 12 gauge lead slug."
icon_state = "blshell" icon_state = "blshell"
worn_icon_state = "shell" worn_icon_state = "shell"
caliber = "shotgun" caliber = CALIBER_SHOTGUN
custom_materials = list(/datum/material/iron=4000) custom_materials = list(/datum/material/iron=4000)
projectile_type = /obj/projectile/bullet/shotgun_slug projectile_type = /obj/projectile/bullet/shotgun_slug

View File

@@ -3,7 +3,7 @@
/obj/item/ammo_casing/c46x30mm /obj/item/ammo_casing/c46x30mm
name = "4.6x30mm bullet casing" name = "4.6x30mm bullet casing"
desc = "A 4.6x30mm bullet casing." desc = "A 4.6x30mm bullet casing."
caliber = "4.6x30mm" caliber = CALIBER_46X30MM
projectile_type = /obj/projectile/bullet/c46x30mm projectile_type = /obj/projectile/bullet/c46x30mm
/obj/item/ammo_casing/c46x30mm/ap /obj/item/ammo_casing/c46x30mm/ap
@@ -21,19 +21,17 @@
/obj/item/ammo_casing/c45 /obj/item/ammo_casing/c45
name = ".45 bullet casing" name = ".45 bullet casing"
desc = "A .45 bullet casing." desc = "A .45 bullet casing."
caliber = ".45" caliber = CALIBER_45
projectile_type = /obj/projectile/bullet/c45 projectile_type = /obj/projectile/bullet/c45
/obj/item/ammo_casing/c45/ap /obj/item/ammo_casing/c45/ap
name = ".45 armor-piercing bullet casing" name = ".45 armor-piercing bullet casing"
desc = "A .45 bullet casing." desc = "A .45 bullet casing."
caliber = ".45"
projectile_type = /obj/projectile/bullet/c45_ap projectile_type = /obj/projectile/bullet/c45_ap
/obj/item/ammo_casing/c45/inc /obj/item/ammo_casing/c45/inc
name = ".45 armor-piercing bullet casing" name = ".45 incendiary bullet casing"
desc = "A .45 bullet casing." desc = "A .45 bullet casing."
caliber = ".45"
projectile_type = /obj/projectile/bullet/incendiary/c45 projectile_type = /obj/projectile/bullet/incendiary/c45
// 9x19mm (PP-95) // 9x19mm (PP-95)
@@ -41,5 +39,5 @@
/obj/item/ammo_casing/c9x19mm /obj/item/ammo_casing/c9x19mm
name = "9x19mm bullet casing" name = "9x19mm bullet casing"
desc = "A 9.19mm bullet casing." desc = "A 9.19mm bullet casing."
caliber = "9x19mm" caliber = CALIBER_9X19MM
projectile_type = /obj/projectile/bullet/c9x19mm projectile_type = /obj/projectile/bullet/c9x19mm

View File

@@ -3,7 +3,7 @@
/obj/item/ammo_casing/p50 /obj/item/ammo_casing/p50
name = ".50 bullet casing" name = ".50 bullet casing"
desc = "A .50 bullet casing." desc = "A .50 bullet casing."
caliber = ".50" caliber = CALIBER_50
projectile_type = /obj/projectile/bullet/p50 projectile_type = /obj/projectile/bullet/p50
icon_state = ".50" icon_state = ".50"

View File

@@ -2,7 +2,7 @@
name = "foam dart" name = "foam dart"
desc = "It's Donk or Don't! Ages 8 and up." desc = "It's Donk or Don't! Ages 8 and up."
projectile_type = /obj/projectile/bullet/reusable/foam_dart projectile_type = /obj/projectile/bullet/reusable/foam_dart
caliber = "foam_force" caliber = CALIBER_FOAM
icon = 'icons/obj/guns/toy.dmi' icon = 'icons/obj/guns/toy.dmi'
icon_state = "foamdart" icon_state = "foamdart"
custom_materials = list(/datum/material/iron = 11.25) custom_materials = list(/datum/material/iron = 11.25)

View File

@@ -1,7 +1,7 @@
/obj/item/ammo_casing/caseless/laser /obj/item/ammo_casing/caseless/laser
name = "laser casing" name = "laser casing"
desc = "You shouldn't be seeing this." desc = "You shouldn't be seeing this."
caliber = "laser" caliber = CALIBER_LASER
icon_state = "s-casing-live" icon_state = "s-casing-live"
slot_flags = null slot_flags = null
projectile_type = /obj/projectile/beam projectile_type = /obj/projectile/beam
@@ -17,6 +17,6 @@
/obj/item/ammo_casing/caseless/harpoon /obj/item/ammo_casing/caseless/harpoon
name = "harpoon" name = "harpoon"
caliber = "harpoon" caliber = CALIBER_HARPOON
icon_state = "magspear" icon_state = "magspear"
projectile_type = /obj/projectile/bullet/harpoon projectile_type = /obj/projectile/bullet/harpoon

View File

@@ -1,14 +1,13 @@
/obj/item/ammo_casing/caseless/rocket /obj/item/ammo_casing/caseless/rocket
name = "\improper PM-9HE" name = "\improper PM-9HE"
desc = "An 84mm High Explosive rocket. Fire at people and pray." desc = "An 84mm High Explosive rocket. Fire at people and pray."
caliber = "84mm" caliber = CALIBER_84MM
icon_state = "srm-8" icon_state = "srm-8"
projectile_type = /obj/projectile/bullet/a84mm_he projectile_type = /obj/projectile/bullet/a84mm_he
/obj/item/ammo_casing/caseless/rocket/hedp /obj/item/ammo_casing/caseless/rocket/hedp
name = "\improper PM-9HEDP" name = "\improper PM-9HEDP"
desc = "An 84mm High Explosive Dual Purpose rocket. Pointy end toward mechs." desc = "An 84mm High Explosive Dual Purpose rocket. Pointy end toward mechs."
caliber = "84mm"
icon_state = "84mm-hedp" icon_state = "84mm-hedp"
projectile_type = /obj/projectile/bullet/a84mm projectile_type = /obj/projectile/bullet/a84mm
@@ -19,6 +18,6 @@
/obj/item/ammo_casing/caseless/a75 /obj/item/ammo_casing/caseless/a75
desc = "A .75 bullet casing." desc = "A .75 bullet casing."
caliber = "75" caliber = CALIBER_75
icon_state = "s-casing-live" icon_state = "s-casing-live"
projectile_type = /obj/projectile/bullet/gyro projectile_type = /obj/projectile/bullet/gyro

View File

@@ -5,7 +5,7 @@
projectile_type = /obj/projectile/energy projectile_type = /obj/projectile/energy
slot_flags = null slot_flags = null
var/e_cost = 100 //The amount of energy a cell needs to expend to create this shot. var/e_cost = 100 //The amount of energy a cell needs to expend to create this shot.
var/select_name = ENERGY var/select_name = CALIBER_ENERGY
fire_sound = 'sound/weapons/laser.ogg' fire_sound = 'sound/weapons/laser.ogg'
firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy firing_effect_type = /obj/effect/temp_visual/dir_setting/firing_effect/energy
heavy_metal = FALSE heavy_metal = FALSE

View File

@@ -54,7 +54,7 @@
load_type = ammo_type load_type = ammo_type
var/obj/item/ammo_casing/round_check = load_type var/obj/item/ammo_casing/round_check = load_type
if(!starting && (caliber && initial(round_check.caliber) != caliber) || (!caliber && load_type != ammo_type)) if(!starting && !(caliber ? (caliber == initial(round_check.caliber)) : (ammo_type == load_type)))
stack_trace("Tried loading unsupported ammocasing type [load_type] into ammo box [type].") stack_trace("Tried loading unsupported ammocasing type [load_type] into ammo box [type].")
return return
@@ -76,7 +76,7 @@
///puts a round into the magazine ///puts a round into the magazine
/obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0) /obj/item/ammo_box/proc/give_round(obj/item/ammo_casing/R, replace_spent = 0)
// Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type. // Boxes don't have a caliber type, magazines do. Not sure if it's intended or not, but if we fail to find a caliber, then we fall back to ammo_type.
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type)) if(!R || !(caliber ? (caliber == R.caliber) : (ammo_type == R.type)))
return FALSE return FALSE
if (stored_ammo.len < max_ammo) if (stored_ammo.len < max_ammo)

View File

@@ -2,7 +2,7 @@
name = "specialized magazine (.75)" name = "specialized magazine (.75)"
icon_state = "75" icon_state = "75"
ammo_type = /obj/item/ammo_casing/caseless/a75 ammo_type = /obj/item/ammo_casing/caseless/a75
caliber = "75" caliber = CALIBER_75
multiple_sprites = AMMO_BOX_FULL_EMPTY multiple_sprites = AMMO_BOX_FULL_EMPTY
max_ammo = 8 max_ammo = 8

View File

@@ -2,7 +2,7 @@
name = "box magazine (7.12x82mm)" name = "box magazine (7.12x82mm)"
icon_state = "a762-50" icon_state = "a762-50"
ammo_type = /obj/item/ammo_casing/mm712x82 ammo_type = /obj/item/ammo_casing/mm712x82
caliber = "mm71282" caliber = CALIBER_712X82MM
max_ammo = 50 max_ammo = 50
/obj/item/ammo_box/magazine/mm712x82/hollow /obj/item/ammo_box/magazine/mm712x82/hollow

View File

@@ -3,7 +3,7 @@
desc = "A gun magazine." desc = "A gun magazine."
icon_state = "9x19p" icon_state = "9x19p"
ammo_type = /obj/item/ammo_casing/c10mm ammo_type = /obj/item/ammo_casing/c10mm
caliber = "10mm" caliber = CALIBER_10MM
max_ammo = 8 max_ammo = 8
multiple_sprites = AMMO_BOX_FULL_EMPTY multiple_sprites = AMMO_BOX_FULL_EMPTY
@@ -11,7 +11,7 @@
name = "handgun magazine (.45)" name = "handgun magazine (.45)"
icon_state = "45-8" icon_state = "45-8"
ammo_type = /obj/item/ammo_casing/c45 ammo_type = /obj/item/ammo_casing/c45
caliber = ".45" caliber = CALIBER_45
max_ammo = 8 max_ammo = 8
/obj/item/ammo_box/magazine/m45/update_icon() /obj/item/ammo_box/magazine/m45/update_icon()
@@ -25,7 +25,7 @@
name = "pistol magazine (9mm)" name = "pistol magazine (9mm)"
icon_state = "9x19p-8" icon_state = "9x19p-8"
ammo_type = /obj/item/ammo_casing/c9mm ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm" caliber = CALIBER_9MM
max_ammo = 8 max_ammo = 8
/obj/item/ammo_box/magazine/m9mm/update_icon() /obj/item/ammo_box/magazine/m9mm/update_icon()
@@ -54,7 +54,7 @@
name = "stechkin pistol magazine (9mm)" name = "stechkin pistol magazine (9mm)"
icon_state = "9mmaps-15" icon_state = "9mmaps-15"
ammo_type = /obj/item/ammo_casing/c9mm ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm" caliber = CALIBER_9MM
max_ammo = 15 max_ammo = 15
/obj/item/ammo_box/magazine/m9mm_aps/update_icon() /obj/item/ammo_box/magazine/m9mm_aps/update_icon()
@@ -80,6 +80,6 @@
name = "handgun magazine (.50ae)" name = "handgun magazine (.50ae)"
icon_state = "50ae" icon_state = "50ae"
ammo_type = /obj/item/ammo_casing/a50ae ammo_type = /obj/item/ammo_casing/a50ae
caliber = ".50" caliber = CALIBER_50
max_ammo = 7 max_ammo = 7
multiple_sprites = AMMO_BOX_PER_BULLET multiple_sprites = AMMO_BOX_PER_BULLET

View File

@@ -3,7 +3,7 @@
desc = "A rechargeable, detachable battery that serves as a magazine for laser rifles." desc = "A rechargeable, detachable battery that serves as a magazine for laser rifles."
icon_state = "oldrifle-20" icon_state = "oldrifle-20"
ammo_type = /obj/item/ammo_casing/caseless/laser ammo_type = /obj/item/ammo_casing/caseless/laser
caliber = "laser" caliber = CALIBER_LASER
max_ammo = 20 max_ammo = 20
/obj/item/ammo_box/magazine/recharge/update_icon() /obj/item/ammo_box/magazine/recharge/update_icon()

View File

@@ -3,7 +3,6 @@
desc = "A well-worn magazine fitted for the surplus rifle." desc = "A well-worn magazine fitted for the surplus rifle."
icon_state = "75-8" icon_state = "75-8"
ammo_type = /obj/item/ammo_casing/c10mm ammo_type = /obj/item/ammo_casing/c10mm
caliber = "10mm"
max_ammo = 10 max_ammo = 10
/obj/item/ammo_box/magazine/m10mm/rifle/update_icon() /obj/item/ammo_box/magazine/m10mm/rifle/update_icon()
@@ -17,7 +16,7 @@
name = "toploader magazine (5.56mm)" name = "toploader magazine (5.56mm)"
icon_state = "5.56m" icon_state = "5.56m"
ammo_type = /obj/item/ammo_casing/a556 ammo_type = /obj/item/ammo_casing/a556
caliber = "a556" caliber = CALIBER_A556
max_ammo = 30 max_ammo = 30
multiple_sprites = AMMO_BOX_FULL_EMPTY multiple_sprites = AMMO_BOX_FULL_EMPTY

View File

@@ -3,7 +3,7 @@
desc = "A drum magazine." desc = "A drum magazine."
icon_state = "m12gb" icon_state = "m12gb"
ammo_type = /obj/item/ammo_casing/shotgun/buckshot ammo_type = /obj/item/ammo_casing/shotgun/buckshot
caliber = "shotgun" caliber = CALIBER_SHOTGUN
max_ammo = 8 max_ammo = 8
/obj/item/ammo_box/magazine/m12g/update_icon() /obj/item/ammo_box/magazine/m12g/update_icon()

View File

@@ -2,7 +2,7 @@
name = "wt550 magazine (4.6x30mm)" name = "wt550 magazine (4.6x30mm)"
icon_state = "46x30mmt-20" icon_state = "46x30mmt-20"
ammo_type = /obj/item/ammo_casing/c46x30mm ammo_type = /obj/item/ammo_casing/c46x30mm
caliber = "4.6x30mm" caliber = CALIBER_46X30MM
max_ammo = 20 max_ammo = 20
/obj/item/ammo_box/magazine/wt550m9/update_icon() /obj/item/ammo_box/magazine/wt550m9/update_icon()
@@ -29,9 +29,9 @@
/obj/item/ammo_box/magazine/plastikov9mm /obj/item/ammo_box/magazine/plastikov9mm
name = "PP-95 magazine (9x19mm)" name = "PP-95 magazine (9x19mm)"
icon_state = "9x19-50" icon_state = CALIBER_9X19MM
ammo_type = /obj/item/ammo_casing/c9x19mm ammo_type = /obj/item/ammo_casing/c9x19mm
caliber = "9x19mm" caliber = CALIBER_9X19MM
max_ammo = 50 max_ammo = 50
/obj/item/ammo_box/magazine/plastikov9mm/update_icon() /obj/item/ammo_box/magazine/plastikov9mm/update_icon()
@@ -45,7 +45,7 @@
name = "uzi magazine (9mm)" name = "uzi magazine (9mm)"
icon_state = "uzi9mm-32" icon_state = "uzi9mm-32"
ammo_type = /obj/item/ammo_casing/c9mm ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm" caliber = CALIBER_9MM
max_ammo = 32 max_ammo = 32
/obj/item/ammo_box/magazine/uzim9mm/update_icon() /obj/item/ammo_box/magazine/uzim9mm/update_icon()
@@ -56,7 +56,7 @@
name = "SMG magazine (9mm)" name = "SMG magazine (9mm)"
icon_state = "smg9mm-42" icon_state = "smg9mm-42"
ammo_type = /obj/item/ammo_casing/c9mm ammo_type = /obj/item/ammo_casing/c9mm
caliber = "9mm" caliber = CALIBER_9MM
max_ammo = 21 max_ammo = 21
/obj/item/ammo_box/magazine/smgm9mm/update_icon() /obj/item/ammo_box/magazine/smgm9mm/update_icon()
@@ -75,7 +75,7 @@
name = "SMG magazine (.45)" name = "SMG magazine (.45)"
icon_state = "c20r45-24" icon_state = "c20r45-24"
ammo_type = /obj/item/ammo_casing/c45 ammo_type = /obj/item/ammo_casing/c45
caliber = ".45" caliber = CALIBER_45
max_ammo = 24 max_ammo = 24
/obj/item/ammo_box/magazine/smgm45/update_icon() /obj/item/ammo_box/magazine/smgm45/update_icon()
@@ -94,5 +94,5 @@
name = "drum magazine (.45)" name = "drum magazine (.45)"
icon_state = "drum45" icon_state = "drum45"
ammo_type = /obj/item/ammo_casing/c45 ammo_type = /obj/item/ammo_casing/c45
caliber = ".45" caliber = CALIBER_45
max_ammo = 50 max_ammo = 50

View File

@@ -3,7 +3,7 @@
icon_state = ".50mag" icon_state = ".50mag"
ammo_type = /obj/item/ammo_casing/p50 ammo_type = /obj/item/ammo_casing/p50
max_ammo = 6 max_ammo = 6
caliber = ".50" caliber = CALIBER_50
/obj/item/ammo_box/magazine/sniper_rounds/update_icon() /obj/item/ammo_box/magazine/sniper_rounds/update_icon()
..() ..()
@@ -18,7 +18,7 @@
icon_state = "soporific" icon_state = "soporific"
ammo_type = /obj/item/ammo_casing/p50/soporific ammo_type = /obj/item/ammo_casing/p50/soporific
max_ammo = 3 max_ammo = 3
caliber = ".50" caliber = CALIBER_50
/obj/item/ammo_box/magazine/sniper_rounds/penetrator /obj/item/ammo_box/magazine/sniper_rounds/penetrator
name = "sniper rounds (penetrator)" name = "sniper rounds (penetrator)"

View File

@@ -1,7 +1,7 @@
/obj/item/ammo_box/magazine/toy /obj/item/ammo_box/magazine/toy
name = "foam force META magazine" name = "foam force META magazine"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart ammo_type = /obj/item/ammo_casing/caseless/foam_dart
caliber = "foam_force" caliber = CALIBER_FOAM
/obj/item/ammo_box/magazine/toy/smg /obj/item/ammo_box/magazine/toy/smg
name = "foam force SMG magazine" name = "foam force SMG magazine"
@@ -31,7 +31,7 @@
/obj/item/ammo_box/magazine/toy/smgm45 /obj/item/ammo_box/magazine/toy/smgm45
name = "donksoft SMG magazine" name = "donksoft SMG magazine"
icon_state = "c20r45-toy" icon_state = "c20r45-toy"
caliber = "foam_force" caliber = CALIBER_FOAM
ammo_type = /obj/item/ammo_casing/caseless/foam_dart ammo_type = /obj/item/ammo_casing/caseless/foam_dart
max_ammo = 20 max_ammo = 20
@@ -46,7 +46,6 @@
/obj/item/ammo_box/magazine/toy/m762 /obj/item/ammo_box/magazine/toy/m762
name = "donksoft box magazine" name = "donksoft box magazine"
icon_state = "a762-toy" icon_state = "a762-toy"
caliber = "foam_force"
ammo_type = /obj/item/ammo_casing/caseless/foam_dart ammo_type = /obj/item/ammo_casing/caseless/foam_dart
max_ammo = 50 max_ammo = 50

View File

@@ -1,7 +1,7 @@
/obj/item/ammo_box/magazine/internal/cylinder /obj/item/ammo_box/magazine/internal/cylinder
name = "revolver cylinder" name = "revolver cylinder"
ammo_type = /obj/item/ammo_casing/a357 ammo_type = /obj/item/ammo_casing/a357
caliber = "357" caliber = CALIBER_357
max_ammo = 7 max_ammo = 7
/obj/item/ammo_box/magazine/internal/cylinder/get_round(keep = 0) /obj/item/ammo_box/magazine/internal/cylinder/get_round(keep = 0)
@@ -33,7 +33,7 @@
return L return L
/obj/item/ammo_box/magazine/internal/cylinder/give_round(obj/item/ammo_casing/R, replace_spent = 0) /obj/item/ammo_box/magazine/internal/cylinder/give_round(obj/item/ammo_casing/R, replace_spent = 0)
if(!R || (caliber && R.caliber != caliber) || (!caliber && R.type != ammo_type)) if(!R || !(caliber ? (caliber == R.caliber) : (ammo_type == R.type)))
return FALSE return FALSE
for(var/i in 1 to stored_ammo.len) for(var/i in 1 to stored_ammo.len)

View File

@@ -1,17 +1,17 @@
/obj/item/ammo_box/magazine/internal/cylinder/grenademulti /obj/item/ammo_box/magazine/internal/cylinder/grenademulti
name = "grenade launcher internal magazine" name = "grenade launcher internal magazine"
ammo_type = /obj/item/ammo_casing/a40mm ammo_type = /obj/item/ammo_casing/a40mm
caliber = "40mm" caliber = CALIBER_40MM
max_ammo = 6 max_ammo = 6
/obj/item/ammo_box/magazine/internal/grenadelauncher /obj/item/ammo_box/magazine/internal/grenadelauncher
name = "grenade launcher internal magazine" name = "grenade launcher internal magazine"
ammo_type = /obj/item/ammo_casing/a40mm ammo_type = /obj/item/ammo_casing/a40mm
caliber = "40mm" caliber = CALIBER_40MM
max_ammo = 1 max_ammo = 1
/obj/item/ammo_box/magazine/internal/rocketlauncher /obj/item/ammo_box/magazine/internal/rocketlauncher
name = "rocket launcher internal magazine" name = "rocket launcher internal magazine"
ammo_type = /obj/item/ammo_casing/caseless/rocket ammo_type = /obj/item/ammo_casing/caseless/rocket
caliber = "84mm" caliber = CALIBER_84MM
max_ammo = 1 max_ammo = 1

View File

@@ -1,11 +1,11 @@
/obj/item/ammo_box/magazine/internal/minigun /obj/item/ammo_box/magazine/internal/minigun
name = "gatling gun fusion core" name = "gatling gun fusion core"
ammo_type = /obj/item/ammo_casing/caseless/laser/gatling ammo_type = /obj/item/ammo_casing/caseless/laser/gatling
caliber = "gatling" caliber = CALIBER_GATLING
max_ammo = 5000 max_ammo = 5000
/obj/item/ammo_box/magazine/internal/hook /obj/item/ammo_box/magazine/internal/hook
name = "hook internal tube" name = "hook internal tube"
ammo_type = /obj/item/ammo_casing/magic/hook ammo_type = /obj/item/ammo_casing/magic/hook
caliber = "hook" caliber = CALIBER_HOOK
max_ammo = 1 max_ammo = 1

View File

@@ -1,19 +1,19 @@
/obj/item/ammo_box/magazine/internal/cylinder/rev38 /obj/item/ammo_box/magazine/internal/cylinder/rev38
name = "detective revolver cylinder" name = "detective revolver cylinder"
ammo_type = /obj/item/ammo_casing/c38 ammo_type = /obj/item/ammo_casing/c38
caliber = "38" caliber = CALIBER_38
max_ammo = 6 max_ammo = 6
/obj/item/ammo_box/magazine/internal/cylinder/rev762 /obj/item/ammo_box/magazine/internal/cylinder/rev762
name = "\improper Nagant revolver cylinder" name = "\improper Nagant revolver cylinder"
ammo_type = /obj/item/ammo_casing/n762 ammo_type = /obj/item/ammo_casing/n762
caliber = "n762" caliber = CALIBER_N762
max_ammo = 7 max_ammo = 7
/obj/item/ammo_box/magazine/internal/cylinder/rus357 /obj/item/ammo_box/magazine/internal/cylinder/rus357
name = "\improper Russian revolver cylinder" name = "\improper Russian revolver cylinder"
ammo_type = /obj/item/ammo_casing/a357 ammo_type = /obj/item/ammo_casing/a357
caliber = "357" caliber = CALIBER_357
max_ammo = 6 max_ammo = 6
multiload = FALSE multiload = FALSE

View File

@@ -2,7 +2,7 @@
name = "bolt action rifle internal magazine" name = "bolt action rifle internal magazine"
desc = "Oh god, this shouldn't be here" desc = "Oh god, this shouldn't be here"
ammo_type = /obj/item/ammo_casing/a762 ammo_type = /obj/item/ammo_casing/a762
caliber = "a762" caliber = CALIBER_A762
max_ammo = 5 max_ammo = 5
multiload = TRUE multiload = TRUE
@@ -15,5 +15,5 @@
/obj/item/ammo_box/magazine/internal/boltaction/harpoon /obj/item/ammo_box/magazine/internal/boltaction/harpoon
max_ammo = 1 max_ammo = 1
caliber = "harpoon" caliber = CALIBER_HARPOON
ammo_type = /obj/item/ammo_casing/caseless/harpoon ammo_type = /obj/item/ammo_casing/caseless/harpoon

View File

@@ -1,7 +1,7 @@
/obj/item/ammo_box/magazine/internal/shot /obj/item/ammo_box/magazine/internal/shot
name = "shotgun internal magazine" name = "shotgun internal magazine"
ammo_type = /obj/item/ammo_casing/shotgun/beanbag ammo_type = /obj/item/ammo_casing/shotgun/beanbag
caliber = "shotgun" caliber = CALIBER_SHOTGUN
max_ammo = 4 max_ammo = 4
multiload = FALSE multiload = FALSE

View File

@@ -1,6 +1,6 @@
/obj/item/ammo_box/magazine/internal/shot/toy /obj/item/ammo_box/magazine/internal/shot/toy
ammo_type = /obj/item/ammo_casing/caseless/foam_dart ammo_type = /obj/item/ammo_casing/caseless/foam_dart
caliber = "foam_force" caliber = CALIBER_FOAM
max_ammo = 4 max_ammo = 4
/obj/item/ammo_box/magazine/internal/shot/toy/crossbow /obj/item/ammo_box/magazine/internal/shot/toy/crossbow

View File

@@ -124,16 +124,18 @@
if(drop_the_gun_it_actually_fired) //We do it like this instead of directly checking chambered.BB here because process_fire will cycle the chamber. if(drop_the_gun_it_actually_fired) //We do it like this instead of directly checking chambered.BB here because process_fire will cycle the chamber.
user.dropItemToGround(src) user.dropItemToGround(src)
return TRUE return TRUE
if(magazine.caliber == "38")
magazine.caliber = "357" switch(magazine.caliber)
fire_sound = 'sound/weapons/gun/revolver/shot_alt.ogg' if(CALIBER_38)
desc = "A classic, if not outdated, law enforcement firearm. \nIt has been modified to fire .357 rounds." magazine.caliber = CALIBER_357
to_chat(user, "<span class='notice'>You loosen the barrel of [src]. Now it will fire .357 rounds.</span>") fire_sound = 'sound/weapons/gun/revolver/shot_alt.ogg'
else desc = "A classic, if not outdated, law enforcement firearm. \nIt has been modified to fire .357 rounds."
magazine.caliber = "38" to_chat(user, "<span class='notice'>You loosen the barrel of [src]. Now it will fire .357 rounds.</span>")
fire_sound = 'sound/weapons/gun/revolver/shot.ogg' else
desc = initial(desc) magazine.caliber = CALIBER_38
to_chat(user, "<span class='notice'>You tighten the barrel of [src]. Now it will fire .38 rounds.</span>") fire_sound = 'sound/weapons/gun/revolver/shot.ogg'
desc = initial(desc)
to_chat(user, "<span class='notice'>You tighten the barrel of [src]. Now it will fire .38 rounds.</span>")
/obj/item/gun/ballistic/revolver/mateba /obj/item/gun/ballistic/revolver/mateba

View File

@@ -67,7 +67,7 @@
ammo_type = /obj/item/ammo_casing/caseless/arrow ammo_type = /obj/item/ammo_casing/caseless/arrow
max_ammo = 1 max_ammo = 1
start_empty = TRUE start_empty = TRUE
caliber = "arrow" caliber = CALIBER_ARROW
/obj/item/ammo_casing/caseless/arrow /obj/item/ammo_casing/caseless/arrow
name = "arrow" name = "arrow"
@@ -77,7 +77,7 @@
throwforce = 1 throwforce = 1
projectile_type = /obj/projectile/bullet/reusable/arrow projectile_type = /obj/projectile/bullet/reusable/arrow
firing_effect_type = null firing_effect_type = null
caliber = "arrow" caliber = CALIBER_ARROW
heavy_metal = FALSE heavy_metal = FALSE
/obj/item/ammo_casing/caseless/arrow/despawning/dropped() /obj/item/ammo_casing/caseless/arrow/despawning/dropped()