Skip to content

Commit

Permalink
projectiles v8 - ammo & magazines (#6637)
Browse files Browse the repository at this point in the history
completely overhauls ammo, magazines, and calibers; makes things a lot
more standardized and efficient.
  • Loading branch information
silicons authored Aug 4, 2024
1 parent 8e2d711 commit 002dda4
Show file tree
Hide file tree
Showing 208 changed files with 5,184 additions and 5,270 deletions.
81 changes: 57 additions & 24 deletions citadel.dme
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,9 @@
#include "code\__DEFINES\procs\saycode.dm"
#include "code\__DEFINES\procs\update_icon.dm"
#include "code\__DEFINES\projectiles\ammo_casing.dm"
#include "code\__DEFINES\projectiles\ammo_magazine.dm"
#include "code\__DEFINES\projectiles\guns.dm"
#include "code\__DEFINES\projectiles\system.dm"
#include "code\__DEFINES\radiation\flags.dm"
#include "code\__DEFINES\radiation\ignore.dm"
#include "code\__DEFINES\radiation\insulation.dm"
Expand Down Expand Up @@ -1037,8 +1039,15 @@
#include "code\game\click\reachability.dm"
#include "code\game\click\rig.dm"
#include "code\game\click\telekinesis.dm"
#include "code\game\content\enigmas\unsorted\cursedform.dm"
#include "code\game\content\enigmas\unsorted\deadringer.dm"
#include "code\game\content\enigmas\unsorted\telecube.dm"
#include "code\game\content\factions\corporations\corporation.dm"
#include "code\game\content\factions\corporations\gorlex\items\guns\phoron_spitter.dm"
#include "code\game\content\factions\corporations\gorlex\items\guns\wild_hunt.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-faction.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\pulse.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\animals.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\atmospherics.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\contraband.dm"
Expand All @@ -1050,11 +1059,6 @@
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\medical.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\miscellaneous.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\munitions.dm"
#include "code\game\content\enigmas\unsorted\cursedform.dm"
#include "code\game\content\enigmas\unsorted\deadringer.dm"
#include "code\game\content\enigmas\unsorted\telecube.dm"
#include "code\game\content\factions\corporations\corporation.dm"
#include "code\game\content\factions\corporations\nanotrasen\items\guns\pulse.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\reagents.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\recreation.dm"
#include "code\game\content\factions\corporations\nanotrasen\nanotrasen-supply\robotics.dm"
Expand Down Expand Up @@ -4296,18 +4300,54 @@
#include "code\modules\preferences\preference_setup\vore\08_traits.dm"
#include "code\modules\preferences\preference_setup\vore\09_nif.dm"
#include "code\modules\preferences\preference_setup\vore\10_misc.dm"
#include "code\modules\projectiles\firing_pin.dm"
#include "code\modules\projectiles\gun.dm"
#include "code\modules\projectiles\gun_item_renderer.dm"
#include "code\modules\projectiles\gun_mob_renderer.dm"
#include "code\modules\projectiles\pins.dm"
#include "code\modules\projectiles\projectile.dm"
#include "code\modules\projectiles\ammunition\ammo_caliber.dm"
#include "code\modules\projectiles\ammunition\ammo_casing.dm"
#include "code\modules\projectiles\ammunition\rounds.dm"
#include "code\modules\projectiles\ammunition\ammo_magazine.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a10g.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a10mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a12_7mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a12g.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a357.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a38.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a44.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a45.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a5_56mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a5_7mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a5mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a75.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a7_62mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a7_92mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a9_5mm.dm"
#include "code\modules\projectiles\ammunition\calibers\normal\a9mm.dm"
#include "code\modules\projectiles\ammunition\calibers\special\arrow.dm"
#include "code\modules\projectiles\ammunition\calibers\special\biomatter-wax.dm"
#include "code\modules\projectiles\ammunition\calibers\special\biomatter.dm"
#include "code\modules\projectiles\ammunition\calibers\special\blunderbuss.dm"
#include "code\modules\projectiles\ammunition\calibers\special\cap.dm"
#include "code\modules\projectiles\ammunition\calibers\special\dart.dm"
#include "code\modules\projectiles\ammunition\calibers\special\foam.dm"
#include "code\modules\projectiles\ammunition\calibers\special\microbattery.dm"
#include "code\modules\projectiles\ammunition\calibers\special\musket.dm"
#include "code\modules\projectiles\ammunition\calibers\special\pellet.dm"
#include "code\modules\projectiles\ammunition\calibers\special\rocket.dm"
#include "code\modules\projectiles\guns\ballistic.dm"
#include "code\modules\projectiles\guns\energy.dm"
#include "code\modules\projectiles\guns\launcher.dm"
#include "code\modules\projectiles\guns\magic.dm"
#include "code\modules\projectiles\guns\vox.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\medigun.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\medigun_cells.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\microbattery-casing.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\microbattery-magazine.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\microbattery.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\revolver.dm"
#include "code\modules\projectiles\guns\ballistic\microbattery\revolver_cells.dm"
#include "code\modules\projectiles\guns\energy\frontier.dm"
#include "code\modules\projectiles\guns\energy\hooklauncher.dm"
#include "code\modules\projectiles\guns\energy\kinetic_accelerator.dm"
#include "code\modules\projectiles\guns\energy\laser.dm"
Expand All @@ -4326,10 +4366,20 @@
#include "code\modules\projectiles\guns\energy\modular\modulargun.dm"
#include "code\modules\projectiles\guns\energy\modular\modularlenses.dm"
#include "code\modules\projectiles\guns\energy\modular\modularpower.dm"
#include "code\modules\projectiles\guns\energy\special\hardlight_bow.dm"
#include "code\modules\projectiles\guns\launcher\crossbow.dm"
#include "code\modules\projectiles\guns\launcher\grenade_launcher.dm"
#include "code\modules\projectiles\guns\launcher\pneumatic.dm"
#include "code\modules\projectiles\guns\launcher\syringe_gun.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\bsharpoon.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\crestrose.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\custom_guns.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\dominator.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\gunsword.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\protector.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\pummeler.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\secutor.dm"
#include "code\modules\projectiles\guns\legacy_vr_guns\sickshot.dm"
#include "code\modules\projectiles\guns\magic\staff.dm"
#include "code\modules\projectiles\guns\magic\wand.dm"
#include "code\modules\projectiles\guns\magnetic\bore.dm"
Expand All @@ -4351,9 +4401,6 @@
#include "code\modules\projectiles\guns\projectile\sniper.dm"
#include "code\modules\projectiles\guns\projectile\caseless\pellet.dm"
#include "code\modules\projectiles\guns\projectile\sniper\collapsible_sniper.dm"
#include "code\modules\projectiles\magazines\magazine.dm"
#include "code\modules\projectiles\magazines\smartmag.dm"
#include "code\modules\projectiles\magazines\unsorted.dm"
#include "code\modules\projectiles\projectile\arc.dm"
#include "code\modules\projectiles\projectile\blob.dm"
#include "code\modules\projectiles\projectile\bullets.dm"
Expand Down Expand Up @@ -5027,25 +5074,11 @@
#include "code\modules\vore\eating\vorepanel_vr.dm"
#include "code\modules\vore\fluffstuff\custom_boxes.dm"
#include "code\modules\vore\fluffstuff\custom_clothes.dm"
#include "code\modules\vore\fluffstuff\custom_guns.dm"
#include "code\modules\vore\fluffstuff\custom_items.dm"
#include "code\modules\vore\fluffstuff\custom_items_cit.dm"
#include "code\modules\vore\fluffstuff\custom_mecha.dm"
#include "code\modules\vore\fluffstuff\custom_permits.dm"
#include "code\modules\vore\fluffstuff\life_crystals.dm"
#include "code\modules\vore\fluffstuff\guns\bsharpoon.dm"
#include "code\modules\vore\fluffstuff\guns\crestrose.dm"
#include "code\modules\vore\fluffstuff\guns\dominator.dm"
#include "code\modules\vore\fluffstuff\guns\gunsword.dm"
#include "code\modules\vore\fluffstuff\guns\protector.dm"
#include "code\modules\vore\fluffstuff\guns\pummeler.dm"
#include "code\modules\vore\fluffstuff\guns\secutor.dm"
#include "code\modules\vore\fluffstuff\guns\sickshot.dm"
#include "code\modules\vore\fluffstuff\guns\cell_loaded\cell_loaded.dm"
#include "code\modules\vore\fluffstuff\guns\cell_loaded\medigun.dm"
#include "code\modules\vore\fluffstuff\guns\cell_loaded\medigun_cells.dm"
#include "code\modules\vore\fluffstuff\guns\cell_loaded\revolver.dm"
#include "code\modules\vore\fluffstuff\guns\cell_loaded\revolver_cells.dm"
#include "code\modules\vore\persist\persist_vr.dm"
#include "code\modules\vore\resizing\grav_pull_vr.dm"
#include "code\modules\vore\resizing\holder_micro_vr.dm"
Expand Down
39 changes: 36 additions & 3 deletions code/__DEFINES/projectiles/ammo_casing.dm
Original file line number Diff line number Diff line change
@@ -1,7 +1,40 @@
// /obj/item/ammo_casing casing_flags
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 silicons *//

//* /obj/item/ammo_casing casing_flags *//

/// delete after fire (usually for caseless)
#define CASING_DELETE (1<<0)
/// we're modified; otherwise, we assume that our type alone is enough to encode our information.
/// you must change this if var-changing a casing, or it might get deleted when it enters a magazine!
#define CASING_MODIFIED (1<<2)

DEFINE_BITFIELD_NEW(ammo_casing_flags, list(
/obj/item/ammo_casing = list(
"casing_flags",
),
), list(
BITFIELD_NEW("Delete after firing", CASING_DELETE),
BITFIELD_NEW("Ferromagnetic", CASING_FERROMAGNETIC),
BITFIELD_NEW("Is Modified", CASING_MODIFIED),
BITFIELD_NEW("Non Chemical", CASING_NONCHEMICAL),
))

//* Firing Method (Priming) Flags *//

/// chemical propellant ignition
#define CASING_PRIMER_CHEMICAL (1<<0)
/// magnetic acceleration
#define CASING_PRIMER_MAGNETIC (1<<1)
/// activate microbattery cell
#define CASING_PRIMER_MICROBATTERY (1<<2)

DEFINE_BITFIELD(casing_flags, list(
BITFIELD(CASING_DELETE),
DEFINE_BITFIELD_NEW(ammo_casing_primer, list(
/obj/item/ammo_casing = list(
"casing_primer",
),
), list(
BITFIELD_NEW("Chemical", CASING_PRIMER_CHEMICAL),
BITFIELD_NEW("Magnetic", CASING_PRIMER_MAGNETIC),
BITFIELD_NEW("Microbattery", CASING_PRIMER_MICROBATTERY),
))
27 changes: 27 additions & 0 deletions code/__DEFINES/projectiles/ammo_magazine.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 silicons *//

//* /obj/item/ammo_magazine magazine_type

/// normal magazines
#define MAGAZINE_TYPE_NORMAL (1<<0)
/// revolver-like speedloader
#define MAGAZINE_TYPE_SPEEDLOADER (1<<1)
/// stripper clip
#define MAGAZINE_TYPE_CLIP (1<<2)
/// loose pouch
#define MAGAZINE_TYPE_POUCH (1<<3)
/// structured box
#define MAGAZINE_TYPE_BOX (1<<3)

DEFINE_BITFIELD_NEW(ammo_magazine_types, list(
/obj/item/ammo_magazine = list(
"magazine_type",
),
), list(
BITFIELD_NEW("Normal", MAGAZINE_TYPE_NORMAL),
BITFIELD_NEW("Speedloader", MAGAZINE_TYPE_SPEEDLOADER),
BITFIELD_NEW("Stripper Clip", MAGAZINE_TYPE_CLIP),
BITFIELD_NEW("Ammo Pouch", MAGAZINE_TYPE_POUCH),
BITFIELD_NEW("Ammo Box", MAGAZINE_TYPE_BOX),
))
15 changes: 15 additions & 0 deletions code/__DEFINES/projectiles/system.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//* This file is explicitly licensed under the MIT license. *//
//* Copyright (c) 2024 silicons *//

//* rendering system
//* this is currently only used on ammo magazines, as guns use composition of datums
//* to determine their renderers instead.

/// no automatic rendering
#define GUN_RENDERING_DISABLED 0
/// overlay rendering
#define GUN_RENDERING_OVERLAYS 1
/// state rendering
#define GUN_RENDERING_STATES 2
/// for some guns, we render segmented overlays with offsets
#define GUN_RENDERING_SEGMENTS 3
2 changes: 1 addition & 1 deletion code/datums/design/designs/ammo/lmg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
id = "AmmoLMG545mm"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m556saw
build_path = /obj/item/ammo_magazine/a5_56mm/saw


32 changes: 16 additions & 16 deletions code/datums/design/designs/ammo/pistol.dm
Original file line number Diff line number Diff line change
Expand Up @@ -5,73 +5,73 @@
id = "AmmoPistol44"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m44
build_path = /obj/item/ammo_magazine/a44

/datum/design/ammo/pistol/a44_rubber
id = "AmmoPistol44Rubber"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m44/rubber
build_path = /obj/item/ammo_magazine/a44/rubber

/datum/design/ammo/pistol/a45
id = "AmmoPistol45"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m45
build_path = /obj/item/ammo_magazine/a45

/datum/design/ammo/pistol/a45_hunter
id = "AmmoPistol45Hunter"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m45/hunter
build_path = /obj/item/ammo_magazine/a45/hunter

/datum/design/ammo/pistol/a45_practice
id = "AmmoPistol45Practice"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m45/practice
build_path = /obj/item/ammo_magazine/a45/practice

/datum/design/ammo/pistol/a45_rubber
id = "AmmoPistol45Rubber"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m45/rubber
build_path = /obj/item/ammo_magazine/a45/rubber

/datum/design/ammo/pistol/a45_flash
id = "AmmoPistol45Flash"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m45/flash
build_path = /obj/item/ammo_magazine/a45/flash

/datum/design/ammo/pistol/a45_uzi
id = "AmmoUzi45"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m45uzi
build_path = /obj/item/ammo_magazine/a45/uzi

/datum/design/ammo/pistol/a9mm
id = "AmmoPistol9mm"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm
build_path = /obj/item/ammo_magazine/a9mm

/datum/design/ammo/pistol/a9mm_rubber
id = "AmmoPistol9mmRubber"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm/rubber
build_path = /obj/item/ammo_magazine/a9mm/rubber

/datum/design/ammo/pistol/a9mm_practice
id = "AmmoPistol9mmPractice"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm/practice
build_path = /obj/item/ammo_magazine/a9mm/practice

/datum/design/ammo/pistol/a9mm_flash
id = "AmmoPistol9mmFlash"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm/flash
build_path = /obj/item/ammo_magazine/a9mm/flash

/datum/design/ammo/pistol/compact
abstract_type = /datum/design/ammo/pistol/compact
Expand All @@ -80,22 +80,22 @@
id = "AmmoCompact9mm"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm/compact
build_path = /obj/item/ammo_magazine/a9mm/compact

/datum/design/ammo/pistol/compact/a9mm_rubber
id = "AmmoCompact9mmRubber"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm/compact/rubber
build_path = /obj/item/ammo_magazine/a9mm/compact/rubber

/datum/design/ammo/pistol/compact/a9mm_practice
id = "AmmoCompact9mmPractice"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm/compact/practice
build_path = /obj/item/ammo_magazine/a9mm/compact/practice

/datum/design/ammo/pistol/compact/a9mm_flash
id = "AmmoCompact9mmFlash"
lathe_type = LATHE_TYPE_AUTOLATHE
design_unlock = DESIGN_UNLOCK_INTRINSIC
build_path = /obj/item/ammo_magazine/m9mm/compact/flash
build_path = /obj/item/ammo_magazine/a9mm/compact/flash
Loading

0 comments on commit 002dda4

Please sign in to comment.